From cd87c9937d085496a4ca03a221f263c592647136 Mon Sep 17 00:00:00 2001 From: Tibsfox Date: Sun, 5 Apr 2026 11:00:09 -0700 Subject: [PATCH 1/2] fix(gsd): treat zero-slice roadmap as pre-planning in guided flow --- src/resources/extensions/gsd/guided-flow.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/resources/extensions/gsd/guided-flow.ts b/src/resources/extensions/gsd/guided-flow.ts index d0f400448..6d924d9ac 100644 --- a/src/resources/extensions/gsd/guided-flow.ts +++ b/src/resources/extensions/gsd/guided-flow.ts @@ -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)); From 5b6d7784c2428989652cc39bca007fca7c118421 Mon Sep 17 00:00:00 2001 From: Tibsfox Date: Sun, 5 Apr 2026 11:55:49 -0700 Subject: [PATCH 2/2] test(gsd): add zero-slice roadmap guided flow test --- .../tests/zero-slice-roadmap-guided.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/resources/extensions/gsd/tests/zero-slice-roadmap-guided.test.ts diff --git a/src/resources/extensions/gsd/tests/zero-slice-roadmap-guided.test.ts b/src/resources/extensions/gsd/tests/zero-slice-roadmap-guided.test.ts new file mode 100644 index 000000000..f41b8bd51 --- /dev/null +++ b/src/resources/extensions/gsd/tests/zero-slice-roadmap-guided.test.ts @@ -0,0 +1,19 @@ +/** + * Regression test for #3441: guided flow must treat a roadmap with zero + * parseable slices the same as no roadmap — offer "Create roadmap" not "Go auto". + */ +import { test } from "node:test"; +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import { join } from "node:path"; + +test("guided-flow checks roadmap slice count before offering auto (#3441)", () => { + const src = readFileSync( + join(import.meta.dirname, "..", "guided-flow.ts"), + "utf-8", + ); + assert.ok( + src.includes("roadmapHasSlices") || src.includes("parseRoadmapSlices"), + "Guided flow must parse roadmap for slices before deciding which options to show", + ); +});