@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
@@ -0,0 +1,203 @@
1
+ @~/.claude/gsd-core/references/response-language-directive.md
2
+ <purpose>
3
+ Batch several `/gsd:quick`-shaped tasks together (#3676, epic #3344, ADR-1239
4
+ "Quick-batch binding"). ONE coordinator (this workflow) owns every shared
5
+ write — `BATCH.json`, STATE.md, worktree create/merge/cleanup — and never
6
+ delegates them to a leaf. Leaves (planner/researcher/checker/executor/
7
+ verifier) return structured results only; they never invoke `/gsd:quick`,
8
+ never touch `BATCH.json`, and never write STATE.md/ROADMAP.md themselves
9
+ (single-writer invariant).
10
+
11
+ Dispatch decisions (effective concurrency, deterministic merge order, spawn
12
+ backpressure, failure/verification routing) are computed by the pure
13
+ `quick-batch-dispatch.cts` module (via the `quick-batch` CLI verbs) — this
14
+ workflow never re-derives that logic inline.
15
+ </purpose>
16
+
17
+ <required_reading>
18
+ Read all files referenced by the invoking prompt's execution_context before starting.
19
+ </required_reading>
20
+
21
+ <available_agent_types>
22
+ Valid GSD subagent types (use exact names — do not fall back to 'general-purpose'):
23
+ - gsd-phase-researcher — Researches technical approaches for an item
24
+ - gsd-planner — Creates a plan for one item (`quick-batch` mode)
25
+ - gsd-plan-checker — Reviews one item's plan before execution
26
+ - gsd-executor — Executes one item's plan, commits, creates SUMMARY.md
27
+ - gsd-verifier — Verifies one item's goal achievement
28
+ </available_agent_types>
29
+
30
+ <process>
31
+ **Step 1: Parse arguments, resolve mode**
32
+
33
+ ```bash
34
+ _GSD_SHIM_NAME="gsd-tools.cjs"; _GSD_RUNTIME_ROOT="${RUNTIME_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"; GSD_TOOLS="${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}"; _gsd_at() { for _p; do if [ -f "$_p" ]; then GSD_TOOLS="$_p"; return 0; fi; done; return 1; }; if _gsd_at "${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}" "${_GSD_RUNTIME_ROOT}/.claude/gsd-core/bin/${_GSD_SHIM_NAME}" "${_GSD_RUNTIME_ROOT}/.codex/gsd-core/bin/${_GSD_SHIM_NAME}"; then gsd_run() { node "$GSD_TOOLS" "$@"; }; elif unset -f gsd_run; _G="$(command -v gsd_run)"; then GSD_TOOLS="$_G"; gsd_run() { "$GSD_TOOLS" "$@"; }; elif _gsd_at "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/gsd-core/bin/${_GSD_SHIM_NAME}" "${HERMES_HOME:-$HOME/.hermes}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CURSOR_CONFIG_DIR:-$HOME/.cursor}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CODEX_HOME:-$HOME/.codex}/gsd-core/bin/${_GSD_SHIM_NAME}" "${GEMINI_CONFIG_DIR:-$HOME/.gemini}/gsd-core/bin/${_GSD_SHIM_NAME}" "${COPILOT_CONFIG_DIR:-$HOME/.copilot}/gsd-core/bin/${_GSD_SHIM_NAME}" "${WINDSURF_CONFIG_DIR:-$HOME/.codeium/windsurf}/gsd-core/bin/${_GSD_SHIM_NAME}" "${AUGMENT_CONFIG_DIR:-$HOME/.augment}/gsd-core/bin/${_GSD_SHIM_NAME}" "${TRAE_CONFIG_DIR:-$HOME/.trae}/gsd-core/bin/${_GSD_SHIM_NAME}" "${QWEN_CONFIG_DIR:-$HOME/.qwen}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CODEBUDDY_CONFIG_DIR:-$HOME/.codebuddy}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CLINE_CONFIG_DIR:-$HOME/.cline}/gsd-core/bin/${_GSD_SHIM_NAME}" "${GROK_AGENTS_HOME:-$HOME/.agents}/gsd-core/bin/${_GSD_SHIM_NAME}" "${ANTIGRAVITY_CONFIG_DIR:-$HOME/.gemini/antigravity}/gsd-core/bin/${_GSD_SHIM_NAME}" "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/gsd-core/bin/${_GSD_SHIM_NAME}" "${KILO_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/kilo}/gsd-core/bin/${_GSD_SHIM_NAME}"; then gsd_run() { node "$GSD_TOOLS" "$@"; }; else echo "ERROR: gsd-tools.cjs not found at $GSD_TOOLS and gsd_run is not on PATH. Run: npx -y @opengsd/gsd-core@latest --claude --local" >&2; exit 1; fi; GSD_IDENTITY_STATUS=unverified; case "$(gsd_run runtime-identity --raw 2>/dev/null || true)" in '{"packageName":"@opengsd/gsd-core"'*'}') GSD_IDENTITY_STATUS=ok;; esac; export GSD_IDENTITY_STATUS; [ "$GSD_IDENTITY_STATUS" = ok ] || echo "WARNING: \"$GSD_TOOLS\" did not prove it is @opengsd/gsd-core - it is either a different package or an @opengsd/gsd-core older than the runtime-identity verb. See docs/how-to/diagnose-a-foreign-gsd-tools.md" >&2; if [ -n "${CLAUDE_ENV_FILE:-}" ] && [ -n "${GSD_TOOLS:-}" ]; then printf "export PATH='%s':\"\$PATH\"\n" "${GSD_TOOLS%/*}" >> "$CLAUDE_ENV_FILE" 2>/dev/null || true; fi
35
+ RESPONSE_LANGUAGE=$(gsd_run query config-get response_language --raw --default "" 2>/dev/null || echo "")
36
+ ```
37
+
38
+ **If `response_language` is set:** all user-facing questions/prompts/explanations MUST be presented in `{response_language}`. Technical terms, code, file paths, and subagent prompts stay in English.
39
+
40
+ Validate `$ARGUMENTS` through the CLI's own grammar — never re-derive it inline (single source of truth: `parseQuickBatchArgs`, `src/quick-batch-dispatch.cts`). `$ARGUMENTS` is raw, attacker-influenced task text — pass it as ONE quoted argument via `--text` so the shell never word-splits or glob-expands it; `quick-batch parse-args` does the whitespace split itself, in Node, after the shell is done:
41
+
42
+ ```bash
43
+ QB_PARSE_JSON=$(gsd_run quick-batch parse-args --raw --text "$ARGUMENTS")
44
+ QB_PARSE_RC=$?
45
+ if [ $QB_PARSE_RC -ne 0 ]; then
46
+ echo "$QB_PARSE_JSON" >&2
47
+ exit 1
48
+ fi
49
+ if [[ "$QB_PARSE_JSON" == @file:* ]]; then QB_PARSE_JSON=$(cat "${QB_PARSE_JSON#@file:}"); fi
50
+ ```
51
+
52
+ Parse `$QB_PARSE_JSON` for `jobs` (`"auto"` or an integer), `validate` (bool), `research` (bool), `resume` (batch id or null). Store as `$JOBS`, `$VALIDATE_MODE`, `$RESEARCH_MODE`, `$RESUME_BATCH_ID`.
53
+
54
+ Extract the raw task-list text / `--file <path>` from `$ARGUMENTS` (everything that is not `--jobs <v>`, `--validate`, `--research`, `--resume <id>`, or `--file <path>`'s own flag pair).
55
+
56
+ ```bash
57
+ VALIDATE_PARAM=""; if [ "$VALIDATE_MODE" = true ]; then VALIDATE_PARAM="--validate"; fi
58
+ RESEARCH_PARAM=""; if [ "$RESEARCH_MODE" = true ]; then RESEARCH_PARAM="--research"; fi
59
+ INIT=$(gsd_run query init.quick-batch $VALIDATE_PARAM $RESEARCH_PARAM)
60
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
61
+ AGENT_SKILLS_PLANNER=$(gsd_run query agent-skills gsd-planner)
62
+ AGENT_SKILLS_EXECUTOR=$(gsd_run query agent-skills gsd-executor)
63
+ AGENT_SKILLS_CHECKER=$(gsd_run query agent-skills gsd-plan-checker)
64
+ AGENT_SKILLS_VERIFIER=$(gsd_run query agent-skills gsd-verifier)
65
+ AGENT_SKILLS_RESEARCHER=$(gsd_run query agent-skills gsd-phase-researcher)
66
+ ```
67
+
68
+ Parse `$INIT` for: `planner_model`, `executor_model`, `checker_model`, `verifier_model`, `researcher_model`, `commit_docs`, `quick_dir`, `quick_batches_dir`, `roadmap_exists`, `planning_exists`.
69
+
70
+ <!-- #2517 model-omit-on-inherit -->
71
+
72
+ > **Model omission (#2517).** Every `Agent()` dispatch below (planner, researcher, plan-checker, executor, verifier) MUST omit the `model` parameter entirely when the value it would carry (`planner_model`, `checker_model`, `executor_model`, `verifier_model`, `researcher_model`) is `"inherit"` or empty. An empty value 404s on runtimes without native tier aliases — the default on non-Claude runtimes, where the installer writes `resolve_model_ids:"omit"`. Omitting it inherits the orchestrator's model. See @gsd-core/references/model-profile-resolution.md.
73
+
74
+ ```bash
75
+ STATE_PATH="${quick_dir%/quick}/STATE.md"
76
+ PROJECT_PATH="${quick_dir%/quick}/PROJECT.md"
77
+ USE_WORKTREES=$(gsd_run query config-get workflow.use_worktrees --raw 2>/dev/null || echo "true")
78
+ RUNTIME=$(gsd_run query config-get runtime --default claude --raw 2>/dev/null || echo "claude")
79
+ ```
80
+
81
+ **If `roadmap_exists` is false:** Error — quick-batch requires an active project with ROADMAP.md. Run `/gsd:new-project` first.
82
+
83
+ If the project uses git submodules, parse `SUBMODULE_PATHS` from `.gitmodules` exactly as `/gsd:quick` does (a fail-loud commit-time guard, applied per item at commit time — see `gsd-core/workflows/quick.md` Step 2 for the identical block, reused verbatim below):
84
+
85
+ ```bash
86
+ if [ -f .gitmodules ]; then
87
+ SUBMODULE_PATHS=$(git config --file .gitmodules --get-regexp '^submodule\..*\.path$' 2>/dev/null | awk '{print $2}')
88
+ else
89
+ SUBMODULE_PATHS=""
90
+ fi
91
+ ```
92
+
93
+ **Resolve capacity now (#3676 design row 3-4).** `--jobs auto`/omitted uses this
94
+ value alone; `--jobs N` is capped by it (`min(taskCount, N, capacity)` — the
95
+ `quick-batch effective-concurrency` verb, called per-wave below, does the
96
+ arithmetic; this is only the raw resolve):
97
+ ```bash
98
+ CAPACITY=$(gsd_run query dispatch-capacity --raw 2>/dev/null || echo 1)
99
+ ```
100
+
101
+ **Resolve isolation now (row 6, 20-22).** Read
102
+ @gsd-core/references/dispatch-isolation-gate.md and run its `Resolve
103
+ ISOLATION`, `Single-agent dispatch sites`, and `Resolve the harness flag`
104
+ blocks in order; they set `ISOLATION`/`HARNESS_FLAG` via `query
105
+ dispatch-isolation`. `ISOLATION` gates every worktree decision below —
106
+ substitute `{harnessFlag}` in Step 6's `Agent()` with `$HARNESS_FLAG`+comma
107
+ when `ISOLATION = "harness-worktree"`, else empty.
108
+
109
+ If `USE_WORKTREES` is not `"false"`, sweep orphaned worktrees before dispatching anything (mirrors `/gsd:quick`'s own startup sweep):
110
+ ```bash
111
+ if [ "$USE_WORKTREES" != "false" ]; then
112
+ gsd_run query worktree.reap-orphans 2>/dev/null || true
113
+ fi
114
+ ```
115
+
116
+ Display banner:
117
+ ```
118
+ ### GSD ► QUICK BATCH
119
+ ◆ jobs=${JOBS} validate=${VALIDATE_MODE} research=${RESEARCH_MODE}${RESUME_BATCH_ID:+ resume=${RESUME_BATCH_ID}}
120
+ ```
121
+
122
+ ---
123
+
124
+ **Step 2: Resume or create**
125
+
126
+ If `$RESUME_BATCH_ID` is set: read and execute `gsd-core/workflows/quick-batch/steps/resume-mode.md`.
127
+ It loads the batch via `quick-batch
128
+ resume`, refuses closed on an unknown batch id or a diverged base revision,
129
+ and sets `$BATCH_ID`/`$BATCH_MANIFEST_JSON` for the steps below. Task-list
130
+ parsing and `quick-batch create` are skipped entirely.
131
+
132
+ Otherwise: read and execute `gsd-core/workflows/quick-batch/steps/batch-init.md`.
133
+ It parses the task list (inline or `--file`) and creates the
134
+ batch via `quick-batch create`, setting the same `$BATCH_ID`/
135
+ `$BATCH_MANIFEST_JSON` pair.
136
+
137
+ Either path converges on the same post-condition — continue to Step 3.
138
+
139
+ ---
140
+
141
+ <!-- gsd:section id="research-phase" when="flag:--research" -->
142
+ If `section_manifest` is `null` or `"research-phase"` is in its `included` list: read and execute `gsd-core/workflows/quick-batch/steps/research-phase.md`. Otherwise skip — do not read the file.
143
+ <!-- /gsd:section -->
144
+
145
+ ---
146
+
147
+ **Step 4: Per-DAG-layer planning**
148
+
149
+ Read and execute `gsd-core/workflows/quick-batch/steps/planner-wave.md`. It
150
+ dispatches a planner per eligible item (one `Agent()` per message, full task
151
+ catalog in every prompt), persists parsed `depends_on`/`files_modified` via
152
+ `quick-batch update` after each layer, and — when `$VALIDATE_MODE` — runs the
153
+ per-item plan-checker loop (`gsd-core/workflows/quick-batch/steps/plan-checker-loop.md`)
154
+ before advancing to the next layer.
155
+
156
+ ---
157
+
158
+ **Step 6: Worktree create + executor dispatch**
159
+
160
+ Read and execute `gsd-core/workflows/quick-batch/steps/worktree-dispatch.md`.
161
+ Worktree create/executor dispatch is serialized per item (one `git worktree
162
+ add` in flight at a time); already-created worktrees run concurrently up to
163
+ the effective MUTATING-wave concurrency.
164
+
165
+ ---
166
+
167
+ **Step 7: Deterministic merge**
168
+
169
+ Read and execute `gsd-core/workflows/quick-batch/steps/merge-wave.md`. Merges
170
+ apply strictly in the wave's original dispatch order (`quick-batch
171
+ merge-eligible`), never completion order.
172
+
173
+ ---
174
+
175
+ <!-- gsd:section id="verification-wave" when="flag:--validate" -->
176
+ If `section_manifest` is `null` or `"verification-wave"` is in its `included` list: read and execute `gsd-core/workflows/quick-batch/steps/verification-wave.md`. Otherwise skip — do not read the file.
177
+ <!-- /gsd:section -->
178
+
179
+ ---
180
+
181
+ **Step 9: Completion**
182
+
183
+ Read and execute `gsd-core/workflows/quick-batch/steps/completion.md`. Calls
184
+ `completeQuickItem` (via `quick-batch complete`) only for a genuinely
185
+ complete item, updates STATE.md, and prints the final batch report.
186
+
187
+ </process>
188
+
189
+ <success_criteria>
190
+ - [ ] `--discuss`/`--full` rejected with a usage error before any dispatch
191
+ - [ ] A malformed `--jobs` value rejected before any dispatch
192
+ - [ ] `--resume <batch-id>` skips task-list parsing, dispatches only eligible items
193
+ - [ ] Task list parsed (inline or `--file`, ≥2 items) and batch created otherwise
194
+ - [ ] Planner dispatched per eligible item per DAG layer, full task catalog in prompt, `depends_on`/`files_modified` requested ALWAYS
195
+ - [ ] (--research) Researcher dispatched per item before planning
196
+ - [ ] (--validate) Plan-checker loop runs per item after planning (≤2 iterations)
197
+ - [ ] Worktree create/merge/cleanup serialized; concurrent leaves inside already-created worktrees
198
+ - [ ] `isolation == none` forces a mutating wave's concurrency to 1; a research-only wave is unaffected
199
+ - [ ] Merges apply in deterministic wave order, never completion order
200
+ - [ ] (--validate) Verifier dispatched per item post-merge; `human_needed` never completes the item, `gaps_found` fails it without rollback or retry
201
+ - [ ] A merge_failed/scope_violation item is marked failed with the worktree PRESERVED
202
+ - [ ] `completeQuickItem` called only for genuinely complete items; STATE.md updated; artifacts committed
203
+ </success_criteria>
@@ -43,7 +43,7 @@ _GSD_SHIM_NAME="gsd-tools.cjs"; _GSD_RUNTIME_ROOT="${RUNTIME_DIR:-$(git rev-pars
43
43
  RESPONSE_LANGUAGE=$(gsd_run query config-get response_language --raw --default "" 2>/dev/null || echo "")
44
44
  ```
45
45
 
46
- **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.
46
+ **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.
47
47
 
48
48
  If `$DESCRIPTION` is empty after parsing, prompt user interactively:
49
49
 
@@ -127,9 +127,10 @@ AGENT_SKILLS_PLANNER=$(gsd_run query agent-skills gsd-planner)
127
127
  AGENT_SKILLS_EXECUTOR=$(gsd_run query agent-skills gsd-executor)
128
128
  AGENT_SKILLS_CHECKER=$(gsd_run query agent-skills gsd-plan-checker)
129
129
  AGENT_SKILLS_VERIFIER=$(gsd_run query agent-skills gsd-verifier)
130
+ AGENT_SKILLS_RESEARCHER=$(gsd_run query agent-skills gsd-phase-researcher)
130
131
  ```
131
132
 
132
- Parse JSON for: `planner_model`, `executor_model`, `checker_model`, `verifier_model`, `reviewer_model`, `commit_docs`, `branch_name`, `quick_id`, `slug`, `date`, `timestamp`, `quick_dir`, `task_dir`, `roadmap_exists`, `planning_exists`, `response_language`.
133
+ Parse JSON for: `planner_model`, `executor_model`, `checker_model`, `verifier_model`, `reviewer_model`, `researcher_model`, `commit_docs`, `branch_name`, `quick_id`, `slug`, `date`, `timestamp`, `quick_dir`, `task_dir`, `roadmap_exists`, `planning_exists`, `response_language`.
133
134
 
134
135
  `init.quick` does not emit dedicated `state_path`/`project_path` fields, so derive them from the already-absolute `quick_dir` (#2376 — files handed to a spawned subagent must resolve regardless of that subagent's own cwd):
135
136
  ```bash
@@ -286,6 +287,13 @@ If `section_manifest` is `null` or `"research-phase"` is in its `included` list:
286
287
 
287
288
  **Step 5: Spawn planner (quick mode)**
288
289
 
290
+ **Capability gate:**
291
+ ```bash
292
+ PLAN_PRE_HOOKS_JSON=$(gsd_run loop render-hooks plan:pre --raw)
293
+ ```
294
+
295
+ **Contribution dispatch (#3778):** read `PLAN_PRE_HOOKS_JSON.activeHooks` directly in context. In registry order, inject only active entries with `kind == "contribution"` and `into == "planner"` into each Quick planner prompt below, using `fragment.inline` verbatim plus resolved `configValues`. Do not paste `rendered`. Empty, inactive, incompatible, or non-planner entries inject nothing and do not error. Reuse this snapshot for revisions; do not render again.
296
+
289
297
  **If `$VALIDATE_MODE`:** Use `quick-full` mode with stricter constraints.
290
298
 
291
299
  **If NOT `$VALIDATE_MODE`:** Use standard `quick` mode.
@@ -312,6 +320,8 @@ ${AGENT_SKILLS_PLANNER}
312
320
 
313
321
  **Project skills:** Check .claude/skills/ or .agents/skills/ directory (if either exists) — read SKILL.md files, plans should account for project skill rules
314
322
 
323
+ {For each active entry in `PLAN_PRE_HOOKS_JSON` where `kind == "contribution"` and `into == "planner"` (in array order): inject the entry's `fragment.inline` verbatim here, plus its resolved `configValues` when the entry carries them. If no active planner contributions exist, omit this block entirely.}
324
+
315
325
  </planning_context>
316
326
 
317
327
  <constraints>
@@ -619,7 +629,7 @@ Insert after `### Blockers/Concerns` section:
619
629
  |---|-------------|------|--------|-----------|
620
630
  ```
621
631
 
622
- **Note:** If the table already exists, match its existing column format. If adding `--validate` (or `--full`) to a project that already has quick tasks without a Status column, add the Status column to the header and separator rows, and leave Status empty for the new row's predecessors.
632
+ **Note:** If the table already exists in a legacy (pre-registry) column format, first run `gsd_run quick-tasks-migrate` — the maintainer-decided repair path (#3730) that rewrites the table onto the canonical schema, losslessly bucketing unmapped columns into Description. It is a silent no-op when the table is already canonical or the section is absent, so running it before the first append of every quick task migrates exactly once and never prompts otherwise. After migration, use the canonical column format below.
623
633
 
624
634
  **7c. Append new row to table:**
625
635
 
@@ -1,3 +1,5 @@
1
+ @~/.claude/gsd-core/references/response-language-directive.md
2
+
1
3
  # Reapply Local Patches Workflow
2
4
 
3
5
  Invoked by `/gsd:update --reapply` (`commands/gsd/update.md`).
@@ -1,3 +1,5 @@
1
+ @~/.claude/gsd-core/references/response-language-directive.md
2
+
1
3
  <purpose>
2
4
  Remove an unstarted future phase from the project roadmap, delete its directory, renumber all subsequent phases to maintain a clean linear sequence, and commit the change. The git commit serves as the historical record of removal.
3
5
  </purpose>
@@ -19,7 +19,7 @@ INIT=$(gsd_run query init.remove-workspace "$WORKSPACE_NAME")
19
19
  if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
20
20
  ```
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
  Parse JSON for: `workspace_name`, `workspace_path`, `has_manifest`, `strategy`, `repos`, `repo_count`, `dirty_repos`, `has_dirty_repos`.
25
25
 
@@ -1,3 +1,5 @@
1
+ @~/.claude/gsd-core/references/response-language-directive.md
2
+
1
3
  <trigger>
2
4
  Use this workflow when:
3
5
  - Starting a new session on an existing project
@@ -25,10 +27,12 @@ INIT=$(gsd_run query init.resume)
25
27
  if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
26
28
  ```
27
29
 
28
- Parse JSON for: `state_exists`, `roadmap_exists`, `project_exists`, `planning_exists`, `has_interrupted_agent`, `interrupted_agent_id`, `commit_docs`.
30
+ Parse JSON for: `state_exists`, `roadmap_exists`, `project_exists`, `planning_exists`, `requirements_exists`, `init_incomplete`, `has_interrupted_agent`, `interrupted_agent_id`, `commit_docs`.
31
+
32
+ **If `init_incomplete` is true (#4040 — interrupted bootstrap):** `.planning/` exists but initialization never finished — one or more of `REQUIREMENTS.md`, `ROADMAP.md`, `STATE.md` were never created. This is NOT a STATE.md-reconstruction case (there is no project history to reconstruct from). Route to initialization recovery: resume `/gsd:new-project`, which continues from the first missing artifact and keeps the existing PROJECT.md and any already-created artifacts. Do not proceed to load_state.
29
33
 
30
34
  **If `state_exists` is true:** Proceed to load_state
31
- **If `state_exists` is false but `roadmap_exists` or `project_exists` is true:** Offer to reconstruct STATE.md
35
+ **If `state_exists` is false but `roadmap_exists` or `project_exists` is true (and `init_incomplete` is false):** Offer to reconstruct STATE.md
32
36
  **If `planning_exists` is false:** This is a new project - route to /gsd:new-project
33
37
  </step>
34
38
 
@@ -1,3 +1,5 @@
1
+ @~/.claude/gsd-core/references/response-language-directive.md
2
+
1
3
  <purpose>
2
4
  Cross-AI peer review — invoke external AI CLIs to independently review phase plans.
3
5
  Each CLI gets the same prompt (PROJECT.md context, phase plans, requirements) and
@@ -208,7 +210,8 @@ Provide structured feedback on plan quality, completeness, and risks.
208
210
  {research if present}
209
211
 
210
212
  ### Plans to Review
211
- {all PLAN.md contents}
213
+ For each `*-PLAN.md` in the phase directory, in glob order, include its full content preceded by a `####` header carrying the plan's **repo-relative path** (e.g. `#### .planning/phases/<phase>/<NN>-PLAN.md`). The path header is the citable anchor for findings about the plan itself — cite it as `<repo-relative plan path>:<line>` (name the heading in prose beside the citation if it helps the reader); reserve `path:line` for repo files the plan references.
214
+ {per-plan: `#### <repo-relative plan path>` + full plan contents}
212
215
 
213
216
  ## Review Instructions
214
217
 
@@ -220,6 +223,13 @@ Provide structured feedback on plan quality, completeness, and risks.
220
223
 
221
224
  Findings citing `file:line` evidence are weighted far more heavily than impressionistic ones; a review that only restates the plan's own claims has low value.
222
225
 
226
+ **Plan coverage is mandatory (#3301).** The exact list of plan ids and the total plan count for
227
+ this review are given in the "## Plan Coverage Manifest" section below. Give **every** listed id
228
+ its own `##`-level section headed with that id **verbatim** (e.g. `## 12.6-01`) before writing any
229
+ cross-plan comparison, an overall risk assessment, or a consensus-style summary. A review that
230
+ stops before every id has its own section is an incomplete review, not a summary — if you must
231
+ stop early, say so explicitly and name which ids you did not reach.
232
+
223
233
  Analyze each plan and provide:
224
234
 
225
235
  1. **Summary** — One-paragraph assessment
@@ -254,14 +264,57 @@ RUN_DIR="{run_dir}" # from gather_context
254
264
  cp "$INSTRUCTIONS_BLOCK_FILE" "${RUN_DIR}/gsd-review-instructions.md"
255
265
  cp "$ROADMAP_SECTION_FILE" "${RUN_DIR}/gsd-review-roadmap.md"
256
266
 
257
- # Plan files: copy each PLAN.md to a predictable numbered path
258
- PLAN_INDEX=0
267
+ # Plan files: copy each PLAN.md to a predictable path named after its source
268
+ # plan id (#3959: a bare padded index discards provenance — the budget tool's
269
+ # per-plan `### <file>` header then renders a run-dir artifact name no reviewer
270
+ # or consensus step can resolve. The plan id keeps the gsd-review-plan-*.md glob
271
+ # prepare_trimmed_prompt_for_reviewer consumes.)
272
+ for PLAN_FILE in "${PHASE_DIR}"/*-PLAN.md; do
273
+ PLAN_BASENAME=$(basename "$PLAN_FILE")
274
+ PLAN_ID="${PLAN_BASENAME%-PLAN.md}"
275
+ cp "$PLAN_FILE" "${RUN_DIR}/gsd-review-plan-${PLAN_ID}.md"
276
+ done
277
+
278
+ # #3301: plan coverage manifest — tell reviewers exactly which plan ids exist and
279
+ # how many there are, so a review that silently covers 6 of 7 plans is no longer
280
+ # indistinguishable from one that covers all 7. The id is the plan file's own
281
+ # basename with the `-PLAN.md` suffix stripped (e.g. `12.6-01-PLAN.md` ->
282
+ # `12.6-01`) — NOT the `plan:` frontmatter key, which holds only the bare
283
+ # in-phase sequence number ("01") and can never reconstruct the phase-qualified
284
+ # id reviewers need to cite. The filename is guaranteed present for every copied
285
+ # plan, so no plan is ever dropped from the manifest for lacking a key.
286
+ # Count and bullets are both derived directly from the glob loop below, never
287
+ # from re-splitting an accumulated string: bash word-splits an unquoted `$VAR`
288
+ # on IFS by default, but zsh does not (no `setopt SH_WORD_SPLIT` here), so a
289
+ # prior `PLAN_IDS="$PLAN_IDS $id"` + `for x in $PLAN_IDS` round-trip silently
290
+ # collapsed every id onto one iteration under zsh whenever there were 2+ plans
291
+ # (gsd-core#4099). Direct glob iteration (`for f in "${PHASE_DIR}"/*-PLAN.md`,
292
+ # same pattern as the copy loop above) is identical under both shells, so this
293
+ # never needs word-splitting at all.
294
+ PLAN_COUNT=0
295
+ PLAN_ID_BULLETS=""
259
296
  for PLAN_FILE in "${PHASE_DIR}"/*-PLAN.md; do
260
- PADDED_IDX=$(printf '%02d' "$PLAN_INDEX")
261
- cp "$PLAN_FILE" "${RUN_DIR}/gsd-review-plan-${PADDED_IDX}.md"
262
- PLAN_INDEX=$((PLAN_INDEX + 1))
297
+ PLAN_BASENAME=$(basename "$PLAN_FILE")
298
+ PLAN_ID="${PLAN_BASENAME%-PLAN.md}"
299
+ PLAN_COUNT=$((PLAN_COUNT + 1))
300
+ PLAN_ID_BULLETS="${PLAN_ID_BULLETS}- ${PLAN_ID}
301
+ "
263
302
  done
264
303
 
304
+ # Named to avoid BOTH existing RUN_DIR globs: `gsd-review-*.md` (reviewer
305
+ # reports, invoke_reviewers) and `gsd-review-plan-*.md` (the plan copies just
306
+ # above) — a manifest matching either would be picked up as a report or as a
307
+ # plan to review.
308
+ {
309
+ echo ""
310
+ echo "## Plan Coverage Manifest"
311
+ echo ""
312
+ echo "Total plans in this review: ${PLAN_COUNT}"
313
+ echo ""
314
+ echo "Plan ids (give each one its own \`##\`-level section, headed verbatim):"
315
+ printf '%s' "$PLAN_ID_BULLETS"
316
+ } > "${RUN_DIR}/.plans-manifest.md"
317
+
265
318
  # Optional section files (only if content was included in the combined prompt)
266
319
  if [ -f ".planning/PROJECT.md" ]; then
267
320
  cp .planning/PROJECT.md "${RUN_DIR}/gsd-review-project.md"
@@ -277,6 +330,15 @@ fi
277
330
  if [ -f ".planning/REQUIREMENTS.md" ]; then
278
331
  cp .planning/REQUIREMENTS.md "${RUN_DIR}/gsd-review-requirements.md"
279
332
  fi
333
+
334
+ # #3301: append the manifest to BOTH files reviewers actually read — the
335
+ # per-lane budget-trimmed instructions file (descriptor lanes get
336
+ # `--instructions-file`) and the full combined prompt (combined-prompt lanes
337
+ # read the whole file). The `instructions` fragment is in prompt-budget's
338
+ # `minimumFor` floor set and is never trimmed, so this survives per-lane
339
+ # budget trimming intact.
340
+ cat "${RUN_DIR}/.plans-manifest.md" >> "${RUN_DIR}/gsd-review-instructions.md"
341
+ cat "${RUN_DIR}/.plans-manifest.md" >> "${RUN_DIR}/gsd-review-prompt.md"
280
342
  ```
281
343
 
282
344
  Note: `INSTRUCTIONS_BLOCK_FILE`, `ROADMAP_SECTION_FILE`, and `PHASE_DIR` come from prompt assembly; `RUN_DIR` is the run-scoped dir from `gather_context` (#2358) re-assigned from `{run_dir}` above. Copy the temp files written during prompt assembly to these section paths (or write each section here if the prompt was built inline).
@@ -292,6 +354,20 @@ declared in the manifest — timeout floor, probe, prompt/output channel, empty-
292
354
  behaviour that data genuinely cannot express is a named first-party `handler` (ADR-2782 D6), never
293
355
  a bespoke block here.
294
356
 
357
+ **Effort and model resolution (#4255).** A lane's reasoning effort and model each resolve through
358
+ their own declared key, and the resolution order is inspectable rather than implicit:
359
+
360
+ | piece | order, highest first |
361
+ |---|---|
362
+ | model | pinned reviewer-instance `--model` → the lane's `modelConfigKey` (`review.models.<slug>`) → the CLI's own default |
363
+ | effort | the lane's `effortConfigKey` (`review.effort.<slug>`) → the lane's declared `defaultEffort` → **nothing emitted**, so the CLI's own configuration applies |
364
+
365
+ Both come from the LANE. Effort in particular is never read from an agent's execution settings:
366
+ until #4255 it was resolved by querying `gsd-plan-checker`, so every prompt-fed lane ran at that
367
+ verifier's `low` and, because the rendered argument is a CLI config override, it silently beat the
368
+ effort the operator had configured for the reviewer CLI itself. A lane that declares no effort
369
+ emits no argument at all — a value borrowed from an unrelated agent is worse than no value.
370
+
295
371
  **Timeout guidance (#2194):** prompt-fed source-grounded reviews are slow — measured ~570 s for
296
372
  Codex at `xhigh` effort and ~525 s for headless Claude on a large plan set. Each lane declares its
297
373
  own `timeoutFloorMs` and the runner enforces it internally, but the **Bash tool call wrapping the
@@ -434,7 +510,14 @@ for SLUG in $(echo "$SELECTED_REVIEWERS" | tr ',' ' '); do
434
510
  DISPATCH_SLUGS="$DISPATCH_SLUGS $SLUG"
435
511
  done
436
512
 
437
- for SLUG in $DISPATCH_SLUGS; do
513
+ # Rewrapped through unquoted command substitution, not consumed as a bare
514
+ # `$DISPATCH_SLUGS`: bash word-splits an unquoted scalar on IFS by default,
515
+ # but zsh does not, so a bare re-split collapsed every slug onto one
516
+ # iteration under zsh whenever 2+ reviewers were selected (gsd-core#4109).
517
+ # Unquoted `$(...)` re-splits identically under both shells regardless of
518
+ # `SH_WORD_SPLIT` — same reason the accumulator-building loop above already
519
+ # works under both.
520
+ for SLUG in $(printf '%s' "$DISPATCH_SLUGS"); do
438
521
  if [ "$PARALLEL_LANES" = "true" ]; then
439
522
  run_review_lane "$SLUG" &
440
523
  else
@@ -452,7 +535,9 @@ wait
452
535
  # produces is byte-identical to the one a sequential run produces. This is post-join and therefore
453
536
  # single-threaded, so `>>` here is safe. A lane that was budget-skipped, or that never started,
454
537
  # leaves no result file and correctly contributes no line.
455
- for SLUG in $DISPATCH_SLUGS; do
538
+ # Rewrapped through unquoted command substitution (gsd-core#4109) — see the
539
+ # dispatch loop above for why a bare `$DISPATCH_SLUGS` collapses under zsh.
540
+ for SLUG in $(printf '%s' "$DISPATCH_SLUGS"); do
456
541
  LANE_RESULT="$RUN_DIR/gsd-review-lane-result-$SLUG.json"
457
542
  if [ -f "$LANE_RESULT" ]; then
458
543
  cat "$LANE_RESULT" >> "$RUN_DIR/gsd-review-lane-results.jsonl"
@@ -513,7 +598,10 @@ if [ "${LANE_LINES:-0}" -eq 0 ]; then
513
598
  # failure stub does not. If a slug has no stub at all, it is not a skip.
514
599
  DISPATCHED_COUNT=0
515
600
  SKIPPED_COUNT=0
516
- for SLUG in $DISPATCH_SLUGS; do
601
+ # Rewrapped through unquoted command substitution (gsd-core#4109): a bare
602
+ # `$DISPATCH_SLUGS` word-splits under bash but not zsh, collapsing every
603
+ # slug onto one iteration there whenever 2+ reviewers were selected.
604
+ for SLUG in $(printf '%s' "$DISPATCH_SLUGS"); do
517
605
  DISPATCHED_COUNT=$((DISPATCHED_COUNT + 1))
518
606
  STUB="$RUN_DIR/gsd-review-$SLUG.md"
519
607
  if [ -f "$STUB" ] && grep -q "review skipped: prompt budget" "$STUB" 2>/dev/null; then
@@ -536,8 +624,90 @@ fi
536
624
  their `.err`/stub files preserved under `.review-diagnostics/` by `present_results`) and stop.
537
625
  - **Otherwise** (at least one lane produced a result — R1, unchanged): proceed exactly as below.
538
626
 
627
+ **#3301: plan coverage check.** For each dispatched lane that produced a *real* review (not a
628
+ stub, not budget-skipped, not empty), check whether its output mentions every plan id from
629
+ `.plans-manifest.md` — the same manifest `build_prompt` gave the reviewer, so the expected-id list
630
+ here can never diverge from what the reviewer was actually told. This is diagnostic only: it never
631
+ blocks the workflow, never fails a lane, and never changes the `TOTAL_LANE_FAILURE`/
632
+ `ALL_LANES_SKIPPED` gate above.
633
+
634
+ CodeRabbit is excluded — it is a diff-only lane that never receives the source-grounding prompt
635
+ (and therefore never receives the manifest or the per-id section instruction either), the same fact
636
+ that already excludes it from grounded-review weighting in the Consensus Summary below.
637
+
638
+ The match is intentionally lenient about *where* an id appears (a `##`-headed section is asked for,
639
+ but plain prose mentioning the id still counts as coverage — grading only the letter of the
640
+ formatting instruction would produce false INCOMPLETE verdicts against a reviewer that cited real
641
+ evidence correctly). It is strict about *what* counts as a match: the id is regex-escaped (a
642
+ decimal phase like `12.6` must not let `12X6-01` satisfy `12.6-01` through an unescaped `.`), and a
643
+ `-`/word character immediately before or after the candidate match does not count as a boundary (so
644
+ a threat id like `T-04-07` elsewhere in the review must not register as covering plan `04-07`).
645
+
646
+ ```bash
647
+ RUN_DIR="{run_dir}"
648
+ MANIFEST="$RUN_DIR/.plans-manifest.md"
649
+
650
+ # Recompute — a shell variable does not survive across separate fenced blocks
651
+ # (each is its own process), so DISPATCH_SLUGS from the gate-check block above
652
+ # cannot be assumed to still be set here. Same recomputation as that block and
653
+ # as invoke_reviewers.
654
+ DISPATCH_SLUGS=""
655
+ for SLUG in $(echo "$SELECTED_REVIEWERS" | tr ',' ' '); do
656
+ case " $DISPATCH_SLUGS " in
657
+ *" $SLUG "*) continue ;;
658
+ esac
659
+ DISPATCH_SLUGS="$DISPATCH_SLUGS $SLUG"
660
+ done
661
+
662
+ # Rewrapped through unquoted command substitution (gsd-core#4109): a bare
663
+ # `$DISPATCH_SLUGS` word-splits under bash but not zsh, collapsing every
664
+ # slug onto one iteration there whenever 2+ reviewers were selected.
665
+ for SLUG in $(printf '%s' "$DISPATCH_SLUGS"); do
666
+ [ "$SLUG" = "coderabbit" ] && continue
667
+ REVIEW_FILE="$RUN_DIR/gsd-review-$SLUG.md"
668
+ [ -f "$REVIEW_FILE" ] || continue
669
+ [ -s "$REVIEW_FILE" ] || continue
670
+ grep -q "review skipped: prompt budget" "$REVIEW_FILE" 2>/dev/null && continue
671
+ grep -q "failed or returned empty output" "$REVIEW_FILE" 2>/dev/null && continue
672
+
673
+ node -e '
674
+ const fs = require("fs");
675
+ const { escapeRegex } = require("./gsd-core/bin/lib/pattern.cjs");
676
+ const manifest = fs.readFileSync(process.argv[1], "utf8");
677
+ const review = fs.readFileSync(process.argv[2], "utf8");
678
+ const ids = manifest.split("\n")
679
+ .filter((l) => l.startsWith("- "))
680
+ .map((l) => l.slice(2).trim())
681
+ .filter(Boolean);
682
+ const missing = ids.filter((id) => {
683
+ const re = new RegExp("(?<![\\w-])" + escapeRegex(id) + "(?![\\w-])");
684
+ return !re.test(review);
685
+ });
686
+ process.stdout.write(JSON.stringify({ complete: missing.length === 0, missing_ids: missing, total: ids.length }));
687
+ ' "$MANIFEST" "$REVIEW_FILE" > "$RUN_DIR/.plan-coverage-$SLUG.json"
688
+ done
689
+ ```
690
+
691
+ Each `${RUN_DIR}/.plan-coverage-<slug>.json` carries `{complete, missing_ids, total}` for one
692
+ graded lane. Collect these into a `plan_coverage` frontmatter block — **only** when at least one
693
+ graded lane has `complete: false` (mirrors the existing `trimmed_reviewers` precedent: present
694
+ only when there is something to report):
695
+
696
+ ```yaml
697
+ plan_coverage: # only present if at least one graded lane is incomplete
698
+ <slug>:
699
+ total: 7
700
+ missing: ["12.6-07"]
701
+ ```
702
+
539
703
  Combine all review responses into `{phase_dir}/{padded_phase}-REVIEWS.md`:
540
704
 
705
+ Capture only the existing conflict entry bytes after the exact `## Plan-Revision Conflicts`
706
+ heading and before the end of the first exact `<!-- gsd:plan-revision-conflicts:begin -->` /
707
+ `<!-- gsd:plan-revision-conflicts:end -->` pair immediately after the artifact title, if present,
708
+ as `{preserved_plan_revision_conflict_entries}`. Ignore identical headings or delimiters in reviewer
709
+ output: reviewers do not own blocking state. Restore the captured bytes at the explicit slot below.
710
+
541
711
  After all reviewers complete, collect trim metadata files written during the run. For each reviewer that was trimmed (i.e. a `.metadata.json` file exists and `hardFailed` or `omitted` is non-empty, or `projectMdShrunk` is true, or `planTruncationPct > 0`), include a `trimmed_reviewers` block in the frontmatter. Omit the key entirely if no reviewer was trimmed.
542
712
 
543
713
  **Reviewer instances (#1517, optional):** when instances ran, frontmatter records their
@@ -580,10 +750,19 @@ trimmed_reviewers: # only present if at least one reviewer was trimmed
580
750
  plan_truncation_pct: 22
581
751
  hard_failed: false
582
752
  note_injected: true
753
+ plan_coverage: # only present if at least one graded lane is incomplete (#3301)
754
+ ollama:
755
+ total: 7
756
+ missing: ["12.6-07"]
583
757
  ---
584
758
 
585
759
  # Cross-AI Plan Review — Phase {N}
586
760
 
761
+ <!-- gsd:plan-revision-conflicts:begin -->
762
+ ## Plan-Revision Conflicts
763
+ {preserved_plan_revision_conflict_entries}
764
+ <!-- gsd:plan-revision-conflicts:end -->
765
+
587
766
  <!-- Sections are RENDERED from each lane's declared `reviewsSection`, in descriptor order.
588
767
  There is deliberately no hardcoded per-reviewer heading list here any more: a hand-maintained
589
768
  list is exactly the drift #2781 was filed about, and it silently disagreed with the roster.
@@ -666,6 +845,19 @@ NOT a preservation failure. This copy is deliberately NOT part of the commit abo
666
845
  step names only `{padded_phase}-REVIEWS.md` explicitly, never a directory glob, so
667
846
  `.review-diagnostics/` is never swept into it.
668
847
 
848
+ **#4097: preserve lane OUTPUT, never the run's own input copies.** `RUN_DIR` holds not only
849
+ lane outputs — prompt assembly (the `gather_context`/section-copy step above) also writes the
850
+ run's assembled INPUTS there under the same `gsd-review-` prefix: the combined prompt, the
851
+ instructions/roadmap sections, a copy of every plan under review, the project/context/research/
852
+ requirements sections, and the per-lane trimmed prompts. Those are byte-identical duplicates of
853
+ files already committed under `.planning/`; sweeping them into `.review-diagnostics/` buries
854
+ the actual evidence under plan duplicates and grows the phase directory on every run. The
855
+ exclusion list below is CLOSED and owned here: this workflow itself writes every input
856
+ basename at prompt-assembly time, so a future input file CANNOT silently join the evidence
857
+ set — adding one means adding its stem to this list consciously. Lane slugs never begin with
858
+ any excluded stem (`prompt`, `instructions`, `plan-`, `project`, `roadmap`, `context`,
859
+ `research`, `requirements`), so a lane report can never be excluded by accident.
860
+
669
861
  Preservation and cleanup MUST run in the same fenced block below (a shell variable cannot
670
862
  survive across separate fences — each is its own process). `mkdir -p` and every `cp` are
671
863
  exit-status checked; `rm -rf "$RUN_DIR"` runs ONLY if nothing was preserved (nothing to
@@ -679,7 +871,20 @@ shopt -s nullglob 2>/dev/null; setopt NULL_GLOB 2>/dev/null
679
871
  RUN_DIR="{run_dir}"
680
872
  DIAG_DIR="{phase_dir}/.review-diagnostics"
681
873
 
682
- _DIAG_MD=( "$RUN_DIR"/gsd-review-*.md )
874
+ # #4097: `gsd-review-*.md` matches BOTH lane outputs (reports, diagnostic stubs) and the
875
+ # run's own assembled input copies (see the #4097 note above). Filter by basename against
876
+ # the closed input set this workflow itself writes — direct glob iteration with a `case`
877
+ # filter, no string accumulator, identical under bash and zsh (#4099/#4109), and the
878
+ # `nullglob` set at the top of this fence keeps an empty RUN_DIR an empty array (#2962).
879
+ # `gsd-review-prompt*` deliberately covers BOTH the combined prompt (`gsd-review-prompt.md`)
880
+ # and the per-lane trimmed prompts (`gsd-review-prompt-<slug>.md`).
881
+ _DIAG_MD=()
882
+ for f in "$RUN_DIR"/gsd-review-*.md; do
883
+ case "$(basename "$f")" in
884
+ gsd-review-prompt*|gsd-review-instructions*|gsd-review-plan-*|gsd-review-project*|gsd-review-roadmap*|gsd-review-context*|gsd-review-research*|gsd-review-requirements*) ;;
885
+ *) _DIAG_MD+=("$f") ;;
886
+ esac
887
+ done
683
888
  _DIAG_ERR=()
684
889
  for f in "$RUN_DIR"/gsd-review-*.err; do
685
890
  [ -s "$f" ] && _DIAG_ERR+=("$f")
@@ -1,3 +1,5 @@
1
+ @~/.claude/gsd-core/references/response-language-directive.md
2
+
1
3
  <purpose>
2
4
  Lightweight codebase assessment. Spawns a single gsd-codebase-mapper agent for one focus area,
3
5
  producing targeted documents in `.planning/codebase/`.