fix(#3511): scope every phase-directory scan to the phase it belongs to (#3535)

This commit is contained in:
Tom Boucher
2026-08-15 07:02:33 -04:00
committed by GitHub
parent 3d17569d5b
commit 59e7a677fe
30 changed files with 1903 additions and 146 deletions

View File

@@ -22,6 +22,9 @@ const { stripFencedCode } = markdownSectionizer;
// eslint-disable-next-line @typescript-eslint/no-require-imports
import verification = require('./verification.cjs');
const { readVerificationStatus } = verification;
// eslint-disable-next-line @typescript-eslint/no-require-imports
import phaseIdMod = require('./phase-id.cjs');
const { scopeToPhase } = phaseIdMod;
// ─── Types ────────────────────────────────────────────────────────────────────
@@ -243,9 +246,18 @@ function evaluateUatPassed(
};
}
// Filter UAT and VERIFICATION files using the same filter as cmdPhaseComplete
const uatFileNames = dirEntries.filter(f => f.includes('-UAT') && f.endsWith('.md'));
const verFileNames = dirEntries.filter(f => f.includes('-VERIFICATION') && f.endsWith('.md'));
// Filter UAT and VERIFICATION files using the same filter as cmdPhaseComplete,
// scoped to THIS phase's own token (#3511) — a stray, cross-phase, or ad-hoc
// file can no longer contribute a blocker to a phase it does not belong to.
const phaseDirBaseName = path.basename(phaseFullDir);
const uatFileNames = scopeToPhase(
dirEntries.filter(f => f.includes('-UAT') && f.endsWith('.md')),
phaseDirBaseName,
);
const verFileNames = scopeToPhase(
dirEntries.filter(f => f.includes('-VERIFICATION') && f.endsWith('.md')),
phaseDirBaseName,
);
// ── Process UAT files ──────────────────────────────────────────────────────
for (const file of uatFileNames) {