From cff7ded42cd0eabe86ce0a4bfe5e0ec14354e48c Mon Sep 17 00:00:00 2001 From: Tibsfox Date: Mon, 6 Apr 2026 22:43:53 -0700 Subject: [PATCH] fix(test): update rogue detection test for auto-remediation behavior The fix auto-remediates stale slice DB status via updateSliceStatus() instead of reporting it as a rogue artifact. Update the test to expect 0 rogues since the stale status is now silently fixed. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../extensions/gsd/tests/rogue-file-detection.test.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/resources/extensions/gsd/tests/rogue-file-detection.test.ts b/src/resources/extensions/gsd/tests/rogue-file-detection.test.ts index e0fd6c00e..09110adf7 100644 --- a/src/resources/extensions/gsd/tests/rogue-file-detection.test.ts +++ b/src/resources/extensions/gsd/tests/rogue-file-detection.test.ts @@ -149,7 +149,7 @@ test("rogue detection: DB not available → returns empty array (graceful degrad } }); -test("rogue detection: slice summary on disk, no DB row → detected as rogue", () => { +test("rogue detection: slice summary on disk, no DB row → auto-remediated (not rogue)", () => { const basePath = createTmpBase(); const dbPath = join(basePath, ".gsd", "gsd.db"); mkdirSync(join(basePath, ".gsd"), { recursive: true }); @@ -160,11 +160,10 @@ test("rogue detection: slice summary on disk, no DB row → detected as rogue", const summaryPath = createSliceSummaryOnDisk(basePath, "M001", "S01"); assert.ok(existsSync(summaryPath), "Slice summary file should exist on disk"); + // Fix #3633: stale slice DB status is auto-remediated via updateSliceStatus() + // instead of being reported as rogue, so rogues array should be empty. const rogues = detectRogueFileWrites("complete-slice", "M001/S01", basePath); - assert.equal(rogues.length, 1, "Should detect one rogue slice file"); - assert.equal(rogues[0].path, summaryPath); - assert.equal(rogues[0].unitType, "complete-slice"); - assert.equal(rogues[0].unitId, "M001/S01"); + assert.equal(rogues.length, 0, "Should auto-remediate stale slice, not report as rogue"); } finally { closeDatabase(); rmSync(basePath, { recursive: true, force: true });