fix(phase-lifecycle): handle project-code-prefixed dirs in phaseAdd fallback scan
Filesystem fallback regex /^(\d+)-/ missed directories like CK-45-foundation when project_code is configured. Updated to /^(?:[A-Z][A-Z0-9]*-)?(\d+)-/i. Addresses coderabbit finding on PR #2737.
This commit is contained in:
@@ -209,7 +209,7 @@ export const phaseAdd: QueryHandler = async (args, projectDir, workstream) => {
|
||||
const entries = await readdir(phasesDir, { withFileTypes: true });
|
||||
for (const entry of entries) {
|
||||
if (!entry.isDirectory()) continue;
|
||||
const dirMatch = /^(\d+)[A-Z]?(?:\.\d+)*-/.exec(entry.name);
|
||||
const dirMatch = /^(?:[A-Z][A-Z0-9]*-)?(\d+)[A-Z]?(?:\.\d+)*-/i.exec(entry.name);
|
||||
if (dirMatch) {
|
||||
const num = parseInt(dirMatch[1], 10);
|
||||
if (num >= 999) continue;
|
||||
|
||||
Reference in New Issue
Block a user