Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 54 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,50 @@ jobs:
if: steps.version-check.outputs.is_prerelease != 'true'
run: python scripts/fix_schema_refs.py

- name: Strict drift check — schemas/cache/ byte-equality
if: steps.version-check.outputs.is_prerelease != 'true'
run: |
# Compares committed cache against the post-pipeline state
# (sync_schemas.py + fix_schema_refs.py). The repo convention
# — solidified at the 3.0.5 sync (008fa3c8) — is to commit
# the post-fix form: relative $refs (../core/...) and stripped
# $id fields. The runtime schema_loader's RefResolver depends
# on this form: absolute refs like /schemas/3.0.7/core/x.json
# don't resolve against a file:// base_uri, breaking the
# storyboard runner.
#
# PR #429-style hand-edits and source-of-truth confusion
# (cache built from static/schemas/source/, next major's WIP)
# show up here as a real diff. The bundle + fix_schema_refs
# output is byte-stable, so this check has no false-positive
# surface.
if ! git diff --exit-code -- schemas/cache/; then
echo "::error::schemas/cache/ differs from the post-pipeline bundle for ADCP_VERSION=$(cat src/adcp/ADCP_VERSION)."
echo "Likely causes:"
echo " - locally synced but didn't run scripts/fix_schema_refs.py before committing"
echo " - hand-edits to schemas/cache/ files (the bundle is the source of truth)"
echo " - cache built from static/schemas/source/ (next major's WIP) instead of dist"
echo " - committed cache predates the pinned ADCP_VERSION"
echo "Fix: run 'python scripts/sync_schemas.py && python scripts/fix_schema_refs.py' locally and commit the result."
exit 1
fi
echo "✓ schemas/cache/ matches post-pipeline bundle"

- name: Bundle schemas into package
if: steps.version-check.outputs.is_prerelease != 'true'
run: python scripts/bundle_schemas.py

- name: Snapshot committed types (for drift check)
if: steps.version-check.outputs.is_prerelease != 'true'
run: |
# Capture the field/enum-member shape of the committed tree
# *before* generate_types overwrites it, so the strict drift
# check after regen can compare regenerated output against
# what's checked in.
python scripts/diff_generated_types.py snapshot \
src/adcp/types/generated_poc/ \
/tmp/committed_types_snapshot.json

- name: Generate models
if: steps.version-check.outputs.is_prerelease != 'true'
run: python scripts/generate_types.py
Expand All @@ -304,38 +344,22 @@ jobs:
echo "Running code generation test suite..."
pytest tests/test_code_generation.py -v --tb=short

- name: Check for schema drift
- name: Strict drift check — generated_poc/ field signatures
if: steps.version-check.outputs.is_prerelease != 'true'
run: |
# datamodel-codegen's numbered-variant class names
# (Pass1/Pass4, Status16/Status17, StatusFilter1/StatusFilter4,
# Type80, etc.) shift between regens because the generator
# walks the schema graph in filesystem-iteration order and
# APFS (macOS) vs. ext4 (Linux CI) sort differently. The
# numbers are an implementation detail; semantic aliases in
# ``src/adcp/types/aliases.py`` pin the names downstream
# actually uses.
#
# The real drift guarantees we need are enforced elsewhere:
# * ``tests/test_schemas_version_pin.py`` — ADCP_VERSION
# matches ``schemas/cache/index.json.adcp_version`` on
# every test run.
# * This job's "Validate generated code syntax/imports"
# steps above — the regenerated code compiles and imports.
# * ``tests/test_asset_aliases_stable.py`` — the semantic
# aliases still point at valid classes.
#
# We keep this step as a "regen runs without error on stable
# tags" smoke — but don't fail on line-level diff, because
# the non-determinism produces false positives that block
# release PRs for cosmetic churn.
if git diff --quiet src/adcp/types/_generated.py schemas/cache/; then
echo "✓ Schemas are up-to-date (no diff)"
else
echo "ℹ Regen produced cosmetic diff — see aliases.py for stable names"
echo " Numbered-variant class-name churn is expected; the semantic"
echo " alias tests and drift-version-pin test guard the real surface."
fi
# Compares regenerated tree against the committed snapshot
# captured before `generate_types.py` ran. The signature is
# the multiset of frozensets of field names per file, so
# `PackageUpdate1` vs `PackageUpdate4` (datamodel-codegen's
# filesystem-order-dependent variant numbering) is invisible
# — only real semantic changes (added/removed field, added/
# removed class, added/removed enum member) cause failure.
# Hand-edits like 1a6ab9a1 ("rename format_ to format in
# FieldModel enum"), and forward-state leaks like PR #429,
# both surface here.
python scripts/diff_generated_types.py check \
/tmp/committed_types_snapshot.json \
src/adcp/types/generated_poc/

storyboard:
name: AdCP storyboard runner — examples/seller_agent.py
Expand Down
6 changes: 6 additions & 0 deletions SCHEMA_DELTAS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Generated-types delta

## Field changes

- `extensions/extension_meta.py`
- `AdcpExtensionFileSchema`: `-field_id`
14 changes: 7 additions & 7 deletions schemas/cache/adagents.json
Original file line number Diff line number Diff line change
Expand Up @@ -785,12 +785,12 @@
],
"examples": [
{
"$schema": "/schemas/3.0.5/adagents.json",
"$schema": "/schemas/3.0.7/adagents.json",
"authoritative_location": "https://cdn.example.com/adagents/v2/adagents.json",
"last_updated": "2025-01-15T10:00:00Z"
},
{
"$schema": "/schemas/3.0.5/adagents.json",
"$schema": "/schemas/3.0.7/adagents.json",
"properties": [
{
"property_id": "example_site",
Expand Down Expand Up @@ -868,7 +868,7 @@
"last_updated": "2025-01-10T12:00:00Z"
},
{
"$schema": "/schemas/3.0.5/adagents.json",
"$schema": "/schemas/3.0.7/adagents.json",
"contact": {
"name": "Meta Advertising Operations",
"email": "adops@meta.com",
Expand Down Expand Up @@ -977,7 +977,7 @@
"last_updated": "2025-01-10T15:30:00Z"
},
{
"$schema": "/schemas/3.0.5/adagents.json",
"$schema": "/schemas/3.0.7/adagents.json",
"contact": {
"name": "Tumblr Advertising"
},
Expand Down Expand Up @@ -1016,7 +1016,7 @@
"last_updated": "2025-01-10T16:00:00Z"
},
{
"$schema": "/schemas/3.0.5/adagents.json",
"$schema": "/schemas/3.0.7/adagents.json",
"contact": {
"name": "Example Third-Party Sales Agent",
"email": "sales@agent.example",
Expand Down Expand Up @@ -1062,7 +1062,7 @@
"last_updated": "2025-01-10T17:00:00Z"
},
{
"$schema": "/schemas/3.0.5/adagents.json",
"$schema": "/schemas/3.0.7/adagents.json",
"contact": {
"name": "Premium News Publisher",
"email": "adops@news.example.com",
Expand Down Expand Up @@ -1137,7 +1137,7 @@
"last_updated": "2025-01-10T18:00:00Z"
},
{
"$schema": "/schemas/3.0.5/adagents.json",
"$schema": "/schemas/3.0.7/adagents.json",
"contact": {
"name": "Polk Automotive Data",
"email": "partnerships@polk.com",
Expand Down
12 changes: 6 additions & 6 deletions schemas/cache/brand.json
Original file line number Diff line number Diff line change
Expand Up @@ -2032,16 +2032,16 @@
],
"examples": [
{
"$schema": "/schemas/3.0.5/brand.json",
"$schema": "/schemas/3.0.7/brand.json",
"authoritative_location": "https://adcontextprotocol.org/brand/abc123/brand.json"
},
{
"$schema": "/schemas/3.0.5/brand.json",
"$schema": "/schemas/3.0.7/brand.json",
"house": "nikeinc.com",
"note": "Redirect to house domain for full brand portfolio"
},
{
"$schema": "/schemas/3.0.5/brand.json",
"$schema": "/schemas/3.0.7/brand.json",
"version": "1.0",
"agents": [
{
Expand All @@ -2052,7 +2052,7 @@
]
},
{
"$schema": "/schemas/3.0.5/brand.json",
"$schema": "/schemas/3.0.7/brand.json",
"version": "1.0",
"house": {
"domain": "pg.com",
Expand Down Expand Up @@ -2358,7 +2358,7 @@
"last_updated": "2026-01-15T10:00:00Z"
},
{
"$schema": "/schemas/3.0.5/brand.json",
"$schema": "/schemas/3.0.7/brand.json",
"version": "1.0",
"house": {
"domain": "nikeinc.com",
Expand Down Expand Up @@ -2527,7 +2527,7 @@
"last_updated": "2026-01-15T10:00:00Z"
},
{
"$schema": "/schemas/3.0.5/brand.json",
"$schema": "/schemas/3.0.7/brand.json",
"version": "1.0",
"house": {
"domain": "mediavine.com",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1705,7 +1705,7 @@
}
},
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.265Z",
"generatedAt": "2026-05-08T11:43:56.422Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
}
],
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.266Z",
"generatedAt": "2026-05-08T11:43:56.423Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3615,7 +3615,7 @@
}
},
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.272Z",
"generatedAt": "2026-05-08T11:43:56.429Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
}
],
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.275Z",
"generatedAt": "2026-05-08T11:43:56.432Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"standards_id"
],
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.275Z",
"generatedAt": "2026-05-08T11:43:56.432Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3875,7 +3875,7 @@
}
},
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.283Z",
"generatedAt": "2026-05-08T11:43:56.439Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
"media_buy_id"
],
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.286Z",
"generatedAt": "2026-05-08T11:43:56.441Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1904,7 +1904,7 @@
}
},
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.289Z",
"generatedAt": "2026-05-08T11:43:56.444Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
},
"additionalProperties": true,
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.290Z",
"generatedAt": "2026-05-08T11:43:56.445Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3904,7 +3904,7 @@
}
},
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.295Z",
"generatedAt": "2026-05-08T11:43:56.453Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3604,7 +3604,7 @@
}
},
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.302Z",
"generatedAt": "2026-05-08T11:43:56.458Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
}
],
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.303Z",
"generatedAt": "2026-05-08T11:43:56.459Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1759,7 +1759,7 @@
}
},
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.305Z",
"generatedAt": "2026-05-08T11:43:56.461Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
}
],
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.305Z",
"generatedAt": "2026-05-08T11:43:56.461Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
2 changes: 1 addition & 1 deletion schemas/cache/bundled/core/tasks-get-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}
],
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.306Z",
"generatedAt": "2026-05-08T11:43:56.462Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
2 changes: 1 addition & 1 deletion schemas/cache/bundled/core/tasks-get-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
}
},
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.307Z",
"generatedAt": "2026-05-08T11:43:56.463Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
2 changes: 1 addition & 1 deletion schemas/cache/bundled/core/tasks-list-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
}
},
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.307Z",
"generatedAt": "2026-05-08T11:43:56.463Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
2 changes: 1 addition & 1 deletion schemas/cache/bundled/core/tasks-list-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
],
"additionalProperties": true,
"_bundled": {
"generatedAt": "2026-05-02T21:51:30.308Z",
"generatedAt": "2026-05-08T11:43:56.464Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
Loading
Loading