@opengsd/gsd-core 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.opencode/plugins/gsd-core.js +12 -0
  4. package/agents/gsd-executor.md +63 -35
  5. package/agents/gsd-plan-checker.md +76 -57
  6. package/agents/gsd-planner.md +14 -0
  7. package/agents/gsd-ui-checker.md +19 -3
  8. package/agents/gsd-ui-researcher.md +29 -0
  9. package/agents/gsd-verifier.md +23 -1
  10. package/bin/install.js +239 -67
  11. package/commands/gsd/execute-phase.md +1 -1
  12. package/commands/gsd/ns-workflow.md +2 -1
  13. package/commands/gsd/phase.md +1 -1
  14. package/commands/gsd/quick-batch.md +105 -0
  15. package/commands/gsd/surface.md +18 -8
  16. package/gsd-core/bin/gsd-tools.cjs +195 -50
  17. package/gsd-core/bin/lib/capability-activation.cjs +27 -0
  18. package/gsd-core/bin/lib/capability-registry.cjs +514 -114
  19. package/gsd-core/bin/lib/capability-state.cjs +7 -1
  20. package/gsd-core/bin/lib/capability-validator.cjs +120 -4
  21. package/gsd-core/bin/lib/capability-writer.cjs +14 -4
  22. package/gsd-core/bin/lib/check-command-router.cjs +85 -2
  23. package/gsd-core/bin/lib/claude-orchestration.cjs +10 -25
  24. package/gsd-core/bin/lib/clusters.cjs +1 -0
  25. package/gsd-core/bin/lib/command-aliases.cjs +16 -0
  26. package/gsd-core/bin/lib/commands.cjs +337 -13
  27. package/gsd-core/bin/lib/config-loader.cjs +3 -0
  28. package/gsd-core/bin/lib/core-utils.cjs +34 -7
  29. package/gsd-core/bin/lib/decisions.cjs +213 -1
  30. package/gsd-core/bin/lib/edge-probe.cjs +14 -1
  31. package/gsd-core/bin/lib/file-overlap-partitioner.cjs +74 -0
  32. package/gsd-core/bin/lib/frontmatter.cjs +137 -23
  33. package/gsd-core/bin/lib/gap-checker.cjs +22 -13
  34. package/gsd-core/bin/lib/git-base-branch.cjs +10 -2
  35. package/gsd-core/bin/lib/health-diagnostic-rules/phase-structure.cjs +8 -2
  36. package/gsd-core/bin/lib/health-diagnostic-rules/roadmap-disk-consistency.cjs +54 -11
  37. package/gsd-core/bin/lib/health-diagnostic-rules/state-consistency.cjs +75 -22
  38. package/gsd-core/bin/lib/host-integration.cjs +57 -5
  39. package/gsd-core/bin/lib/init-command-router.cjs +14 -0
  40. package/gsd-core/bin/lib/init.cjs +132 -15
  41. package/gsd-core/bin/lib/install-engine.cjs +184 -12
  42. package/gsd-core/bin/lib/install-model-override-resolver.cjs +45 -0
  43. package/gsd-core/bin/lib/install-profiles.cjs +22 -14
  44. package/gsd-core/bin/lib/installer-migration-report.cjs +1 -0
  45. package/gsd-core/bin/lib/io.cjs +35 -0
  46. package/gsd-core/bin/lib/loop-resolver.cjs +14 -8
  47. package/gsd-core/bin/lib/markdown-table.cjs +123 -0
  48. package/gsd-core/bin/lib/milestone.cjs +22 -2
  49. package/gsd-core/bin/lib/phase-command-router.cjs +13 -6
  50. package/gsd-core/bin/lib/phase-id.cjs +251 -9
  51. package/gsd-core/bin/lib/phase.cjs +774 -35
  52. package/gsd-core/bin/lib/plan-document.cjs +10 -0
  53. package/gsd-core/bin/lib/planning-snapshot.cjs +147 -20
  54. package/gsd-core/bin/lib/planning-workspace.cjs +103 -28
  55. package/gsd-core/bin/lib/quick-batch-command-router.cjs +285 -0
  56. package/gsd-core/bin/lib/quick-batch-dispatch.cjs +250 -0
  57. package/gsd-core/bin/lib/quick-batch.cjs +840 -0
  58. package/gsd-core/bin/lib/review-lane-descriptor.cjs +53 -5
  59. package/gsd-core/bin/lib/review-lane-invocation.cjs +73 -1
  60. package/gsd-core/bin/lib/review-lane-runner.cjs +136 -10
  61. package/gsd-core/bin/lib/roadmap-parser.cjs +499 -26
  62. package/gsd-core/bin/lib/roadmap.cjs +187 -58
  63. package/gsd-core/bin/lib/runtime-artifact-conversion.cjs +233 -33
  64. package/gsd-core/bin/lib/runtime-artifact-install-plan.cjs +16 -17
  65. package/gsd-core/bin/lib/runtime-artifact-layout.cjs +286 -108
  66. package/gsd-core/bin/lib/runtime-hooks-surface.cjs +215 -43
  67. package/gsd-core/bin/lib/shell-command-projection.cjs +4 -0
  68. package/gsd-core/bin/lib/smart-entry.cjs +7 -9
  69. package/gsd-core/bin/lib/state-document.cjs +30 -5
  70. package/gsd-core/bin/lib/state-md-schema.cjs +23 -13
  71. package/gsd-core/bin/lib/state-transition.cjs +333 -44
  72. package/gsd-core/bin/lib/state.cjs +684 -125
  73. package/gsd-core/bin/lib/surface.cjs +23 -8
  74. package/gsd-core/bin/lib/tdd-red-evidence.cjs +133 -0
  75. package/gsd-core/bin/lib/uat.cjs +1419 -515
  76. package/gsd-core/bin/lib/update-context.cjs +6 -2
  77. package/gsd-core/bin/lib/validate.cjs +230 -12
  78. package/gsd-core/bin/lib/verification-command-router.cjs +2 -1
  79. package/gsd-core/bin/lib/verification.cjs +273 -12
  80. package/gsd-core/bin/lib/verify-command-router.cjs +1 -0
  81. package/gsd-core/bin/lib/verify.cjs +346 -16
  82. package/gsd-core/bin/lib/workstream-inventory.cjs +20 -2
  83. package/gsd-core/bin/lib/worktree-safety.cjs +8 -0
  84. package/gsd-core/bin/shared/config-schema.manifest.json +8 -0
  85. package/gsd-core/bin/verify-reapply-patches.cjs +70 -3
  86. package/gsd-core/references/agent-contracts.md +3 -3
  87. package/gsd-core/references/edge-probe.md +17 -13
  88. package/gsd-core/references/execute-mvp-tdd.md +18 -16
  89. package/gsd-core/references/execute-phase-response-language.md +6 -0
  90. package/gsd-core/references/executor-examples.md +42 -0
  91. package/gsd-core/references/few-shot-examples/plan-checker.md +15 -15
  92. package/gsd-core/references/mvp-concepts.md +2 -2
  93. package/gsd-core/references/plan-checker-examples.md +41 -0
  94. package/gsd-core/references/planner-antipatterns.md +25 -0
  95. package/gsd-core/references/planner-chunked.md +5 -1
  96. package/gsd-core/references/planner-coupling.md +42 -0
  97. package/gsd-core/references/planner-quick-batch.md +71 -0
  98. package/gsd-core/references/planner-reviews.md +47 -0
  99. package/gsd-core/references/planner-revision.md +75 -2
  100. package/gsd-core/references/planning-config.md +2 -1
  101. package/gsd-core/references/response-language-directive.md +9 -0
  102. package/gsd-core/references/revision-loop.md +118 -11
  103. package/gsd-core/references/tdd.md +14 -9
  104. package/gsd-core/references/verifier-evidence-gate.md +160 -0
  105. package/gsd-core/templates/phase-prompt.md +4 -0
  106. package/gsd-core/templates/verification-report.md +5 -0
  107. package/gsd-core/workflows/add-backlog.md +2 -0
  108. package/gsd-core/workflows/add-phase.md +2 -0
  109. package/gsd-core/workflows/add-tests.md +1 -1
  110. package/gsd-core/workflows/add-todo.md +1 -1
  111. package/gsd-core/workflows/ai-integration-phase.md +1 -1
  112. package/gsd-core/workflows/analyze-dependencies.md +2 -0
  113. package/gsd-core/workflows/audit-fix.md +2 -0
  114. package/gsd-core/workflows/audit-milestone.md +2 -0
  115. package/gsd-core/workflows/audit-uat.md +2 -0
  116. package/gsd-core/workflows/autonomous.md +2 -0
  117. package/gsd-core/workflows/check-todos.md +1 -1
  118. package/gsd-core/workflows/cleanup.md +1 -1
  119. package/gsd-core/workflows/code-review/steps/structural-pre-pass.md +15 -13
  120. package/gsd-core/workflows/code-review-fix.md +2 -0
  121. package/gsd-core/workflows/code-review.md +73 -31
  122. package/gsd-core/workflows/complete-milestone.md +13 -4
  123. package/gsd-core/workflows/debug.md +1 -1
  124. package/gsd-core/workflows/diagnose-issues.md +5 -1
  125. package/gsd-core/workflows/discuss-phase/modes/advisor.md +2 -0
  126. package/gsd-core/workflows/discuss-phase/modes/all.md +2 -0
  127. package/gsd-core/workflows/discuss-phase/modes/analyze.md +2 -0
  128. package/gsd-core/workflows/discuss-phase/modes/auto.md +2 -0
  129. package/gsd-core/workflows/discuss-phase/modes/batch.md +2 -0
  130. package/gsd-core/workflows/discuss-phase/modes/chain.md +2 -0
  131. package/gsd-core/workflows/discuss-phase/modes/default.md +2 -0
  132. package/gsd-core/workflows/discuss-phase/modes/power.md +2 -0
  133. package/gsd-core/workflows/discuss-phase/modes/text.md +2 -0
  134. package/gsd-core/workflows/discuss-phase/templates/context.md +2 -0
  135. package/gsd-core/workflows/discuss-phase/templates/discussion-log.md +2 -0
  136. package/gsd-core/workflows/discuss-phase-assumptions.md +1 -1
  137. package/gsd-core/workflows/discuss-phase-power.md +2 -0
  138. package/gsd-core/workflows/discuss-phase.md +1 -1
  139. package/gsd-core/workflows/do.md +43 -13
  140. package/gsd-core/workflows/docs-update.md +1 -1
  141. package/gsd-core/workflows/edit-phase.md +2 -0
  142. package/gsd-core/workflows/eval-review.md +1 -1
  143. package/gsd-core/workflows/execute-phase/steps/codebase-drift-gate.md +2 -0
  144. package/gsd-core/workflows/execute-phase/steps/executor-isolation-dispatch.md +17 -1
  145. package/gsd-core/workflows/execute-phase/steps/per-plan-worktree-gate.md +8 -2
  146. package/gsd-core/workflows/execute-phase/steps/regression-gate-run.md +2 -0
  147. package/gsd-core/workflows/execute-phase/steps/tdd-applicability-resolution.md +25 -0
  148. package/gsd-core/workflows/execute-phase/steps/worktree-recovery-policy.md +2 -0
  149. package/gsd-core/workflows/execute-phase.md +32 -14
  150. package/gsd-core/workflows/execute-plan.md +8 -8
  151. package/gsd-core/workflows/explore.md +2 -0
  152. package/gsd-core/workflows/extract-learnings.md +2 -0
  153. package/gsd-core/workflows/fast.md +6 -0
  154. package/gsd-core/workflows/forensics.md +2 -0
  155. package/gsd-core/workflows/graduation.md +1 -1
  156. package/gsd-core/workflows/health.md +1 -1
  157. package/gsd-core/workflows/help/modes/brief.md +2 -0
  158. package/gsd-core/workflows/help/modes/default.md +2 -0
  159. package/gsd-core/workflows/help/modes/full.md +12 -0
  160. package/gsd-core/workflows/help/modes/topic.md +2 -0
  161. package/gsd-core/workflows/help.md +2 -0
  162. package/gsd-core/workflows/import.md +3 -3
  163. package/gsd-core/workflows/inbox.md +1 -1
  164. package/gsd-core/workflows/ingest-docs.md +1 -1
  165. package/gsd-core/workflows/insert-phase.md +2 -0
  166. package/gsd-core/workflows/list-phase-assumptions.md +2 -0
  167. package/gsd-core/workflows/list-seeds.md +2 -0
  168. package/gsd-core/workflows/list-workspaces.md +2 -0
  169. package/gsd-core/workflows/manager.md +3 -3
  170. package/gsd-core/workflows/map-codebase.md +2 -0
  171. package/gsd-core/workflows/milestone-summary.md +2 -0
  172. package/gsd-core/workflows/mvp-phase.md +1 -1
  173. package/gsd-core/workflows/new-milestone.md +1 -1
  174. package/gsd-core/workflows/new-project.md +5 -3
  175. package/gsd-core/workflows/new-workspace.md +1 -1
  176. package/gsd-core/workflows/next.md +2 -0
  177. package/gsd-core/workflows/node-repair.md +2 -0
  178. package/gsd-core/workflows/note.md +2 -0
  179. package/gsd-core/workflows/onboard.md +1 -1
  180. package/gsd-core/workflows/pause-work.md +19 -4
  181. package/gsd-core/workflows/plan-phase/steps/chunked-planning-mode.md +100 -18
  182. package/gsd-core/workflows/plan-phase/steps/prd-express-path.md +2 -0
  183. package/gsd-core/workflows/plan-phase/steps/stall-detection-helpers.md +9 -0
  184. package/gsd-core/workflows/plan-phase.md +130 -12
  185. package/gsd-core/workflows/plan-review-convergence.md +102 -10
  186. package/gsd-core/workflows/plant-seed.md +1 -1
  187. package/gsd-core/workflows/pr-branch.md +11 -3
  188. package/gsd-core/workflows/profile-user.md +1 -1
  189. package/gsd-core/workflows/progress/steps/forensic-audit.md +1 -1
  190. package/gsd-core/workflows/progress.md +25 -3
  191. package/gsd-core/workflows/quick/steps/plan-checker-loop.md +37 -2
  192. package/gsd-core/workflows/quick/steps/research-phase.md +3 -3
  193. package/gsd-core/workflows/quick-batch/steps/batch-init.md +55 -0
  194. package/gsd-core/workflows/quick-batch/steps/completion.md +65 -0
  195. package/gsd-core/workflows/quick-batch/steps/merge-wave.md +100 -0
  196. package/gsd-core/workflows/quick-batch/steps/plan-checker-loop.md +147 -0
  197. package/gsd-core/workflows/quick-batch/steps/planner-wave.md +158 -0
  198. package/gsd-core/workflows/quick-batch/steps/research-phase.md +95 -0
  199. package/gsd-core/workflows/quick-batch/steps/resume-mode.md +49 -0
  200. package/gsd-core/workflows/quick-batch/steps/verification-wave.md +73 -0
  201. package/gsd-core/workflows/quick-batch/steps/worktree-dispatch.md +169 -0
  202. package/gsd-core/workflows/quick-batch.md +203 -0
  203. package/gsd-core/workflows/quick.md +13 -3
  204. package/gsd-core/workflows/reapply-patches.md +2 -0
  205. package/gsd-core/workflows/remove-phase.md +2 -0
  206. package/gsd-core/workflows/remove-workspace.md +1 -1
  207. package/gsd-core/workflows/resume-project.md +6 -2
  208. package/gsd-core/workflows/review.md +215 -10
  209. package/gsd-core/workflows/scan.md +2 -0
  210. package/gsd-core/workflows/section-manifest.json +12 -0
  211. package/gsd-core/workflows/secure-phase.md +1 -1
  212. package/gsd-core/workflows/session-report.md +2 -0
  213. package/gsd-core/workflows/settings-advanced.md +2 -0
  214. package/gsd-core/workflows/settings-integrations.md +9 -8
  215. package/gsd-core/workflows/settings.md +1 -1
  216. package/gsd-core/workflows/ship.md +10 -10
  217. package/gsd-core/workflows/sketch-wrap-up.md +2 -0
  218. package/gsd-core/workflows/sketch.md +1 -1
  219. package/gsd-core/workflows/smart-entry.md +1 -1
  220. package/gsd-core/workflows/spec-phase.md +24 -19
  221. package/gsd-core/workflows/spike-wrap-up.md +2 -0
  222. package/gsd-core/workflows/spike.md +1 -1
  223. package/gsd-core/workflows/stats.md +2 -0
  224. package/gsd-core/workflows/sync-skills.md +12 -4
  225. package/gsd-core/workflows/thread.md +2 -0
  226. package/gsd-core/workflows/transition.md +2 -0
  227. package/gsd-core/workflows/ui-phase.md +26 -5
  228. package/gsd-core/workflows/ui-review.md +1 -1
  229. package/gsd-core/workflows/ultraplan-phase.md +2 -0
  230. package/gsd-core/workflows/undo.md +1 -1
  231. package/gsd-core/workflows/update.md +41 -38
  232. package/gsd-core/workflows/validate-phase.md +1 -1
  233. package/gsd-core/workflows/verify-work.md +49 -3
  234. package/hooks/dist/gsd-check-update-worker.js +19 -2
  235. package/hooks/dist/gsd-context-monitor.js +283 -12
  236. package/hooks/dist/gsd-node-runner.sh +1 -0
  237. package/hooks/dist/gsd-prompt-guard.js +30 -5
  238. package/hooks/dist/gsd-read-guard.js +2 -0
  239. package/hooks/dist/gsd-read-injection-scanner.js +5 -5
  240. package/hooks/dist/gsd-secret-read-guard.js +1079 -0
  241. package/hooks/dist/gsd-statusline.js +7 -3
  242. package/hooks/dist/gsd-validate-commit.sh +444 -7
  243. package/hooks/dist/gsd-workflow-guard.js +2 -1
  244. package/hooks/dist/lib/git-cmd.js +210 -1
  245. package/hooks/dist/lib/injection-patterns.js +36 -6
  246. package/hooks/dist/managed-hooks-registry.cjs +1 -0
  247. package/hooks/gsd-check-update-worker.js +19 -2
  248. package/hooks/gsd-context-monitor.js +283 -12
  249. package/hooks/gsd-node-runner.sh +1 -0
  250. package/hooks/gsd-prompt-guard.js +30 -5
  251. package/hooks/gsd-read-guard.js +2 -0
  252. package/hooks/gsd-read-injection-scanner.js +5 -5
  253. package/hooks/gsd-secret-read-guard.js +1079 -0
  254. package/hooks/gsd-statusline.js +7 -3
  255. package/hooks/gsd-validate-commit.sh +444 -7
  256. package/hooks/gsd-workflow-guard.js +2 -1
  257. package/hooks/hooks.json +6 -0
  258. package/hooks/lib/git-cmd.js +210 -1
  259. package/hooks/lib/injection-patterns.js +36 -6
  260. package/hooks/managed-hooks-registry.cjs +1 -0
  261. package/package.json +5 -5
  262. package/scripts/build-hooks.js +11 -4
  263. package/scripts/ci-test-scope.cjs +7 -0
  264. package/scripts/docs-guard-registry.cjs +10 -0
  265. package/scripts/gen-loop-host-contract.cjs +67 -15
  266. package/scripts/lib/shellcheck-fetch.cjs +247 -0
  267. package/scripts/lint-allow-test-rule-refs.allowlist.json +0 -6
  268. package/scripts/lint-allow-test-rule-refs.effective-ceiling.json +1 -1
  269. package/scripts/lint-allow-test-rule-refs.unverified-ceiling.json +1 -1
  270. package/scripts/lint-docs-guard-registration.exempt-baseline.cjs +5 -0
  271. package/scripts/lint-phase-enumeration-drift.cjs +24 -6
  272. package/scripts/lint-phase-id-drift.cjs +133 -8
  273. package/scripts/lint-portable-grep.cjs +176 -0
  274. package/scripts/lint-response-language-coverage.cjs +524 -0
  275. package/scripts/lint-test-file-count.allowlist.json +3 -1
  276. package/scripts/lint-workflow-shellcheck-baseline.json +1027 -0
  277. package/scripts/lint-workflow-shellcheck.cjs +614 -0
  278. package/scripts/npm-audit-baseline.cjs +376 -0
  279. package/scripts/prompt-injection-scan.sh +8 -0
  280. package/scripts/require-issue-link-policy.cjs +16 -1
  281. package/skills/gsd-execute-phase/SKILL.md +1 -1
  282. package/skills/gsd-ns-workflow/SKILL.md +1 -0
  283. package/skills/gsd-phase/SKILL.md +1 -1
  284. package/skills/gsd-quick-batch/SKILL.md +105 -0
  285. package/skills/gsd-surface/SKILL.md +18 -8
  286. package/vscode/package.json +1 -1
@@ -21,12 +21,43 @@ issues:
21
21
  - plan: "16-01"
22
22
  dimension: "task_completeness"
23
23
  severity: "blocker"
24
+ required_property: "Every `auto` task has a `<verify>` separating pass from fail"
24
25
  description: "Task 2 missing <verify> element"
25
26
  fix_hint: "Add verification command for build output"
26
27
  ```
27
28
 
28
29
  Group by plan, dimension, severity.
29
30
 
31
+ **What binds and what does not.** `required_property` (the invariant that must hold),
32
+ `description` (the evidence it does not) and `severity` are binding. `fix_hint` is **one
33
+ example** of a route to that property — an illustration, never an instruction. You address an
34
+ issue by making `required_property` true; the hint's own mechanism is optional.
35
+
36
+ An older checker may return an issue with no `required_property`. Derive it from `dimension`
37
+ + `description` and state the derived property in your revision summary. Never treat the
38
+ absence of the field as licence to apply `fix_hint` literally.
39
+
40
+ **Prefer the smallest sufficient mechanism.** If a smaller change than the hint makes
41
+ `required_property` true, take it — that fully addresses the issue and must be reported as
42
+ addressed, naming the property satisfied and the mechanism used.
43
+
44
+ ### Step 2.5: Constraint Re-check (before any edit)
45
+
46
+ Before editing, re-read the constraints already in force:
47
+
48
+ - Locked decisions in CONTEXT.md (`## Decisions`) and deferred ideas (`## Deferred Ideas`)
49
+ - Active capability / project guidance (CLAUDE.md, `.claude/skills/`, `.agents/skills/`)
50
+ - Constraints the existing plans already encode (chosen mechanism, scope boundary, must_haves)
51
+
52
+ A `fix_hint` conflicts when applying it would contradict any of those. Applying it anyway is
53
+ a contract violation, not a judgement call. When a hint conflicts — or when the property is
54
+ unreachable without breaking a constraint — do NOT edit around it and do NOT burn a revision
55
+ iteration on it: emit `## REVISION_CONFLICT` (Step 7) for that issue, apply every
56
+ non-conflicting issue normally, and return.
57
+
58
+ A hint that merely proposes a *bigger* mechanism than needed is not a conflict. Take the
59
+ smaller route under Step 2 and report it as addressed.
60
+
30
61
  ### Step 3: Revision Strategy
31
62
 
32
63
  | Dimension | Strategy |
@@ -38,15 +69,25 @@ Group by plan, dimension, severity.
38
69
  | scope_sanity | Split into multiple plans |
39
70
  | must_haves_derivation | Derive and add must_haves to frontmatter |
40
71
 
72
+ Each strategy is the usual route, not the only one. Any change that makes the issue's
73
+ `required_property` true is a valid strategy.
74
+
41
75
  ### Step 4: Make Targeted Updates
42
76
 
43
77
  **DO:** Edit specific flagged sections, preserve working parts, update waves if dependencies change.
78
+ Choose the smallest mechanism that makes each issue's `required_property` true — explicitly
79
+ including a mechanism smaller than, or different from, the one its `fix_hint` names.
44
80
 
45
- **DO NOT:** Rewrite entire plans for minor issues, add unnecessary tasks, break existing working plans.
81
+ **DO NOT:** Rewrite entire plans for minor issues, add unnecessary tasks, break existing working
82
+ plans, or apply a `fix_hint` that contradicts a constraint from Step 2.5 — that one goes to
83
+ `## REVISION_CONFLICT` instead.
46
84
 
47
85
  ### Step 5: Validate Changes
48
86
 
49
- - [ ] All flagged issues addressed
87
+ - [ ] Every flagged issue's `required_property` now holds — reached by its `fix_hint` OR by a
88
+ smaller/different mechanism (both count as addressed), OR raised as `## REVISION_CONFLICT`
89
+ - [ ] No `fix_hint` applied that contradicts a locked decision, capability guidance, or an
90
+ existing plan constraint (Step 2.5)
50
91
  - [ ] No new issues introduced
51
92
  - [ ] Wave numbers still valid
52
93
  - [ ] Dependencies still correct
@@ -85,3 +126,35 @@ gsd_run query commit "fix($PHASE): revise plans based on checker feedback" --fil
85
126
  |-------|--------|
86
127
  | {issue} | {why - needs user input, architectural change, etc.} |
87
128
  ```
129
+
130
+ ### Step 7b: Return Revision Conflict (when Step 2.5 found one)
131
+
132
+ Emit this INSTEAD OF `## REVISION COMPLETE` when at least one issue could not be addressed
133
+ without contradicting a constraint. Non-conflicting issues you already fixed stay listed under
134
+ `### Changes Made` so the work is not lost. The orchestrator routes this to the user or to the
135
+ configured plan-review convergence loop; it does not count as a failed revision iteration.
136
+
137
+ ```markdown
138
+ ## REVISION_CONFLICT
139
+
140
+ **Conflicts:** {N} | **Issues addressed anyway:** {M}
141
+
142
+ | Issue | required_property | Conflicts with | Why the hint cannot be applied |
143
+ |-------|-------------------|----------------|-------------------------------|
144
+ | {dimension}/{plan} | {property} | {locked decision D-nn / CLAUDE.md rule / plan constraint} | {one line} |
145
+
146
+ ### Alternatives Considered
147
+
148
+ | Issue | Alternative | Satisfies required_property? | Cost of adopting |
149
+ |-------|-------------|------------------------------|------------------|
150
+ | {dimension}/{plan} | {smaller or different mechanism} | {yes / partially — how} | {what it changes} |
151
+
152
+ ### Changes Made
153
+
154
+ {table of the non-conflicting issues you DID address, same shape as REVISION COMPLETE}
155
+ ```
156
+
157
+ **Every field is one line of plain text.** No newlines inside a cell, and never begin a field with
158
+ `#`, `-`, `|` or a code fence. These fields are appended to a shared markdown file that a later
159
+ reader scans by heading; a field that starts a heading truncates that scan and hides conflicts
160
+ below it.
@@ -299,7 +299,7 @@ Set via `workflow.*` namespace in config.json (e.g., `"workflow": { "research":
299
299
  | `workflow.build_command` | string\|null | `null` | Any shell command | Build gate command run by the post-merge gate. Unset → build step auto-detected/skipped. |
300
300
  | `workflow.mvp_mode` | boolean | `false` | `true`, `false` | Persist the MVP-mode flag in config so every phase defaults to MVP framing without requiring `--mvp` on the CLI. Resolved via the chain: `--mvp` CLI flag → ROADMAP.md `**Mode:** mvp` field → this config value → `false`. When `true`, the planner, executor, verifier, and discovery surfaces (progress, stats, graphify) all treat the phase as an MVP vertical slice (UI → API → DB) of one user-visible capability. |
301
301
  | `workflow.context_guard_mode` | string | `"warn"` | `"auto"`, `"warn"`, `"off"` | Context exhaustion guard mode for `execute-phase`. Before each wave, the orchestrator self-assesses context pressure using degradation signals from `context-budget.md`. `"warn"` (default): emit a warning and recommend `/gsd:pause-work` when POOR tier is detected. `"auto"`: automatically invoke `/gsd:pause-work` before the next wave when POOR tier is detected. `"off"`: disable the guard. The guard is heuristic — no programmatic context-% API exists. |
302
- | `workflow.plan_chunked` | boolean | `false` | `true`, `false` | Enable chunked planning mode. When `true`, the plan-phase orchestrator splits the single long-lived planner Task into a short outline Task followed by N short per-plan Tasks (~3–5 min each). Each plan is committed individually for crash resilience. Particularly useful on Windows where long-lived Tasks may hang on stdio. Also activated by the `--chunked` flag. |
302
+ | `workflow.plan_chunked` | boolean | `false` | `true`, `false` | Enable chunked planning mode. When `true`, the plan-phase orchestrator splits the single long-lived planner Task into a short outline Task followed by N short per-plan Tasks (~3–5 min each). Each plan is committed individually for crash resilience. Particularly useful on Windows where long-lived Tasks may hang on stdio. Also activated by the `--chunked` flag. See `planning.chunked_parallel` below for concurrent per-plan dispatch. |
303
303
  | `workflow.specless_probe_fallback` | boolean | `true` | `true`, `false` | Gate the SPEC-less probe fallback in `plan-phase`. When `true` (default), a phase that did not supply a `## Edge Coverage` / `## Prohibitions` SPEC section (header absent or present-but-empty) runs the existing probe protocol — the deterministic `edge-probe.cjs` for edges and an in-planner LLM recall pass for prohibitions — and authors the resulting predicates into PLAN.md `must_haves` (section-level precedence: a SPEC-supplied section is never re-run or overwritten). When `false`, the fallback is skipped but the skip is recorded: plan-phase emits a visible "probe fallback disabled" marker, never a silent skip. |
304
304
  | `workflow.code_review_command` | string\|null | `null` | Any shell command | External code-review command integrated into `/gsd:ship`. The diff is piped to the command via stdin; the command must output JSON with a `verdict` field (`"APPROVED"` or `"REVISE"`). Non-zero exit or `"REVISE"` verdict blocks the ship workflow. When unset, the built-in review flow runs. Example: `my-review-tool --review`. |
305
305
  | `workflow.inline_plan_threshold` | number | `2` | `0`–`10` | Plans with ≤N tasks execute inline instead of spawning a subagent |
@@ -404,6 +404,7 @@ These can be set at top level or nested under `planning.*` (e.g., `"planning": {
404
404
  |-----|------|---------|----------------|-------------|
405
405
  | `planning.commit_docs` | boolean | `true` | `true`, `false` | Alias for top-level `commit_docs` |
406
406
  | `planning.search_gitignored` | boolean | `false` | `true`, `false` | Alias for top-level `search_gitignored` |
407
+ | `planning.chunked_parallel` | boolean | `false` | `true`, `false` | Opt-in for `workflow.plan_chunked`'s per-plan loop (§8.5.2 of `chunked-planning-mode.md`, #3777). When `true`, the runnable per-plan planners within one outline Wave are dispatched concurrently (one message, `run_in_background=true` each) instead of one at a time, honoring the outline's Wave column as the schedule (`Depends On` is expected to name only an earlier Wave and is not separately parsed — batching strictly by Wave already respects it). Gated on the negotiated `dispatch-capacity` query (#3673): a host that declares no `maxConcurrency` (capacity resolves to `1`) stays serial regardless of this setting. Default `false` is byte-identical to the pre-#3777 serial loop. Trade-off: per-plan commits interleave within a batch instead of strictly one-at-a-time, and a stalled plan's retry no longer blocks sibling plans in the same batch from having already committed. |
407
408
 
408
409
  ---
409
410
 
@@ -0,0 +1,9 @@
1
+ # Response-Language Directive (#2529)
2
+
3
+ **If `response_language` is set** (in the init JSON this workflow parses, or in `.planning/config.json`): ALL user-facing output of this workflow MUST be in that language — narration between tool calls, status updates, progress notes, findings, banners, report prose, questions (AskUserQuestion or plain text), and summaries. Technical terms, code, file paths, commands, and identifiers stay in English.
4
+
5
+ Literal English report/banner templates embedded in a workflow are a structural SOURCE, not literal output to copy verbatim — render their prose translated into `{response_language}` while keeping headings' structural markers, table columns, IDs, commands, and file paths unchanged. Exception: blocks a workflow explicitly requires to be emitted byte-for-byte (e.g. pre-rendered checkpoints) are output exactly as rendered.
6
+
7
+ Pass `response_language: {value}` into every spawned subagent prompt so any user-facing output they produce stays in the configured language.
8
+
9
+ Workflows take this contract in one of three forms (REQ-LANG-03): an `@`-reference to this file; their own inline directive naming the same narration class; or, for a fragment loaded by a covered parent, inheritance from that parent. Coverage is enforced by `scripts/lint-response-language-coverage.cjs` — a new workflow cannot ship without one of the three, and the lint checks this file's own wording too, so a weakened directive here uncovers every workflow that imports it rather than passing silently. Workflow-specific directives (e.g. `execute-phase-response-language.md`) take precedence where present.
@@ -16,6 +16,8 @@ This pattern applies whenever:
16
16
  ```
17
17
  prev_issue_count = Infinity
18
18
  iteration = 0
19
+ previous_conflict_property = null
20
+ conflict_return_count = 0
19
21
 
20
22
  LOOP:
21
23
  1. Run checker/validator on current output
@@ -23,15 +25,30 @@ LOOP:
23
25
  3. If PASSED or only INFO-level issues:
24
26
  -> Accept output, exit loop
25
27
  4. If BLOCKER or WARNING issues found:
26
- a. iteration += 1
27
- b. If iteration > 3:
28
+ a. If iteration + 1 > 3:
28
29
  -> Escalate to user (see "After 3 Iterations" below)
29
- c. Parse issue count from checker output
30
- d. If issue_count >= prev_issue_count:
30
+ b. Parse issue count from checker output
31
+ c. If issue_count >= prev_issue_count:
31
32
  -> Escalate to user: "Revision loop stalled (issue count not decreasing)"
32
- e. prev_issue_count = issue_count
33
- f. Re-spawn the producing agent with checker feedback appended
34
- g. After revision completes, go to LOOP
33
+ d. prev_issue_count = issue_count
34
+ e. Re-spawn the producing agent with checker feedback appended
35
+ f. If the agent returns REVISION_CONFLICT:
36
+ -> conflict_return_count += 1
37
+ -> If conflict_return_count >= 3:
38
+ escalate through the iteration-cap gate
39
+ -> If it names the same required_property as the previous conflict:
40
+ escalate as a stall (the resolution did not take)
41
+ Else: previous_conflict_property = current required_property
42
+ resolve it (see "Conflict Return" below) and go to step e.
43
+ Do NOT increment iteration -- the conflict was not a failed attempt.
44
+ Else: previous_conflict_property = null (a normal revision ends the conflict chain --
45
+ a LATER, unrelated conflict on the same property must not be misread as a repeat)
46
+ g. iteration += 1
47
+ h. After revision completes, go to LOOP
48
+
49
+ The increment is step g, AFTER the producing agent returns. An iteration counted at step a is
50
+ already spent by the time a REVISION_CONFLICT comes back, so it cannot then be withheld, and the
51
+ cap would punish the agent for correctly refusing to apply incompatible advice.
35
52
  ```
36
53
 
37
54
  ### Issue Count Tracking
@@ -45,19 +62,38 @@ Display iteration progress before each revision spawn:
45
62
 
46
63
  When re-spawning the producing agent for revision, pass the checker's YAML-formatted issues. The checker's output contains a `## Issues` heading followed by a YAML block. Parse this block and pass it verbatim to the revision agent.
47
64
 
65
+ The field names are the plan-checker's schema (`agents/gsd-plan-checker.md` → `<issue_structure>`):
66
+ `plan`, `dimension`, `severity`, `required_property`, `description`, `task`, `fix_hint`. There is no
67
+ `suggested_fix` field and no `finding` or `affected_field` field — those names were drift, and every
68
+ producer now emits the schema above.
69
+
48
70
  ```
49
71
  <checker_issues>
50
- The issues below are in YAML format. Each has: dimension, severity, finding,
51
- affected_field, suggested_fix. Address ALL BLOCKER issues. Address WARNING
52
- issues where feasible.
72
+ The issues below are in YAML format. Each has: dimension, severity,
73
+ required_property, description, fix_hint.
74
+
75
+ BINDING: required_property (the invariant that must hold), description (the
76
+ evidence it does not), severity. NON-BINDING: fix_hint -- ONE example route to
77
+ the property, never an instruction.
78
+
79
+ Satisfy the required_property of ALL BLOCKER issues. Satisfy WARNING issues
80
+ where feasible.
53
81
 
54
82
  {YAML issues block from checker output -- passed verbatim}
55
83
  </checker_issues>
56
84
 
57
85
  <revision_instructions>
58
86
  Address ALL BLOCKER and WARNING issues identified above.
59
- - For each BLOCKER: make the required change
87
+ - For each BLOCKER: make required_property true. Its fix_hint is one example
88
+ route; a smaller or different mechanism that makes the same property true
89
+ addresses the issue in full -- report which mechanism you used.
60
90
  - For each WARNING: address or explain why it's acceptable
91
+ - Before editing, re-check locked decisions, active capability guidance, and
92
+ constraints the existing output already encodes. If a fix_hint would
93
+ contradict one of those, or the property is unreachable without breaking one,
94
+ do NOT apply it and do NOT work around it: return REVISION_CONFLICT naming
95
+ the conflict and the alternatives considered, having addressed every
96
+ non-conflicting issue.
61
97
  - Do NOT introduce new issues while fixing existing ones
62
98
  - Preserve all content not flagged by the checker
63
99
  This is revision iteration {N} of max 3. Previous iteration had {prev_count}
@@ -65,6 +101,75 @@ issues. You must reduce the count or the loop will terminate.
65
101
  </revision_instructions>
66
102
  ```
67
103
 
104
+ ### Conflict Return (REVISION_CONFLICT)
105
+
106
+ A revision agent that returns `REVISION_CONFLICT` has not failed and has not stalled. Handle it
107
+ BEFORE the iteration counter and the stall check — a conflict is not resolvable by re-running the
108
+ same loop, so spending retry budget on it only exhausts the cap:
109
+
110
+ **This protocol is shared.** Every revision-bearing workflow follows it — `plan-phase`, `quick`,
111
+ `ui-phase`, and `verify-work`'s gap-plan loop. `plan-phase` @-imports this reference and states
112
+ only its own bindings (counter name, artifact path, next step). The other three do not import it,
113
+ so they restate the operative rules inline; this section is the authority they must agree with.
114
+
115
+ 1. **Do not spend budget.** Do NOT increment the iteration counter and do NOT update
116
+ `prev_issue_count`. Do NOT re-spawn the checker yet — the conflict is not a revised output.
117
+ 2. **Record**, where the host has a channel an arbitration loop reads. `review.md` emits one
118
+ fixed writer-owned slot immediately after the artifact title, between
119
+ `<!-- gsd:plan-revision-conflicts:begin -->` and
120
+ `<!-- gsd:plan-revision-conflicts:end -->`. When `workflow.plan_review_convergence` is enabled
121
+ and the phase `*-REVIEWS.md` already exists, `plan-phase` appends one line per conflict under
122
+ `## Plan-Revision Conflicts` inside that slot:
123
+
124
+ ```markdown
125
+ - [ ] REVISION_CONFLICT {dimension}/{plan} — required_property: {property} | conflicts with: {locked decision D-nn / CLAUDE.md rule / plan constraint} | alternatives: {the agent's alternatives}
126
+ ```
127
+
128
+ A checkbox, not a table row: `- [ ] REVISION_CONFLICT` is open and `- [x] REVISION_CONFLICT`
129
+ is resolved. The reader counts matching open lines only inside the first fixed slot after the
130
+ artifact title; an identical marker in reviewer output is not state. An open line in the owned
131
+ slot blocks convergence even if this run is abandoned.
132
+ A workflow with no such channel (`quick` has no phase and no REVIEWS.md) skips this step.
133
+
134
+ Before appending, reuse the existing open line instead of appending a duplicate when its
135
+ sanitized fields identify the same conflict. This makes persisted conflict state idempotent.
136
+
137
+ **Sanitize before writing — the conflict text is agent-authored.** Every field comes from the
138
+ producing agent. Before appending, for EACH field: collapse every newline and tab to a single
139
+ space, and strip any leading `#`, `-`, `|` or backtick-fence run. Otherwise an embedded
140
+ newline can forge an extra conflict-shaped record inside the owned slot. One conflict is exactly
141
+ one line beginning `- [ ]`. Never append agent text verbatim, and never append a fenced block.
142
+ 3. **Resolve** — present the conflict and its alternatives to the user and ask which to take
143
+ (pattern: `gsd-core/references/gate-prompts.md`): adopt a named alternative / override the
144
+ named constraint and apply the hint / amend the constraint itself. Each option resolves the
145
+ conflict. Accepting the output with the blocker still open is NOT offered here — the blocking
146
+ `required_property` still fails, and that choice belongs to the cap escalation.
147
+ 4. **Close** — the workflow that wrote the line owns flipping it to `- [x]` once the resolution
148
+ has been applied, appending ` | resolved: {chosen resolution}`. Readers only read. A line left
149
+ open is a live blocker, never a stale artifact.
150
+ 5. **Re-spawn** with the chosen resolution, then re-evaluate the return from the top of this
151
+ handler — never fall through to the checker spawn. A second conflict is still a conflict, not
152
+ a revised output, and handing it to the checker would check the conflict message.
153
+
154
+ **Bounded — two ways, because one is evadable.** Not incrementing must not make this path
155
+ unbounded:
156
+
157
+ - **Repeat.** A conflict naming the SAME `required_property` twice in a row means the chosen
158
+ resolution did not take. Stop re-spawning; escalate as a stall.
159
+ - **Total.** Count every conflict return in this revision loop, whatever property each names. On
160
+ the THIRD, stop and escalate — an agent that alternates property names never trips the repeat
161
+ rule, so the repeat rule alone leaves the loop unbounded. This total is what actually bounds the
162
+ path; the repeat rule just catches the common case sooner.
163
+
164
+ Both escalate through the same gate the iteration cap uses. A conflict still never consumes a
165
+ revision iteration — the cap on conflicts is separate from, and additional to, the cap on
166
+ revisions.
167
+
168
+ **No workflow hands a conflict to a loop and returns.** Asking the user is the route everywhere;
169
+ recording is in addition to asking, never instead of it. `plan-phase` in particular never invokes
170
+ `/gsd:plan-review-convergence` — it runs *inside* that loop, so invoking it would be a cycle, and
171
+ "was I invoked by convergence?" is not a question the orchestrator can answer at runtime.
172
+
68
173
  ### After 3 Iterations
69
174
 
70
175
  If issues persist after 3 revision cycles:
@@ -95,3 +200,5 @@ If issues persist after 3 revision cycles:
95
200
  - **Each iteration gets a fresh agent spawn** -- don't try to continue in the same context
96
201
  - **Checker feedback must be inlined** -- the revision agent needs to see exactly what failed
97
202
  - **Don't silently swallow issues** -- always present the final state to the user after exiting the loop
203
+ - **A remediation hint is an example, not an order** -- an issue satisfied through a smaller valid
204
+ mechanism is addressed, and counts as resolved for the issue-count and stall checks
@@ -94,9 +94,10 @@ After completion, create SUMMARY.md with:
94
94
  **RED - Write failing test:**
95
95
  1. Create test file following project conventions
96
96
  2. Write test describing expected behavior (from `<behavior>` element)
97
- 3. Run test - it MUST fail
98
- 4. If test passes: feature exists or test is wrong. Investigate.
99
- 5. Commit: `test({phase}-{plan}): add failing test for [feature]`
97
+ 3. Run test - it MUST fail **intentionally** (#3770): the TARGET test you named must be the test that fails, on an assertion for the planned behavior. A nonzero exit alone is NOT RED — syntax errors, zero-test discovery, fixture crashes, parser errors, and unrelated assertions are INVALID_RED and must not authorize GREEN.
98
+ 4. Persist the RED evidence record (command, exit code, failing test, expected result, actual result) and verify it: `gsd_run check tdd-red-evidence <record.json>`. Only verdict `RED_EVIDENCE_OK` satisfies the RED gate; `INVALID_RED` blocks GREEN until the RED phase is fixed.
99
+ 5. If test passes: feature exists or test is wrong. Investigate.
100
+ 6. Commit: `test({phase}-{plan}): add failing test for [feature]`
100
101
 
101
102
  **GREEN - Implement to pass:**
102
103
  1. Write minimal code to make test pass
@@ -256,26 +257,30 @@ When `workflow.tdd_mode` is enabled in config, the RED/GREEN/REFACTOR gate seque
256
257
 
257
258
  | Gate | Required | Commit Pattern | Validation |
258
259
  |------|----------|---------------|------------|
259
- | RED | Yes | `test({phase}-{plan}): ...` | Test exists AND fails before implementation |
260
+ | RED | Yes | `test({phase}-{plan}): ...` | Test exists AND fails before implementation — intentionally: `check tdd-red-evidence` returns `RED_EVIDENCE_OK` (target test failed on an assertion for the behavior; anything else is INVALID_RED) |
260
261
  | GREEN | Yes | `feat({phase}-{plan}): ...` | Test passes after implementation |
261
262
  | REFACTOR | No | `refactor({phase}-{plan}): ...` | Tests still pass after cleanup |
262
263
 
263
264
  ### Fail-Fast Rules
264
265
 
265
266
  1. **Unexpected GREEN in RED phase:** If the test passes before any implementation code is written, STOP. The feature may already exist or the test is wrong. Investigate before proceeding.
266
- 2. **Missing RED commit:** If no `test(...)` commit precedes the `feat(...)` commit, the TDD discipline was violated. Flag in SUMMARY.md.
267
- 3. **REFACTOR breaks tests:** Undo the refactor immediately. Commit was premature — refactor in smaller steps.
267
+ 2. **INVALID_RED in RED phase (#3770):** A nonzero exit is not RED by itself. Zero-test discovery, fixture/load crashes, nonzero exits with no failing test, unrelated failing tests, and unexpected greens all classify as INVALID_RED (`gsd_run check tdd-red-evidence`). STOP and fix the RED phase — do NOT proceed to GREEN.
268
+ 3. **Missing RED commit:** If no `test(...)` commit precedes the `feat(...)` commit, the TDD discipline was violated. Flag in SUMMARY.md.
269
+ 4. **REFACTOR breaks tests:** Undo the refactor immediately. Commit was premature — refactor in smaller steps.
268
270
 
269
271
  ### Executor Gate Validation
270
272
 
271
273
  After completing a `type: tdd` plan, the executor validates the git log:
272
274
  ```bash
275
+ # The commit protocol promises no zero-padding for ${PHASE}/${PLAN} — strip both and
276
+ # match the commit-scope position anchored (#4003).
277
+ PHASE_N=$((10#${PHASE})); PLAN_N=$((10#${PLAN}))
273
278
  # Check for RED gate commit
274
- git log --oneline --grep="^test(${PHASE}-${PLAN})" | head -1
279
+ git log --oneline -E --grep="^test\((0*${PHASE_N})-(0*${PLAN_N})\):" | head -1
275
280
  # Check for GREEN gate commit
276
- git log --oneline --grep="^feat(${PHASE}-${PLAN})" | head -1
281
+ git log --oneline -E --grep="^feat\((0*${PHASE_N})-(0*${PLAN_N})\):" | head -1
277
282
  # Check for optional REFACTOR gate commit
278
- git log --oneline --grep="^refactor(${PHASE}-${PLAN})" | head -1
283
+ git log --oneline -E --grep="^refactor\((0*${PHASE_N})-(0*${PLAN_N})\):" | head -1
279
284
  ```
280
285
 
281
286
  If RED or GREEN gate commits are missing, add a `## TDD Gate Compliance` section to SUMMARY.md with the violation details.
@@ -0,0 +1,160 @@
1
+ # Convergence Evidence Gate (#3304)
2
+
3
+ Bounds Step 7's anti-pattern scan so an approved gap-closure contract can
4
+ actually close. Applies **only** when `is_re_verification = true` (Step 0) —
5
+ a first pass has no prior contract to be out-of-contract from, so this gate
6
+ is a pure no-op there.
7
+
8
+ ## The problem this closes
9
+
10
+ Steps 4-7c re-verify at full, unbounded scope on every re-verification pass —
11
+ that is documented, intended design, not the bug. The bug is narrower: Step
12
+ 7's `Categorize:` line lets the verifier's own free-form judgment label
13
+ *anything* it believes "prevents goal" a 🛑 Blocker, and Step 9 Rule 1
14
+ promotes any 🛑 Blocker straight into `status: gaps_found` — with no
15
+ distinction between a blocker tied to what the gap-closure round was actually
16
+ supposed to fix and a blocker that is simply a new opinion formed on this
17
+ pass. Reported real-world instance: a re-verification cycle promoted four
18
+ "architectural and security observations" to blockers, none backed by a
19
+ failing test, none traceable to a requirement/decision/prior gap, reverting a
20
+ completed, all-green gap-closure round and recommending another `--gaps`
21
+ cycle — with no bound on how many times that could repeat.
22
+
23
+ Truths, artifacts, and key links (Steps 3-6) can **never** produce this
24
+ failure mode: Step 0 re-verification mode reuses the must-haves extracted in
25
+ Step 2 verbatim ("Skip to Step 3") rather than re-establishing them, so
26
+ whatever a truth/artifact/link *is* was fixed before this re-verification
27
+ round started. Only Step 7's blanket per-file scan is unbounded by that
28
+ must-haves contract — which is exactly the mechanism the issue's diagnosis
29
+ names. This gate therefore touches Step 7 only.
30
+
31
+ ## Definitions
32
+
33
+ **Self-evidencing blocker (unaffected by this gate).** The debt-marker gate
34
+ (`TBD`/`FIXME`/`XXX` with no `issue #123`/`PR #123`/`#123`/`DEF-*` reference
35
+ on the same line) is the *only* Step 7 category with zero judgment
36
+ component — a regex match plus the absence of a follow-up reference, nothing
37
+ inferred. Its own textual presence in the file is the deterministic evidence.
38
+ It keeps blocking unconditionally, exactly as before. Do **not** extend this
39
+ carve-out to any other Step 7 category (stub classification, hollow props,
40
+ empty implementations, console-log-only): every one of those already
41
+ requires judgment per Step 7's own "Stub classification" paragraph ("a grep
42
+ match is a STUB only when the value flows to rendering... and no other code
43
+ path populates it with real data") — that judgment is exactly what this gate
44
+ exists to check.
45
+
46
+ **New-scope finding.** Any Step 7 🛑 Blocker other than a self-evidencing one
47
+ (above) is a new-scope finding **unless** either of the following holds, in
48
+ which case it is in-contract and blocks unconditionally, evidence or not:
49
+
50
+ 1. **Carried-forward gap** — it matches an item in the previous
51
+ VERIFICATION.md's `gaps:` list, using the same 80%-token-overlap matching
52
+ algorithm Step 3b already uses for override matching (normalize to
53
+ lowercase, strip punctuation, collapse whitespace, tokenize, intersect).
54
+ 2. **Regression** — the flagged file was modified since the previous
55
+ VERIFICATION.md's `verified:` timestamp. Check file-level, not
56
+ line-level — an LLM agent re-deriving precise line provenance mid-pass is
57
+ unreliable; file-level modification is a single, robust command:
58
+
59
+ ```bash
60
+ git log --since="$PREV_VERIFIED_TS" --oneline -- "$file"
61
+ ```
62
+
63
+ A non-empty result means the file changed since the prior pass — the
64
+ gap-closure round could plausibly have introduced this finding, so it's
65
+ self-evidencing as a regression and blocks. **Fail closed**: if git
66
+ history is unavailable, ambiguous, or the timestamp can't be parsed,
67
+ treat the file as modified (blocks). The imprecision this trades away
68
+ (a big file with one unrelated hunk touched treats every pattern in it as
69
+ "new") only ever makes *more* things block, never fewer — consistent with
70
+ `<adversarial_stance>`.
71
+
72
+ A finding that is neither a carried-forward gap nor on a file modified since
73
+ the prior pass predates the gap-closure round entirely and was never flagged
74
+ as a gap then — this is the literal "some findings predated the gap
75
+ implementation and had previously been explicitly treated as non-blocking"
76
+ case from the issue.
77
+
78
+ **Deterministic evidence** — required for a new-scope finding to stay
79
+ blocking. One of:
80
+
81
+ - A **named test that FAILS when actually run** (red). Run exactly one test,
82
+ the same discipline Step 7b already uses for behavioral spot-checks —
83
+ never the full suite. Record the exact command and the failing output.
84
+ - **Another concrete, reproducible artifact** — a command + output that
85
+ demonstrates the defect (a crash, a probe failure, a reproducible bad
86
+ response). An assertion, opinion, or architectural preference with no test
87
+ and no reproducible command output is not evidence, however well-reasoned.
88
+
89
+ ## The gate
90
+
91
+ - New-scope finding **with** deterministic evidence → 🛑 Blocker, unchanged.
92
+ This includes evidenced security findings — they are preserved and still
93
+ block.
94
+ - New-scope finding **without** deterministic evidence → downgrade out of
95
+ the blocker set. Record it in the `advisory:` frontmatter list (parallel to
96
+ the existing Step 9b `deferred:` list) with its reasoning intact. It does
97
+ **not** count toward Step 9 Rule 1's `gaps_found` trigger and does **not**
98
+ revert a completed must-have or, on its own, justify another
99
+ `/gsd:plan-phase --gaps` cycle.
100
+
101
+ This changes nothing else: a carried-forward gap or a regression still
102
+ blocks with or without a pre-existing requirement to point at, and every
103
+ non-Step-7 trigger (FAILED truth, MISSING/STUB artifact, NOT_WIRED link) is
104
+ untouched, since those can never be new-scope in the first place.
105
+
106
+ ## What this deliberately does NOT implement
107
+
108
+ The issue as filed proposed a broader rule: a finding is advisory whenever
109
+ it is untraceable to a requirement/decision/prior-gap (conditions A and B),
110
+ regardless of evidence. The maintainer approved **condition C only** —
111
+ evidence, not contract-traceability, is the bar. A finding with no
112
+ pre-existing requirement to point at but with a real failing test still
113
+ blocks. Do not implement A/B: that would demote a genuine, reproducible
114
+ defect to advisory purely for being newly discovered, which is exactly the
115
+ deferral this project's no-defer rule forbids. This gate narrows *when a
116
+ blocker needs proof*, not *what counts as in scope*.
117
+
118
+ ## Advisory frontmatter
119
+
120
+ ```yaml
121
+ advisory: # Only if new-scope findings lack deterministic evidence (Step 7)
122
+ - finding: "Short description of the new-scope concern"
123
+ category: architectural | security | other
124
+ reason: "Why this was raised; what would resolve it"
125
+ evidence_status: "none provided" # or cite what was attempted but inconclusive
126
+ ```
127
+
128
+ ## Report section
129
+
130
+ ```markdown
131
+ ### Advisory (New Scope, Unevidenced)
132
+
133
+ New-scope findings from Step 7 with no deterministic evidence — reported,
134
+ not blocking, do not revert a completed must-have.
135
+
136
+ | # | Finding | Category | Why Advisory |
137
+ |---|---------|----------|--------------|
138
+ | 1 | {finding} | {category} | new-scope, no deterministic evidence |
139
+ ```
140
+
141
+ Include this section (even if empty, stating "None") whenever
142
+ `is_re_verification = true` ran — an omitted section reads as "not
143
+ checked," not "checked and clean."
144
+
145
+ ## Worked example (from the issue's reported incident)
146
+
147
+ Prior pass: `gaps_found`, 4 items — all closed by approved gap-closure plans,
148
+ re-verification begins.
149
+
150
+ - Finding: "the retry loop's backoff strategy is architecturally fragile
151
+ under sustained load." Not in the prior `gaps:` list. The flagged file was
152
+ last modified 3 weeks before this verification pass (before the
153
+ gap-closure plans even started) — not a regression. No test run, no
154
+ reproducible command demonstrating a failure. → **advisory**, does not
155
+ block, does not revert the 4 closed gaps.
156
+ - Finding: `TBD: handle the timeout case` left in a file the gap-closure plan
157
+ edited this pass. → self-evidencing debt marker, unaffected by this gate,
158
+ blocks exactly as it always has.
159
+ - Finding: a previously-closed gap's file now fails the SAME named test that
160
+ originally proved it broken. → carried-forward gap, blocks.
@@ -22,6 +22,10 @@ files_modified: [] # Files this plan modifies.
22
22
  files_deleted: [] # OPTIONAL. Files this plan REMOVES. Declaring a path here is what
23
23
  # lets worktree cleanup-wave merge the branch that deletes it; an
24
24
  # undeclared deletion still blocks. Exact paths, not globs or dirs.
25
+ coupling_justified: [] # OPTIONAL. Deliberate, order-independent same-wave couplings: one
26
+ # "plan-id: reason" string per coupled peer, e.g.
27
+ # ["03-02: both append independent config keys"]. Exempts the pair
28
+ # from the plan-checker's Dimension 3b advisory (#3724).
25
29
  autonomous: true # false if plan has checkpoints requiring user interaction
26
30
  requirements: [] # REQUIRED — Requirement IDs from ROADMAP this plan addresses. MUST NOT be empty.
27
31
  user_setup: [] # Human-required setup Claude cannot automate (see below)
@@ -12,6 +12,11 @@ phase: XX-name
12
12
  verified: YYYY-MM-DDTHH:MM:SSZ
13
13
  status: passed | gaps_found | human_needed
14
14
  score: N/M must-haves verified
15
+ covered_files: # #4155 — see agents/gsd-verifier.md's "Create VERIFICATION.md" step for what belongs here and how to compute it
16
+ - .planning/phases/XX-name/{phase_num}-{plan}-PLAN.md
17
+ - .planning/phases/XX-name/{phase_num}-{plan}-SUMMARY.md
18
+ - src/{changed-file}.cts
19
+ covered_digest: "v1:sha256:{digest from verification.fingerprint}"
15
20
  behavior_unverified: 0 # Count of ⚠️ PRESENT_BEHAVIOR_UNVERIFIED truths (present + wired, behavior not exercised)
16
21
  behavior_unverified_items: # Only if behavior_unverified > 0 — the truths above as structured items; emitted regardless of overall status
17
22
  - truth: "Observable truth whose state transition or cancellation/cleanup/ordering invariant no test exercises"
@@ -1,3 +1,5 @@
1
+ @~/.claude/gsd-core/references/response-language-directive.md
2
+
1
3
  # Add Backlog Item Workflow
2
4
 
3
5
  Invoked by `/gsd:capture --backlog` (`commands/gsd/capture.md`).
@@ -1,3 +1,5 @@
1
+ @~/.claude/gsd-core/references/response-language-directive.md
2
+
1
3
  <purpose>
2
4
  Add a new integer phase to the end of the current milestone in the roadmap. Automatically calculates next phase number, creates phase directory, and updates roadmap structure.
3
5
  </purpose>
@@ -40,7 +40,7 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
40
40
 
41
41
  Extract from init JSON: `phase_dir`, `phase_number`, `phase_name`, `response_language`.
42
42
 
43
- **If `response_language` is set:** All user-facing questions, prompts, and explanations in this workflow MUST be presented in `{response_language}`. Technical terms, code, file paths, and subagent prompts stay in English — only user-facing output is translated.
43
+ **If `response_language` is set:** All user-facing output of this workflow — narration between tool calls, status updates, progress notes, findings, questions, prompts, and explanations — MUST be presented in `{response_language}`. Technical terms, code, file paths, and subagent prompts stay in English — only user-facing output is translated.
44
44
 
45
45
  Verify the phase directory exists. If not:
46
46
  ```
@@ -19,7 +19,7 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
19
19
 
20
20
  Extract from init JSON: `commit_docs`, `date`, `timestamp`, `todo_count`, `todos`, `pending_dir`, `todos_dir_exists`, `response_language`.
21
21
 
22
- **If `response_language` is set:** All user-facing questions, prompts, and explanations in this workflow MUST be presented in `{response_language}`. Technical terms, code, file paths, and subagent prompts stay in English — only user-facing output is translated.
22
+ **If `response_language` is set:** All user-facing output of this workflow — narration between tool calls, status updates, progress notes, findings, questions, prompts, and explanations — MUST be presented in `{response_language}`. Technical terms, code, file paths, and subagent prompts stay in English — only user-facing output is translated.
23
23
 
24
24
  Ensure directories exist:
25
25
  ```bash
@@ -27,7 +27,7 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
27
27
 
28
28
  Parse JSON for: `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_context`, `has_research`, `commit_docs`, `response_language`.
29
29
 
30
- **If `response_language` is set:** All user-facing questions, prompts, and explanations in this workflow MUST be presented in `{response_language}`. Technical terms, code, file paths, and subagent prompts stay in English — only user-facing output is translated.
30
+ **If `response_language` is set:** All user-facing output of this workflow — narration between tool calls, status updates, progress notes, findings, questions, prompts, and explanations — MUST be presented in `{response_language}`. Technical terms, code, file paths, and subagent prompts stay in English — only user-facing output is translated.
31
31
 
32
32
  **File paths:** `state_path`, `roadmap_path`, `requirements_path`, `context_path`.
33
33
 
@@ -1,3 +1,5 @@
1
+ @~/.claude/gsd-core/references/response-language-directive.md
2
+
1
3
  <purpose>
2
4
  Analyze ROADMAP.md phases for dependency relationships before execution. Detect file overlap between phases, semantic API/data-flow dependencies, and suggest `Depends on` entries to prevent merge conflicts during parallel execution by `/gsd:manager`.
3
5
  </purpose>
@@ -1,3 +1,5 @@
1
+ @~/.claude/gsd-core/references/response-language-directive.md
2
+
1
3
  <purpose>
2
4
  Autonomous audit-to-fix pipeline. Runs an audit, parses findings, classifies each as
3
5
  auto-fixable vs manual-only, spawns executor agents for fixable issues, runs tests
@@ -1,3 +1,5 @@
1
+ @~/.claude/gsd-core/references/response-language-directive.md
2
+
1
3
  <purpose>
2
4
  Verify milestone achieved its definition of done by aggregating phase verifications, checking cross-phase integration, and assessing requirements coverage. Reads existing VERIFICATION.md files (phases already verified during execute-phase), aggregates tech debt and deferred gaps, then spawns integration checker for cross-phase wiring.
3
5
  </purpose>
@@ -1,3 +1,5 @@
1
+ @~/.claude/gsd-core/references/response-language-directive.md
2
+
1
3
  <purpose>
2
4
  Cross-phase audit of all UAT and verification files. Finds every outstanding item (pending, skipped, blocked, human_needed), optionally verifies against the codebase to detect stale docs, and produces a prioritized human test plan.
3
5
  </purpose>
@@ -1,3 +1,5 @@
1
+ @~/.claude/gsd-core/references/response-language-directive.md
2
+
1
3
  <purpose>
2
4
 
3
5
  Drive milestone phases autonomously — all remaining phases, a range via `--from N`/`--to N`, or a single phase via `--only N`. For each incomplete phase: discuss → plan → execute using Skill() flat invocations. When `--converge` or `--cross-ai` is set, route the planning step through plan-review convergence before execution. Pauses only for explicit user decisions (grey area acceptance, blockers, validation requests). Re-reads ROADMAP.md after each phase to catch dynamically inserted phases.