Repository navigation
fix(formats): treat an omitted display_tag asset_source as buyer_uploaded in projection checks - #3863
Merged
Merged
Conversation
…aded in projection checks The get_products narrowing check compared each parameter of the projected v1_format_ref declaration against the seller's option and failed on any omission. The display_html projection carries asset_source: buyer_uploaded, but the canonical display_tag schema defines no asset_source, so a valid inline-markup display_tag option paired with display_html was rejected. An omitted parameter now compares as the canonical's default: its schema default, or, for a parameter the canonical does not declare, the default every declaring canonical agrees on. Explicit values still must match. Refs adcontextprotocol/adcp#9368 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bokelley
added a commit
that referenced
this pull request
Dec 6, 2026
…ection (#3868) canonicalParamDefault(kind, key) is the rule the SDK's v1_format_ref narrowing check uses (#3863): an omitted canonical-format parameter compares as the format's default, its schema default or the default every declaring canonical agrees on (asset_source -> buyer_uploaded on display_tag). It was internal, so a downstream readiness check kept comparing literally and flagging a real seller. Export it from @adcp/sdk/v2/projection with TSDoc (parameters, the { value } | undefined return, an example). Each call now returns a fresh copy, so a caller cannot mutate the memoized default. The adopter type-check guard imports it from the packed subpath. Co-authored-by: Claude Opus 5.5 <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.
Refs adcontextprotocol/adcp#9368
Problem
A 3.2 seller declares a canonical
display_tagoption withsupported_delivery_types: ["inline_markup"]and pairs it with the standard v1 iddisplay_htmlviav1_format_ref. The SDK's reference projection ofdisplay_htmlis{ kind: "display_tag", asset_source: "buyer_uploaded", slots: [html_creative], supported_delivery_types: ["inline_markup"] }. Theget_productsnarrowing check (matchLegacyRefToDeclarationinsrc/lib/server/decisioning/runtime/from-platform.ts) required every projected parameter to appear on the seller's option, so the option failed withINVALID_REQUEST: "get_products returned a canonical declaration that does not narrow its v1_format_ref." The canonicaldisplay_tagschema defines noasset_source, so the seller couldn't set it. In production this showed up as acanonical_creativesfinding against real sellers.Fix
An omitted parameter now compares as the canonical's default (new
canonicalParamDefault(kind, key)insrc/lib/v2/projection/canonical-properties.ts, which reads the bundled canonical schemas):_base.json) declares the parameter, the omitted value is the schemadefault. With no default, the omission is still a mismatch.image,video_hosted,audio_hostedandnative_in_feedall defaultasset_sourcetobuyer_uploaded, sodisplay_taggetsbuyer_uploaded. If they disagree, or none declares it, there is no default.Explicit values still have to match exactly. The reference projection output and the protocol vectors are unchanged.
Behavior
display_tag+ inline slots +inline_markup, noasset_source, vsdisplay_html(IDM shape)asset_source: buyer_uploadedasset_source: agent_synthesizeddisplay_tagomittingslotsvsdisplay_html(default slot istag_url)imageomittingasset_sourcevsdisplay_300x250_generative(agent_synthesized)imageomittingasset_sourcevsnative_standard(buyer_uploaded, theimagedefault)The last row comes from the general rule:
buyer_uploadedis the declaredimagedefault.Tests
test/server-display-tag-asset-source-default.test.js(15 tests) covers the cases above pluscanonicalParamDefaultunit cases. It's a separate file so it doesn't conflict with in-flight work ontest/server-decisioning-from-platform.test.js.test/server-decisioning-from-platform.test.js: 280/280 pass.v1_format_ref, plusv2-projection-loader-paths: 1240/1240 pass.npm run typecheck,npm run lint(0 errors), prettier, andnpm run build:liball pass.🤖 Generated with Claude Code
Correction (2026-12-05): an earlier version of this description called the first row the "IDM/BidMachine shape". It's IDM's shape only. BidMachine's
canonical_creativesfailure is unrelated toasset_source: its options'v1_format_refnames legacy formats (e.g.interstitial_320x480,banner_320x50) that the product's ownformat_idsdoesn't list. That's a seller-side contradiction this change doesn't affect.