Skip to content

feat(compat): server-side shape-based v2.5 detection (stage 6)#673

Merged
bokelley merged 2 commits into
mainfrom
claude/versioned-schemas-stage-6
May 11, 2026
Merged

feat(compat): server-side shape-based v2.5 detection (stage 6)#673
bokelley merged 2 commits into
mainfrom
claude/versioned-schemas-stage-6

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Closes the wire-version-detection gap: real v2.5 buyers can't send adcp_version (field didn't exist in v2.5). Adds AdapterPair.is_legacy_shape probes for the 4 tools with unambiguous markers (sync_creatives, get_products, create_media_buy, update_media_buy). Dispatcher falls through to probes when envelope is empty. 10 new tests; 4534 passed.

bokelley and others added 2 commits May 11, 2026 09:17
Closes the wire-version-detection gap: real v2.5 buyers can't send
adcp_version because the field didn't exist in v2.5. Stage 3's
envelope detection never fires for them — requests get rejected by
v3 schema validation with confusing v3 field paths.

Stage 6 adds fallback shape probes. When envelope is empty, dispatcher
walks LEGACY_ADAPTER_VERSIONS and runs each adapter's optional
is_legacy_shape probe. A match promotes wire_version and the existing
legacy adapter path takes over.

New AdapterPair.is_legacy_shape. Probes for 4 tools with strong
v2.5 markers:
* sync_creatives: bare-string format_id
* get_products: brand_manifest or promoted_offerings
* create_media_buy: brand_manifest or package creative_ids
* update_media_buy: package creative_ids

list_creative_formats and preview_creative request shapes are
identical across versions — no probe possible, none registered.

Precedence: explicit envelope wins; shape is fallback.
Bias: conservative — probe matches only on fields v3 doesn't emit.

10 new tests covering each tool's positive + negative case,
explicit-version-wins precedence, and no-probe behaviour.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… order

Review feedback on PR #673 noted that the dispatcher's shape-detection
loop walks ``LEGACY_ADAPTER_VERSIONS`` in tuple order and breaks on
first match — so when a second legacy version is added, the tuple
ordering becomes a routing policy. Document the contract on the
constant directly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley bokelley merged commit d6210cc into main May 11, 2026
16 checks passed
@bokelley bokelley deleted the claude/versioned-schemas-stage-6 branch May 11, 2026 13:36
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