Skip to content

fix(compliance): give hosted runs the bundle test kit's asset fixtures - #8930

Merged
bokelley merged 1 commit into
mainfrom
fix/hosted-run-test-kit-fixtures-8882
Nov 11, 2026
Merged

bokelley merged 1 commit into
mainfrom
fix/hosted-run-test-kit-fixtures-8882

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Fixes #8882.

Root cause

Hosted grading never gave the SDK the bundle's test kit.

  • Hosted comply() copies the owner's grading credential into a run-level test_kit. That happens in withHostedAuthTestKit (server/src/services/hosted-compliance-version.ts:652), which withHostedComplianceRunOptions applies inside comply() (server/src/addie/services/compliance-testing.ts). The heartbeat always passes owner auth, so every hosted run has a run-level kit, and that kit holds only auth.
  • @adcp/sdk loads a storyboard's declared kit only when the run has no test_kit of its own. resolveDeclaredTestKit returns early on options.test_kit !== undefined (17.0.0-beta.21, dist/lib/testing/storyboard/test-kit.js:110). So hosted runs never read prerequisites.test_kit: test-kits/acme-outdoor.yaml.
  • $build_assets_from_format reads options.test_kit.assets (creative-assets.js:457, buildAsset). With no assets, the required image slot fails with "selected test kit does not declare asset fixtures". The step skips as fixture_unavailable, every step after it skips, and the storyboard grades untested 0/0.

PR #8846 moved media_buy_seller and the two dependency_impairment scenarios onto the directive in 3.1.33. creative_fate_after_cancellation already used it, which is why it has read untested since 3.1.31. A local comply() run with the bundle's kit passes because that kit carries assets.images. storyboard_start_offset and the SDK version have no effect on this.

Fix

comply() takes one kit for the whole run. The hosted run now adds the target bundle's test-kits/acme-outdoor.yaml assets only to its run-level kit (server/src/compliance/hosted-run-test-kit.ts). It is an allowlist, like testKitOptionsFromKit:

  • assets is the only kit field the directive reads. The SDK reads test_kit.assets nowhere else.
  • Other fields (brand, account, commercial_relationship, creative_build_probes, creative_formats, …) are not copied, because storyboards that declare other kits would see them.
  • The hosted credential and probe task are unchanged, and the kit's demo key is never copied.
  • A run with no run-level kit is left alone, so the SDK still loads each declared kit itself. A caller-supplied kit, or one that already sets assets, is also left alone.

This is a server change on main and deploys with the app. The 3.1.x storyboards are correct: they declare the kit, and they pass with it. No 3.1.x storyboard patch is needed.

Tests

server/tests/unit/hosted-run-test-kit.test.ts:

  • Hosted comply() on the real 3.1.33 target hands the SDK a run-level kit that holds exactly auth (the owner credential) and the bundle kit's assets.
  • The SDK's own expandCreativeAssetDirectives builds the 3.1.33 media_buy_seller sync_creatives creative from that kit. The test format is the reporter's display_300x250: a required 300×250 image plus a click URL. The result is hero-300x250.jpg plus the kit's click URL. With the credential-only kit that hosted runs used before, the directive stays unresolved. Both tests fail without the fix.
  • Allowlist checks: other kit fields are never copied, the kit's credential is never copied, and the run is left alone when it has no kit, has a caller kit, or already sets assets.
  • Drift guard: every $build_assets_from_format storyboard declares the kit the assets come from, in source and in every published bundle.

Related suites pass: hosted route storyboard, target discovery, forward specialisms, 3.0 governance, controller preflight, echoed release, hosted version and storyboards. The precommit full server unit suite also passed.

I also ran hosted comply() end to end against the in-process training agent, before and after the fix: sales on 3.1.33, and sales and creative on 3.2.10. Step results were identical. That shows no collateral change. The training agent has no image-only format on this path, so it can't show the improvement; the SDK-expansion test does.

Known gaps (not fixed here), tracked in #8929

  • Storyboards that declare nova-motors.yaml, summit-foods.yaml, hosted-grader.yaml and other kits still get none of their own kit's fixtures on hosted runs.
  • universal/billing-gate-dispatch.yaml phases gated on skip_if: "test_kit.commercial_relationship != 'passthrough_only'" still skip on hosted runs. Locally they run with billing-gate-runner.yaml.

The general fix is for hosted runs to load each storyboard's declared kit and overlay only the hosted credential. That most likely needs an SDK option.

🤖 Generated with Claude Code

Hosted comply() copies the owner's grading credential into a run-level
test_kit. The SDK only loads a storyboard's declared kit
(prerequisites.test_kit) when the run has no test_kit, so hosted runs never
saw test-kits/acme-outdoor.yaml. The run kit carried auth and nothing else,
so $build_assets_from_format had no assets.images to fill a required image
slot. The step skipped as fixture_unavailable and the storyboard graded
untested (0/0). On 3.1.33 that hit media_buy_seller and the two
dependency_impairment scenarios (moved to the directive in #8846), plus
creative_fate_after_cancellation since 3.1.31. The same storyboards pass
locally with the bundle's kit.

comply() takes one kit for the whole run, so the hosted run now adds the
target bundle's acme-outdoor `assets` to its run-level kit. Only `assets` is
copied, the one field the directive reads; brand, account,
commercial_relationship and the rest stay out, because storyboards that
declare other kits would see them. The hosted credential is unchanged and
the kit's demo key is never copied. A run without a run-level kit, and a
caller-supplied kit, are left alone.

A unit test keeps the single-kit assumption honest: every storyboard that
uses $build_assets_from_format, in source and in every published bundle,
declares test-kits/acme-outdoor.yaml.

Closes #8882

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 app-level fix, no blocking or medium findings.

This is a server/Addie-only change (#8882) that restores hosted comply() grading. withHostedRunFixtureTestKit now copies only the bundle kit's assets into the run-level kit, so $build_assets_from_format regains assets.images and storyboards grade correctly instead of falling back to untested, while a caller-supplied kit stays authoritative.

Checks performed:

  • No static/schemas/source/**, dist/**, or wire-shape changes — no changeset required and correctly none present (app-level scope).
  • New getTestKit→loadTestKits path is fail-safe (hosted-run-test-kit.ts:99-100), degrading to pre-fix behavior rather than throwing.
  • Load-bearing HOSTED_RUN_FIXTURE_TEST_KIT_ID='acme_outdoor' is guarded by the invariant test (hosted-run-test-kit.test.ts:331-349) that walks source + every published bundle.

High-risk flag is true only because of a (modified) match on server/src/addie/**; with no medium-or-higher finding on that file, the modification is presumed safe (no escalation on the flag alone). No no-auto-approve team match, gated_paths is false. Rows 1–8 do not fire; falls through to row 9.

@bokelley
bokelley merged commit 2438742 into main Nov 11, 2026
32 checks passed
@bokelley
bokelley deleted the fix/hosted-run-test-kit-fixtures-8882 branch November 11, 2026 19:13
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.

Hosted heartbeat grades $build_assets_from_format storyboards untested on 3.1.33; they pass with the bundle's test kit

1 participant