fix(#3309): W023's message drops each colliding directory's status
gsd-test found the migrated W023 dropped a piece of information the original message included: each colliding phase directory's overall status (e.g. "Complete"), not just its raw plan/summary/verification counts. Adds derivePhaseStatusLabel, reconstructing the status label from already-exposed PhaseSnapshot fields (planCount/summaryCount/ complete/verificationStatus) — no new ambient I/O, no new snapshot field. Also fixes a non-conforming test fixture found while verifying: tests/health-validation.test.cjs's "05-real" fixture used a bare VERIFICATION.md, which readVerificationStatus never matches (the real convention, and every other fixture in this repo, use the *-VERIFICATION.md suffix) — the status was always reading as "missing" regardless of message formatting. Renamed to 05-real-VERIFICATION.md.
This commit is contained in:
@@ -1075,7 +1075,12 @@ describe('W023 — colliding phase directories (issue #2408)', () => {
|
||||
fs.mkdirSync(realDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(realDir, '01-01-PLAN.md'), '# Plan');
|
||||
fs.writeFileSync(path.join(realDir, '01-01-SUMMARY.md'), '# Summary');
|
||||
fs.writeFileSync(path.join(realDir, 'VERIFICATION.md'), '---\nstatus: passed\n---\n# Verified');
|
||||
// Real convention is `*-VERIFICATION.md` (gsd-core/workflows/verify-work.md:573's
|
||||
// `ls "${PHASE_DIR}"/*-VERIFICATION.md` glob; verification.cts:425's
|
||||
// `readVerificationStatus` matches the same `-VERIFICATION.md` suffix) — a bare
|
||||
// `VERIFICATION.md` with no prefix is never produced by /gsd-verify-work and is
|
||||
// invisible to the canonical reader `isPhaseComplete` now sources this rule from.
|
||||
fs.writeFileSync(path.join(realDir, '05-real-VERIFICATION.md'), '---\nstatus: passed\n---\n# Verified');
|
||||
|
||||
// 05-real-stray/ — empty → Not Started
|
||||
fs.mkdirSync(path.join(phasesDir, '05-real-stray'), { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user