Skip to content

fix(formats): treat an omitted display_tag asset_source as buyer_uploaded in projection checks - #3863

Merged
bokelley merged 2 commits into
mainfrom
fix/display-tag-asset-source-default
Dec 5, 2026
Merged

bokelley merged 2 commits into
mainfrom
fix/display-tag-asset-source-default

Conversation

@bokelley

@bokelley bokelley commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Refs adcontextprotocol/adcp#9368

Problem

A 3.2 seller declares a canonical display_tag option with supported_delivery_types: ["inline_markup"] and pairs it with the standard v1 id display_html via v1_format_ref. The SDK's reference projection of display_html is { kind: "display_tag", asset_source: "buyer_uploaded", slots: [html_creative], supported_delivery_types: ["inline_markup"] }. The get_products narrowing check (matchLegacyRefToDeclaration in src/lib/server/decisioning/runtime/from-platform.ts) required every projected parameter to appear on the seller's option, so the option failed with INVALID_REQUEST: "get_products returned a canonical declaration that does not narrow its v1_format_ref." The canonical display_tag schema defines no asset_source, so the seller couldn't set it. In production this showed up as a canonical_creatives finding against real sellers.

Fix

An omitted parameter now compares as the canonical's default (new canonicalParamDefault(kind, key) in src/lib/v2/projection/canonical-properties.ts, which reads the bundled canonical schemas):

  • When the canonical (or _base.json) declares the parameter, the omitted value is the schema default. With no default, the omission is still a mismatch.
  • When the canonical does not declare the parameter (its params are open), the omitted value is the default that every canonical declaring the parameter agrees on. image, video_hosted, audio_hosted and native_in_feed all default asset_source to buyer_uploaded, so display_tag gets buyer_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

Option vs. ref Before After
display_tag + inline slots + inline_markup, no asset_source, vs display_html (IDM shape) rejected accepted
same, explicit asset_source: buyer_uploaded accepted accepted
same, explicit asset_source: agent_synthesized rejected rejected
display_tag omitting slots vs display_html (default slot is tag_url) rejected rejected
image omitting asset_source vs display_300x250_generative (agent_synthesized) rejected rejected
image omitting asset_source vs native_standard (buyer_uploaded, the image default) rejected accepted

The last row comes from the general rule: buyer_uploaded is the declared image default.

Tests

  • New test/server-display-tag-asset-source-default.test.js (15 tests) covers the cases above plus canonicalParamDefault unit cases. It's a separate file so it doesn't conflict with in-flight work on test/server-decisioning-from-platform.test.js.
  • test/server-decisioning-from-platform.test.js: 280/280 pass.
  • Every test file that references v1_format_ref, plus v2-projection-loader-paths: 1240/1240 pass.
  • npm run typecheck, npm run lint (0 errors), prettier, and npm run build:lib all 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_creatives failure is unrelated to asset_source: its options' v1_format_ref names legacy formats (e.g. interstitial_320x480, banner_320x50) that the product's own format_ids doesn't list. That's a seller-side contradiction this change doesn't affect.

…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
bokelley merged commit 520a336 into main Dec 5, 2026
41 checks passed
@bokelley
bokelley deleted the fix/display-tag-asset-source-default branch December 5, 2026 13:48
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>
@aao-ipr-bot aao-ipr-bot Bot mentioned this pull request Dec 6, 2026
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