Skip to content

feat(schemas): fetch + bundle v2.5 schemas from pinned upstream SHA (stage 4b1)#670

Merged
bokelley merged 1 commit into
mainfrom
claude/versioned-schemas-stage-4b1
May 11, 2026
Merged

feat(schemas): fetch + bundle v2.5 schemas from pinned upstream SHA (stage 4b1)#670
bokelley merged 1 commit into
mainfrom
claude/versioned-schemas-stage-4b1

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

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).

  • New scripts/sync_legacy_schemas.py — pins each legacy version to a commit SHA from adcontextprotocol/adcp and extracts static/schemas/source/ from the zipball. SHA is the integrity gate.
  • v2.5 pinned to 4e553ad955f83b49c7d221ab5c3ff78237ad02e3 (current tip of the upstream 2.5-maintenance branch).
  • Sync writes 158 upstream files plus 29 synthesized into bundled/ (so schema_loader._build_index discovers request/response pairs the same way it does for 3.x).
  • fix_schema_refs.py extended to accept --bundle-key and to handle both $ref shapes (/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_version is in LEGACY_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 passed
  • 4 new tests for v2.5 schema bundle discovery + shape acceptance
  • ruff check + mypy

🤖 Generated with Claude Code

…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>
@bokelley bokelley merged commit bd6837f into main May 11, 2026
16 checks passed
@bokelley bokelley deleted the claude/versioned-schemas-stage-4b1 branch May 11, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant