Repository navigation
test(compliance): guard 3.1.x seeded storyboard fixtures against missing discriminators - #8699
Conversation
…ing discriminators Adds tests/storyboard-fixture-discriminators.test.cjs. It collects every object a 3.1.x storyboard seeds through comply_test_controller (top-level fixtures blocks and inline seed_* steps), validates each against its domain schema with Ajv discriminator support, and fails on any discriminated union that is missing its tag or names an unknown one. Fixtures stay sparse: other gaps are left to the seller's baseline merge. This is the class behind #8646: publisher_properties entries with only publisher_domain match no branch of core/publisher-property-selector.json, so a seller echoing the seeded product fails the storyboard's own response schema check. With the preceding fixture fix the 3.1.x tree has no other instance (156 seeded objects checked). Wired into npm test and the build-check storyboard lint step. Refs #8646 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve.
No blocking findings. Clean diff across 5 files (patch-level changeset, conformance fixture + additive test, CI wiring).
Checked:
static/compliance/source/universal/get-products-pagination-integrity.yaml:53,62— addsselection_type: "all"to both seededpublisher_propertiesentries, matching the discriminated oneOf branch incore/publisher-property-selector.json, so verbatim echo now resolves correctly.tests/storyboard-fixture-discriminators.test.cjs(269 new lines) — seededObject id-reinsertion, inline-vs-fixture walk,discriminatorErrorsfiltering, and thechecked > 100guard against a silently-dead walk are all correct; fail-first unit cases pin the #8646 shape.- Versioning correct (patch changeset, only
static/compliance/source/**, nodist/**). - CI wiring (build-check.yml, package.json
test) is additive.
high_risk false, gated_paths false, no author team gate, no prior decision. No escalation triggers (rows 1–8) fire → row 9 approve. Pre-existing unrelated test:storyboard-scenario-fixtures failure on 3.1.x tip noted but out of scope for this PR.
f5b92db to
c358d85
Compare
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — additive conformance-harness test, no blocking findings.
No critical/high/medium findings. This subsequent pass adds a new guard test (tests/storyboard-fixture-discriminators.test.cjs) plus its wiring into package.json and .github/workflows/build-check.yml. Reviewer verified the control flow: the seededObjects walk skips re-walking the top-level fixtures block (L207-209) to avoid double-counting, inline seed steps are gated on params.fixture (L203), discriminator mechanism matches Ajv's discriminator: true, and both fragment refs resolve.
Gate checks: no no-auto-approve team match; gated_paths false; review_decision APPROVED. high_risk false. Prior decision was approve with no findings — clean iteration continues. None of rows 1-8 fire; falls through to row 9.
…#8705) typed_proposal_negotiation and refine_frequency_cap_negotiation seeded products[2] with format_kind "native", which is not a canonical format kind, so the declaration matched no product-format-declaration branch. Use native_in_feed, the canonical in-feed native kind, and add the params every format declaration requires. Port the 3.1.x seeded-fixture discriminator guard (#8699) to main. On main a fixtures entry can be a discover-only fixture_resolution handle (DR-0010) that is never seeded, so the guard skips those and grades every entry whose effective strategies include seed. Co-authored-by: Claude Opus 5.5 <[email protected]>
Reverts 1aa9ca0 ("Version Packages (#8700)"). The release PR head d68f6cc was generated on 66ac6bd, but #8699 (3561440) merged into 3.1.x 39 seconds before #8700 was admin-merged. The merge's base parent and tree therefore differ from the reviewed head, so the publication run quarantined it (scripts/check-release-state.cjs), and the committed signing certificate is bound to 66ac6bd rather than the merge's first parent, so the original signed tuple can never publish from 3.1.x. Nothing was published: no v3.1.32 tag or GitHub release, and R2 holds no schemas/3.1.32/, compliance/3.1.32/ or protocol/3.1.32 objects (verified). This revert restores the exact tree of 3561440 so the release workflow regenerates a fresh, re-signed 3.1.32 Version Packages candidate on the new head, which then needs a fresh non-author human approval on its exact head (RELEASING.md "Maintained 3.1 publication authority"). Co-authored-by: Claude Opus 5.5 <[email protected]>
Refs #8646. Follow-up to #8683.
#8683 (thanks @sujanchalla0510) fixed #8646 on
3.1.x: twoget_products_pagination_integrityfixture entries named onlypublisher_domain, while every branch ofcore/publisher-property-selector.jsonrequiresselection_type. That PR is merged as 66ac6bd. This PR adds a regression test so the same class of fixture bug can't come back on3.1.x, and it records an audit of every seeded fixture on the branch. It changes no fixtures.Thanks to @EvgenyAndroid for the analysis in #8646. It gave exact line references in the 3.1.31 and 3.1.30 bundles, the
oneOf/requiredreasoning, the runner and schema-root setup that reproduces it, and the note that 3.1.31's wholesale gating newly exposes it.The test
tests/storyboard-fixture-discriminators.test.cjs(npm run test:storyboard-fixture-discriminators). I wired it intonpm testand thebuild-check"Storyboard lint tests" step.comply_test_controller: the top-levelfixtures:blocks for products, pricing options, accounts, creative formats, creatives, media buys and plans, plus the inlineseed_*steps.discriminator: true.discriminatorerror: a missing tag, or a tag value that matches no branch.mergeSeed*in@adcp/sdk), but arrays replace the baseline wholesale and a seller can't guess which branch an entry meant. That is why a missing discriminator is the case worth grading.universal/get-products-pagination-integrity.yaml fixtures.products[0|1]: /publisher_properties/0 is missing its discriminator "selection_type".No changeset: the diff is a test, a
package.jsonscript and a CI step, none of which are protocol release surface.check-changeset-protocol-scope.cjs origin/3.1.xreports no protocol-scoped changes, and the changeset-check workflow skips on that.Audit
I validated all 156 seeded objects in the 3.1.x storyboards against the 3.1.x schemas.
3.1.x: the only discriminator omissions were the two fixed by #8683, and none remain. There are no other fixture fixes to make in this class.
Other mismatches against the full schema exist on 3.1.x. They aren't in this class, so I left them alone:
name,description,pricing_options,reporting_capabilities, …) are missing by design.format_ids[]entries with onlyid, noagent_url: 47 product entries and 4 creative entries. The same pattern is still onmain(31) and3.2.x(29). The rightagent_urldepends on the seller, so the fix isn't unambiguous from the schema. Flagging it for a separate decision.3.2.x and main (not changed here):
format_options[0]withformat_kind: "native"inprotocols/media-buy/scenarios/refine_frequency_cap_negotiation.yamlandtyped_proposal_negotiation.yaml(products[2]).nativeisn't a canonical format kind (the enum hasnative_in_feed), so the entry matches no branch.fixtures.pricing_optionsentries have nopricing_model. They arefixture_resolutiondiscover handles rather than verbatim seeds, so they're probably false positives for main's model.main, it fails on thenativeentries until they're fixed. It may also need to learnfixture_resolution. Expect a manual resolution, along with the usualpackage.jsonscript-list conflict.Verification (on this branch, after
npm ciwith the 3.1.x lockfile)test:schemas,test:storyboard-response-schemaandtest:compliance-source-authoritypass on the rebased tree.build:compliancetest:json-schema,test:composed,test:oneof-discriminators,test:immutable-release-artifactsbuild-checkstoryboard lint chain and every othertest:storyboard-*linttest:compliance-packaged-refs,test:pagination-invarianttypecheckget_products_pagination_integrityagainst the 3.1.x sales tenant, with schema rootdist/schemas/3.1.31.wholesale_first_pagewith the reporter's exact error.test:storyboard-scenario-fixtureshas one failure that is already on the 3.1.x tip:inline creatives: a legacy-only seller honouring format_kinds…. The test mutatessample_request.filters.format_kinds, but fix(compliance): support auction-only 3.1 sellers and optional features #8603 removedfiltersfrom that step. This PR doesn't touch that test or storyboard.ADCP_SKIP_STORYBOARD_MATRIXswitch. The changeset policy check found no protocol release-surface changes. The current storyboard matrix passed all six tenants above their floors, including every required-clean storyboard, and the 3.0-compat matrix passed too.🤖 Generated with Claude Code