fix(gsd): make auto mode complete a milestone end to end - #1605
Merged
Conversation
Contributor
🔴 PR Risk Report — CRITICAL
Affected Systems
File Breakdown
|
Auto mode could not finish a planned milestone. Nine defects, each found by running a real milestone against a scratch project and measuring, each with a test that fails without its fix. Startup and dispatch: - migrateToFlatPhase held no cross-process lock. Headless runs the extension in two processes and both fire session_start, so two migrations raced and the loser died on ENOENT. Repro went 3/3 fail to 5/5 clean. - Dispatch raced that migration's move-aside window, when slice plans exist in neither layout, and re-planned an already-planned milestone on every run. Scoped to a migration actually in flight so a settled legacy project still reaches the rule (#4671). Verification and gates: - The verification gate executed a task's prose `verify` field as a shell command: `greet/hello.txt exists and contains "hello"` ran the .txt file and exited 126, failing a task that had succeeded. The prose detector only caught capitalised prose; lowercase fell through. - Browser-UAT escalation fired on a negated mention. "no runtime behavior, server, UI, or browser interaction is involved" reads as a browser requirement when the negator is a list away. Reporting: - Blocked stops exited 0, reporting success over an unfinished milestone. Two independent breaks in stop-notice.ts, the module written to keep emitter and detector in lockstep: the reason reached stopAuto unmarked, and the detector tested for "blocked:" while the formatter emits "Auto-mode blocked -" with no colon. Blocked prefixes were also absent from TERMINAL_NOTICE_PREFIXES. Projection and identity: - Slice plans now state their DB identity. Under flat-phase layout an agent inferred milestoneId "01-m001" from the directory name and was hard-blocked. Unit tool contracts: - Contracts were enforced but not advertised: 15 of 24 units with an allowedGsdTools list had no tool guidance. The allowed set is now derived from the same table the enforcer reads, and repeated as a one-line reminder at the dispatch seam - the Tool Surface section alone sat 4% into a 14K prompt and had no effect. HARD BLOCKs went 4 to 0. - That reminder is phrased as a reference, not a menu: advertising gsd_reassess_roadmap invited validate-milestone to add slices to a completed milestone until the run stopped terminating. Worktree closeout: - Under git.isolation=worktree the closeout consistency gate computed the verification source revision from the project root while validation had run in the worktree - two different trees by design - so a milestone the DB had marked complete was refused at merge with "validation authorization is not current". Measured: worktree sha256:074a8c04 matched the recorded value exactly; root sha256:a86aa329 did not. Verified: a 2-slice/4-task milestone completes unattended with exit 0, both slices and the milestone complete in the DB, and byte-exact artifacts. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ordance Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
jeremymcs
force-pushed
the
fix/gsd-auto-milestone-completion-pr
branch
from
August 7, 2026 18:55
a916deb to
f836b5c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auto mode could not finish a planned milestone. Nine defects, each found by running a real milestone against a scratch project and measuring the result, each with a test that fails without its fix.
Progress across acceptance runs
What was broken
Startup and dispatch
migrateToFlatPhaseheld no cross-process lock. Headless runs the extension in two processes and both firesession_start, so two migrations raced and the loser died on ENOENT. Repro went 3/3 fail → 5/5 clean.Verification and gates
verifyfield as a shell command:greet/hello.txt exists and contains "hello"tried to run the.txtfile, exited 126, and failed a task that had succeeded. The prose detector only caught capitalised prose.no runtime behavior, server, UI, or browser interaction is involvedreads as a browser requirement when the negator is a list away.Reporting
stop-notice.ts— the module written to keep emitter and detector in lockstep. Either alone loses the exit code.Projection and identity
milestoneId: "01-m001"from the directory name and was hard-blocked.Unit tool contracts
allowedGsdToolslist had no tool guidance at all. The allowed set is now derived from the same table the enforcer reads, and repeated at the dispatch seam — the## Tool Surfacesection alone sat 4% into a 14K-character prompt and had no measurable effect. HARD BLOCKs went 4 → 0.gsd_reassess_roadmapinvitedvalidate-milestoneto add slices to a completed milestone until runs stopped terminating.Worktree closeout
git.isolation=worktreethe closeout gate computed the verification source revision from the project root while validation ran in the worktree — different trees by design — so a milestone the DB had marked complete was refused at merge. Measured: worktreesha256:074a8c04…matched the recorded authorization exactly; rootsha256:a86aa329…did not.Verification
exit=0, both slices and the milestonecompletein the DB, byte-exact artifacts, 0 HARD BLOCKs.Known limits
ok) and introduces no regressions, but every full acceptance attempt under worktree isolation was cut short. The gate fix also has no regression test — one needs a project with a registered git worktree plus recorded validation events.main.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled.