feat(compat): server-side shape-based v2.5 detection (stage 6)#673
Merged
Conversation
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>
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.
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.