Context
A filtered unit order reproduced one orchestrator spec leaking its deploymentStateBridge.snapshotPath value into an unrelated MCP smoke assertion. The exact failing arm was 1 failed / 2080 passed; replacing this spec's ineffective cleanup with the shipped resolved-value capture made the same arm 2097 passed in PR #16901.
This leaf records only that delivered repair. Broad worker-local isolation and mutation-shape enforcement remain owned by #16885 and #15874.
The Problem
test/playwright/unit/ai/daemons/orchestrator/services/DeploymentStateBridgeService.spec.mjs directly writes leaves under AiConfig.orchestrator.deploymentStateBridge and deploymentRuntimeAccess. Its prior Neo.clone(...) plus Object.assign(...) cleanup did not restore those directly assigned leaves in the observed filtered run, allowing state to survive into later specs in the same worker.
The failure is behavioral and independently reproduced. This ticket deliberately does not generalize why every AiConfig/Provider clone behaves this way: two probes observed different clone shapes on different config surfaces, while both confirmed that the old cleanup failed to restore the written value.
The Architectural Reality
- ADR-0019 owns
AiConfig as a reactive Provider single source of truth and treats shared-singleton test mutation as a safety-sensitive boundary.
snapshotAiConfig() in test/playwright/unit/ai/services/memory-core/util.mjs is the shipped narrow capture/restore primitive for existing resolved leaves.
- The affected spec currently writes 14 leaves through two syntactic shapes: direct leaf assignment and
Object.assign(node, {...}).
- No production class or new file placement changes. The Agent OS structure-map gate was attempted and hit its existing
Cannot create a string longer than 0x1fffffe8 characters ceiling; exact diff and sibling inspection bind this leaf to the existing orchestrator service spec.
The Fix
In DeploymentStateBridgeService.spec.mjs:
- Replace the five hand-rolled
Neo.clone / Object.assign cleanup pairs with snapshotAiConfig(AiConfig, explicitPaths) restoration.
- Name every currently written bridge and runtime-access leaf in explicit path lists.
- Add a non-vacuous source census over both write shapes so a future written-but-unlisted leaf fails by name.
- Preserve the no-sink and filtered-run behavior outside this cleanup change.
Contract Ledger
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
DeploymentStateBridgeService.spec.mjs AiConfig cleanup |
explicit written-leaf path lists + snapshotAiConfig |
every existing leaf written by the spec returns to its captured resolved value after each scope |
fail the census when a write lacks a capture path |
test JSDoc |
exact filtered-order rerun + missing-list mutation |
| written-leaf census |
the spec's two current assignment shapes |
discover all current bridge/runtime-access writes and compare them with the capture lists |
fail closed on a non-empty missing set; non-vacuity requires more than five discovered writes |
control comment |
removing readOperations from the list turns the control red |
Decision Record impact
Aligned with ADR-0019. This leaf applies its existing test-isolation boundary; it does not amend the decision.
Acceptance Criteria
Out of Scope
- Eliminating every shared
AiConfig mutation across the test tree; #15874 owns that population and its mechanical guard.
- Closing #16885, which retains the broader worker-isolation and unresolved mechanism work.
- Changing production
DeploymentStateBridgeService behavior.
Avoided Traps
- Do not claim a universal zero-enumerable-key clone mechanism; the two relevant config surfaces produced different clone populations.
- Do not derive the census baseline from the capture list itself; that would make an omitted path invisible by construction.
- Do not widen this one-file repair into subtree-replacement cleanup; those destructive shapes remain #15874 scope.
Related
- #16885 — broader filtered-run isolation carrier; remains open
- #15874 — assignment-shape enforcement and remaining AiConfig test pollution
- PR #16901 — delivered implementation
- ADR-0019 — reactive Provider single-source-of-truth authority
Origin Session ID: ff601885-0018-437a-af95-6fea47a186b9
Retrieval Hint: PR #16901 snapshotAiConfig DeploymentStateBridgeService filtered unit pollution
Live latest-open + A2A duplicate sweep: checked immediately before filing; no equivalent found.
Context
A filtered unit order reproduced one orchestrator spec leaking its
deploymentStateBridge.snapshotPathvalue into an unrelated MCP smoke assertion. The exact failing arm was1 failed / 2080 passed; replacing this spec's ineffective cleanup with the shipped resolved-value capture made the same arm2097 passedin PR #16901.This leaf records only that delivered repair. Broad worker-local isolation and mutation-shape enforcement remain owned by #16885 and #15874.
The Problem
test/playwright/unit/ai/daemons/orchestrator/services/DeploymentStateBridgeService.spec.mjsdirectly writes leaves underAiConfig.orchestrator.deploymentStateBridgeanddeploymentRuntimeAccess. Its priorNeo.clone(...)plusObject.assign(...)cleanup did not restore those directly assigned leaves in the observed filtered run, allowing state to survive into later specs in the same worker.The failure is behavioral and independently reproduced. This ticket deliberately does not generalize why every
AiConfig/Provider clone behaves this way: two probes observed different clone shapes on different config surfaces, while both confirmed that the old cleanup failed to restore the written value.The Architectural Reality
AiConfigas a reactive Provider single source of truth and treats shared-singleton test mutation as a safety-sensitive boundary.snapshotAiConfig()intest/playwright/unit/ai/services/memory-core/util.mjsis the shipped narrow capture/restore primitive for existing resolved leaves.Object.assign(node, {...}).Cannot create a string longer than 0x1fffffe8 charactersceiling; exact diff and sibling inspection bind this leaf to the existing orchestrator service spec.The Fix
In
DeploymentStateBridgeService.spec.mjs:Neo.clone/Object.assigncleanup pairs withsnapshotAiConfig(AiConfig, explicitPaths)restoration.Contract Ledger
DeploymentStateBridgeService.spec.mjsAiConfig cleanupsnapshotAiConfigreadOperationsfrom the list turns the control redDecision Record impact
Aligned with ADR-0019. This leaf applies its existing test-isolation boundary; it does not amend the decision.
Acceptance Criteria
DeploymentStateBridgeService.spec.mjsusesnapshotAiConfigover explicit resolved-leaf paths.deploymentRuntimeAccess.readOperationsis removed.enabled,composeProject,allowedServices, andreadOperationsall restore after the repair.Out of Scope
AiConfigmutation across the test tree; #15874 owns that population and its mechanical guard.DeploymentStateBridgeServicebehavior.Avoided Traps
Related
Origin Session ID: ff601885-0018-437a-af95-6fea47a186b9
Retrieval Hint:
PR #16901 snapshotAiConfig DeploymentStateBridgeService filtered unit pollutionLive latest-open + A2A duplicate sweep: checked immediately before filing; no equivalent found.