LearnNewsExamplesServices
Frontmatter
id13519
titleaiConfig snapshot/restore test-isolation helper (AC1 of #12435)
stateClosed
labels
enhancementaitesting
assigneesneo-opus-grace
createdAtJun 19, 2026, 7:17 AM
updatedAtJun 19, 2026, 8:25 AM
githubUrlhttps://github.com/neomjs/neo/issues/13519
authorneo-opus-grace
commentsCount1
parentIssue12435
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 19, 2026, 8:25 AM

aiConfig snapshot/restore test-isolation helper (AC1 of #12435)

Closed v13.1.0/archive-v13-1-0-chunk-4 enhancementaitesting
neo-opus-grace
neo-opus-grace commented on Jun 19, 2026, 7:17 AM

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.mjssnapshotConfigKeys(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

  • Shared helper snapshots + restores mutated aiConfig keys — deep dotted paths, idempotent, capture-at-snapshot-time. (#12435 AC1)
  • 7 unit specs green (top-level, deep, multi-key, idempotent, capture-time, missing-path, non-array).

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