fix(gsd): treat zero-slice roadmap as pre-planning in guided flow

This commit is contained in:
Tibsfox 2026-04-05 11:00:09 -07:00
parent 092d1c0a9e
commit cd87c9937d

View file

@ -1314,7 +1314,19 @@ export async function showSmartEntry(
const roadmapFile = resolveMilestoneFile(basePath, milestoneId, "ROADMAP");
const hasRoadmap = !!(roadmapFile && await loadFile(roadmapFile));
if (!hasRoadmap) {
// A roadmap file with zero parseable slices (placeholder text) should be
// treated the same as no roadmap — offer "Create roadmap" instead of "Go auto"
// which would immediately get stuck in blocked state (#3441).
let roadmapHasSlices = false;
if (hasRoadmap) {
const roadmapContent = await loadFile(roadmapFile!);
if (roadmapContent) {
const parsed = parseRoadmapSlices(roadmapContent);
roadmapHasSlices = parsed.length > 0;
}
}
if (!hasRoadmap || !roadmapHasSlices) {
// No roadmap → discuss or plan
const contextFile = resolveMilestoneFile(basePath, milestoneId, "CONTEXT");
const hasContext = !!(contextFile && await loadFile(contextFile));