Skip to content

fix(compliance): grade inline creative paths on advertised format representations - #8236

Merged
bokelley merged 1 commit into
3.2.xfrom
conductor/cli-test-fixtures-protocol-32-backport
Oct 16, 2026
Merged

bokelley merged 1 commit into
3.2.xfrom
conductor/cli-test-fixtures-protocol-32-backport

Conversation

@bokelley

@bokelley bokelley commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #8235 (59d1049c on main; this branch's object is 56e611aed) to the 3.2.x maintenance 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.x compliance bundles, so publishing only main (future 3.3) or 3.1.x does not deliver these fixtures to the default CLI — this backport is what does.

What was wrong

#3268 — 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. core/product.json requires format_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-required publisher_properties and reporting_capabilities, declaring no format at all, with a CPM pricing option carrying a rate field 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 first format_options[] declaration from a single get_products response. Three mutually exclusive canonical execution phases then read that captured declaration via dotted skip_if:

captured declaration path selector sent
format_option_id, no publisher_domain canonical_product_scoped_inline_path format_option_refs[], scope: "product"
format_option_id + publisher_domain canonical_publisher_scoped_inline_path format_option_refs[], scope: "publisher", full identity pair
no format_option_id canonical_unnamed_option_inline_path none — format_kind alone

Legacy 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 closing assert_contribution fails any run where no path completed.

Why capture the declaration whole. format_option_id and publisher_domain are 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 omitting publisher_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_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.

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 reads products[0] of its own response and that product's first declaration. Answer this brief with a first product whose pricing_options[0] is fixed-price and whose format_options[0] — or format_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/sdk 14.0.0-rc.53)

seller shape phases run creates emitted ref validates declaration mutated
unnamed canonical_unnamed_option_inline_path 1 (none — selector-less, intended) n/a no
product-local canonical_product_scoped_inline_path 1 {…, format_option_id, scope:"product"} yes no
publisher-catalog canonical_publisher_scoped_inline_path 1 {…, format_option_id, publisher_domain, scope:"publisher"} yes no

Mutation safety is structural: injectContext inserts the captured object by reference, but applyContextInputs structuredClones the request before setPath, and the runner calls them in that order. scope is injected alone — injecting the declaration via context_inputs and then writing scope would mutate the capture.

scope coming from a storyboard-root constant is not a runner defect: whole-object $context substitution works; the grammar simply has no object-spread or projection, so a substituted object cannot also carry a literal sibling. 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.

Maintenance-line deviations from #8235

  • patch, not minor. A minor changeset on 3.2.x would cut 3.3.0 off the maintenance line and collide with main's 3.3. In-line precedent: canonical-formats-direct-selector-image-formats shipped as patch. The one adopter-visible tightening — a dual-emitting seller with a broken legacy inline path now fails where the optional legacy phase did not grade it — is stated in the changeset.
  • Unnamed gate carries an existence clause. A dotted reference onto an absent key is falsy, so the bare form ran that phase for a legacy-only seller and failed it on unresolved context.
  • Linter: placeholderFor's object arm now takes its shape from the first object branch when the root has no properties, so a $context placeholder targeting { type, discriminator, oneOf } no longer synthesizes {}. The allowlist is unchanged. A broader resolveSchemaNode guard was tried and reverted — it regressed account_timezone_buyer_selected by resolving account-ref.json to its account_id-only branch and turning sandbox into a string. That was 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: 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 in test:governance-task-slices (in the root scripts.test CI manifest)
  • 19 storyboard lints, build:compliance --check, changeset scope, changesets status → patch, server typecheck — all green against a baseline captured green before any edit
  • Mandatory pre-commit gate passed in full (server-unit shards + typecheck). The local storyboard matrix was skipped at push via the documented ADCP_SKIP_STORYBOARD_MATRIX=1 (.agents/playbook.md §Testing, .husky/pre-push); training-agent-storyboards.yml is the authoritative gate and runs here.
  • Expert review: protocol, code, DX, security, plus a correction re-review of the final source that returned no blockers.

Runner floor

The canonical gates read captured context; 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 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

…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]>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 optional format_option_id/publisher_domain from 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_price fix is sound: fixed_price is a real CPM field (cpm-option.json L23); rate was additionalProperties-ignored.
  • firstObjectBranch (lint L202) exists.
  • Changeset present, patch type, 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.

@bokelley
bokelley merged commit 74302e7 into 3.2.x Oct 16, 2026
49 checks passed
@bokelley
bokelley deleted the conductor/cli-test-fixtures-protocol-32-backport branch October 16, 2026 15:31
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]>
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