test: harden mvp-mode behavioral coverage

This commit is contained in:
Tom Boucher
2026-05-15 20:17:57 -04:00
parent 5a8610e0c2
commit ceb7a948d8
2 changed files with 45 additions and 3 deletions

View File

@@ -226,7 +226,7 @@ function getRoadmapModeForPhase(cwd, phaseNum) {
const sectionStart = headerMatch.index;
const rest = content.slice(sectionStart);
const nextHeader = rest.slice(headerMatch[0].length).match(/\n#{2,4}\s+Phase\s+\d/i);
const nextHeader = rest.slice(headerMatch[0].length).match(/\n#{2,4}\s+Phase\s+\S/i);
const sectionEnd = nextHeader ? sectionStart + headerMatch[0].length + nextHeader.index : content.length;
const section = content.slice(sectionStart, sectionEnd);
const modeMatch = section.match(/\*\*Mode(?::\*\*|\*\*:)\s*([^\n]+)/i);