Skip to content

fix(compliance): preserve deterministic account ownership across lifecycle controls - #8730

Merged
bokelley merged 1 commit into
mainfrom
fix/deterministic-account-lifecycle-scope
Nov 4, 2026
Merged

bokelley merged 1 commit into
mainfrom
fix/deterministic-account-lifecycle-scope

Conversation

@bokelley

@bokelley bokelley commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

The deterministic_testing storyboard's product and pricing-option fixtures belong to the Acme Outdoor / Pinnacle sandbox account. Its sync_accounts step legitimately provisions a separate test.example account for the account-state checks, and the runner then rebinds context.account to that provisioned account for the rest of the run. Before this change:

  • later media-buy, creative, delivery and budget controller calls inherited the Test account and targeted buys that belong to Acme, so a strict account-aware seller correctly answered NOT_FOUND;
  • an unfiltered list_accounts could return an unrelated visible account first, and that account's ID then became the target of the Test account-state controls.

This change:

  • declares the Acme / Pinnacle sandbox account as the owner of the product and pricing-option fixtures;
  • scopes all ten media-buy, creative, delivery and budget controller calls explicitly to that owner, including the negative paths;
  • filters list_accounts to the effective run account (account: '$context.account', the existing full-object substitution). After sync_accounts that's the provisioned Test account. For sellers that don't support buyer account provisioning (sync is not_applicable), it's the caller-selected account ID. Either way, the account-state target ID stays coherent with the controller account.

Released 3.1.0 already defines this exact account-list filter. There is no normative, schema or new storyboard-DSL change; SI, gates, fixtures, formats and validations are unchanged. This replaces the closed #8726, whose seed-owner-only repair this expands.

Tests (tests/cli-scenario-fixtures.test.cjs, 35/35 pass, 0 skipped):

  • Static: all ten Acme lifecycle controls are scoped to the fixture owner, and provisioning keeps its own identity.
  • Retains resource ownership after provisioning another account. A strict seller sees all eight authored steps pass. The causal negative removes only the authored resource scope and reproduces NOT_FOUND on exactly force_media_buy_active and simulate_delivery.
  • Exact account listing. The causal negative removes only the list filter: the unrelated first account's ID reaches force_account_status, which fails NOT_FOUND, and reactivation is skipped.
  • No-sync namespace seller. sync_accounts is not_applicable with no dispatch, and the list and both account controls use the caller-selected account ID.
  • The strict buyer/namespace regressions validate every dispatched request and response and verify that the runner mutates neither the caller context nor the authored storyboard.

Local gates on this head: the fixture test file above; compliance-source-authority, storyboard-fixture-resolution, storyboard-context-entity, storyboard-sample-request-schema, storyboard-test-kits, storyboard-auth-shape and compliance-packaged-refs; the changeset protocol-scope check and changeset status (patch: adcontextprotocol); and the normal pre-commit hook (unit, server-unit 3/3 shards, typecheck). The local advisory storyboard matrix was skipped with the repo-supported ADCP_SKIP_STORYBOARD_MATRIX=1; CI's training-agent storyboards are authoritative.

Source preview, not a release claim: with the public @adcp/sdk beta.16 against the selected released 3.1.31 schemas, two schema-valid positive paths were replayed, the buyer path and the account-ID / no-sync namespace path. Independent causal negatives (unfiltered list, unscoped resources) produced the expected strict NOT_FOUND. This does not qualify the still-unpublished 3.1.32 corpus, the native CLI or Activate; full CI on this head is required.

🤖 Generated with Claude Code

…cycle controls

The deterministic_testing storyboard's product and pricing-option fixtures
belong to the Acme Outdoor / Pinnacle sandbox account, while its
sync_accounts step legitimately provisions a separate test.example account
for the account-state checks. The runner then rebinds context.account to
that provisioned account, so later media-buy, creative, delivery and budget
controller calls followed it and targeted the wrong sandbox account, and an
unfiltered list_accounts could hand an unrelated visible account's ID to the
account-state controls.

- Declare the Acme / Pinnacle sandbox account as the fixture owner.
- Scope the ten media-buy, creative, delivery and budget controller calls
  explicitly to that owner.
- Filter list_accounts to the effective run account ($context.account): the
  provisioned Test account after sync, or the caller-selected account ID when
  buyer provisioning is not applicable.
- Regression tests, with causal negatives, for resource ownership after
  provisioning, exact account listing, and the no-sync namespace path.

Replaces the closed #8726 with this expanded repair. No schema, normative
or new storyboard-DSL change.

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 — compliance fixture scoping fix, no blocking findings.

Checked:

  • No critical/high findings (row 1 clear).
  • gated_paths: false (row 2 N/A despite review_decision REVIEW_REQUIRED).
  • high_risk: false, no deletions (rows 3, 5 N/A).
  • No medium findings in any category (rows 4, 8 N/A).
  • No no-auto-approve team match (row 7 N/A).
  • No prior decision (row 6 N/A).

The diff touches a published compliance source asset (static/compliance/source/universal/deterministic-testing.yaml) and correctly ships a patch changeset — compliance source is published protocol surface and the scoping fix is non-breaking (no schema/docs/oneOf/dist change). Write controls carry explicit brand+operator to stay Acme-scoped after sync_accounts rebind; reads already Acme-scoped and consistent. Test harness (tests/cli-scenario-fixtures.test.cjs) is self-consistent with sound cross-account NOT_FOUND coverage. Fictional names comply with character-bible; no governance precedent contradicted.

Falls through to row 9 — approve.

@bokelley
bokelley merged commit ded86cd into main Nov 4, 2026
57 checks passed
@bokelley
bokelley deleted the fix/deterministic-account-lifecycle-scope branch November 4, 2026 03:39
bokelley added a commit that referenced this pull request Nov 4, 2026
…#8731)

* fix(compliance): preserve deterministic account ownership across lifecycle controls (#8730)

The deterministic_testing storyboard's product and pricing-option fixtures
belong to the Acme Outdoor / Pinnacle sandbox account, while its
sync_accounts step legitimately provisions a separate test.example account
for the account-state checks. The runner then rebinds context.account to
that provisioned account, so later media-buy, creative, delivery and budget
controller calls followed it and targeted the wrong sandbox account, and an
unfiltered list_accounts could hand an unrelated visible account's ID to the
account-state controls.

- Declare the Acme / Pinnacle sandbox account as the fixture owner.
- Scope the ten media-buy, creative, delivery and budget controller calls
  explicitly to that owner.
- Filter list_accounts to the effective run account ($context.account): the
  provisioned Test account after sync, or the caller-selected account ID when
  buyer provisioning is not applicable.
- Regression tests, with causal negatives, for resource ownership after
  provisioning, exact account listing, and the no-sync namespace path.

Replaces the closed #8726 with this expanded repair. No schema, normative
or new storyboard-DSL change.

Maintenance adaptation: preserve the 3.1 legacy fixtures, all 817 existing
fixture-test lines and the selected-schema test wrapper. After recorded
aggregate cutoffs, align only local precommit unit/server budgets with main
(180s to 300s; 240s to 1500s). Commands, per-test settings, dependencies,
versions, workflow limits and both matrix gates remain unchanged.

Co-authored-by: Claude Opus 5.5 <[email protected]>
(cherry picked from commit ded86cd)

* fix(training-agent): restore 3.1 task envelopes and update the runner

Partially backport ce91b14 (#8522): retain its four status-free tools, thread the tool name through serialization, and default only absent successful task status to completed. Preserve the maintenance serializer's JSON text, errors, advisories, explicit statuses, replay behavior and payload ownership. Registered MCP regression cases cover filtered account listing and serialization behavior.

Adopt the actually published @adcp/[email protected] only in the private fixture-test runner and root lockfile. Its account-subject identity repair and native controller schemas are bound to release merge 2d1ea7059f116a178841e43b95165735dc722c2e. Production @adcp/sdk stays 9.6.2. Keep the original deterministic lifecycle source repair unchanged.

This is a deliberately partial backport and test-runtime adoption, not a schema or DSL change. It does not claim AdCP 3.1.32, stable SDK 16.7, or Activate qualification.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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