Repository navigation
fix(compliance): grade inline creative paths on advertised format representations - #8236
Merged
Merged
Conversation
…resentations Backport of 3ec9123 (#8235) to the 3.2.x maintenance line, carrying the coordinated redesign of canonical discovery that followed review on all lines. inline_creatives_without_sync required a product carrying canonical format_options[] with a stable format_option_id and treated the legacy format_ids[] path as optional, so canonical-only sellers with unnamed options and legacy-only sellers were graded wrongly (adcp-client#3268). core/product.json requires format_ids, format_options, or both - not both. One canonical discovery captures the product, the pricing option, the canonical format_kind and the WHOLE first format_options[] declaration from a single get_products response. Three mutually exclusive canonical execution phases read that captured declaration through dotted skip_if references to decide which selector shape the seller published - product-local ref, publisher-catalog ref carrying the complete {publisher_domain, format_option_id} pair, or no selector at all for a declaration with no stable id. The legacy format_ids[] path keeps its own discovery and runs independently. Execution phases stay required, and a closing assert_contribution fails any run where no path completed. Capturing the declaration whole is what makes this safe: format_option_id and publisher_domain are both optional on a declaration, and a capture that does not resolve fails its step and discards every other capture with it, so capturing either leaf alone made it a precondition for a path that must not require it. That was the reordering false failure review found: a seller answering one brief with different canonical shapes across calls had no canonical gate open at all. With one discovery the shape is observed once. A publisher-catalog-backed product previously received a scope "product" ref with no publisher_domain. core/format-option-ref.json's product-local branch forbids publisher_domain, so that ref was unresolvable and a conformant seller had to reject it. It is now graded on its own path. The three provenance storyboards seeded schema-invalid products (adcp-client#3269): they omitted the required publisher_properties and reporting_capabilities, declared no format at all, and their CPM pricing option carried a `rate` field the schema ignores, so the product advertised no price. They now declare fixed_price and an image format option matching their probes. Supporting changes: - Canonical discovery checks products[0].format_options[0].format_kind is image. filters.format_kinds narrows to products that ACCEPT a kind and says nothing about declaration order, so a conformant multi-kind product may lead with another kind; capturing it would ship this fixture's 300x250 image asset under the wrong format_kind for a seller to correctly reject, on a non-optional phase. The check DETECTS that mismatch; it does not select a matching declaration. A canonical-only seller leading with another kind is therefore not graded on any canonical path and fails the coverage gate - that behaviour is pinned by a regression so the check is never mistaken for order-independent format selection. The first-declaration and fixed-300x250 applicability predates this change and is now stated in prerequisites. - scope is the only ref member no response supplies, so it comes from a storyboard-root constant injected with context_inputs. Not a runner defect: whole-object $context substitution works, but the grammar has no object spread or projection, so a substituted object cannot also carry a literal sibling. Order is what makes it safe - applyContextInputs structuredClones the request before setPath, so the captured declaration is never mutated. Both ref branches set additionalProperties true; receivers must tolerate the declaration's own members and must not read its nested format_kind as a package-level selector route. - The unnamed gate carries an existence clause. A dotted reference onto an absent key is falsy, so the bare form ran this phase for a legacy-only seller and failed it on unresolved context. - lint-storyboard-sample-request-schema synthesized {} for a $context placeholder whose target is a discriminated union written as { type, discriminator, oneOf } (core/format-option-ref.json), because the shape lives on the branches rather than the root. placeholderFor's object arm now takes the shape from the first object branch when the root carries no properties. The allowlist is unchanged. A broader resolveSchemaNode guard was tried first and reverted: it regressed account_timezone_buyer_selected by resolving account-ref.json to its account_id-only branch, turning sandbox into a string - an introduced regression, not pre-existing drift. - Legacy discovery stays unfiltered. In product-format-declaration.json the "once a format_id has been projected" condition attaches to the prohibition on raw (agent_url, id) matching, not to normalization itself; the narrower reason the filter is omitted is that a legacy-only product whose id has no canonical projection has no canonical kind to match, so a seller honouring the filter would exclude itself from its only gradeable path. - Drops the obsolete known-failing entry for get_products_legacy_format. - The changeset is `patch`, not main's `minor`. A minor changeset on 3.2.x would cut 3.3.0 off the maintenance line and collide with main's 3.3. Runner floor: the canonical gates read captured context, and on a runner whose skip_if grammar cannot evaluate it every canonical path would execute rather than exactly one. Verified end-to-end on the pinned @adcp/sdk 14.0.0-rc.53 and reported green on 15.9.2; no claim is made about which earlier release first carried the grammar. 27 fixture regressions, 19 storyboard lints, build:compliance --check and the changeset scope check pass. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean backport to 3.2.x of the one-discovery canonical-format redesign (#3268/#3269).
No blocking or medium findings; no inline comments posted.
Checked:
- Largest file
inline_creatives_without_sync.yaml(~660 net+): skip_if asymmetry is correct, not a bug. Unnamed path (L276) needs the existence clause; product-scoped path (L460) needs none due to negated leading term. Capturing the whole declaration at L247 keeps optionalformat_option_id/publisher_domainfrom becoming per-path preconditions. tests/cli-scenario-fixtures.test.cjs(651 new lines): L1244-1246 asserts probe width/height == option.params (real fixture↔schema coherence); L1513-1515 freezes served declarations to prove scope injection never mutates the capture.- Provenance
rate→fixed_pricefix is sound:fixed_priceis a real CPM field (cpm-option.json L23);ratewas additionalProperties-ignored. firstObjectBranch(lint L202) exists.- Changeset present,
patchtype, scope = compliance assets. No schema/dist/oneOf changes.
Gate checks: high_risk false; gated_paths false; no no-auto-approve team match; no critical/high/medium findings. No breaking-class protocol change — compliance-asset/fixture changes only, no static/schemas/source/** or dist/** modifications. Legacy-path grading is adopter-visible and documented in the changeset. Row 9 — approve.
sujanchalla0510
pushed a commit
to sujanchalla0510/adcp
that referenced
this pull request
Oct 18, 2026
Merge the published v3.2.5 maintenance release (tag v3.2.5, 3512882, the adcontextprotocol#8171 Version Packages merge on 3.2.x) into main as a record-only merge. The merge keeps main's tree (ours strategy) and adds only the 3.2.5 release records: - dist/schemas/3.2.5/, dist/compliance/3.2.5/ and the signed dist/protocol/3.2.5.tgz{,.crt,.sha256,.sig} tuple, byte-identical to the tag. - CHANGELOG.md: the 3.2.5 block, verbatim from the tag. - static/compliance/published-versions.json: register 3.2.5, matching the 3.2.x manifest. - dist/schemas/index.json and latest.json: regenerated by build:schemas; latest_stable, v3 and v3.2 now 3.2.5. The 3.2.4..3.2.5 source changes (adcontextprotocol#8163, adcontextprotocol#8236) are already on main in their main form (adcontextprotocol#8161, adcontextprotocol#8235), so no 3.2.x source is taken. The second parent records that reconciliation so the next 3.2.x forward merge does not re-conflict on it. Co-Authored-By: Claude Opus 5.5 (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.
Backport of #8235 (
59d1049con main; this branch's object is56e611aed) to the3.2.xmaintenance line, carrying the one-discovery redesign of canonical format handling that all three lines converged on during review.Fixes the protocol side of adcontextprotocol/adcp-client#3268 and #3269 for the 3.2 bundle. SDKs pin versioned
3.2.xcompliance bundles, so publishing onlymain(future 3.3) or3.1.xdoes not deliver these fixtures to the default CLI — this backport is what does.What was wrong
#3268 —
inline_creatives_without_syncrequired a product carrying canonicalformat_options[]with a stableformat_option_id, and treated the legacyformat_ids[]path asoptional.core/product.jsonrequiresformat_ids,format_options, or both — not both. Canonical-only sellers with unnamed options, and legacy-only sellers, failed a representation AdCP never required them to publish.#3269 — the three
provenance_*storyboards seeded products missing the schema-requiredpublisher_propertiesandreporting_capabilities, declaring no format at all, with a CPM pricing option carrying aratefield the schema ignores (so the product advertised no price). The official response-schema validator rejected them outright.The design
One canonical discovery captures the product, the pricing option, the canonical
format_kind, and the whole firstformat_options[]declaration from a singleget_productsresponse. Three mutually exclusive canonical execution phases then read that captured declaration via dottedskip_if:format_option_id, nopublisher_domaincanonical_product_scoped_inline_pathformat_option_refs[],scope: "product"format_option_id+publisher_domaincanonical_publisher_scoped_inline_pathformat_option_refs[],scope: "publisher", full identity pairformat_option_idcanonical_unnamed_option_inline_pathformat_kindaloneLegacy
format_ids[]keeps its own discovery and runs independently. Execution phases are not optional, so once a representation was captured, inline create, update and readback on it must work. A closingassert_contributionfails any run where no path completed.Why capture the declaration whole.
format_option_idandpublisher_domainare both optional, and a capture that does not resolve fails its step and discards every other capture with it — so capturing either leaf alone makes it a precondition for the path that must not require it. That was the reordering false failure: a seller answering one brief with different canonical shapes across calls had no canonical gate open at all. With one discovery the shape is observed once, so gate and buy are always the same observation.Publisher-catalog fix. Such a product previously received a
scope: "product"ref omittingpublisher_domain.core/format-option-ref.json's product-local branch forbids that field, so the ref was unresolvable and a conformant seller had to reject it — failing the storyboard for being right.The image check detects, it does not select
Canonical discovery checks
products[0].format_options[0].format_kindisimage.filters.format_kindsnarrows to products that accept a kind and says nothing about declaration order, so a conformant multi-kind product may lead with another kind; capturing it would ship this fixture's 300x250 image asset under the wrongformat_kindfor a seller to correctly reject, on a non-optional phase.This check detects that mismatch — it does not select a matching declaration. A canonical-only catalog leading with another kind is therefore not graded on any canonical path and fails the coverage gate, with zero creates. That behaviour is pinned by a regression so the check is never mistaken for order-independent format selection.
Applicability (predates this change, now stated in
prerequisites): the buyer submits one fixed 300x250 image creative, and every path readsproducts[0]of its own response and that product's first declaration. Answer this brief with a first product whosepricing_options[0]is fixed-price and whoseformat_options[0]— orformat_ids[0]on the legacy path — accepts a 300x250 image. Order-independent kind/dimension selection would need a selector the storyboard grammar does not have; recorded as a general limitation, not addressed here.Evidence on the pinned runner (
@adcp/sdk14.0.0-rc.53)canonical_unnamed_option_inline_pathcanonical_product_scoped_inline_path{…, format_option_id, scope:"product"}canonical_publisher_scoped_inline_path{…, format_option_id, publisher_domain, scope:"publisher"}Mutation safety is structural:
injectContextinserts the captured object by reference, butapplyContextInputsstructuredClones the request beforesetPath, and the runner calls them in that order.scopeis injected alone — injecting the declaration viacontext_inputsand then writingscopewould mutate the capture.scopecoming from a storyboard-root constant is not a runner defect: whole-object$contextsubstitution works; the grammar simply has no object-spread or projection, so a substituted object cannot also carry a literal sibling. Both ref branches setadditionalProperties: true; receivers must tolerate the declaration's own members and must not read its nestedformat_kindas a package-level selector route.Maintenance-line deviations from #8235
patch, notminor. Aminorchangeset on3.2.xwould cut 3.3.0 off the maintenance line and collide with main's 3.3. In-line precedent:canonical-formats-direct-selector-image-formatsshipped aspatch. The one adopter-visible tightening — a dual-emitting seller with a broken legacy inline path now fails where theoptionallegacy phase did not grade it — is stated in the changeset.placeholderFor's object arm now takes its shape from the first object branch when the root has noproperties, so a$contextplaceholder targeting{ type, discriminator, oneOf }no longer synthesizes{}. The allowlist is unchanged. A broaderresolveSchemaNodeguard was tried and reverted — it regressedaccount_timezone_buyer_selectedby resolvingaccount-ref.jsonto itsaccount_id-only branch and turningsandboxinto a string. That was an introduced regression, not pre-existing drift.product-format-declaration.jsonthe "once aformat_idhas been projected" condition attaches to the prohibition on raw(agent_url, id)matching, not to normalization itself. The narrower reason the filter is omitted: a legacy-only product whose id has no canonical projection has no canonical kind to match, so a seller honouring the filter would exclude itself from its only gradeable path.Verification
tests/cli-scenario-fixtures.test.cjs— 27/27, registered intest:governance-task-slices(in the rootscripts.testCI manifest)build:compliance --check, changeset scope,changesets status → patch, server typecheck — all green against a baseline captured green before any editADCP_SKIP_STORYBOARD_MATRIX=1(.agents/playbook.md§Testing,.husky/pre-push);training-agent-storyboards.ymlis the authoritative gate and runs here.Runner floor
The canonical gates read captured context; on a runner whose
skip_ifgrammar cannot evaluate it, every canonical path would execute rather than exactly one. Verified end-to-end on the pinned 14.0.0-rc.53 and reported green on 15.9.2. No claim is made about which earlier release first carried the grammar — run the fixture regressions against an older runner before pointing it at this bundle.🤖 Generated with Claude Code