Skip to content

fix(compliance): one canonical discovery and three exclusive format-option paths - #8237

Merged
bokelley merged 5 commits into
3.1.xfrom
conductor/inline-route-selection-followup
Oct 16, 2026
Merged

bokelley merged 5 commits into
3.1.xfrom
conductor/inline-route-selection-followup

Conversation

@bokelley

@bokelley bokelley commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Backport of the canonical-identity redesign proven on main/3.2, adapted for 3.1.x. Follows #8234 (merged as 28034985c), which this supersedes in shape.

What was wrong with the shipped 3.1 state

Two defects, both reproduced on 9.6.2 and 15.8.1:

  1. Publisher-backed sellers were failed outright. The named path emitted scope: "product" unconditionally. core/format-option-ref.json's product-local arm sets publisher_domain: false, so a publisher-catalog-backed declaration sent that way is schema-invalid, not merely unresolvable.
  2. A reordered catalog failed a conformant seller. With a discovery probe per representation, a seller whose brief ranking differed between calls satisfied neither probe and failed with zero paths executed.

What this does

One canonical discovery captures products[0].format_options[0] as a whole declaration, plus product and pricing option. Three mutually exclusive, exhaustive guards route it:

Shape Guard Selector sent
unnamed !context.canonical_declaration || context.canonical_declaration.format_option_id none; format_kind on the creative
product-local !…format_option_id || …publisher_domain scope: "product"
publisher-catalog !…format_option_id || !…publisher_domain scope: "publisher" + publisher_domain

Gate and buy are one observation, so reordered or changed discovery results cannot produce a false failure. Each ref is the captured declaration with a scope constant injected via context_inputs, which clones the request — the stored context is never mutated.

Legacy discovery deliberately does not narrow by canonical kind: a non-projectable legacy format has no projection, so there is no kind it can honestly accept, and narrowing would exclude exactly the legacy-only population this scenario serves.

A field_value: image mismatch detector on the canonical first declaration sits in the optional discovery phase. A non-image first declaration fails the probe, captures are never promoted, and all three canonical lanes stand down — so the fixture's 300x250 image is never bought under a video declaration. It is a detector, not a selector: a canonical-only video-first seller opens no execution phase, buys nothing, and fails the coverage gate.

Required execution, readback and the closing assert_contribution remain fatal.

Runner floor

The guards dereference captured context in skip_if. Verified with @adcp/sdk 15.8.1 and 15.9.2; verified absent on 9.6.2. 15.8.1 was checked against the published registry tarball (sha256 9bd2cc8d…00e9) by compiled-source inspection and a public-API runStoryboard reproduction covering all three shapes, an absent declaration, and the no-mutation boundary. 15.8.1 is not claimed to be the earliest supporting release.

This does not raise the floor above 15.x — billing_out_of_band, evaluator_auth and refine_finalize_exclusivity already ship context-reading skip_if on 3.1.x — but it is the first on this line to dereference a nested field of a captured object, and the first on non-optional phases. On a sub-floor runner the scenario mis-executes rather than degrading politely; that is stated in the storyboard narrative.

Production @adcp/sdk stays 9.6.2. The regression tests run against a private, dev-only tests/sdk-runner helper (file: devDependency) pinning a published 15.9.2, whose conflicting peers nest locally. Clean npm install and npm ci both exit 0 with no peer flags, no workspaces, no .npmrc change. The helper is private: true and absent from every published artifact.

Deliberate 3.1-vs-main divergences

Not to be reconciled toward main:

  • account.operator_unit removed (16 sites) — absent from 3.1's account-ref.json, whose arms are additionalProperties: false, so it was a hard lint failure.
  • filters.format_kinds removed — in main's product-filters.json, not 3.1's; it would have ridden in on additionalProperties and asserted a guarantee no conformant 3.1 seller owes.
  • requires: [controller], prerequisites.controller_seeding, fixtures.accounts removed — none existed at 28034985c; copying them would have whole-skipped the storyboard for every seller without a test controller or seed_account. Verified a no-controller profile now executes 7 steps, makes a real create and passes the coverage gate, rather than passing by whole-skip.
  • Allowlist untouched — 2 entries, unchanged, regeneration a no-op. Main's 15 added lines were for its operator_unit.
  • 3.1 provenance assertions retained, including the .example agent_url host guard.

Linter fix

The sample-request linter's object placeholder now descends into a discriminated union written as { type, discriminator, oneOf } (core/format-option-ref.json) so it synthesises a tagged placeholder instead of {}. The descent happens only when the resolved node declares no properties — a broad resolveSchemaNode change was tried first and reverted because it made core/account-ref.json resolve to oneOf[0], stringifying sandbox and growing the allowlist. Verified A/B: format-option-ref gains {"scope":"publisher",…}; the account placeholder is byte-identical to before.

Correction rounds applied

Three review rounds landed on top of the initial port, all verified green:

  • Linter narrowed. A broad resolveSchemaNode composite guard was tried and reverted — it made core/account-ref.json resolve to oneOf[0], stringifying sandbox and growing the allowlist. The fix now lives in placeholderFor's object arm and descends only when the resolved node declares no properties. Allowlist is unchanged vs 3.1.x.
  • 3.1 gating restored. requires: [controller], prerequisites.controller_seeding and fixtures.accounts were copied from main's post-image; none existed at 28034985c, and together they would have whole-skipped this storyboard for every seller without a test controller or seed_account. Removed. Verified a no-controller profile still executes 7 steps, makes a real create and passes the coverage gate.
  • Tests made load-bearing. The same-kind ambiguity rule now has an unnamed + same-kind case where ambiguity — not format_option_id — is what rejects, with an observation hook proving that branch fires. The legacy-filter test asserts the mechanism rather than a red run any broken stub would produce. Served declarations are frozen and count-asserted.

Known limitation, unchanged

Order-independent selection of a product and declaration by kind and dimensions is not closed here, and the detector does not provide it. Each probe reads products[0] and format_options[0]; the buyer submits a fixed 300x250 image at a fixed price. Recorded in prerequisites.

Validation

27/27 scenario tests, 22 storyboard/compliance lint suites clean, build:compliance clean, typecheck exit 0, changeset scope check and changesets status clean, clean npm ci exit 0.

🤖 Generated with Claude Code


Open workspace in Conductor

bokelley and others added 4 commits October 16, 2026 14:11
…ption paths

inline_creatives_without_sync used a discovery probe per representation.
Independent probes read independent get_products responses, so a seller whose
brief ranking differed between calls could satisfy neither and fail with no
path executed. The product-local reference was also emitted unconditionally,
and format-option-ref.json's product-local arm sets publisher_domain: false,
so a publisher-catalog-backed declaration sent with scope "product" is
schema-invalid - a conformant publisher-backed seller was failed outright.

One canonical discovery now captures products[0].format_options[0] as a whole
declaration alongside the product and pricing option. Three mutually exclusive,
exhaustive guards route it: unnamed (format_kind alone, no selector),
product-local (scope "product"), and publisher-catalog (scope "publisher" with
publisher_domain). Gate and buy are one observation, so reordered or changed
discovery results cannot produce a false failure. Each reference is the
captured declaration with a scope constant injected through context_inputs,
which deep-clones the request, so stored context is never mutated.

Legacy discovery stays unfiltered by canonical kind: a non-projectable legacy
format has no canonical projection and accepts no kind, so a seller honouring
such a filter would exclude itself and lose its only gradeable path. On 3.1
neither probe narrows, because this line's product-filters.json defines no
canonical-kind filter; asset applicability is stated in the narrative instead.

Required execution, readback and the final contribution assertion stay fatal.

Ported from the design proven on main, adapted for 3.1: account.operator_unit
and filters.format_kinds are main-only and are dropped here, the 3.1 provenance
fixture assertions are preserved, and the sample-request allowlist regenerates
unchanged.

The guards read captured context in skip_if, which production @adcp/sdk 9.6.2
does not evaluate. Production stays 9.6.2; the regression tests run against a
private dev-only tests/sdk-runner helper pinning a published 15.9.2, whose
conflicting peers nest locally and which is absent from every published
artifact.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…inline port

Corrections from the fresh review of the ported redesign.

Linter: the broad resolveSchemaNode composite guard introduced drift rather
than revealing it. core/account-ref.json is {type:object, oneOf:[account_id,
natural-key]} with no top-level properties, so the guard made it resolve to
oneOf[0] and every natural-key child fell through to a string placeholder -
sandbox became a string and account_timezone grew an allowlist entry. Reverted,
and narrowed to placeholderFor's object arm, which descends only when the
resolved node declares no properties. format-option-ref.json still synthesises
a scope-tagged placeholder; account refs are byte-identical to before and the
allowlist does not grow.

3.1 gating: copying main's post-image added requires:[controller],
prerequisites.controller_seeding and a fixtures.accounts block that this
scenario never had and no step references. Together they would have
whole-skipped the storyboard for every seller without a test controller or
seed_account. All three removed; the test-kit reference stays. Verified a
no-controller profile still grades - 7 executed steps, a real create, coverage
gate passed - rather than passing by whole-skip. Explicit depends_on:[] on the
coverage phase and [capability_discovery] on legacy discovery restored.

Tests: the ambiguous same-kind catalog now gates rejection on the ambiguity
itself rather than on format_options[0] having an id, so the second declaration
is load-bearing; the legacy-filter test asserts the mechanism (legacy path never
opens, coverage gate fails) instead of a red run a stub would produce either
way; served declarations are frozen and counted so the no-mutation proof cannot
go vacuous; missing lane buys return a graded failure instead of crashing the
stub.

Narrative: discovery/execution phase counts corrected (two and four), the
normalization paraphrase narrowed to what the schema says, the context_inputs
construction explained as the supported way to add one literal sibling key
rather than an SDK defect, the clone guarantee claimed only where verified
(15.9.2), the >=15.8.1 floor and the old-runner mis-execution risk stated, and
the controlled-fixture applicability limit - first product, first declaration,
fixed 300x250 image, fixed price - recorded with order-independent selection
called out as a separate unclosed limitation.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…fied floor

Adds the mismatch detector agreed with the 3.2 lead: the optional canonical
discovery now asserts field_value image on products[0].format_options[0]
.format_kind. A non-image first declaration fails the probe, its captures are
never promoted, and all three canonical paths stand down - so the fixture's
300x250 image is never bought under, say, a video declaration.

It is a detector, not a selector, and the tests pin that distinction. A mixed
seller whose canonical first declaration is video opens no canonical lane and
is carried by legacy with one buy; a canonical-only video-first seller opens no
execution phase at all, buys nothing, and fails the closing contribution gate.
General order-independent kind and dimension selection stays an open
limitation, recorded in prerequisites. 3.1 still sends no format_kinds filter,
which this line's product-filters.json does not define.

Runner floor wording now matches the evidence: verified with 15.8.1 and 15.9.2
rather than hedged. 15.8.1 was checked against the published registry tarball by
compiled-source inspection and a public-API runStoryboard reproduction covering
the three canonical shapes, an absent declaration, and the scope-only
no-mutation boundary, so the clone guarantee is no longer claimed for 15.9.2
alone. Still verified absent on 9.6.2, and 15.8.1 is not claimed to be the
earliest supporting release.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…e detector

Correction-review findings on the ported redesign.

The same-kind rejection rule computed an ambiguity flag that no test could
exercise: the only sameKindCatalog case used the product shape, where
format_option_id alone already triggers rejection. Adds the unnamed same-kind
case - two declarations sharing a format_kind with no id on either - where the
ambiguity clause is what decides, with an observation hook so the test proves
that branch fired rather than inferring it from a red run. The comment claiming
the suite verified a rejecting seller is corrected: the rule is a live guard
against a storyboard regression, not a branch this suite otherwise takes.

Narrative corrections. The applicability paragraph still said a video-first
seller is "rejected on create"; that is now true only on the legacy side, since
the canonical probe detects the mismatch before any create is issued and a
dual-emitting seller passes on legacy alone. The coverage-gate diagnostic
omitted the kind requirement. A comment documenting the legacy-filter rationale
was orphaned when the detector tests were inserted above the test it describes.
The format_kinds definition quoted from the 3.2/main schema is now attributed
rather than asserted, since the same test proves 3.1 defines no such filter.
The stub rebuilt its catalog without canonicalKind.

The runner floor now records that failed-discovery capture suppression - the
property the detector rests on - is verified on 15.8.1 as well as 15.9.2.

Changesets. The new one did not mention the detector. The superseded marker on
the pending changeset governed only its runner-compatibility paragraph while
three others still described the replaced shape; it now heads the whole
inline-scenario half, leaving the provenance half standing.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@bokelley
bokelley requested a review from a team as a code owner October 16, 2026 15:11

@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.

No blocking or medium findings. Reviewer completed a full review (2701 lines / 11 files) and verified: the canonical discovery refactor in inline_creatives_without_sync.yaml with three mutually-exclusive, exhaustive skip_if guards (head L852/L1062/L1330) is correct across all (format_option_id, publisher_domain) combinations with no double-buy and correct stand-down on absent capture; the field_value: image detector (L823-826), test no-mutation freeze (L2171) and validateRef schema check (L2154), and lint placeholderFor descent (L551) are all sound. Linter change is strictly more schema-valid; tests/sdk-runner is a private dev-only helper leaving production @adcp/sdk 9.6.2 untouched. The sub-15.8.1 runner-floor limitation is documented and non-regressive.

Gate checks: no no-auto-approve team match; gated_paths false; high_risk false; no prior decision. No rows 1–8 fired → row 9 approve.

…rrect three claims

Re-review of the final tip found one claimed correction that was never made and
three texts that misdescribe what they sit beside.

There were TWO legacy-filter rationale comments orphaned when the detector
tests were inserted, not one. The previous commit moved the first and its
message claimed the orphaning was fixed; the second - "the concrete loss if the
filter were added" - was still heading the video-first detector test, which has
nothing to do with filters.format_kinds. Moved to the test it describes, so
pruning the detector test can no longer carry away the only stated motive for
leaving legacy discovery unfiltered.

The unnamed same-kind test's comment claimed NEITHER declaration carries a
format_option_id. The second one does - buildProduct's ?? 'image' fallback
yields image_premium. The mechanism is unaffected and still sound: only
options[0] is ever captured and it has no id, so `ambiguous` remains the sole
term that can trigger the rejection. But a maintainer trusting the prose could
tighten the stub's rule and silently change what the test proves, so the
comment now says what the fixture actually builds and why the second
declaration being unreachable is the point.

The superseded marker said "four exclusive context-guarded paths" while
pointing at an entry titled "three exclusive canonical paths". Four paths
exist, but only the three canonical ones are mutually exclusive; legacy runs
independently of all three, as the narrative and the dual-emitting test both
state. Reworded.

Also drops a dangling conjunction left by the earlier format_kinds attribution
rewrite.

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 comment/prose-only delta, no actionable findings.

This subsequent push adds a 67-line delta across 2 files, all comment/prose changes: the changeset reclassifies the fourth discovery path, and the test file rewords two in-test comments and relocates a "concrete loss" explanation block above the legacy-only format_kinds test it describes. No executable code changed. Prior pass was clean (approve) and nothing new is introduced.

Gate checks:

  • No no-auto-approve team match.
  • gated_paths: false; review_decision: APPROVED.
  • high_risk: false.
  • No critical/high/medium findings.

Rows 1–8 do not fire → row 9 approve.

@bokelley
bokelley merged commit 933ea92 into 3.1.x Oct 16, 2026
12 checks passed
@bokelley
bokelley deleted the conductor/inline-route-selection-followup branch October 16, 2026 15:30
sujanchalla0510 pushed a commit to sujanchalla0510/adcp that referenced this pull request Oct 18, 2026
…main

Merge the published v3.1.29 maintenance release (tag v3.1.29,
f082c7a, the adcontextprotocol#8247 Version Packages
merge on 3.1.x) into main as a record-only merge. v3.1.29 descends from
v3.1.28 (f4d53b8, adcontextprotocol#8069), so both releases' records come in.

The merge keeps main's tree (ours strategy) and adds only:

- dist/schemas/3.1.28/, dist/schemas/3.1.29/, dist/compliance/3.1.28/,
  dist/compliance/3.1.29/ and the signed dist/protocol/3.1.28.tgz* and
  3.1.29.tgz* tuples, byte-identical to the tag.
- CHANGELOG.md: the 3.1.29 and 3.1.28 blocks, verbatim from the tag,
  above main's 3.1.27 block.
- dist/schemas/index.json: regenerated by build:schemas; v3.1 and
  latest_by_minor 3.1 now 3.1.29. latest.json is unchanged (3.2.5).

The 3.1.27..3.1.29 source changes (adcontextprotocol#7907, adcontextprotocol#8020, adcontextprotocol#8234, adcontextprotocol#8237, adcontextprotocol#8245)
are 3.1-line adaptations of fixes main already carries in its own form
(adcontextprotocol#7580, adcontextprotocol#7583, adcontextprotocol#7617, adcontextprotocol#8235; main's root request-signing vectors are
already unpadded base64url), so no 3.1.x source, tests or tooling are
taken. The second parent records that reconciliation so the next 3.1.x
forward merge starts from v3.1.29.

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