Skip to content

fix(compliance): seed native negotiation fixtures with native_in_feed - #8705

Merged
bokelley merged 1 commit into
mainfrom
fix/native-format-kind-fixtures
Nov 3, 2026
Merged

bokelley merged 1 commit into
mainfrom
fix/native-format-kind-fixtures

Conversation

@bokelley

@bokelley bokelley commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to the #8699 audit.

What

Two storyboards seeded a native product with format_kind: "native", at fixtures.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)

native isn't in core/canonical-format-kind.json, so the declaration matched no core/product-format-declaration.json branch. 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.

  • Why 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_placement needs a catalog and responsive_creative is an algorithmic asset pool, so neither fits.
  • Not a negative test: no step asserts on the format kind or on format validity. In refine_frequency_cap_negotiation, the product is "non-participating" because it doesn't declare media_buy_support.frequency_cap; its format plays no part. In typed_proposal_negotiation it's an ordinary third product in the seed proposal.
  • params added: with the kind fixed, the declaration still failed, because every format declaration requires params. I added title_max_chars: 90, body_text_max_chars: 140 and main_image_sizes: [{1200×627}], the IAB native typical values named in formats/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 into npm test) is #8699's guard, with one adaptation for how main resolves fixtures:

  • On main, a fixtures: entry can be a bare handle that fixture_resolution resolves only by discover (DR-0010). The runner never seeds such an entry.
  • The guard now skips an entry whose resolution strategies exclude seed. It keys handles the same way as scripts/lint-storyboard-fixture-resolution.cjs. An entry with no resolution entry keeps the effective [seed] strategy and is graded.
  • Without the skip, the guard flagged 10 discover-only pricing_options handles (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 two native entries.
  • A new unit case covers the skip. test(compliance): guard 3.1.x seeded storyboard fixtures against missing discriminators #8699's four cases are unchanged.
  • Fail-first: before the fixture fix, the test reported exactly typed_proposal_negotiation.yaml and refine_frequency_cap_negotiation.yaml fixtures.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.json already resolves to main's copy under the forward-merge rules. Main's build-check.yml has no per-lint step list, so the test runs through npm test (the sharded canonical stages) and needs no separate CI step.

Verification

  • Full schema check of both storyboards' seeded fixtures: every format_options entry now validates as core/product-format-declaration.json, and every pricing option validates as core/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 and storyboard tests:
    • build:compliance and build:compliance -- --check pass.
    • test:schemas, test:json-schema, test:composed, test:oneof-discriminators and test:contracts pass.
    • test:immutable-release-artifacts and test:test-coverage pass.
    • Every storyboard lint (test:storyboard-*, including fixture-resolution, sample-request-schema, response-schema and context-resolution) passes.
    • test:refine-finalize-validation-ids, test:compliance-packaged-refs, test:compliance-source-authority and test:pagination-invariant pass.
  • Training agent: I ran both storyboards against /sales/profiles/typed-negotiation in 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 is revise_exceed_constraints: the profile returns revised where unable is 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.
  • Hooks: I committed with --no-verify. The pre-commit hook passed test:unit and the dynamic-import and callApi guards, and its server unit suite passed every file except tests/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, and build-check is green on the base commit 8baa287b0. I ran typecheck separately and it passes. I pushed with ADCP_SKIP_STORYBOARD_MATRIX=1 and skipped no other push hooks.
  • Changeset: patch. check-changeset-protocol-scope.cjs origin/main passes, and changeset status reports a patch.

A 3.2.x backport of the fixture fix follows separately.

🤖 Generated with Claude Code

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

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

@bokelley
bokelley merged commit b70de1e into main Nov 3, 2026
75 of 77 checks passed
@bokelley
bokelley deleted the fix/native-format-kind-fixtures branch November 3, 2026 00:06
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