Repository navigation
fix(training-agent): resolve comply_test_controller account_id targets and run server/src tests in CI - #7708
Conversation
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — narrowly-scoped training-agent fix, no blocking findings.
What I checked:
- Change lets
comply_test_controllerresolveaccount_idtargets by stripping the controller-only sandbox assertion before canonicalizing, while reinstating the fail-closed guard viaisUnknownControllerAccountso unknown IDs resolve to null and hit the SDK sandbox gate. - Fail-closed behavior is covered by the PERMISSION_DENIED rejection test; principal-scoped isolation preserved.
- Both resolvers patched symmetrically.
- Diff is confined to
server/**training-agent files pluspackage.json— app/operational, not protocol surface (static/schemas/source/**,docs/reference/**, dist artifacts). No changeset required. package.jsonchange is not a hand-edited protocolversionbump.
Gate checks:
- No critical/high/medium findings (row 1 N/A).
gated_paths: false— row 2 does not apply even thoughreview_decisionis REVIEW_REQUIRED.high_risk: false; no deleted/modified sensitive files (rows 3–5 N/A).- No prior decision (row 6 N/A).
- No no-auto-approve team match (row 7 N/A).
- Zero medium findings (row 8 N/A).
Falls through to row 9 → approve.
…s and run server/src tests in CI comply_test_controller requests carry their own account object: an account_id plus the required `sandbox: true` assertion. The core AccountRef schema forbids `sandbox` on account_id refs, so the training resolvers' canonicalizer threw, the SDK folded the error into "account unresolved", and every controller call addressed by account_id was refused (adcontextprotocol/adcp-client#3037). The only thing keeping unknown account_ids out was that same accidental throw, because the resolvers synthesize a sandbox account for any ref. - Drop the controller's `sandbox` assertion before canonicalizing, so the resolved account record, not the flag, decides sandbox status. - Resolve controller account_id targets only when the seller holds the account (synced by the caller, or a compliance fixture), as the controller schema requires. Unknown account_ids still fail the gate. - Include server/src in test:server-unit. The account-change-feed transport test that exercises this path lived under server/src, which no CI job or pre-commit run covered, so it broke on main unnoticed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…account isolation
Drop the known-account check. On the frozen 3.0 surface an opaque
account_id becomes real by use, and the controller must reach its
handler so resource isolation can answer (NOT_FOUND for another
account's media buy). The check refused those accounts at the gate and
broke training-agent-3-0-compat-tools.
Keep stripping the controller's sandbox assertion, so
{ account_id, sandbox: true } now behaves like { account_id } already
did. Rewrite the opaque-account smoke test to assert what actually
protects accounts: a controller-forced get_signals task armed for one
opaque account is invisible to another and is delivered only to the
account that armed it.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
b10ad9c to
2f03ab4
Compare
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean training-agent fix, no blocking findings.
This PR touches 5 files, all non-protocol: server/src/training-agent/** and package.json test scripts. It resolves comply_test_controller account_id targets by stripping the controller-only sandbox assertion before canonicalizing, scoped strictly to that tool via dispatch-set toolName. The rewritten isolation test verifies success plus per-account isolation across opaque accounts, and the test:server-unit widening closes a CI gap.
No changes to static/schemas/source/**, docs/reference/**, dist/**, or any wire-shape/changeset surface, so schema↔docs coherence, changeset scope, oneOf discriminator, and artifact-immutability gates do not apply. No hand-edited package.json version. Reviewer found no Critical, High, or Medium findings.
Gate checks: gated_paths is false; high_risk is false; author is not on any no-auto-approve team; no medium findings. Although review_decision is REVIEW_REQUIRED, row 2 only fires when gated_paths is true, so it does not apply. Falls through to row 9 → approve. Consistent with the prior approve on the earlier head.
|
Issue #7715 proposes fixing Generated by Claude Code |
|
Issue #7729 proposes a training-agent Generated by Claude Code |
|
Looked at #7729. Recommend follow-up, not fold. The fix in #7729 is in #7729 is a clean standalone P1 on 3.2.0; it can land as its own PR off main once this one merges. Issue stays on 3.2.0. Generated by Claude Code |
Why
comply_test_controllerrequests carry their ownaccountobject: anaccount_idplus thesandbox: trueassertion the controller schema requires. The coreAccountRefschema forbidssandboxonaccount_idrefs, so the training agent's resolvers (canonicalizeAccountRef) threw on every controller call addressed byaccount_id. The SDK folds that error into "account unresolved" and refuses the call; see adcontextprotocol/adcp-client#3037. As a result, the 3.2 surface refused controller calls byaccount_idfor every account, including the shared compliance fixtureacc_luma_shared.The test that exercises this,
server/src/training-agent/tenants/account-change-feed-transport.test.ts, has been failing on main. Nobody noticed because no CI job or pre-commit run covers tests underserver/src.Changes
accountRefForResolutiondrops the controller-onlysandboxassertion fromaccount_idrefs before canonicalizing. It applies only whentoolName === 'comply_test_controller'; every other tool keeps strict coreAccountRefvalidation.{ account_id, sandbox: true }now resolves the same way{ account_id }already did. The training agent is sandbox-only and treats every account as a sandbox account.account_idsent withsandbox: true. That passed only because of the throw above: the same account without the flag already resolved. It's rewritten to assert what actually protects accounts, per-account isolation. Aget_signalstask the controller arms for one opaque account is invisible to another account (inget_signalsandlist_tasks) and is delivered only to the account that armed it. This matches the frozen 3.0 surface, wheretraining-agent-3-0-compat-toolschecks that controller calls for opaque accounts reach their handler and are isolated by resource (NOT_FOUNDacross accounts).test:server-unitnow includessrc/, so the existing 4-shard CI job and the pre-commit server run cover the fourserver/srctest files. Previously CI ran onlytenant-smokefrom there, viatest:tenant-routing.An earlier revision also limited controller targets to accounts the agent already held (synced or fixtures). That broke the 3.0 surface, where opaque accounts exist through use, so it was dropped.
Once #3037 is fixed in the SDK, the stripping step becomes redundant but stays harmless.
Testing (rebased on main, which now has
@adcp/[email protected])server/srctests plustests/unit/training-agent-product-coveragepass: 76 tests. That includes the shared-account controller test that fails on main and the rewritten isolation test.training-agent-3-0-compat-tools(8/8), which failed on the previous revision.account_idgave identical results with and without the change:reporting_core,reliable_reporting_managed_delivery,pagination_integrity_creative_formats,pagination_integrity_list_accounts, andmedia_buy_seller/account_change_feed. The full matrix is left totraining-agent-storyboards.yml.🤖 Generated with Claude Code