Repository navigation
fix(compliance): seed native negotiation fixtures with native_in_feed - #8705
Conversation
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]>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean compliance-asset fix with no blocking or medium findings.
Both negotiation storyboards previously seeded a native product with format_kind: "native", which matches no branch of the canonical product-format declaration (canonical kind is native_in_feed); a seller echoing it would fail product-schema validation. Both scenarios now correctly use native_in_feed with valid params (title_max_chars/body_text_max_chars integers ≥1, main_image_sizes 1200×627) validating against formats/canonical/native_in_feed.json.
Changeset is patch, correctly scoped to a compliance-asset fix — no schema source touched (no spec drift, no oneOf regression), no dist/** mutation, based on main. The new test tests/storyboard-fixture-discriminators.test.cjs correctly collects seeded objects (both fixtures: block and inline seed_* steps) while skipping discover-only handles per DR-0010, and scopes grading to discriminator-keyword errors by design. Deps (yaml, ajv, ajv-formats) are wired into test.
No critical/high/medium findings. high_risk false, gated_paths false, no author team gate. Falls through to row 9.
Follow-up to the #8699 audit.
What
Two storyboards seeded a native product with
format_kind: "native", atfixtures.products[2].format_options[0]:static/compliance/source/protocols/media-buy/scenarios/typed_proposal_negotiation.yaml(native_feed_q4)static/compliance/source/protocols/media-buy/scenarios/refine_frequency_cap_negotiation.yaml(no_fcap_native_q4)nativeisn't incore/canonical-format-kind.json, so the declaration matched nocore/product-format-declaration.jsonbranch. A seller that echoed the seeded product as authored would fail product schema validation. Seeds replace arrays wholesale, so the seller's baseline can't repair the entry.This PR changes both entries to
native_in_feed.native_in_feed: it's the only native kind in the enum, and its schema calls it the canonical for IAB in-feed native and content-recommendation units. The product ids (native_feed_q4), the option id (native_article), the display channel, and the steps' asks ("Add native inventory…") all describe in-feed native.sponsored_placementneeds a catalog andresponsive_creativeis an algorithmic asset pool, so neither fits.refine_frequency_cap_negotiation, the product is "non-participating" because it doesn't declaremedia_buy_support.frequency_cap; its format plays no part. Intyped_proposal_negotiationit's an ordinary third product in the seed proposal.paramsadded: with the kind fixed, the declaration still failed, because every format declaration requiresparams. I addedtitle_max_chars: 90,body_text_max_chars: 140andmain_image_sizes: [{1200×627}], the IAB native typical values named informats/canonical/native_in_feed.json.Guard test ported from 3.1.x (#8699)
tests/storyboard-fixture-discriminators.test.cjs(npm run test:storyboard-fixture-discriminators, wired intonpm test) is #8699's guard, with one adaptation for how main resolves fixtures:fixtures:entry can be a bare handle thatfixture_resolutionresolves only bydiscover(DR-0010). The runner never seeds such an entry.seed. It keys handles the same way asscripts/lint-storyboard-fixture-resolution.cjs. An entry with no resolution entry keeps the effective[seed]strategy and is graded.pricing_optionshandles (the false positives test(compliance): guard 3.1.x seeded storyboard fixtures against missing discriminators #8699 predicted). With the skip, the only failures were the twonativeentries.typed_proposal_negotiation.yamlandrefine_frequency_cap_negotiation.yamlfixtures.products[2]: /format_options/0 has format_kind="native", which matches no branch.Forward-merge note: on 3.1.x, which has no
fixture_resolution, this version of the test behaves exactly like #8699's. If #8699 adopts this file, the 3.1.x → main forward-merge has nothing to reconcile in the test. Otherwise, take main's copy when they conflict.package.jsonalready resolves to main's copy under the forward-merge rules. Main'sbuild-check.ymlhas no per-lint step list, so the test runs throughnpm test(the sharded canonical stages) and needs no separate CI step.Verification
format_optionsentry now validates ascore/product-format-declaration.json, and every pricing option validates ascore/pricing-option.json. Products are missing only the sparse top-level fields (name,description,publisher_properties,pricing_options,reporting_capabilities), which seeds leave to the seller's baseline.build:complianceandbuild:compliance -- --checkpass.test:schemas,test:json-schema,test:composed,test:oneof-discriminatorsandtest:contractspass.test:immutable-release-artifactsandtest:test-coveragepass.test:storyboard-*, includingfixture-resolution,sample-request-schema,response-schemaandcontext-resolution) passes.test:refine-finalize-validation-ids,test:compliance-packaged-refs,test:compliance-source-authorityandtest:pagination-invariantpass./sales/profiles/typed-negotiationin candidate-version mode, which is how CI grades this storyboard.typed_proposal_negotiation: 20 passed, 1 skipped (revise_unsupported_dimension, N/A). That's the CI floor and the same before and after the change.refine_frequency_cap_negotiation: 6 passed, 1 failed. The failure isrevise_exceed_constraints: the profile returnsrevisedwhereunableis expected. The result is identical with the original fixture, so the failure predates this change. CI doesn't grade this storyboard.revise_include_non_participating, which includes the native product, passes.--no-verify. The pre-commit hook passedtest:unitand the dynamic-import and callApi guards, and its server unit suite passed every file excepttests/unit/training-agent-creative33-buyer.test.ts("consumes a complete typed brief…": a 404 fetching the fixture video). That test fails the same way in this sandbox on its own, this PR touches no server code, andbuild-checkis green on the base commit8baa287b0. I rantypecheckseparately and it passes. I pushed withADCP_SKIP_STORYBOARD_MATRIX=1and skipped no other push hooks.check-changeset-protocol-scope.cjs origin/mainpasses, andchangeset statusreports a patch.A 3.2.x backport of the fixture fix follows separately.
🤖 Generated with Claude Code