Repository navigation
docs(development): wire-version compat playbook - #1191
Merged
Merged
Conversation
Codifies the recipe for the v2.5 work that landed this round: * schema cache (sync-v2-5-schemas.ts → schemas/cache/v2.5/) * codegen (generate-v2-5-types.ts → src/lib/types/v2-5/) * adapter registry (src/lib/adapters/legacy/v2-5/, AdapterPair) * version-pinned validation (TaskExecutor.validateResponseSchema) * drift surface (validateAdaptedRequestAgainstV2 → result.debug_logs) * warn-by-default response validation (#1172) * conformance fixtures + smoke harness Future contributors adding a new legacy compat shim — most likely when the SDK pin moves to v4 and v3 sellers need ongoing support — copy the v2.5 directory shape and walk through nine numbered steps. Each step maps to a discrete commit; the doc names the files to touch and the patterns to follow. Also explains the N=1 "active legacy shim" framing (vs N×M matrix) that motivated naming the directory `legacy/v2-5/` rather than `v3-to-v2-5/` — matches OpenRTB / Prebid / GAM precedent and prevents encoding a maintenance burden nobody will staff. Index hooks added in CLAUDE.md and AGENTS.md so future contributors discover the doc when they touch any of the three layered surfaces. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Synthesizes feedback from four parallel reviewers (docs, dx, ad-tech-protocol, code-reviewer): - Fix line citation: TaskExecutor.ts ~1835 → ~1844 (code-reviewer). - Soften N=1 framing: industry precedent is mixed (OpenRTB 2.x and 3.0 coexist for years; Prebid carries multiple version mappings), not the uniform pattern the original draft implied. Re-frame as "we choose N=1 because we can't staff N×M, not because the industry has converged" (protocol expert). - Step 5 (dispatch generalization): replace hand-wavy `selectAdapterRegistry` reference with a concrete map-based pattern + name `get_adcp_capabilities.adcp_version` as the preferred detection channel (string-matching `tools/list` is shape-sniffing, not declaration; AdCP 3.0+ sellers expose the version explicitly). Show the actual function shape so contributors don't hallucinate signatures (DX + protocol). - Step 4: explicitly call out that `utils/*-adapter.ts` files are v2.5-locked despite their unversioned names. Don't add v4 branches — per-version `utils/<tool>-adapter-v<X>.ts` is the right path (DX). - Step 6: replace contradictory ternary fall-through with a map-based validation pin that mirrors step 5's registry map (DX). - Step 8a: add mock-server escape hatch for the common v3→v4 case where no live seller exists yet. Two paths — stand up a `createAdcpServer` fixture under `test/fixtures/`, or round-trip the adapter against the schema bundle. Use both when you can (DX). - AdapterPair asymmetry: add a section on lossy fields, direction inversion for newer-than-pin sellers, and the optional `unsupported?` discriminant to grow into when a real case needs it (protocol). - Deprecation runway: commit to "one major-version overlap or 12 months, whichever longer" rather than leaving "deprecation notice + version" undefined (protocol). - Sunsetting subsection: spell out the four-step deletion mechanic (announce, switch detection to typed rejection, delete the directory, bump major) so future contributors know what "shim sunsets" actually means (docs). - Anti-patterns subsection: name the six common mistakes (branching v2.5 helpers, skipping validation pinning, sharing fixtures across versions, bumping ADCP_VERSION in the same PR, omitting numbered- duplicate dedupe, bypassing _provenance.json) (DX). - Time estimate: ~1 week with live seller, ~2 weeks without (DX). - Cross-link from PROTOCOL_DIFFERENCES.md back to the playbook (docs). Doc grew from ~250 to ~390 lines. The increases are concentrated in the recipe steps and the new "Sunsetting" + "Anti-patterns" sections — all of which are load-bearing for contributors and impossible to infer from the code alone. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
One-line nit from docs-expert follow-up — the sunset deletion list needs to mention pruning REGISTRY_BY_VERSION (step 5) and SCHEMA_BUNDLE_BY_VERSION (step 6) entries. A stale map entry pointing at a deleted registry compiles fine but blows up at runtime. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
bokelley
added a commit
that referenced
this pull request
May 1, 2026
* docs(development): wire-version compat playbook Codifies the recipe for the v2.5 work that landed this round: * schema cache (sync-v2-5-schemas.ts → schemas/cache/v2.5/) * codegen (generate-v2-5-types.ts → src/lib/types/v2-5/) * adapter registry (src/lib/adapters/legacy/v2-5/, AdapterPair) * version-pinned validation (TaskExecutor.validateResponseSchema) * drift surface (validateAdaptedRequestAgainstV2 → result.debug_logs) * warn-by-default response validation (#1172) * conformance fixtures + smoke harness Future contributors adding a new legacy compat shim — most likely when the SDK pin moves to v4 and v3 sellers need ongoing support — copy the v2.5 directory shape and walk through nine numbered steps. Each step maps to a discrete commit; the doc names the files to touch and the patterns to follow. Also explains the N=1 "active legacy shim" framing (vs N×M matrix) that motivated naming the directory `legacy/v2-5/` rather than `v3-to-v2-5/` — matches OpenRTB / Prebid / GAM precedent and prevents encoding a maintenance burden nobody will staff. Index hooks added in CLAUDE.md and AGENTS.md so future contributors discover the doc when they touch any of the three layered surfaces. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * docs(development): expert-review fixups on wire-version compat playbook Synthesizes feedback from four parallel reviewers (docs, dx, ad-tech-protocol, code-reviewer): - Fix line citation: TaskExecutor.ts ~1835 → ~1844 (code-reviewer). - Soften N=1 framing: industry precedent is mixed (OpenRTB 2.x and 3.0 coexist for years; Prebid carries multiple version mappings), not the uniform pattern the original draft implied. Re-frame as "we choose N=1 because we can't staff N×M, not because the industry has converged" (protocol expert). - Step 5 (dispatch generalization): replace hand-wavy `selectAdapterRegistry` reference with a concrete map-based pattern + name `get_adcp_capabilities.adcp_version` as the preferred detection channel (string-matching `tools/list` is shape-sniffing, not declaration; AdCP 3.0+ sellers expose the version explicitly). Show the actual function shape so contributors don't hallucinate signatures (DX + protocol). - Step 4: explicitly call out that `utils/*-adapter.ts` files are v2.5-locked despite their unversioned names. Don't add v4 branches — per-version `utils/<tool>-adapter-v<X>.ts` is the right path (DX). - Step 6: replace contradictory ternary fall-through with a map-based validation pin that mirrors step 5's registry map (DX). - Step 8a: add mock-server escape hatch for the common v3→v4 case where no live seller exists yet. Two paths — stand up a `createAdcpServer` fixture under `test/fixtures/`, or round-trip the adapter against the schema bundle. Use both when you can (DX). - AdapterPair asymmetry: add a section on lossy fields, direction inversion for newer-than-pin sellers, and the optional `unsupported?` discriminant to grow into when a real case needs it (protocol). - Deprecation runway: commit to "one major-version overlap or 12 months, whichever longer" rather than leaving "deprecation notice + version" undefined (protocol). - Sunsetting subsection: spell out the four-step deletion mechanic (announce, switch detection to typed rejection, delete the directory, bump major) so future contributors know what "shim sunsets" actually means (docs). - Anti-patterns subsection: name the six common mistakes (branching v2.5 helpers, skipping validation pinning, sharing fixtures across versions, bumping ADCP_VERSION in the same PR, omitting numbered- duplicate dedupe, bypassing _provenance.json) (DX). - Time estimate: ~1 week with live seller, ~2 weeks without (DX). - Cross-link from PROTOCOL_DIFFERENCES.md back to the playbook (docs). Doc grew from ~250 to ~390 lines. The increases are concentrated in the recipe steps and the new "Sunsetting" + "Anti-patterns" sections — all of which are load-bearing for contributors and impossible to infer from the code alone. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * docs(development): prune dispatch maps when sunsetting a shim One-line nit from docs-expert follow-up — the sunset deletion list needs to mention pruning REGISTRY_BY_VERSION (step 5) and SCHEMA_BUNDLE_BY_VERSION (step 6) entries. A stale map entry pointing at a deleted registry compiles fine but blows up at runtime. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * chore: empty changeset — playbook is docs-only --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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.
Capstone for the v2.5 series. Codifies the recipe future contributors will need when adding a new legacy compat shim — most concretely, when the SDK pin moves to v4 and v3 sellers need ongoing support.
What's in this PR
docs/development/WIRE-VERSION-COMPAT.md— the playbook itself. Covers what's already wired, the nine-step recipe for adding a new wire version (one commit per step), the N=1 vs N×M framing, the current compatibility matrix, the testing checklist, and when N=1 isn't enough.src/lib/adapters/legacy/,src/lib/types/v*-*/, orschemas/cache/<version>/.What it codifies
Everything that landed in the v2.5 series this round:
sync-v2-5-schemas.ts→schemas/cache/v2.5/, with the 2.5-maintenance HEAD pinning workaround foradcontextprotocol/adcp#3689)generate-v2-5-types.ts→src/lib/types/v2-5/tools.generated.ts, sharing theenforceStrictSchema+removeNumberedTypeDuplicatespipeline with v3)src/lib/adapters/legacy/v2-5/,AdapterPair<TReq3, TReq25, TRes25, TRes3>,getV25Adapter/listV25AdapterTools)TaskExecutor.validateResponseSchemaderivesvalidationVersionfromlastKnownServerVersion)validateAdaptedRequestAgainstV2→result.debug_logs, post-refactor(client): drop unnecessary debug_logs cast at v2.5 drift merge sites #1133/fix(client): unblock v2.5 sellers — brand alias type guard + response validation version pin #1137)test/lib/adapter-v2-5-conformance.test.js,test/lib/legacy-v2-5-adapter-registry.test.js)scripts/smoke-wonderstruck-v2-5.ts, committed in chore(scripts): commit v2.5 drift smoke + brand-schema probe #1151)Why N=1, not N×M
The directory tree is
legacy/v2-5/, notv3-to-v2-5/. That's intentional and the doc explains why: real ad-tech compat layers (OpenRTB, Prebid, GAM) carry one active legacy shim with a deprecation runway, not a matrix. Encoding a matrix would larp a maintenance burden nobody staffs. When the SDK pin moves to v4, the v2.5 shim sunsets and a new v3 shim joins — two active shims briefly, dropping back to one when v2.5 hits end-of-support.Test plan
npx prettier --check docs/development/WIRE-VERSION-COMPAT.md— cleancopy-schemas-to-dist.ts,resolveBundleKey,package.json#exports, the registry index, etc.)CLAUDE.mdno-changeset criteria)🤖 Generated with Claude Code