Repository navigation
fix(compliance): unblock the account_change_feed storyboard webhook and drain steps - #7716
Merged
Merged
Conversation
…nd drain steps The storyboard failed on the /sales tenant for two independent reasons, neither in the training agent's emit path. 1. The local storyboard harness threads the test-kit brand (acmeoutdoor.example) into the SDK runner. The runner addresses comply_test_controller by the natural key sync_accounts returned (luma-outdoor.example / pinnacle-agency.example), and its brand invariant swapped in the test-kit brand. That key names no synced account, so seed_creative recorded no change and no account.change_recorded webhook fired. Skip the test-kit brand for this storyboard, as the harness already does for the wholesale scope-isolation vectors. 2. The storyboard threaded the external creative ID through a $generate:uuid_v4#alias across phases. Runner aliases are phase-scoped, so later phases compared the feed against a fresh UUID. Generate the ID once through context_outputs and read it via $context. Adds a unit test that seeds a creative through the controller by the synced natural key and asserts the subscriber receives account.change_recorded, and that a foreign-brand key does not. Closes #7715 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Contributor
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean, tightly scoped compliance fix for the account_change_feed storyboard.
Checked:
- Diff touches a changeset, a manual harness script, a unit test, and one compliance scenario YAML — no schema source (
static/schemas/source/**), nodist/**artifact mutation, no docs/reference change, so no schema↔docs coherence or oneOf/immutability concerns apply. - Changeset present and correct (patch, protocol-scoped, correct type) — changeset scope/type gate satisfied.
- Not based on
3.1.x; no transport/auth/signing changes; no breaking-class wire change, so the breaking-change hard gate does not fire. - External creative ID threaded through all 8 alias sites via the phase-1 context_outputs uuid_v4 generator; regression test added.
Gate checks:
- No no-auto-approve team match.
- gated_paths: false — row 2 does not apply.
- high_risk: false.
- No Critical/High/Medium findings.
None of decision-table rows 1–8 fire, so the outcome is approve (row 9).
This was referenced Sep 28, 2026
Merged
bokelley
added a commit
that referenced
this pull request
Sep 29, 2026
…storyboards (#7731) The @adcp/sdk storyboard runner scopes $generate:<kind>#<alias> values to one phase (adcp-client#1658): the alias cache is keyed on the context object, and each phase starts from a shallow copy that does not carry the cache. A later phase that reuses an alias mints a different UUID. Five storyboards reused an idempotency-key alias between the check_governance payload and the governed mutation in a later phase, so the executed request no longer matched the authorized payload: media_buy_seller/governance_conditions, governance_spend_authority, and the brand_rights, creative_transformers, and signal_marketplace governance_approved scenarios. Each now generates the key once with a context_outputs generator on the step before its first use and reads it as $context.<name>. account_change_feed gets the identical fix from #7716 so the new lint passes on its own. Add scripts/lint-storyboard-generate-phase-scope.cjs, run from build:compliance and from npm test (test:storyboard-generate-phase-scope), which fails when a $generate alias appears in more than one phase. Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This was referenced Sep 29, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7715
Root cause
The training agent's emit path is fine. Two separate problems stopped the storyboard, and the second one was hidden behind the first.
1. No webhook: the controller targeted the wrong account (local harness).
@adcp/sdkrc.49 buildscomply_test_controllerrequests withcontext.account, not the authoredaccount: { account_id: "acc_luma_shared", sandbox: true }. The runner'ssync_accountsextractor fillscontext.accountwith the brand and operator thatsync_accountsreturned:luma-outdoor.example/pinnacle-agency.example.server/tests/manual/run-storyboards.tsthen passes the test-kit brand (acmeoutdoor.example) asoptions.brand, and the runner's brand invariant writes that brand over the natural key. Soseed_creativearrived as{ brand: acmeoutdoor.example, operator: pinnacle-agency.example, sandbox: true }. That key matches no account the buyer synced, socontrollerAccountIdwas undefined,seedCreativerecorded no account change, and noaccount.change_recordedwebhook fired. Temporary logging confirmed this: the subscriber was registered onfixture:acc_luma_shared, and the controller call resolved no account.2. Drain mismatch: cross-phase
$generatealias (storyboard). Once the webhook arrived,drain_after_checkpointfailed withExpected "<uuid A>", got "<uuid B>". The storyboard threaded the creative ID through$generate:uuid_v4#account_change_feed_external_creativeacross four phases. Runner aliases are scoped to one phase by design (adcontextprotocol/adcp-client#1658), so each later phase generated a new UUID.The storyboard hasn't changed since it was added in #6811, and as far as I can tell it has never passed end to end on the training agent.
Fix
server/tests/manual/run-storyboards.ts:brandFromKitreturnsundefinedformedia_buy_seller/account_change_feed. This uses the same exclusion the harness already applies to the wholesale scope-isolation vectors, whose authored account identity also differs from the test-kit brand. With the exclusion, the controller receives the natural keysync_accountsreturned, which resolves toacc_luma_shared.static/compliance/source/.../account_change_feed.yaml: the creative ID is generated once through acontext_outputsgenerate: uuid_v4entry onacquire_latest_checkpoint. All 8 uses now read$context.account_change_external_creative_id. No assertions or timeouts changed.server/tests/unit/account-change-feed.test.ts. It syncsacc_luma_sharedbyaccount_idwith anaccount.change_recordedsubscriber, then seeds a creative through the controller using the natural keysync_accountsreturned, which is the shape the runner sends. It asserts one webhook withnotification_id == change_idand the creative identity. It also asserts that a foreign-brand natural key (the test-kit brand) wakes no subscriber.No training-agent source changed, and none of #7708's files are touched. Reporting-core code is untouched.
Storyboard results (
TENANT_PATH=sales,ADCP_COMPLIANCE_DIR=dist/compliance/latest, as in CI)expect_account_change_webhook) / 13 skippeddrain_after_checkpoint, UUID mismatch) / 12 skippedexpect_account_change_webhook) / 13 skippedThe repro command in the issue doesn't set
ADCP_COMPLIANCE_DIR, so it runs the storyboard copy bundled in@adcp/sdk(3.2.0-rc.7), not repo source. With this PR that run reaches 4 passed / 1 failed atdrain_after_checkpoint. It will be clean once a release ships the fixed storyboard and the SDK bundles it.Testing
npx vitest run --config server/vitest.config.ts src/ tests/unit/account-change-feed.test.ts tests/unit/comply-test-controller.test.ts: 185 of 186 pass. The one failure issrc/training-agent/tenants/account-change-feed-transport.test.ts, which fails on main and is fixed by fix(training-agent): resolve comply_test_controller account_id targets and run server/src tests in CI #7708.npm run typecheckpasses.Follow-ups (not in this PR)
comply_test_controllerrequest builder drops an authoredaccount.account_idin favor ofcontext.accountor the test-kit account. That is why the harness exclusion is needed. Worth an adcp-client issue.$generatealias across phases and may have the same bug:governance_conditions,governance-spend-authority, and thegovernance_approvedscenarios for brand-rights, creative-transformers, and signal-marketplace.🤖 Generated with Claude Code