feat(schemas): fetch + bundle v2.5 schemas from pinned upstream SHA (stage 4b1)#670
Merged
Merged
Conversation
…stage 4b1)
New scripts/sync_legacy_schemas.py pins each legacy bundle to a commit
SHA from adcontextprotocol/adcp, fetches the zipball via GitHub API,
and extracts static/schemas/source/ into schemas/cache/{bundle_key}/.
SHA itself is the integrity check.
v2.5 pinned to 4e553ad9 (2.5-maintenance branch tip): 158 upstream
files + 29 synthesized into bundled/ (so schema_loader._build_index
discovers request/response pairs uniformly).
fix_schema_refs.py extended to accept --bundle-key and to handle both
ref shapes (/schemas/VERSION/... and bare /schemas/...). The sync
invokes it automatically.
Adopters can now get_validator("sync_creatives", "request", version="2.5")
and get a real v2.5 validator (39 keys discovered).
Stage 4b2 wires pre-adapter validation in the dispatcher.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 4b1 of the versioned-schema-validation port.
Summary
Bundle real v2.5 schemas so adopters can validate v2.5-claimed traffic against the v2.5 wire shape (previously the dispatcher only validated the adapter output against v3).
scripts/sync_legacy_schemas.py— pins each legacy version to a commit SHA fromadcontextprotocol/adcpand extractsstatic/schemas/source/from the zipball. SHA is the integrity gate.4e553ad955f83b49c7d221ab5c3ff78237ad02e3(current tip of the upstream2.5-maintenancebranch).bundled/(soschema_loader._build_indexdiscovers request/response pairs the same way it does for 3.x).fix_schema_refs.pyextended to accept--bundle-keyand to handle both$refshapes (/schemas/3.0.7/core/...and the bare/schemas/core/...v2.5 uses). The sync invokes it automatically.Adopters can now
get_validator(\"sync_creatives\", \"request\", version=\"2.5\")and get a real v2.5 validator (39 validator keys discovered).Stage 4b2 will
Wire pre-adapter validation in the dispatcher: when
wire_versionis inLEGACY_ADAPTER_VERSIONS, validate the incoming params against the v2.5 schema before running the adapter, so structural errors in the v2.5 wire shape surface with v2.5 field paths.Test plan
pytest— 4500 passedruff check+mypy🤖 Generated with Claude Code