Repository navigation
fix(training): backport caller-isolated controller replays to 3.2 - #8592
Conversation
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean, well-scoped multi-tenant isolation fix.
This is a backport of #8591 to the 3.2.x line. It namespaces the SDK comply-controller seed-replay cache by the AsyncLocalStorage-established trusted caller scope (getTrainingCallerScope → requiredClientScope(undefined)), which caller-supplied __training_principal/__training_task_owner_scope fields cannot override. Scope is read lazily at replay time inside runWithTrainingTaskScope. All four seed-bearing tenant configs are covered; the underlying cache is built once at registry init so keys isolate rather than rebuild per request. The new test asserts cross-caller isolation plus same-caller divergence rejection across all five live routes.
App-only server change under server/** — correctly carries no protocol changeset; no static/schemas/source/, docs/reference/, or dist/** surface touched. No high-risk paths, no gated paths, no author team gate.
Reviewer surfaced no Critical/High/Medium findings. Falls through to row 9.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean backport of #8591 to 3.2.x (caller-isolated comply seed-replay cache).
Checked:
- No critical/high/medium findings from the reviewer.
high_risk: false,gated_paths: false, no no-auto-approve team match, no prior decision.- Change scope is
server/**app-only (mcp-task-store.ts, comply.ts + a unit test), not the published protocol surface (static/schemas/source/**, normativedocs/reference/**, dist artifacts), so no changeset is required. getTrainingCallerScope()reads the trusted ALS scope derived from the auth-setprincipal(router.ts:563), not caller-supplied body fields; spoofed__training_principalis overwritten at router.ts:498. Cache is namespaced per caller, with fail-closed behavior on missing scope. Regression test covers all five native tenants and verifies ownership/session spoofs are ignored.
No decision-table trigger (rows 1–8) fires; falls through to row 9.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean backport (#8591 → 3.2.x) of a caller-isolation fix for the training agent's SDK seed-replay cache.
createPrincipalScopedSeedCache (comply.ts:39) scopes every get/has/set by the trusted ALS-established caller scope, partitioning the shared per-registry cache by authenticated principal rather than caller-supplied fields. The new test proves isolation via __training_principal spoofing across all five tenants. App-only server code — no static/schemas/source/** or wire-shape change, so no protocol changeset required.
No findings. high_risk false, gated_paths false, no author team gate, no prior decision. None of rows 1–8 fire → row 9 approve.
Backport #8591 to 3.2. Two authenticated callers can seed their independently owned sandbox accounts using the same correlation/account IDs without colliding in the SDK replay cache. The trusted tenant/caller scope namespaces the bounded native cache; equivalent replays still succeed and divergent replays by the same caller still fail.
The runtime changes and regression match main across all native tenant configurations. Retains 3.2.8, SDK 14.0.0-rc.53, existing authentication/sandbox gates, public/demo shared-fixture semantics and released artifacts. This app-only correction needs no protocol changeset.
Validation:
Refs #8589. The 3.1 account-fixture adaptation is #8590; legacy 3.1 non-account seed-cache behavior is a separate follow-up.
Open workspace in Conductor