fix(roadmap-update-plan-progress): propagate Plans** regex hardening from phase-lifecycle

Applies the same [ \t]* + section-boundary lookahead fix that was applied
to planCountPattern in phase-lifecycle.ts. roadmap.update-plan-progress
shared the same corruption vector via \s* crossing newlines.

Addresses coderabbit finding on PR #2736.
This commit is contained in:
Tom Boucher
2026-04-26 11:19:34 -04:00
parent a9f49f8f9d
commit c85e65ec03
2 changed files with 191 additions and 1 deletions

View File

@@ -84,7 +84,7 @@ export const roadmapUpdatePlanProgress: QueryHandler = async (args, projectDir,
});
const planCountPattern = new RegExp(
`(#{2,4}\\s*Phase\\s+${phaseEscaped}[\\s\\S]*?\\*\\*Plans:\\*\\*\\s*)[^\\n]+`,
`(#{2,4}\\s*Phase\\s+${phaseEscaped}(?:(?!\\n#{2,4})[\\s\\S])*?\\*\\*Plans:\\*\\*[ \\t]*)[^\\n]+`,
'i',
);
const planCountText = isComplete