Context
The AC1 foundation of #12435 (aiConfig Provider singleton mutated without restore across ~11 specs → latent cross-test live-DB-bleed). Ships the shared snapshot/restore helper as a complete, independently-testable unit; the ~11-spec adoption + the negative full-suite --workers=1 isolation test (#12435 AC2/AC3) follow in #12435.
Live latest-open sweep: checked latest 20 open issues at ~2026-06-19T05:15Z; no equivalent — sub of #12435.
Release classification: boardless (test-hygiene; post-v13).
The Fix
test/playwright/util/aiConfigSnapshot.mjs — snapshotConfigKeys(target, keys) returns a restore() closure that captures the given dotted keys at snapshot time and re-assigns them on restore. Generalizes the in-tree capture/restore precedent (DestructiveOperationGuard.spec). Pure (operates on the object handed in → unit-testable, no singleton import-coupling), supports dotted deep paths (storagePaths.graph), idempotent restore.
Acceptance Criteria
Out of Scope (remains in #12435)
- Adopting the helper across the ~11 enumerated specs + removing their unrestored
aiConfig.* writes (#12435 AC2).
- The negative full-suite
--workers=1 isolation run (#12435 AC3).
Related
- Parent: #12435 (retains adoption + the negative isolation test).
- Precedent:
test/playwright/unit/ai/mcp/server/shared/services/DestructiveOperationGuard.spec.mjs.
Origin Session ID
045a6048-1e1d-44c1-9738-7f09b62cc998
Context
The AC1 foundation of #12435 (aiConfig Provider singleton mutated without restore across ~11 specs → latent cross-test live-DB-bleed). Ships the shared snapshot/restore helper as a complete, independently-testable unit; the ~11-spec adoption + the negative full-suite
--workers=1isolation test (#12435 AC2/AC3) follow in #12435.Live latest-open sweep: checked latest 20 open issues at ~2026-06-19T05:15Z; no equivalent — sub of #12435. Release classification: boardless (test-hygiene; post-v13).
The Fix
test/playwright/util/aiConfigSnapshot.mjs—snapshotConfigKeys(target, keys)returns arestore()closure that captures the given dotted keys at snapshot time and re-assigns them on restore. Generalizes the in-tree capture/restore precedent (DestructiveOperationGuard.spec). Pure (operates on the object handed in → unit-testable, no singleton import-coupling), supports dotted deep paths (storagePaths.graph), idempotent restore.Acceptance Criteria
aiConfigkeys — deep dotted paths, idempotent, capture-at-snapshot-time. (#12435 AC1)Out of Scope (remains in #12435)
aiConfig.*writes (#12435 AC2).--workers=1isolation run (#12435 AC3).Related
test/playwright/unit/ai/mcp/server/shared/services/DestructiveOperationGuard.spec.mjs.Origin Session ID
045a6048-1e1d-44c1-9738-7f09b62cc998