From 1254b631c81cf6326ed7186ec16c8f1bf46fea5e Mon Sep 17 00:00:00 2001 From: Tibsfox Date: Mon, 6 Apr 2026 22:38:56 -0700 Subject: [PATCH] fix(test): add CONTEXT file to queued milestone ghost detection test The fix changed isGhostMilestone to treat queued+no-files as a ghost. The test was asserting queued+DB-row = not ghost, but without content files it is now correctly identified as a ghost. Add a CONTEXT file to make it a legitimate queued milestone. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/resources/extensions/gsd/tests/derive-state-db.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/resources/extensions/gsd/tests/derive-state-db.test.ts b/src/resources/extensions/gsd/tests/derive-state-db.test.ts index 81466f16a..08ea28f8a 100644 --- a/src/resources/extensions/gsd/tests/derive-state-db.test.ts +++ b/src/resources/extensions/gsd/tests/derive-state-db.test.ts @@ -1098,16 +1098,17 @@ describe('derive-state-db', async () => { // M001: complete milestone with summary writeFile(base, 'milestones/M001/M001-SUMMARY.md', '# M001 Summary\n\nDone.'); - // M002: queued milestone — directory exists, no content files, but has DB row + // M002: queued milestone — directory exists with CONTEXT file and DB row mkdirSync(join(base, '.gsd', 'milestones', 'M002', 'slices'), { recursive: true }); + writeFile(base, 'milestones/M002/M002-CONTEXT.md', '# M002 Context\n\nPlanned milestone.'); // DB has both M001 complete and M002 queued openDatabase(':memory:'); insertMilestone({ id: 'M001', title: 'First', status: 'complete' }); insertMilestone({ id: 'M002', title: 'Second', status: 'queued' }); - // isGhostMilestone should NOT treat M002 as ghost when DB row exists - assert.ok(!isGhostMilestone(base, 'M002'), 'ghost-dbrow: M002 with DB row is NOT a ghost'); + // isGhostMilestone should NOT treat M002 as ghost when DB row + content files exist + assert.ok(!isGhostMilestone(base, 'M002'), 'ghost-dbrow: M002 with DB row and content is NOT a ghost'); invalidateStateCache(); const dbState = await deriveStateFromDb(base);