Repository navigation
fix(compliance): give hosted runs the bundle test kit's asset fixtures - #8930
Conversation
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]>
There was a problem hiding this comment.
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→loadTestKitspath 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.
Fixes #8882.
Root cause
Hosted grading never gave the SDK the bundle's test kit.
comply()copies the owner's grading credential into a run-leveltest_kit. That happens inwithHostedAuthTestKit(server/src/services/hosted-compliance-version.ts:652), whichwithHostedComplianceRunOptionsapplies insidecomply()(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 onlyauth.@adcp/sdkloads a storyboard's declared kit only when the run has notest_kitof its own.resolveDeclaredTestKitreturns early onoptions.test_kit !== undefined(17.0.0-beta.21,dist/lib/testing/storyboard/test-kit.js:110). So hosted runs never readprerequisites.test_kit: test-kits/acme-outdoor.yaml.$build_assets_from_formatreadsoptions.test_kit.assets(creative-assets.js:457,buildAsset). With noassets, the required image slot fails with "selected test kit does not declare asset fixtures". The step skips asfixture_unavailable, every step after it skips, and the storyboard gradesuntested0/0.PR #8846 moved
media_buy_sellerand the twodependency_impairmentscenarios onto the directive in 3.1.33.creative_fate_after_cancellationalready used it, which is why it has readuntestedsince 3.1.31. A localcomply()run with the bundle's kit passes because that kit carriesassets.images.storyboard_start_offsetand 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'stest-kits/acme-outdoor.yamlassetsonly to its run-level kit (server/src/compliance/hosted-run-test-kit.ts). It is an allowlist, liketestKitOptionsFromKit:assetsis the only kit field the directive reads. The SDK readstest_kit.assetsnowhere else.brand,account,commercial_relationship,creative_build_probes,creative_formats, …) are not copied, because storyboards that declare other kits would see them.assets, is also left alone.This is a server change on
mainand 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:comply()on the real 3.1.33 target hands the SDK a run-level kit that holds exactlyauth(the owner credential) and the bundle kit'sassets.expandCreativeAssetDirectivesbuilds the 3.1.33media_buy_sellersync_creativescreative from that kit. The test format is the reporter'sdisplay_300x250: a required 300×250 image plus a click URL. The result ishero-300x250.jpgplus 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.assets.$build_assets_from_formatstoryboard 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
nova-motors.yaml,summit-foods.yaml,hosted-grader.yamland other kits still get none of their own kit's fixtures on hosted runs.universal/billing-gate-dispatch.yamlphases gated onskip_if: "test_kit.commercial_relationship != 'passthrough_only'"still skip on hosted runs. Locally they run withbilling-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