fix(conformance): treat absent proposal support as unsupported#2247
Merged
Conversation
There was a problem hiding this comment.
Right fix, and it's spec-mandated rather than a judgment call. Treating absent supports_proposals as unsupported puts it on the same opt-in trust-boundary footing as inline_creative_management — the seller advertises the feature, or the conformance runner skips its storyboard.
Things I checked
- Spec authority.
media_buy.supports_proposals's own schema description (core.generated.ts:22594-22597) reads "When false or absent, conformance runners skip proposal-lifecycle storyboards." Absence semantics are pre-declared by the field author — this is not the ambiguous "agent may pre-date the field" case the general run-anyway rule exists for.ad-tech-protocol-expert: sound, spec-cited. - Type-predicate widening.
isAbsenceMeansUnsupportedGatenarrows to{ path: string; equals: true }instead of the inline literal. Both call sites (runner.ts:345,runner.ts:377) feedpredicatestraight intoevaluateCapabilityPredicate, which takes the full union and never readspathas a literal — no caller depended on the narrowed type. Safe. - Symmetric coverage. Both the
raw_capabilities-present path and the no-get_adcp_capabilitiesprofile path route through the same Set, so the two exception paths can't drift. - Absence vs. explicit-false. The
actual !== undefined && actual !== equalsbranch is preserved, so explicitsupports_proposals: falsestill skips. New test atstoryboard-capability-gate.test.jsexercises undefined→skip, true→run, false→skip, plus the raw-caps-unavailable profile. - Changeset. Present,
patch, correct shape — conformance-runner gating behavior only, no public API or signature change.code-reviewer: patch matches impact.
Follow-ups (non-blocking — file as issues)
sales-proposal-modeis a stable specialism. A seller that genuinely sells via proposals but forgets the flag now silently gets proposal storyboards skipped rather than failed. That's the deliberate opt-in-is-the-trust-boundary design, and the schema's "buyers should still honor any proposals the seller actually returns" clause is the runtime safety net — but worth a one-line note in the adopter-facing validate guide so the skip doesn't read as a false pass.- Per the spec→mock→SDK triage order, the SDK doc-comment is generated downstream. Worth confirming the canonical
adcontextprotocol/adcpmedia-buycapability prose carries the identical "false or absent → skip" language. The generated schema is strong evidence; the spec repo is the source of truth.
LGTM. Follow-ups noted below.
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.
Summary
media_buy.supports_proposalsas unsupported for proposal-lifecyclerequires_capabilitygates.get_adcp_capabilitiesis unavailable.Fixes #2245.
Validation
npm run build:libNODE_ENV=test node --test-timeout=60000 --test-force-exit --test test/lib/storyboard-capability-gate.test.jsnpx prettier --check src/lib/testing/storyboard/runner.ts src/lib/testing/storyboard/types.ts test/lib/storyboard-capability-gate.test.jsgit diff --checknpm run typecheck+ build hook