FN-6741: rescue core quarantine entries

Rescue the loaded @fusion/core quarantine batch while keeping the remaining lock flake quarantined.

- Remove rescued core test files from the quarantine ledger and Vitest exclude list.
- Close the settings-export TaskStore before fixture cleanup to release resources deterministically.
- Re-quarantine the store-concurrent-writes broad-lane SQLite lock flake observed during merge verification.
- Document the rescue evidence and remaining deletion-ratchet follow-up.

Files changed:
 docs/testing.md                                    |  8 ++++++-
 .../core/src/__tests__/settings-export.test.ts     |  5 ++++
 packages/core/vitest.config.ts                     | 11 +++++----
 scripts/lib/test-quarantine.json                   | 27 +---------------------
 4 files changed, 19 insertions(+), 32 deletions(-)

Fusion-Task-Id: FN-6741

Fusion-Task-Lineage: 064367a6-f1c4-4685-a766-37bf2204a42c
This commit is contained in:
gsxdsm
2026-06-19 15:14:35 -07:00
parent 60b69dd3eb
commit 8d2b396e85
4 changed files with 19 additions and 32 deletions

View File

@@ -201,7 +201,13 @@ Legitimate legacy exceptions must be recorded in `scripts/lib/test-timeout-appea
<!-- FNXC:TestQuarantine 2026-06-19-14:15: FN-6740 audited the same-day quarantine ledger as a coordinated deletion-ratchet batch. The ledger had 14 entries (3 dashboard, 6 core, 5 CLI) and every entry was mirrored in its package Vitest exclude; keep follow-up rescue/delete work scoped by subsystem so ledger/config edits remain lockstep and do not collide. -->
**2026-06-19 quarantine audit (FN-6740):** the 2026-06-19 ledger batch expires on **2026-07-03**. FN-6740 found no ledger/config half-state and chose no inline rescue/delete. The five CLI files (`extension-goal-tools`, `extension-mission-goal-tools`, `extension-task-tools`, `extension`, `research-extension-tools`) are explicitly deferred to FN-6734's outcome and must not get a duplicate rescue task. The six core files (`activity-analytics`, `db`, `store-concurrent-writes`, `store-create-summarize-deferred-hook`, `vitest-teardown-worker-root-cleanup`, `settings-export`) are tracked by FN-6741 as a shared worker-root/temp-redirect cleanup-race follow-up, with the repeat after FN-6600/FN-6486 treated as a product-race signal. The dashboard files are split by likely root cause: FN-6742 owns `session-cross-tab` cleanup `ENOTEMPTY`, FN-6743 owns the third-repeat QuickEntryBox focus-restoration race after FN-6514/FN-6642, and FN-6744 owns WorkflowNodeEditor duplicate-merge-seam concurrency. Until those follow-ups rescue with root-cause evidence or delete under the ratchet, leave all corresponding ledger entries and package excludes in lockstep.
**2026-06-19 quarantine audit (FN-6740):** the 2026-06-19 ledger batch expires on **2026-07-03**. FN-6740 found no ledger/config half-state and chose no inline rescue/delete. The five CLI files (`extension-goal-tools`, `extension-mission-goal-tools`, `extension-task-tools`, `extension`, `research-extension-tools`) are explicitly deferred to FN-6734's outcome and must not get a duplicate rescue task. Five core files (`activity-analytics`, `db`, `store-create-summarize-deferred-hook`, `vitest-teardown-worker-root-cleanup`, `settings-export`) were rescued by FN-6741 after the loaded `@fusion/core` lane passed with only `store-concurrent-writes` re-quarantined; `settings-export` now closes its `TaskStore` before fixture cleanup. The dashboard files are split by likely root cause: FN-6742 owns `session-cross-tab` cleanup `ENOTEMPTY`, FN-6743 owns the third-repeat QuickEntryBox focus-restoration race after FN-6514/FN-6642, and FN-6744 owns WorkflowNodeEditor duplicate-merge-seam concurrency. Until those dashboard and remaining core follow-ups rescue with root-cause evidence or delete under the ratchet, leave all corresponding ledger entries and package excludes in lockstep.
<!-- FNXC:CoreTests 2026-06-19-14:55: FN-6741 rescued five same-day @fusion/core quarantine entries after proving the broad core lane with only store-concurrent-writes still failing, then removed ledger/config entries in lockstep for the rescued files. Keep this rescue pattern evidence-driven: fix close-order leaks such as TaskStore handles before fixture cleanup, prove the package lane, and do not replace quarantine removal with timeout, retry, or worker-count appeasement.
FNXC:CoreTests 2026-06-19-15:05: Merge verification re-observed store-concurrent-writes failing under broad @fusion/core load with SQLite BEGIN IMMEDIATE lock exhaustion. Keep that single file quarantined until a root-cause fix proves the transient-lock regression under suite load; do not widen SQLite recovery timing to appease the flake. -->
**2026-06-19 core suite-load rescue (FN-6741):** `activity-analytics.test.ts`, `db.test.ts`, `store-create-summarize-deferred-hook.test.ts`, `vitest-teardown-worker-root-cleanup.test.ts`, and `settings-export.test.ts` were rescued before their 2026-07-03 deletion deadline. The key evidence was a loaded `pnpm --filter @fusion/core test` pass across the package after re-quarantining `store-concurrent-writes.test.ts`, with no `ENOTEMPTY`, `EBUSY`, hook timeout, or missed deferred hook in the rescued files. Four files needed no weakening because their regression value still held under load; `settings-export.test.ts` kept its import/export coverage but now closes the real `TaskStore` before removing the fixture root. `store-concurrent-writes.test.ts` remains in the deletion ratchet after merge verification re-observed the broad-lane SQLite lock flake. Required closure evidence for this class is ledger/config convergence, the rescued package lane, the timeout-appeasement guard, `pnpm test:gate`, `pnpm test`, `pnpm typecheck`, and `pnpm build`.
**2026-06-16 rescue (FN-6514):** `packages/dashboard/app/components/__tests__/QuickEntryBox.test.tsx` was rescued before its 2026-06-30 deletion deadline. The file still caught real quick-entry behavior regressions, but it leaked jsdom descriptors for `window.innerWidth`, `window.matchMedia`, `document.visibilityState`, `URL.createObjectURL`, and `URL.revokeObjectURL`; a mobile viewport helper could leave later tests in the same dashboard backfill shard observing `innerWidth=375` and mismatched responsive assertions. The rescue removed the ledger/config quarantine entries in lockstep, captured each original `PropertyDescriptor` at module load, restored those descriptors (or deleted own properties that were originally absent) in `afterEach`, and added a guard test that mutates all rescued globals before asserting they return to their original descriptors. Reusable pattern: any test file that changes jsdom globals with `Object.defineProperty` or spies on replaceable globals must snapshot the original descriptor at the top of the file, restore it in every `afterEach`, and prove the invariant with a guard test; do not use timeout bumps, retries, worker changes, or blanket `vi.restoreAllMocks()` when module mocks depend on stable implementations.

View File

@@ -63,6 +63,11 @@ describe("settings-export", () => {
});
afterEach(() => {
/*
FNXC:CoreTests 2026-06-19-14:30:
FN-6741 rescues settings-export from the core suite-load quarantine by closing the in-memory TaskStore before removing its fixture root. The test still covers settings import/export behavior, but teardown must release store resources before temp cleanup instead of relying on process exit.
*/
store.close();
cleanupTestEnv(env.tempDir);
});

View File

@@ -33,13 +33,14 @@ const quarantinedCoreTests = [
FNXC:CoreTests 2026-06-19-10:24:
FN-6705 verification then observed settings-export time out in beforeEach only under the broad changed-package core lane while the targeted file rerun passed in 5.1s. Quarantine the suite-load hook flake instead of increasing hookTimeout.
FNXC:CoreTests 2026-06-19-14:31:
FN-6741 reloaded the six 2026-06-19 core quarantine files under the broad @fusion/core lane and rescued them in lockstep with scripts/lib/test-quarantine.json. Keep this array empty; future core suite-load flakes must prove a remaining shared worker-root/temp-redirect or fixture close-order gap before re-quarantining.
FNXC:CoreTests 2026-06-19-15:05:
Merge verification for FN-6741 observed store-concurrent-writes fail again under the broad @fusion/core lane with SQLite BEGIN IMMEDIATE lock exhaustion. Re-quarantine that single suite-load lock flake in lockstep with the ledger; keep the other rescued core files loaded.
*/
"src/__tests__/activity-analytics.test.ts",
"src/__tests__/db.test.ts",
"src/__tests__/store-concurrent-writes.test.ts",
"src/__tests__/store-create-summarize-deferred-hook.test.ts",
"src/__tests__/vitest-teardown-worker-root-cleanup.test.ts",
"src/__tests__/settings-export.test.ts",
];
export default defineConfig({

View File

@@ -16,34 +16,9 @@
"reason": "FN-6726 local workspace `pnpm test` observed the duplicate-merge-seam template conflict assertion fail only in the broad dashboard components-b shard, while a targeted rerun of that exact test passed; quarantine the workflow editor concurrency flake instead of appeasing unrelated template insertion behavior while the Command Center token containment fix remains scoped.",
"quarantinedAt": "2026-06-19"
},
{
"file": "packages/core/src/__tests__/activity-analytics.test.ts",
"reason": "FN-6705 local workspace `pnpm test` observed this core file fail only in the broad changed-package core lane (hook/test timeout, ENOTEMPTY cleanup, or missed deferred hook under suite load); immediate targeted rerun of all five files passed, so quarantine the suite-load flake instead of appeasing it with wider timeouts/retries.",
"quarantinedAt": "2026-06-19"
},
{
"file": "packages/core/src/__tests__/db.test.ts",
"reason": "FN-6705 local workspace `pnpm test` observed this core file fail only in the broad changed-package core lane (hook/test timeout, ENOTEMPTY cleanup, or missed deferred hook under suite load); immediate targeted rerun of all five files passed, so quarantine the suite-load flake instead of appeasing it with wider timeouts/retries.",
"quarantinedAt": "2026-06-19"
},
{
"file": "packages/core/src/__tests__/store-concurrent-writes.test.ts",
"reason": "FN-6705 local workspace `pnpm test` observed this core file fail only in the broad changed-package core lane (hook/test timeout, ENOTEMPTY cleanup, or missed deferred hook under suite load); immediate targeted rerun of all five files passed, so quarantine the suite-load flake instead of appeasing it with wider timeouts/retries.",
"quarantinedAt": "2026-06-19"
},
{
"file": "packages/core/src/__tests__/store-create-summarize-deferred-hook.test.ts",
"reason": "FN-6705 local workspace `pnpm test` observed this core file fail only in the broad changed-package core lane (hook/test timeout, ENOTEMPTY cleanup, or missed deferred hook under suite load); immediate targeted rerun of all five files passed, so quarantine the suite-load flake instead of appeasing it with wider timeouts/retries.",
"quarantinedAt": "2026-06-19"
},
{
"file": "packages/core/src/__tests__/vitest-teardown-worker-root-cleanup.test.ts",
"reason": "FN-6705 local workspace `pnpm test` observed this core file fail only in the broad changed-package core lane (hook/test timeout, ENOTEMPTY cleanup, or missed deferred hook under suite load); immediate targeted rerun of all five files passed, so quarantine the suite-load flake instead of appeasing it with wider timeouts/retries.",
"quarantinedAt": "2026-06-19"
},
{
"file": "packages/core/src/__tests__/settings-export.test.ts",
"reason": "FN-6705 local workspace `pnpm test` observed this core file time out in beforeEach only in the broad changed-package core lane; immediate targeted rerun passed in 5.1s, so quarantine the suite-load hook flake instead of appeasing it with wider hook timeouts/retries.",
"reason": "FN-6741 merge verification observed store-concurrent-writes fail again only under the broad @fusion/core lane with SQLite BEGIN IMMEDIATE lock exhaustion after the other same-day core quarantine entries stayed loaded; re-quarantine this suite-load lock flake instead of widening SQLite lock-recovery timing, adding retries, or weakening concurrent-write assertions.",
"quarantinedAt": "2026-06-19"
},
{