plan-slice infinite loop due to worktree/canonical projection mismatch in artifact verification
Problem
Auto-mode gets stuck in an infinite loop on plan-slice/M001/S02. The agent successfully generates the task plans, but verification fails because the artifacts are written to the worktree-local .gsd while the verifier checks the canonical project .gsd. The verifier interprets the plans as missing and re-dispatches executing → execute-task (recover missing task plan → plan-slice), which loops infinitely.
Root Cause
paths.js:325 resolves gsdProjectionRoot (used by writers) to the worktree-local path, whereas auto-recovery.js:787 uses resolveTasksDir, which calls gsdRoot and resolves to the canonical project root.
Writer snippet (.gsd/agent/extensions/gsd/markdown-renderer.js:335):
const tasksDir = join(gsdProjectionRoot(basePath), "milestones", milestoneId, "slices", sliceId, "tasks");Reader snippet (.gsd/agent/extensions/gsd/auto-recovery.js:787-794):
const tasksDir = resolveTasksDir(base, mid, sid);
if (!tasksDir) { ... }
for (const tid of taskIds) {
const taskPlanFile = join(tasksDir, `${tid}-PLAN.md`);
if (!existsSync(taskPlanFile)) { return false; } // Fails here
}Expected Behavior
The projection layer must use a single authoritative root for reads and writes. According to the Phase C specification ("reads + writes converge at projectRoot"), gsdProjectionRoot should be removed, and all callers (including markdown-renderer.js and plan-slice.js) should use gsdRoot directly.
Environment
- GSD version: 3.0.0
- Model: gemini-3.1-pro-low
- Unit: plan-slice/M001/S02
Reproduction Context
Auto-mode, worktree isolation enabled, in milestone M001 slice S02. The loop was triggered when the agent finished generating task plans for the slice.
Forensic Evidence
[ERROR] stuck-loop: Unit plan-slice/M001/S02 was dispatched 3 times- Journal events show:
dispatch-match flow=c95b261c rule=executing → execute-task (recover missing task plan → plan-slice) unit=M001/S02 - Post-unit verify consistently fails and triggers
artifact-verification-retry.
Auto-generated by /gsd forensics
Source: gsd-build/gsd-2