fix(#3639): dir-aware sentinel recognition for the disk-side guards (#3698)

* test(#3639): pin bracket sentinel recognition in disk-side guards

* fix(#3639): dir-aware sentinel recognition for the disk-side guards

* chore(#3639): add changeset

* fix(#3639): disclose the digit-continuation residual, join phases-clear, load-bearing over-suppression guard

* test(#3639): match the token form W007 reports

* chore(#3639): backfill changeset pr number

---------

Co-authored-by: sim <sim@local>
This commit is contained in:
Tom Boucher
2026-08-19 21:55:18 -04:00
committed by GitHub
parent 66228a89cf
commit 71e00d426e
7 changed files with 153 additions and 8 deletions

View File

@@ -30,7 +30,7 @@ import ioMod = require('./io.cjs');
const { output, error } = ioMod;
// eslint-disable-next-line @typescript-eslint/no-require-imports
import phaseIdMod = require('./phase-id.cjs');
const { normalizePhaseName, matchPhaseDirs, PHASE_NUMBER_TOKEN_SOURCE, isSentinelPhaseId } = phaseIdMod;
const { normalizePhaseName, matchPhaseDirs, PHASE_NUMBER_TOKEN_SOURCE, isSentinelPhaseId, isSentinelPhaseDir } = phaseIdMod;
import { escapeRegex } from './pattern.cjs';
// eslint-disable-next-line @typescript-eslint/no-require-imports
import roadmapParserMod = require('./roadmap-parser.cjs');
@@ -1198,7 +1198,11 @@ function cmdPhasesClear(cwd: string, raw: boolean, args: string[]): void {
// divergence meant a `0-*` directory `roadmap analyze` preserves as a
// sentinel was DELETED here. Routed through the canonical predicate so
// every reader of "is this a sentinel phase" agrees by construction.
const dirs = entries.filter((e) => e.isDirectory() && !isSentinelPhaseId(e.name));
// #3639: the DIR-AWARE recognizer — the convention-less id predicate
// never saw bracket sentinel dirs (GSD.999-07-icebox), so they were
// counted for deletion here while the disk guards (post-#3639) preserve
// them; the destructive path must not be the one blind reader left.
const dirs = entries.filter((e) => e.isDirectory() && !isSentinelPhaseDir(e.name));
if (dirs.length > 0 && !confirm) {
error(