gsd-pi 2.82.0-dev.ed17d078d → 3.0.0-dev.8b8d129d7

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 (562) hide show
  1. package/README.md +93 -18
  2. package/dist/cli.js +20 -9
  3. package/dist/headless.js +9 -2
  4. package/dist/resources/.managed-resources-content-hash +1 -1
  5. package/dist/resources/GSD-WORKFLOW.md +10 -1
  6. package/dist/resources/extensions/claude-code-cli/partial-builder.js +2 -1
  7. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +44 -6
  8. package/dist/resources/extensions/cmux/index.js +5 -0
  9. package/dist/resources/extensions/gsd/auto/infra-errors.js +9 -3
  10. package/dist/resources/extensions/gsd/auto/loop.js +110 -37
  11. package/dist/resources/extensions/gsd/auto/orchestrator.js +12 -1
  12. package/dist/resources/extensions/gsd/auto/phases.js +97 -38
  13. package/dist/resources/extensions/gsd/auto/session.js +6 -0
  14. package/dist/resources/extensions/gsd/auto/workflow-kernel.js +3 -0
  15. package/dist/resources/extensions/gsd/auto/workflow-memory-pressure.js +12 -0
  16. package/dist/resources/extensions/gsd/auto-dashboard.js +66 -1
  17. package/dist/resources/extensions/gsd/auto-direct-dispatch.js +1 -0
  18. package/dist/resources/extensions/gsd/auto-dispatch.js +20 -19
  19. package/dist/resources/extensions/gsd/auto-model-selection.js +2 -0
  20. package/dist/resources/extensions/gsd/auto-post-unit.js +278 -137
  21. package/dist/resources/extensions/gsd/auto-prompts.js +36 -10
  22. package/dist/resources/extensions/gsd/auto-recovery.js +79 -14
  23. package/dist/resources/extensions/gsd/auto-start.js +87 -14
  24. package/dist/resources/extensions/gsd/auto-timers.js +11 -3
  25. package/dist/resources/extensions/gsd/auto-verification.js +102 -34
  26. package/dist/resources/extensions/gsd/auto-worktree.js +178 -11
  27. package/dist/resources/extensions/gsd/auto.js +98 -54
  28. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +31 -7
  29. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +10 -9
  30. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +5 -4
  31. package/dist/resources/extensions/gsd/bootstrap/subagent-input.js +21 -9
  32. package/dist/resources/extensions/gsd/bootstrap/write-gate.js +24 -9
  33. package/dist/resources/extensions/gsd/clean-root-preflight.js +170 -8
  34. package/dist/resources/extensions/gsd/commands/catalog.js +10 -1
  35. package/dist/resources/extensions/gsd/commands/handlers/core.js +38 -0
  36. package/dist/resources/extensions/gsd/commands/handlers/ops.js +20 -0
  37. package/dist/resources/extensions/gsd/commands-bootstrap.js +5 -0
  38. package/dist/resources/extensions/gsd/commands-handlers.js +2 -0
  39. package/dist/resources/extensions/gsd/commands-mcp-status.js +9 -0
  40. package/dist/resources/extensions/gsd/commands-prefs-wizard.js +7 -2
  41. package/dist/resources/extensions/gsd/commands-verdict.js +139 -0
  42. package/dist/resources/extensions/gsd/crash-recovery.js +43 -5
  43. package/dist/resources/extensions/gsd/db/milestone-leases.js +24 -0
  44. package/dist/resources/extensions/gsd/db/unit-dispatches.js +3 -2
  45. package/dist/resources/extensions/gsd/db-base-schema.js +2 -0
  46. package/dist/resources/extensions/gsd/db-migration-steps.js +4 -0
  47. package/dist/resources/extensions/gsd/db-task-slice-rows.js +2 -0
  48. package/dist/resources/extensions/gsd/dispatch-guard.js +46 -2
  49. package/dist/resources/extensions/gsd/docs/preferences-reference.md +8 -0
  50. package/dist/resources/extensions/gsd/doctor-git-checks.js +46 -1
  51. package/dist/resources/extensions/gsd/doctor-runtime-checks.js +28 -11
  52. package/dist/resources/extensions/gsd/doctor.js +2 -28
  53. package/dist/resources/extensions/gsd/export-html.js +27 -425
  54. package/dist/resources/extensions/gsd/forensics.js +8 -3
  55. package/dist/resources/extensions/gsd/git-service.js +138 -10
  56. package/dist/resources/extensions/gsd/gsd-db.js +76 -33
  57. package/dist/resources/extensions/gsd/guided-flow-queue.js +4 -3
  58. package/dist/resources/extensions/gsd/guided-flow.js +110 -117
  59. package/dist/resources/extensions/gsd/guided-unit-context.js +23 -0
  60. package/dist/resources/extensions/gsd/init-wizard.js +17 -2
  61. package/dist/resources/extensions/gsd/markdown-renderer.js +10 -8
  62. package/dist/resources/extensions/gsd/mcp-filter.js +58 -0
  63. package/dist/resources/extensions/gsd/migrate/parsers.js +10 -0
  64. package/dist/resources/extensions/gsd/migration-auto-check.js +12 -17
  65. package/dist/resources/extensions/gsd/milestone-actions.js +11 -4
  66. package/dist/resources/extensions/gsd/native-git-bridge.js +57 -14
  67. package/dist/resources/extensions/gsd/parallel-orchestrator.js +3 -0
  68. package/dist/resources/extensions/gsd/paths.js +4 -0
  69. package/dist/resources/extensions/gsd/pending-auto-start.js +52 -0
  70. package/dist/resources/extensions/gsd/planning-path-scope.js +9 -3
  71. package/dist/resources/extensions/gsd/post-execution-checks.js +73 -9
  72. package/dist/resources/extensions/gsd/pre-execution-checks.js +38 -11
  73. package/dist/resources/extensions/gsd/preferences-mcp.js +19 -0
  74. package/dist/resources/extensions/gsd/preferences-types.js +2 -0
  75. package/dist/resources/extensions/gsd/preferences-validation.js +138 -0
  76. package/dist/resources/extensions/gsd/preferences.js +2 -0
  77. package/dist/resources/extensions/gsd/prompt-loader.js +1 -1
  78. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
  79. package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -1
  80. package/dist/resources/extensions/gsd/prompts/discuss-headless.md +8 -8
  81. package/dist/resources/extensions/gsd/prompts/discuss.md +9 -9
  82. package/dist/resources/extensions/gsd/prompts/forensics.md +3 -3
  83. package/dist/resources/extensions/gsd/prompts/guided-discuss-project.md +4 -4
  84. package/dist/resources/extensions/gsd/prompts/guided-discuss-requirements.md +3 -3
  85. package/dist/resources/extensions/gsd/prompts/plan-slice.md +4 -4
  86. package/dist/resources/extensions/gsd/prompts/queue.md +4 -4
  87. package/dist/resources/extensions/gsd/prompts/reactive-execute.md +1 -1
  88. package/dist/resources/extensions/gsd/prompts/refine-slice.md +2 -2
  89. package/dist/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
  90. package/dist/resources/extensions/gsd/queue-reorder-ui.js +30 -13
  91. package/dist/resources/extensions/gsd/repository-registry.js +44 -0
  92. package/dist/resources/extensions/gsd/safety/evidence-collector.js +2 -0
  93. package/dist/resources/extensions/gsd/safety/evidence-cross-ref.js +42 -18
  94. package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +59 -2
  95. package/dist/resources/extensions/gsd/smart-entry-routing.js +36 -0
  96. package/dist/resources/extensions/gsd/state-reconciliation/drift/merge-state.js +6 -1
  97. package/dist/resources/extensions/gsd/state-reconciliation/drift/project-md.js +9 -14
  98. package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +19 -24
  99. package/dist/resources/extensions/gsd/state.js +14 -4
  100. package/dist/resources/extensions/gsd/status-guards.js +14 -2
  101. package/dist/resources/extensions/gsd/templates/plan.md +9 -5
  102. package/dist/resources/extensions/gsd/templates/task-plan.md +10 -2
  103. package/dist/resources/extensions/gsd/tools/complete-milestone.js +6 -8
  104. package/dist/resources/extensions/gsd/tools/complete-slice.js +6 -8
  105. package/dist/resources/extensions/gsd/tools/plan-milestone.js +7 -1
  106. package/dist/resources/extensions/gsd/tools/plan-slice.js +151 -15
  107. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +119 -0
  108. package/dist/resources/extensions/gsd/unit-context-manifest.js +36 -17
  109. package/dist/resources/extensions/gsd/validation.js +23 -1
  110. package/dist/resources/extensions/gsd/verification-gate.js +142 -7
  111. package/dist/resources/extensions/gsd/verification-verdict.js +26 -0
  112. package/dist/resources/extensions/gsd/workflow-manifest.js +2 -0
  113. package/dist/resources/extensions/gsd/workflow-mcp.js +17 -1
  114. package/dist/resources/extensions/gsd/workflow-projections.js +6 -8
  115. package/dist/resources/extensions/gsd/worktree-lifecycle.js +54 -10
  116. package/dist/resources/extensions/gsd/worktree-manager.js +1 -1
  117. package/dist/resources/extensions/gsd/worktree-state-projection.js +31 -0
  118. package/dist/resources/extensions/shared/html-shell.js +388 -0
  119. package/dist/resources/extensions/shared/interview-ui.js +6 -4
  120. package/dist/resources/extensions/subagent/index.js +448 -78
  121. package/dist/resources/extensions/subagent/launch.js +77 -0
  122. package/dist/resources/extensions/subagent/run-store.js +148 -0
  123. package/dist/resources/extensions/ttsr/ttsr-manager.js +3 -1
  124. package/dist/resources/extensions/visual-brief/artifact-policy.js +29 -0
  125. package/dist/resources/extensions/visual-brief/extension-manifest.json +8 -0
  126. package/dist/resources/extensions/visual-brief/index.js +5 -0
  127. package/dist/resources/extensions/visual-brief/page-contract.js +124 -0
  128. package/dist/resources/extensions/visual-brief/prompts.js +140 -0
  129. package/dist/resources/skills/forensics/SKILL.md +1 -1
  130. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  131. package/dist/web/standalone/.next/BUILD_ID +1 -1
  132. package/dist/web/standalone/.next/app-path-routes-manifest.json +9 -9
  133. package/dist/web/standalone/.next/build-manifest.json +3 -3
  134. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  135. package/dist/web/standalone/.next/react-loadable-manifest.json +5 -5
  136. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  137. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  138. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  139. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  140. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  141. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  142. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  143. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  144. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  145. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  146. package/dist/web/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  147. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  148. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  149. package/dist/web/standalone/.next/server/app/_not-found.rsc +4 -7
  150. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -7
  151. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  152. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +4 -5
  153. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  154. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  155. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -5
  156. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  157. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  158. package/dist/web/standalone/.next/server/app/index.html +1 -1
  159. package/dist/web/standalone/.next/server/app/index.rsc +4 -7
  160. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  161. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -7
  162. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  163. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +4 -5
  164. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -5
  165. package/dist/web/standalone/.next/server/app/page.js +2 -2
  166. package/dist/web/standalone/.next/server/app/page.js.nft.json +1 -1
  167. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  168. package/dist/web/standalone/.next/server/app-paths-manifest.json +9 -9
  169. package/dist/web/standalone/.next/server/chunks/4266.js +2 -0
  170. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  171. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  172. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  173. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  174. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  175. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  176. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  177. package/dist/web/standalone/.next/static/chunks/2973.33f26573894b6153.js +2 -0
  178. package/dist/web/standalone/.next/static/chunks/8359.65b24fac92188a6b.js +10 -0
  179. package/dist/web/standalone/.next/static/chunks/9441.ff70bb53f6835771.js +1 -0
  180. package/dist/web/standalone/.next/static/chunks/app/layout-8c10ec293ae0f1d5.js +1 -0
  181. package/dist/web/standalone/.next/static/chunks/{webpack-de742b64187e13fe.js → webpack-855d616060cb6e59.js} +1 -1
  182. package/dist/web/standalone/.next/static/css/746ee28c929d1880.css +1 -0
  183. package/package.json +4 -4
  184. package/packages/contracts/dist/rpc.test.js +7 -0
  185. package/packages/contracts/dist/rpc.test.js.map +1 -1
  186. package/packages/contracts/dist/workflow.d.ts +21 -0
  187. package/packages/contracts/dist/workflow.d.ts.map +1 -1
  188. package/packages/contracts/dist/workflow.js +24 -0
  189. package/packages/contracts/dist/workflow.js.map +1 -1
  190. package/packages/contracts/src/rpc.test.ts +8 -0
  191. package/packages/contracts/src/workflow.ts +24 -0
  192. package/packages/daemon/package.json +2 -2
  193. package/packages/mcp-server/README.md +13 -4
  194. package/packages/mcp-server/dist/workflow-tools.d.ts +0 -3
  195. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  196. package/packages/mcp-server/dist/workflow-tools.js +80 -0
  197. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  198. package/packages/mcp-server/package.json +2 -2
  199. package/packages/mcp-server/src/workflow-tools.test.ts +23 -1
  200. package/packages/mcp-server/src/workflow-tools.ts +168 -0
  201. package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
  202. package/packages/native/package.json +1 -1
  203. package/packages/native/tsconfig.json +2 -1
  204. package/packages/native/tsconfig.tsbuildinfo +1 -1
  205. package/packages/pi-agent-core/package.json +1 -1
  206. package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts.map +1 -1
  207. package/packages/pi-ai/dist/providers/google-gemini-cli.js +5 -0
  208. package/packages/pi-ai/dist/providers/google-gemini-cli.js.map +1 -1
  209. package/packages/pi-ai/dist/providers/google-gemini-cli.test.d.ts +2 -0
  210. package/packages/pi-ai/dist/providers/google-gemini-cli.test.d.ts.map +1 -0
  211. package/packages/pi-ai/dist/providers/google-gemini-cli.test.js +41 -0
  212. package/packages/pi-ai/dist/providers/google-gemini-cli.test.js.map +1 -0
  213. package/packages/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
  214. package/packages/pi-ai/dist/providers/openai-codex-responses.js +82 -1
  215. package/packages/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
  216. package/packages/pi-ai/dist/providers/openai-codex-responses.test.d.ts +2 -0
  217. package/packages/pi-ai/dist/providers/openai-codex-responses.test.d.ts.map +1 -0
  218. package/packages/pi-ai/dist/providers/openai-codex-responses.test.js +52 -0
  219. package/packages/pi-ai/dist/providers/openai-codex-responses.test.js.map +1 -0
  220. package/packages/pi-ai/dist/providers/simple-options.d.ts +2 -4
  221. package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
  222. package/packages/pi-ai/dist/providers/simple-options.js +5 -6
  223. package/packages/pi-ai/dist/providers/simple-options.js.map +1 -1
  224. package/packages/pi-ai/dist/providers/simple-options.test.d.ts +2 -0
  225. package/packages/pi-ai/dist/providers/simple-options.test.d.ts.map +1 -0
  226. package/packages/pi-ai/dist/providers/simple-options.test.js +50 -0
  227. package/packages/pi-ai/dist/providers/simple-options.test.js.map +1 -0
  228. package/packages/pi-ai/package.json +1 -1
  229. package/packages/pi-ai/src/providers/google-gemini-cli.test.ts +49 -0
  230. package/packages/pi-ai/src/providers/google-gemini-cli.ts +7 -0
  231. package/packages/pi-ai/src/providers/openai-codex-responses.test.ts +63 -0
  232. package/packages/pi-ai/src/providers/openai-codex-responses.ts +91 -1
  233. package/packages/pi-ai/src/providers/simple-options.test.ts +60 -0
  234. package/packages/pi-ai/src/providers/simple-options.ts +5 -6
  235. package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
  236. package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.d.ts +2 -0
  237. package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.d.ts.map +1 -0
  238. package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.js +66 -0
  239. package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.js.map +1 -0
  240. package/packages/pi-coding-agent/dist/core/agent-session.js +1 -1
  241. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  242. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +44 -3
  243. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
  244. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +6 -1
  245. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
  246. package/packages/pi-coding-agent/dist/core/compaction/compaction.js +7 -2
  247. package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
  248. package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js +14 -1
  249. package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js.map +1 -1
  250. package/packages/pi-coding-agent/dist/core/sdk.js +1 -1
  251. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
  252. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
  253. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +24 -6
  254. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
  255. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  256. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +71 -97
  257. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  258. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js +7 -7
  259. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js.map +1 -1
  260. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +11 -0
  261. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
  262. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.js +25 -1
  263. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.js.map +1 -1
  264. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +2 -0
  265. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  266. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +24 -10
  267. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  268. package/packages/pi-coding-agent/package.json +1 -1
  269. package/packages/pi-coding-agent/src/core/agent-session-thinking-level.test.ts +79 -0
  270. package/packages/pi-coding-agent/src/core/agent-session.ts +1 -1
  271. package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +53 -3
  272. package/packages/pi-coding-agent/src/core/compaction/compaction.test.ts +23 -1
  273. package/packages/pi-coding-agent/src/core/compaction/compaction.ts +7 -2
  274. package/packages/pi-coding-agent/src/core/sdk.ts +1 -1
  275. package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +23 -7
  276. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +75 -102
  277. package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +15 -1
  278. package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.ts +9 -9
  279. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-ordering.test.ts +30 -1
  280. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +29 -10
  281. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
  282. package/packages/pi-tui/dist/__tests__/terminal.test.d.ts +2 -0
  283. package/packages/pi-tui/dist/__tests__/terminal.test.d.ts.map +1 -0
  284. package/packages/pi-tui/dist/__tests__/terminal.test.js +103 -0
  285. package/packages/pi-tui/dist/__tests__/terminal.test.js.map +1 -0
  286. package/packages/pi-tui/dist/__tests__/tui.test.js +45 -2
  287. package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
  288. package/packages/pi-tui/dist/terminal.d.ts +2 -0
  289. package/packages/pi-tui/dist/terminal.d.ts.map +1 -1
  290. package/packages/pi-tui/dist/terminal.js +12 -0
  291. package/packages/pi-tui/dist/terminal.js.map +1 -1
  292. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  293. package/packages/pi-tui/dist/tui.js +106 -27
  294. package/packages/pi-tui/dist/tui.js.map +1 -1
  295. package/packages/pi-tui/package.json +1 -1
  296. package/packages/pi-tui/src/__tests__/terminal.test.ts +121 -0
  297. package/packages/pi-tui/src/__tests__/tui.test.ts +59 -2
  298. package/packages/pi-tui/src/terminal.ts +11 -0
  299. package/packages/pi-tui/src/tui.ts +108 -27
  300. package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
  301. package/packages/rpc-client/package.json +1 -1
  302. package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
  303. package/pkg/package.json +1 -1
  304. package/src/resources/GSD-WORKFLOW.md +10 -1
  305. package/src/resources/extensions/claude-code-cli/partial-builder.ts +2 -1
  306. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +52 -6
  307. package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +19 -2
  308. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +49 -2
  309. package/src/resources/extensions/cmux/index.ts +6 -0
  310. package/src/resources/extensions/gsd/auto/contracts.ts +17 -6
  311. package/src/resources/extensions/gsd/auto/infra-errors.ts +9 -3
  312. package/src/resources/extensions/gsd/auto/loop.ts +111 -38
  313. package/src/resources/extensions/gsd/auto/orchestrator.ts +12 -1
  314. package/src/resources/extensions/gsd/auto/phases.ts +115 -49
  315. package/src/resources/extensions/gsd/auto/session.ts +16 -0
  316. package/src/resources/extensions/gsd/auto/types.ts +3 -0
  317. package/src/resources/extensions/gsd/auto/workflow-kernel.ts +5 -1
  318. package/src/resources/extensions/gsd/auto/workflow-memory-pressure.ts +13 -0
  319. package/src/resources/extensions/gsd/auto-dashboard.ts +72 -1
  320. package/src/resources/extensions/gsd/auto-direct-dispatch.ts +1 -0
  321. package/src/resources/extensions/gsd/auto-dispatch.ts +21 -19
  322. package/src/resources/extensions/gsd/auto-model-selection.ts +2 -1
  323. package/src/resources/extensions/gsd/auto-post-unit.ts +312 -148
  324. package/src/resources/extensions/gsd/auto-prompts.ts +36 -13
  325. package/src/resources/extensions/gsd/auto-recovery.ts +83 -11
  326. package/src/resources/extensions/gsd/auto-start.ts +94 -12
  327. package/src/resources/extensions/gsd/auto-timers.ts +10 -3
  328. package/src/resources/extensions/gsd/auto-verification.ts +124 -42
  329. package/src/resources/extensions/gsd/auto-worktree.ts +195 -11
  330. package/src/resources/extensions/gsd/auto.ts +91 -42
  331. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +42 -7
  332. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +10 -9
  333. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +5 -4
  334. package/src/resources/extensions/gsd/bootstrap/subagent-input.ts +19 -7
  335. package/src/resources/extensions/gsd/bootstrap/write-gate.ts +27 -10
  336. package/src/resources/extensions/gsd/clean-root-preflight.ts +174 -8
  337. package/src/resources/extensions/gsd/commands/catalog.ts +10 -1
  338. package/src/resources/extensions/gsd/commands/handlers/core.ts +41 -0
  339. package/src/resources/extensions/gsd/commands/handlers/ops.ts +21 -0
  340. package/src/resources/extensions/gsd/commands-bootstrap.ts +10 -0
  341. package/src/resources/extensions/gsd/commands-handlers.ts +2 -0
  342. package/src/resources/extensions/gsd/commands-mcp-status.ts +8 -0
  343. package/src/resources/extensions/gsd/commands-prefs-wizard.ts +8 -3
  344. package/src/resources/extensions/gsd/commands-verdict.ts +202 -0
  345. package/src/resources/extensions/gsd/crash-recovery.ts +44 -4
  346. package/src/resources/extensions/gsd/db/milestone-leases.ts +26 -0
  347. package/src/resources/extensions/gsd/db/unit-dispatches.ts +4 -3
  348. package/src/resources/extensions/gsd/db-base-schema.ts +2 -0
  349. package/src/resources/extensions/gsd/db-migration-steps.ts +5 -0
  350. package/src/resources/extensions/gsd/db-task-slice-rows.ts +4 -0
  351. package/src/resources/extensions/gsd/dispatch-guard.ts +60 -2
  352. package/src/resources/extensions/gsd/docs/preferences-reference.md +8 -0
  353. package/src/resources/extensions/gsd/doctor-git-checks.ts +45 -1
  354. package/src/resources/extensions/gsd/doctor-runtime-checks.ts +25 -13
  355. package/src/resources/extensions/gsd/doctor-types.ts +1 -0
  356. package/src/resources/extensions/gsd/doctor.ts +2 -27
  357. package/src/resources/extensions/gsd/export-html.ts +27 -427
  358. package/src/resources/extensions/gsd/forensics.ts +7 -3
  359. package/src/resources/extensions/gsd/git-service.ts +166 -11
  360. package/src/resources/extensions/gsd/gsd-db.ts +80 -31
  361. package/src/resources/extensions/gsd/guided-flow-queue.ts +4 -3
  362. package/src/resources/extensions/gsd/guided-flow.ts +142 -134
  363. package/src/resources/extensions/gsd/guided-unit-context.ts +30 -0
  364. package/src/resources/extensions/gsd/init-wizard.ts +17 -2
  365. package/src/resources/extensions/gsd/journal.ts +8 -1
  366. package/src/resources/extensions/gsd/markdown-renderer.ts +10 -8
  367. package/src/resources/extensions/gsd/mcp-filter.ts +80 -0
  368. package/src/resources/extensions/gsd/migrate/parsers.ts +11 -0
  369. package/src/resources/extensions/gsd/migration-auto-check.ts +15 -23
  370. package/src/resources/extensions/gsd/milestone-actions.ts +10 -4
  371. package/src/resources/extensions/gsd/native-git-bridge.ts +63 -14
  372. package/src/resources/extensions/gsd/parallel-orchestrator.ts +3 -0
  373. package/src/resources/extensions/gsd/paths.ts +5 -0
  374. package/src/resources/extensions/gsd/pending-auto-start.ts +79 -0
  375. package/src/resources/extensions/gsd/planning-path-scope.ts +10 -2
  376. package/src/resources/extensions/gsd/post-execution-checks.ts +87 -12
  377. package/src/resources/extensions/gsd/pre-execution-checks.ts +49 -11
  378. package/src/resources/extensions/gsd/preferences-mcp.ts +27 -0
  379. package/src/resources/extensions/gsd/preferences-types.ts +33 -0
  380. package/src/resources/extensions/gsd/preferences-validation.ts +145 -0
  381. package/src/resources/extensions/gsd/preferences.ts +5 -0
  382. package/src/resources/extensions/gsd/prompt-loader.ts +1 -1
  383. package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
  384. package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -1
  385. package/src/resources/extensions/gsd/prompts/discuss-headless.md +8 -8
  386. package/src/resources/extensions/gsd/prompts/discuss.md +9 -9
  387. package/src/resources/extensions/gsd/prompts/forensics.md +3 -3
  388. package/src/resources/extensions/gsd/prompts/guided-discuss-project.md +4 -4
  389. package/src/resources/extensions/gsd/prompts/guided-discuss-requirements.md +3 -3
  390. package/src/resources/extensions/gsd/prompts/plan-slice.md +4 -4
  391. package/src/resources/extensions/gsd/prompts/queue.md +4 -4
  392. package/src/resources/extensions/gsd/prompts/reactive-execute.md +1 -1
  393. package/src/resources/extensions/gsd/prompts/refine-slice.md +2 -2
  394. package/src/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
  395. package/src/resources/extensions/gsd/queue-reorder-ui.ts +31 -13
  396. package/src/resources/extensions/gsd/repository-registry.ts +77 -0
  397. package/src/resources/extensions/gsd/safety/evidence-collector.ts +2 -0
  398. package/src/resources/extensions/gsd/safety/evidence-cross-ref.ts +54 -19
  399. package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +52 -1
  400. package/src/resources/extensions/gsd/smart-entry-routing.ts +77 -0
  401. package/src/resources/extensions/gsd/state-reconciliation/drift/merge-state.ts +8 -1
  402. package/src/resources/extensions/gsd/state-reconciliation/drift/project-md.ts +12 -15
  403. package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +17 -25
  404. package/src/resources/extensions/gsd/state.ts +15 -4
  405. package/src/resources/extensions/gsd/status-guards.ts +16 -2
  406. package/src/resources/extensions/gsd/templates/plan.md +9 -5
  407. package/src/resources/extensions/gsd/templates/task-plan.md +10 -2
  408. package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +71 -0
  409. package/src/resources/extensions/gsd/tests/auto-deterministic-error-classification-4973.test.ts +116 -0
  410. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +300 -1
  411. package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +174 -8
  412. package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +151 -12
  413. package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +53 -2
  414. package/src/resources/extensions/gsd/tests/auto-post-unit-step-message.test.ts +18 -6
  415. package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +129 -6
  416. package/src/resources/extensions/gsd/tests/auto-retry-mcp-churn-fixes.test.ts +12 -0
  417. package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +1 -0
  418. package/src/resources/extensions/gsd/tests/auto-stop-notification.test.ts +20 -0
  419. package/src/resources/extensions/gsd/tests/auto-worktree-registry.test.ts +69 -1
  420. package/src/resources/extensions/gsd/tests/autocomplete-regressions-1675.test.ts +21 -0
  421. package/src/resources/extensions/gsd/tests/brief-command.test.ts +89 -0
  422. package/src/resources/extensions/gsd/tests/checkout-branch-stash-guard.test.ts +87 -0
  423. package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +107 -2
  424. package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +32 -4
  425. package/src/resources/extensions/gsd/tests/closeout-git-deferral.test.ts +16 -0
  426. package/src/resources/extensions/gsd/tests/commands-verdict.test.ts +378 -0
  427. package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +4 -1
  428. package/src/resources/extensions/gsd/tests/complete-slice.test.ts +5 -9
  429. package/src/resources/extensions/gsd/tests/complete-task.test.ts +3 -1
  430. package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +86 -2
  431. package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +2 -0
  432. package/src/resources/extensions/gsd/tests/db-authority-regression.test.ts +208 -0
  433. package/src/resources/extensions/gsd/tests/db-task-slice-rows.test.ts +1 -0
  434. package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +61 -2
  435. package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +66 -0
  436. package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +68 -1
  437. package/src/resources/extensions/gsd/tests/doctor-empty-worktree.test.ts +65 -0
  438. package/src/resources/extensions/gsd/tests/doctor-forensics-db-open-regression.test.ts +50 -0
  439. package/src/resources/extensions/gsd/tests/evidence-cross-ref.test.ts +97 -0
  440. package/src/resources/extensions/gsd/tests/export-html-enhancements.test.ts +8 -0
  441. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +28 -0
  442. package/src/resources/extensions/gsd/tests/gsdroot-worktree-detection.test.ts +5 -2
  443. package/src/resources/extensions/gsd/tests/guided-discuss-project-prompt-rendering.test.ts +2 -0
  444. package/src/resources/extensions/gsd/tests/guided-dispatch-root.test.ts +106 -0
  445. package/src/resources/extensions/gsd/tests/guided-flow-session-isolation.test.ts +59 -11
  446. package/src/resources/extensions/gsd/tests/guided-flow.test.ts +21 -0
  447. package/src/resources/extensions/gsd/tests/guided-tool-contract.test.ts +65 -0
  448. package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +7 -7
  449. package/src/resources/extensions/gsd/tests/hook-model-resolution.test.ts +5 -0
  450. package/src/resources/extensions/gsd/tests/infra-error.test.ts +2 -2
  451. package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +9 -0
  452. package/src/resources/extensions/gsd/tests/init-prefs-routing.test.ts +22 -0
  453. package/src/resources/extensions/gsd/tests/integration/doctor-runtime.test.ts +20 -0
  454. package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +199 -2
  455. package/src/resources/extensions/gsd/tests/integration/state-machine-runtime-failures.test.ts +6 -1
  456. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +49 -3
  457. package/src/resources/extensions/gsd/tests/journal.test.ts +32 -0
  458. package/src/resources/extensions/gsd/tests/mcp-filter.test.ts +287 -0
  459. package/src/resources/extensions/gsd/tests/mcp-status.test.ts +11 -0
  460. package/src/resources/extensions/gsd/tests/merge-db-cycle.test.ts +179 -0
  461. package/src/resources/extensions/gsd/tests/migrate-validator-parsers.test.ts +24 -1
  462. package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +26 -18
  463. package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +80 -2
  464. package/src/resources/extensions/gsd/tests/orphaned-worktree-audit.test.ts +121 -1
  465. package/src/resources/extensions/gsd/tests/parallel-orchestrator-zombie-cleanup.test.ts +55 -0
  466. package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +55 -1
  467. package/src/resources/extensions/gsd/tests/pending-autostart-scope.test.ts +29 -5
  468. package/src/resources/extensions/gsd/tests/pipeline-variant-dispatch.test.ts +2 -1
  469. package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +26 -0
  470. package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +2 -0
  471. package/src/resources/extensions/gsd/tests/plan-slice.test.ts +343 -3
  472. package/src/resources/extensions/gsd/tests/plan-task.test.ts +18 -1
  473. package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +79 -1
  474. package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +105 -3
  475. package/src/resources/extensions/gsd/tests/post-unit-git-failure.test.ts +1 -1
  476. package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +84 -0
  477. package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +59 -0
  478. package/src/resources/extensions/gsd/tests/pre-execution-pause-wiring.test.ts +54 -0
  479. package/src/resources/extensions/gsd/tests/preferences-mcp.test.ts +128 -0
  480. package/src/resources/extensions/gsd/tests/preferences.test.ts +75 -0
  481. package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +70 -0
  482. package/src/resources/extensions/gsd/tests/prompt-loader.test.ts +23 -0
  483. package/src/resources/extensions/gsd/tests/provider-errors.test.ts +37 -1
  484. package/src/resources/extensions/gsd/tests/quality-gates.test.ts +6 -0
  485. package/src/resources/extensions/gsd/tests/queue-reorder-ui.test.ts +54 -0
  486. package/src/resources/extensions/gsd/tests/remediation-completion-guard.test.ts +89 -2
  487. package/src/resources/extensions/gsd/tests/repository-registry.test.ts +52 -0
  488. package/src/resources/extensions/gsd/tests/run-uat-replay-cap.test.ts +2 -3
  489. package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +10 -0
  490. package/src/resources/extensions/gsd/tests/slice-parallel-orchestrator.test.ts +72 -1
  491. package/src/resources/extensions/gsd/tests/smart-entry-routing.test.ts +113 -0
  492. package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +53 -2
  493. package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +6 -0
  494. package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +119 -23
  495. package/src/resources/extensions/gsd/tests/status-guards.test.ts +17 -1
  496. package/src/resources/extensions/gsd/tests/stuck-state-via-db.test.ts +64 -1
  497. package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +2 -1
  498. package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +7 -3
  499. package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +128 -9
  500. package/src/resources/extensions/gsd/tests/uok-gitops-turn-action.test.ts +111 -1
  501. package/src/resources/extensions/gsd/tests/validate-milestone-stuck-guard.test.ts +29 -2
  502. package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +42 -1
  503. package/src/resources/extensions/gsd/tests/verification-gate.test.ts +173 -1
  504. package/src/resources/extensions/gsd/tests/verification-verdict.test.ts +78 -0
  505. package/src/resources/extensions/gsd/tests/workflow-kernel.test.ts +7 -0
  506. package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +19 -1
  507. package/src/resources/extensions/gsd/tests/workflow-memory-pressure.test.ts +21 -1
  508. package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +1 -1
  509. package/src/resources/extensions/gsd/tests/worktree-git-pathspec.test.ts +39 -0
  510. package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +64 -12
  511. package/src/resources/extensions/gsd/tests/worktree-lifecycle.test.ts +25 -0
  512. package/src/resources/extensions/gsd/tests/worktree-preferences-sync.test.ts +25 -0
  513. package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +95 -0
  514. package/src/resources/extensions/gsd/tests/worktree-write-gate.test.ts +27 -0
  515. package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +59 -0
  516. package/src/resources/extensions/gsd/tools/complete-milestone.ts +8 -10
  517. package/src/resources/extensions/gsd/tools/complete-slice.ts +6 -8
  518. package/src/resources/extensions/gsd/tools/plan-milestone.ts +5 -1
  519. package/src/resources/extensions/gsd/tools/plan-slice.ts +172 -12
  520. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +135 -0
  521. package/src/resources/extensions/gsd/types.ts +1 -1
  522. package/src/resources/extensions/gsd/unit-context-manifest.ts +51 -18
  523. package/src/resources/extensions/gsd/validation.ts +23 -1
  524. package/src/resources/extensions/gsd/verification-gate.ts +170 -6
  525. package/src/resources/extensions/gsd/verification-verdict.ts +47 -0
  526. package/src/resources/extensions/gsd/workflow-manifest.ts +2 -0
  527. package/src/resources/extensions/gsd/workflow-mcp.ts +18 -1
  528. package/src/resources/extensions/gsd/workflow-projections.ts +6 -8
  529. package/src/resources/extensions/gsd/worktree-lifecycle.ts +61 -10
  530. package/src/resources/extensions/gsd/worktree-manager.ts +1 -1
  531. package/src/resources/extensions/gsd/worktree-state-projection.ts +43 -0
  532. package/src/resources/extensions/shared/html-shell.ts +412 -0
  533. package/src/resources/extensions/shared/interview-ui.ts +6 -4
  534. package/src/resources/extensions/shared/tests/interview-notes-loop.test.ts +15 -0
  535. package/src/resources/extensions/subagent/index.ts +567 -103
  536. package/src/resources/extensions/subagent/launch.ts +131 -0
  537. package/src/resources/extensions/subagent/run-store.ts +218 -0
  538. package/src/resources/extensions/subagent/tests/launch.test.ts +115 -0
  539. package/src/resources/extensions/subagent/tests/run-store.test.ts +111 -0
  540. package/src/resources/extensions/ttsr/ttsr-manager.ts +5 -1
  541. package/src/resources/extensions/visual-brief/artifact-policy.ts +41 -0
  542. package/src/resources/extensions/visual-brief/extension-manifest.json +8 -0
  543. package/src/resources/extensions/visual-brief/index.ts +8 -0
  544. package/src/resources/extensions/visual-brief/page-contract.ts +136 -0
  545. package/src/resources/extensions/visual-brief/prompts.ts +183 -0
  546. package/src/resources/extensions/visual-brief/tests/visual-brief.test.ts +212 -0
  547. package/src/resources/skills/forensics/SKILL.md +1 -1
  548. package/dist/web/standalone/.next/server/chunks/5822.js +0 -2
  549. package/dist/web/standalone/.next/static/chunks/2556.0527fea66e123b7f.js +0 -1
  550. package/dist/web/standalone/.next/static/chunks/8359.e059d86b255fce1c.js +0 -10
  551. package/dist/web/standalone/.next/static/chunks/9441.1081da1125d1764f.js +0 -1
  552. package/dist/web/standalone/.next/static/chunks/app/layout-a16c7a7ecdf0c2cf.js +0 -1
  553. package/dist/web/standalone/.next/static/css/54ec2745c1da488b.css +0 -1
  554. package/dist/web/standalone/.next/static/css/de70bee13400563f.css +0 -1
  555. package/dist/web/standalone/.next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
  556. package/dist/web/standalone/.next/static/media/747892c23ea88013-s.woff2 +0 -0
  557. package/dist/web/standalone/.next/static/media/8d697b304b401681-s.woff2 +0 -0
  558. package/dist/web/standalone/.next/static/media/93f479601ee12b01-s.p.woff2 +0 -0
  559. package/dist/web/standalone/.next/static/media/9610d9e46709d722-s.woff2 +0 -0
  560. package/dist/web/standalone/.next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
  561. /package/dist/web/standalone/.next/static/{YEvjuT-fsFfYQhDSWtueS → _kljR-_Miq_YV1IW0wpRO}/_buildManifest.js +0 -0
  562. /package/dist/web/standalone/.next/static/{YEvjuT-fsFfYQhDSWtueS → _kljR-_Miq_YV1IW0wpRO}/_ssgManifest.js +0 -0
@@ -19,7 +19,33 @@ import { existsSync } from "node:fs";
19
19
  import { spawn } from "node:child_process";
20
20
  import { homedir } from "node:os";
21
21
  import { resolve } from "node:path";
22
+ import { validateVerificationCommand } from "./verification-gate.js";
22
23
  const NPM_COMMAND = process.platform === "win32" ? "npm.cmd" : "npm";
24
+ export function checkVerificationCommands(tasks) {
25
+ const results = [];
26
+ for (const task of tasks) {
27
+ const verify = task.verify.trim();
28
+ if (!verify)
29
+ continue;
30
+ const commands = verify
31
+ .split("&&")
32
+ .map((command) => command.trim())
33
+ .filter(Boolean);
34
+ for (const command of commands) {
35
+ const validation = validateVerificationCommand(command);
36
+ if (!validation.ok) {
37
+ results.push({
38
+ category: "tool",
39
+ target: `${task.id} Verify`,
40
+ passed: false,
41
+ message: `Unsafe or non-runnable Verify command: ${command} (${validation.reason})`,
42
+ blocking: true,
43
+ });
44
+ }
45
+ }
46
+ }
47
+ return results;
48
+ }
23
49
  // ─── Package Existence Check ─────────────────────────────────────────────────
24
50
  /**
25
51
  * Extract npm package names from task descriptions.
@@ -81,7 +107,7 @@ export function extractPackageReferences(description) {
81
107
  while ((importMatch = importPattern.exec(description)) !== null) {
82
108
  // Skip relative imports and node builtins
83
109
  const pkg = importMatch[1];
84
- if (!pkg.startsWith(".") && !pkg.startsWith("node:")) {
110
+ if (!pkg.startsWith(".") && !pkg.startsWith("node:") && !pkg.startsWith("@/")) {
85
111
  packages.add(normalizePackageName(pkg));
86
112
  }
87
113
  }
@@ -389,8 +415,9 @@ function getExpectedOutputsUpTo(tasks, taskIndex) {
389
415
  *
390
416
  * All paths are normalized before comparison to ensure ./src/a.ts matches src/a.ts.
391
417
  */
392
- export function checkFilePathConsistency(tasks, basePath) {
418
+ export function checkFilePathConsistency(tasks, basePath, context) {
393
419
  const results = [];
420
+ const resolutionRoots = [basePath, ...(context?.additionalRoots ?? [])];
394
421
  // Build a set of all files created by any task at any position (normalized).
395
422
  // Used to suppress consistency errors for files that will be caught with a
396
423
  // more precise message by checkTaskOrdering (sequence violation).
@@ -416,8 +443,7 @@ export function checkFilePathConsistency(tasks, basePath) {
416
443
  if (containsGlobPattern(normalizedFile))
417
444
  continue;
418
445
  // Check if file exists on disk
419
- const absolutePath = resolve(basePath, normalizedFile);
420
- const existsOnDisk = existsSync(absolutePath);
446
+ const existsOnDisk = resolutionRoots.some((root) => existsSync(resolve(root, normalizedFile)));
421
447
  // Check if file is in prior expected outputs (priorOutputs already normalized)
422
448
  const inPriorOutputs = priorOutputs.has(normalizedFile);
423
449
  const inOwnOutputs = ownOutputs.has(normalizedFile);
@@ -455,8 +481,9 @@ export function checkFilePathConsistency(tasks, basePath) {
455
481
  *
456
482
  * All paths are normalized before comparison to ensure ./src/a.ts matches src/a.ts.
457
483
  */
458
- export function checkTaskOrdering(tasks, basePath) {
484
+ export function checkTaskOrdering(tasks, basePath, context) {
459
485
  const results = [];
486
+ const resolutionRoots = [basePath, ...(context?.additionalRoots ?? [])];
460
487
  // Build map: normalized file → task index that creates it
461
488
  const fileCreators = new Map();
462
489
  for (let i = 0; i < tasks.length; i++) {
@@ -494,8 +521,7 @@ export function checkTaskOrdering(tasks, basePath) {
494
521
  if (isDirectoryReference(file))
495
522
  continue;
496
523
  const creator = fileCreators.get(normalizedFile);
497
- const absolutePath = resolve(basePath, normalizedFile);
498
- const existsOnDisk = existsSync(absolutePath);
524
+ const existsOnDisk = resolutionRoots.some((root) => existsSync(resolve(root, normalizedFile)));
499
525
  // Skip if the creating task has already completed — its output is available
500
526
  // regardless of disk state (e.g. file was a temp artifact cleaned up after
501
527
  // the task ran, or a replan introduced a new earlier-sequence task that
@@ -640,14 +666,15 @@ export function checkInterfaceContracts(tasks, _basePath) {
640
666
  * @param basePath - Base path for resolving file references
641
667
  * @returns PreExecutionResult with status, checks, and duration
642
668
  */
643
- export async function runPreExecutionChecks(tasks, basePath) {
669
+ export async function runPreExecutionChecks(tasks, basePath, context) {
644
670
  const startTime = Date.now();
645
671
  const allChecks = [];
646
672
  // Run sync checks first
647
- const fileChecks = checkFilePathConsistency(tasks, basePath);
648
- const orderingChecks = checkTaskOrdering(tasks, basePath);
673
+ const fileChecks = checkFilePathConsistency(tasks, basePath, context);
674
+ const orderingChecks = checkTaskOrdering(tasks, basePath, context);
649
675
  const contractChecks = checkInterfaceContracts(tasks, basePath);
650
- allChecks.push(...fileChecks, ...orderingChecks, ...contractChecks);
676
+ const verificationChecks = checkVerificationCommands(tasks);
677
+ allChecks.push(...fileChecks, ...orderingChecks, ...contractChecks, ...verificationChecks);
651
678
  // Run async package checks
652
679
  const packageChecks = await checkPackageExistence(tasks, basePath);
653
680
  allChecks.push(...packageChecks);
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Resolve MCP server config for a given model ID using longest-prefix-wins matching.
3
+ *
4
+ * Keys in config.per_model are model-ID prefixes. When modelId.startsWith(key),
5
+ * the key is a candidate; the longest matching key wins. Returns undefined when
6
+ * no key matches or per_model is empty.
7
+ */
8
+ export function resolveModelMcpConfig(modelId, config) {
9
+ let bestKey;
10
+ const perModel = config.per_model ?? {};
11
+ for (const key of Object.keys(perModel)) {
12
+ if (modelId.startsWith(key)) {
13
+ if (bestKey === undefined || key.length > bestKey.length) {
14
+ bestKey = key;
15
+ }
16
+ }
17
+ }
18
+ return bestKey !== undefined ? perModel[bestKey] : undefined;
19
+ }
@@ -99,6 +99,8 @@ export const KNOWN_PREFERENCE_KEYS = new Set([
99
99
  "context_window_override",
100
100
  "context_mode",
101
101
  "planning_depth",
102
+ "claude_code_mcp",
103
+ "workspace",
102
104
  ]);
103
105
  /**
104
106
  * Broad union of every recognized unit-type *label* used across the codebase.
@@ -5,6 +5,7 @@
5
5
  * Accepts a raw GSDPreferences object and returns a sanitized copy
6
6
  * together with any errors and warnings.
7
7
  */
8
+ import { isAbsolute } from "node:path";
8
9
  import { VALID_BRANCH_NAME } from "./git-service.js";
9
10
  import { normalizeStringArray } from "../shared/format-utils.js";
10
11
  import { KNOWN_PREFERENCE_KEYS, KNOWN_UNIT_LABELS, SKILL_ACTIONS, } from "./preferences-types.js";
@@ -1264,6 +1265,143 @@ export function validatePreferences(preferences) {
1264
1265
  errors.push("codebase must be an object");
1265
1266
  }
1266
1267
  }
1268
+ // ─── Claude Code MCP Per-Model Config ───────────────────────────────────────
1269
+ if (preferences.claude_code_mcp !== undefined) {
1270
+ if (typeof preferences.claude_code_mcp === "object" && preferences.claude_code_mcp !== null) {
1271
+ const raw = preferences.claude_code_mcp;
1272
+ if (typeof raw.per_model !== "object" || raw.per_model === null || Array.isArray(raw.per_model)) {
1273
+ warnings.push("claude_code_mcp.per_model must be an object — ignoring claude_code_mcp");
1274
+ }
1275
+ else {
1276
+ const perModel = raw.per_model;
1277
+ const validPerModel = {};
1278
+ for (const [prefix, entry] of Object.entries(perModel)) {
1279
+ if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
1280
+ warnings.push(`claude_code_mcp.per_model["${prefix}"] must be an object — ignoring entry`);
1281
+ continue;
1282
+ }
1283
+ const e = entry;
1284
+ const validEntry = {};
1285
+ for (const field of ["allowed_servers", "blocked_servers"]) {
1286
+ if (e[field] !== undefined) {
1287
+ if (Array.isArray(e[field]) && e[field].every((s) => typeof s === "string")) {
1288
+ validEntry[field] = e[field];
1289
+ }
1290
+ else {
1291
+ warnings.push(`claude_code_mcp.per_model["${prefix}"].${field} must be an array of strings — ignoring field`);
1292
+ }
1293
+ }
1294
+ }
1295
+ validPerModel[prefix] = validEntry;
1296
+ }
1297
+ validated.claude_code_mcp = { per_model: validPerModel };
1298
+ }
1299
+ }
1300
+ else {
1301
+ warnings.push("claude_code_mcp must be an object — ignoring");
1302
+ }
1303
+ }
1304
+ // ─── Workspace Repository Registry ─────────────────────────────────
1305
+ if (preferences.workspace !== undefined) {
1306
+ if (typeof preferences.workspace === "object" && preferences.workspace !== null && !Array.isArray(preferences.workspace)) {
1307
+ const workspace = preferences.workspace;
1308
+ const validWorkspace = {};
1309
+ if (workspace.mode !== undefined) {
1310
+ if (workspace.mode === "project" || workspace.mode === "parent") {
1311
+ validWorkspace.mode = workspace.mode;
1312
+ }
1313
+ else {
1314
+ errors.push('workspace.mode must be one of: project, parent');
1315
+ }
1316
+ }
1317
+ if (workspace.repositories !== undefined) {
1318
+ if (typeof workspace.repositories === "object" &&
1319
+ workspace.repositories !== null &&
1320
+ !Array.isArray(workspace.repositories)) {
1321
+ const repos = workspace.repositories;
1322
+ const validRepos = {};
1323
+ const normalizedPaths = new Set();
1324
+ for (const [repoId, repoValue] of Object.entries(repos)) {
1325
+ if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(repoId)) {
1326
+ errors.push(`workspace.repositories key "${repoId}" must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/`);
1327
+ continue;
1328
+ }
1329
+ if (typeof repoValue !== "object" || repoValue === null || Array.isArray(repoValue)) {
1330
+ errors.push(`workspace.repositories.${repoId} must be an object`);
1331
+ continue;
1332
+ }
1333
+ const repo = repoValue;
1334
+ const validRepo = { path: "" };
1335
+ if (typeof repo.path === "string" && repo.path.trim().length > 0) {
1336
+ validRepo.path = repo.path.trim();
1337
+ if (isAbsolute(validRepo.path)) {
1338
+ errors.push(`workspace.repositories.${repoId}.path must be a relative path`);
1339
+ continue;
1340
+ }
1341
+ const normalizedPathKey = validRepo.path.replace(/\\/g, "/").replace(/\/+$/, "").toLowerCase();
1342
+ if (normalizedPaths.has(normalizedPathKey)) {
1343
+ errors.push(`workspace.repositories contains duplicate path: ${validRepo.path}`);
1344
+ continue;
1345
+ }
1346
+ normalizedPaths.add(normalizedPathKey);
1347
+ }
1348
+ else {
1349
+ errors.push(`workspace.repositories.${repoId}.path must be a non-empty string`);
1350
+ continue;
1351
+ }
1352
+ if (repo.role !== undefined) {
1353
+ if (typeof repo.role === "string" && repo.role.trim().length > 0)
1354
+ validRepo.role = repo.role.trim();
1355
+ else
1356
+ errors.push(`workspace.repositories.${repoId}.role must be a non-empty string`);
1357
+ }
1358
+ if (repo.verification !== undefined) {
1359
+ if (Array.isArray(repo.verification) &&
1360
+ repo.verification.every((v) => typeof v === "string" && v.trim().length > 0)) {
1361
+ validRepo.verification = repo.verification.map((v) => v.trim());
1362
+ }
1363
+ else {
1364
+ errors.push(`workspace.repositories.${repoId}.verification must be an array of non-empty strings`);
1365
+ }
1366
+ }
1367
+ if (repo.commit_policy !== undefined) {
1368
+ if (repo.commit_policy === "auto" || repo.commit_policy === "skip") {
1369
+ validRepo.commit_policy = repo.commit_policy;
1370
+ }
1371
+ else {
1372
+ errors.push(`workspace.repositories.${repoId}.commit_policy must be one of: auto, skip`);
1373
+ }
1374
+ }
1375
+ const knownRepoKeys = new Set(["path", "role", "verification", "commit_policy"]);
1376
+ for (const key of Object.keys(repo)) {
1377
+ if (!knownRepoKeys.has(key)) {
1378
+ warnings.push(`unknown workspace.repositories.${repoId} key "${key}" — ignored`);
1379
+ }
1380
+ }
1381
+ validRepos[repoId] = validRepo;
1382
+ }
1383
+ if (Object.keys(validRepos).length > 0) {
1384
+ validWorkspace.repositories = validRepos;
1385
+ }
1386
+ }
1387
+ else {
1388
+ errors.push("workspace.repositories must be an object mapping repo ids to config");
1389
+ }
1390
+ }
1391
+ const knownWorkspaceKeys = new Set(["mode", "repositories"]);
1392
+ for (const key of Object.keys(workspace)) {
1393
+ if (!knownWorkspaceKeys.has(key)) {
1394
+ warnings.push(`unknown workspace key "${key}" — ignored`);
1395
+ }
1396
+ }
1397
+ if (Object.keys(validWorkspace).length > 0) {
1398
+ validated.workspace = validWorkspace;
1399
+ }
1400
+ }
1401
+ else {
1402
+ errors.push("workspace must be an object");
1403
+ }
1404
+ }
1267
1405
  // ─── Enhanced Verification ──────────────────────────────────────────────────
1268
1406
  if (preferences.enhanced_verification !== undefined) {
1269
1407
  if (typeof preferences.enhanced_verification === "boolean") {
@@ -38,6 +38,8 @@ export function resolveSkillStalenessDays(basePath) {
38
38
  }
39
39
  // ─── Re-exports: models ─────────────────────────────────────────────────────
40
40
  export { resolveModelForUnit, resolveModelWithFallbacksForUnit, getNextFallbackModel, isTransientNetworkError, validateModelId, updatePreferencesModels, resolveDynamicRoutingConfig, resolveAutoSupervisorConfig, resolveProfileDefaults, getProfileTierMap, resolveEffectiveProfile, resolveInlineLevel, resolveContextSelection, resolveSearchProviderFromPreferences, resolveDisabledModelProvidersFromPreferences, } from "./preferences-models.js";
41
+ // ─── Re-exports: MCP ────────────────────────────────────────────────────────
42
+ export { resolveModelMcpConfig } from "./preferences-mcp.js";
41
43
  // ─── Path Constants & Getters ───────────────────────────────────────────────
42
44
  function globalPreferencesPath() {
43
45
  return join(gsdHome(), "PREFERENCES.md");
@@ -181,7 +181,7 @@ export function loadPrompt(name, vars = {}) {
181
181
  .map(m => m.slice(2, -2))
182
182
  .filter(key => !(key in effectiveVars));
183
183
  if (missing.length > 0) {
184
- throw new GSDError(GSD_PARSE_ERROR, `loadPrompt("${name}"): template declares {{${missing.join("}}, {{")}}}} but no value was provided. ` +
184
+ throw new GSDError(GSD_PARSE_ERROR, `loadPrompt("${name}"): template declares {{${missing.join("}}, {{")}}} but no value was provided. ` +
185
185
  `This usually means the extension code in memory is older than the template on disk. ` +
186
186
  `Restart pi to reload the extension.`);
187
187
  }
@@ -57,7 +57,7 @@ Subagents report only; they do not write user source. Fold any findings into Dec
57
57
  **Success path** (all verifications passed):
58
58
 
59
59
  10. For each requirement whose status changed in step 9, call `gsd_requirement_update` with the requirement ID and updated `status` and `validation` fields — the tool regenerates `.gsd/REQUIREMENTS.md` automatically. Do this BEFORE completing the milestone so requirement updates are persisted.
60
- 11. Update `.gsd/PROJECT.md`: use the `write` tool with `path: ".gsd/PROJECT.md"` and `content` containing the full updated document reflecting milestone completion and current project state. Do NOT use the `edit` tool for this PROJECT.md is a full-document refresh.
60
+ 11. Refresh the project state through `gsd_summary_save` with `artifact_type: "PROJECT"` and the full updated project markdown as `content`; omit `milestone_id`. The tool persists the DB-backed PROJECT artifact and renders `.gsd/PROJECT.md`. Do not write or edit `.gsd/PROJECT.md` directly.
61
61
  12. Extract structured learnings from this milestone and persist them to the GSD memory store. Follow the procedure block immediately below — it writes `{{milestoneId}}-LEARNINGS.md` as the audit trail and persists Patterns, Lessons, and Decisions via `capture_thought` (categories: pattern, gotcha/convention, architecture). The memory store is the single source of truth for cross-session durable knowledge (ADR-013).
62
62
 
63
63
  {{extractLearningsSteps}}
@@ -34,7 +34,7 @@ Use `subagent` only for fresh-context review when useful: reviewer for cross-cut
34
34
  12. Review the inlined task-summary excerpts for DECISIONS.md and KNOWLEDGE.md-worthy decisions, patterns, and gotchas. Read full `*-SUMMARY.md` files only when an excerpt is absent, truncated, or lacks the specific evidence needed for the slice narrative. Capture significant items with `capture_thought`; do not append knowledge files directly.
35
35
  13. When verification passes, call `gsd_slice_complete`. The DB-backed tool is the canonical write path. Do **not** manually write `{{sliceSummaryPath}}`. Do **not** manually write `{{sliceUatPath}}`. Do not edit roadmap checkboxes; the tool renders files and updates projections.
36
36
  14. Do not run git commands.
37
- 15. Update `.gsd/PROJECT.md` with a full `write` only if the current project state needs refresh.
37
+ 15. If the current project state needs refresh, call `gsd_summary_save` with `artifact_type: "PROJECT"` and the full updated project markdown as `content`; omit `milestone_id`. Do not write or edit `.gsd/PROJECT.md` directly.
38
38
 
39
39
  **Autonomous execution:** no human is available. Do not call `ask_user_questions` or `secure_env_collect`; make reasonable assumptions and document them.
40
40
 
@@ -106,8 +106,8 @@ Directories use bare IDs. Files use ID-SUFFIX format. Titles live inside content
106
106
 
107
107
  In a single pass:
108
108
  1. `mkdir -p .gsd/milestones/{{milestoneId}}/slices`
109
- 2. Write or update `.gsd/PROJECT.md` use the **Project** output template below. Describe what the project is, its current state, and list the milestone sequence.
110
- 3. Write or update `.gsd/REQUIREMENTS.md` use the **Requirements** output template below. Confirm states, ownership, and traceability before roadmap creation.
109
+ 2. Call `gsd_summary_save` with `artifact_type: "PROJECT"` and full Project template content. The tool persists the DB-backed PROJECT artifact and renders `.gsd/PROJECT.md`. Describe what the project is, its current state, and list the milestone sequence.
110
+ 3. Persist requirements with `gsd_requirement_save` or `gsd_requirement_update`, then call `gsd_summary_save` with `artifact_type: "REQUIREMENTS"` so the tool renders `.gsd/REQUIREMENTS.md` from DB rows. Confirm states, ownership, and traceability before roadmap creation.
111
111
 
112
112
  **Depth-Preservation Guidance for context.md:** Preserve the specification's exact terminology, emphasis, and framing. Do not flatten domain-specific language into generics. CONTEXT.md is downstream agents' only window into this spec.
113
113
 
@@ -120,8 +120,8 @@ In a single pass:
120
120
 
121
121
  Before emitting the ready phrase, verify in the CURRENT turn that you have:
122
122
 
123
- - [ ] Written `.gsd/PROJECT.md` (step 2)
124
- - [ ] Written `.gsd/REQUIREMENTS.md` (step 3)
123
+ - [ ] Called `gsd_summary_save` for the PROJECT artifact (step 2)
124
+ - [ ] Persisted requirements and called `gsd_summary_save` for the REQUIREMENTS artifact (step 3)
125
125
  - [ ] Written `{{contextPath}}` (step 4)
126
126
  - [ ] Called `gsd_plan_milestone` (step 5)
127
127
 
@@ -145,8 +145,8 @@ Next steps:
145
145
  #### Phase 1: Shared artifacts
146
146
 
147
147
  1. For each milestone, call `gsd_milestone_generate_id`; never invent IDs. Then `mkdir -p .gsd/milestones/<ID>/slices`.
148
- 2. Write `.gsd/PROJECT.md` use the **Project** output template below.
149
- 3. Write `.gsd/REQUIREMENTS.md` use the **Requirements** output template below. Capture Active, Deferred, Out of Scope, and any already Validated requirements. Later milestones may have provisional ownership where slice plans do not exist yet.
148
+ 2. Call `gsd_summary_save` with `artifact_type: "PROJECT"` and full Project template content so the tool persists the DB-backed PROJECT artifact and renders `.gsd/PROJECT.md`.
149
+ 3. Persist requirements with `gsd_requirement_save` or `gsd_requirement_update`, then call `gsd_summary_save` with `artifact_type: "REQUIREMENTS"` so the tool renders `.gsd/REQUIREMENTS.md` from DB rows. Capture Active, Deferred, Out of Scope, and any already Validated requirements. Later milestones may have provisional ownership where slice plans do not exist yet.
150
150
  4. For any architectural or pattern decisions, call `gsd_decision_save` — the tool auto-assigns IDs and regenerates `.gsd/DECISIONS.md` automatically.
151
151
 
152
152
  #### Phase 2: Primary milestone
@@ -214,8 +214,8 @@ For single-milestone projects, do NOT write this file.
214
214
 
215
215
  Before emitting the ready phrase, verify in the CURRENT turn that you have:
216
216
 
217
- - [ ] Written `.gsd/PROJECT.md`
218
- - [ ] Written `.gsd/REQUIREMENTS.md`
217
+ - [ ] Called `gsd_summary_save` for the PROJECT artifact
218
+ - [ ] Persisted requirements and called `gsd_summary_save` for the REQUIREMENTS artifact
219
219
  - [ ] Written the primary milestone `CONTEXT.md`
220
220
  - [ ] Called `gsd_plan_milestone` for the primary milestone
221
221
  - [ ] Written `.gsd/DISCUSSION-MANIFEST.json` with `gates_completed === total`
@@ -186,7 +186,7 @@ Research is advisory, not auto-binding. Use discussion output to identify table
186
186
 
187
187
  ## Capability Contract
188
188
 
189
- Before writing a roadmap, produce or update `.gsd/REQUIREMENTS.md`.
189
+ Before writing a roadmap, persist requirements with `gsd_requirement_save` or `gsd_requirement_update`, then render `.gsd/REQUIREMENTS.md` through `gsd_summary_save` with `artifact_type: "REQUIREMENTS"`.
190
190
 
191
191
  Use it as the project's explicit capability contract.
192
192
 
@@ -226,8 +226,8 @@ Directories use bare IDs. Files use ID-SUFFIX format. Titles live inside file co
226
226
 
227
227
  Once the user is satisfied, in a single pass:
228
228
  1. `mkdir -p .gsd/milestones/{{milestoneId}}/slices`
229
- 2. Write or update `.gsd/PROJECT.md` use the **Project** output template below. Describe what the project is, its current state, and list the milestone sequence.
230
- 3. Write or update `.gsd/REQUIREMENTS.md` use the **Requirements** output template below. Confirm requirement states, ownership, and traceability before roadmap creation.
229
+ 2. Call `gsd_summary_save` with `artifact_type: "PROJECT"` and full Project template content. The tool persists the DB-backed PROJECT artifact and renders `.gsd/PROJECT.md`. Describe what the project is, its current state, and list the milestone sequence.
230
+ 3. Persist requirements with `gsd_requirement_save` or `gsd_requirement_update`, then call `gsd_summary_save` with `artifact_type: "REQUIREMENTS"` so the tool renders `.gsd/REQUIREMENTS.md` from DB rows. Confirm requirement states, ownership, and traceability before roadmap creation.
231
231
  **Depth-Preservation Guidance for context.md:**
232
232
  When writing context.md, preserve the user's exact terminology, emphasis, and framing. Do not flatten nuance into generic summaries. If the user said "craft feel," write "craft feel," not "high-quality user experience." CONTEXT.md is downstream agents' only window into this conversation.
233
233
 
@@ -243,8 +243,8 @@ When writing CONTEXT.md, include discussion-layer sections: **Scope**, **Archite
243
243
 
244
244
  Before emitting the ready phrase, verify in the CURRENT turn that you have:
245
245
 
246
- - [ ] Written `.gsd/PROJECT.md` (step 2)
247
- - [ ] Written `.gsd/REQUIREMENTS.md` (step 3)
246
+ - [ ] Called `gsd_summary_save` for the PROJECT artifact (step 2)
247
+ - [ ] Persisted requirements and called `gsd_summary_save` for the REQUIREMENTS artifact (step 3)
248
248
  - [ ] Written `{{contextPath}}` (step 4)
249
249
  - [ ] Called `gsd_plan_milestone` (step 5)
250
250
 
@@ -270,8 +270,8 @@ Once the user confirms the milestone split:
270
270
  #### Phase 1: Shared artifacts
271
271
 
272
272
  1. For each milestone, call `gsd_milestone_generate_id`; never invent IDs. Then `mkdir -p .gsd/milestones/<ID>/slices`.
273
- 2. Write `.gsd/PROJECT.md` use the **Project** output template below.
274
- 3. Write `.gsd/REQUIREMENTS.md` use the **Requirements** output template below. Capture Active, Deferred, Out of Scope, and any already Validated requirements. Later milestones may have provisional ownership where slice plans do not exist yet.
273
+ 2. Call `gsd_summary_save` with `artifact_type: "PROJECT"` and full Project template content so the tool persists the DB-backed PROJECT artifact and renders `.gsd/PROJECT.md`.
274
+ 3. Persist requirements with `gsd_requirement_save` or `gsd_requirement_update`, then call `gsd_summary_save` with `artifact_type: "REQUIREMENTS"` so the tool renders `.gsd/REQUIREMENTS.md` from DB rows. Capture Active, Deferred, Out of Scope, and any already Validated requirements. Later milestones may have provisional ownership where slice plans do not exist yet.
275
275
  4. For any architectural or pattern decisions made during discussion, call `gsd_decision_save` — the tool auto-assigns IDs and regenerates `.gsd/DECISIONS.md` automatically.
276
276
 
277
277
  #### Phase 2: Primary milestone
@@ -344,8 +344,8 @@ For single-milestone projects, do NOT write this file.
344
344
 
345
345
  Before emitting the ready phrase, verify in the CURRENT turn that you have:
346
346
 
347
- - [ ] Written `.gsd/PROJECT.md` (Phase 1)
348
- - [ ] Written `.gsd/REQUIREMENTS.md` (Phase 1)
347
+ - [ ] Called `gsd_summary_save` for the PROJECT artifact (Phase 1)
348
+ - [ ] Persisted requirements and called `gsd_summary_save` for the REQUIREMENTS artifact (Phase 1)
349
349
  - [ ] Written primary-milestone `CONTEXT.md` (Phase 2)
350
350
  - [ ] Called `gsd_plan_milestone` for the primary milestone (Phase 2)
351
351
  - [ ] Written `.gsd/DISCUSSION-MANIFEST.json` with `gates_completed === total` (Phase 3)
@@ -50,11 +50,11 @@ GSD extension source: `{{gsdSourceDir}}`
50
50
 
51
51
  The journal is a structured event log for auto-mode iterations. Daily files contain JSONL:
52
52
 
53
- ```
54
- { ts: "ISO-8601", flowId: "UUID", seq: 0, eventType: "iteration-start", rule?: "rule-name", causedBy?: { flowId, seq }, data?: { unitId, status, ... } }
53
+ ```json
54
+ { ts: "ISO-8601", flowId: "UUID", seq: 0, eventType: "orchestrator-iteration-start", rule?: "rule-name", causedBy?: { flowId, seq }, data?: { unitId, status, ... } }
55
55
  ```
56
56
 
57
- Key events: `iteration-start/end`, `dispatch-match/stop`, `unit-start/end`, `terminal`, `guard-block`, `stuck-detected`, `milestone-transition`, worktree events. `flowId` groups one loop; `causedBy` links causal events; `seq` orders events. Trace stuck loops with `stuck-detected` -> `flowId`; guard blocks with `guard-block` and `data.reason`.
57
+ Key orchestrator events: `orchestrator-iteration-start/end`, `orchestrator-dispatch-match/stop`, `orchestrator-guard-block`, `orchestrator-terminal`. Legacy loop and phase events (`iteration-start/end`, `dispatch-match/stop`, `unit-start/end`, `terminal`, `guard-block`, `stuck-detected`, `milestone-transition`) still appear for non-orchestrator paths, along with worktree events. `flowId` groups one loop; `causedBy` links causal events; `seq` orders events. Trace orchestrator stalls with `orchestrator-guard-block`/`orchestrator-dispatch-stop` and `data.reason`.
58
58
 
59
59
  ### Crash Lock Format (`auto.lock`)
60
60
 
@@ -1,6 +1,6 @@
1
1
  **Working directory:** `{{workingDirectory}}`. All file reads, writes, and shell commands MUST operate relative to this directory. Do NOT `cd` elsewhere. For `.gsd` files, use absolute paths rooted at `{{workingDirectory}}`, not `Glob`.
2
2
 
3
- Discuss the **project** as a whole: vision, users, anti-goals, constraints, and rough milestone sequence. Ask only real gray areas, then write `.gsd/PROJECT.md` with the **Project** template below. If a `GSD Skill Preferences` block exists, use it; artifact rules still apply.
3
+ Discuss the **project** as a whole: vision, users, anti-goals, constraints, and rough milestone sequence. Ask only real gray areas, then persist the final Project template through `gsd_summary_save` with `artifact_type: "PROJECT"`. The tool renders `.gsd/PROJECT.md`; do not write the projection directly. If a `GSD Skill Preferences` block exists, use it; artifact rules still apply.
4
4
 
5
5
  This runs once before milestone discussion. Later milestones, requirements, and roadmaps depend on it.
6
6
 
@@ -34,7 +34,7 @@ After the opening answer, classify project shape as **`simple`** or **`complex`*
34
34
 
35
35
  **Default to `complex` when uncertain.** The user can override the verdict in plain text; if they do, accept it and proceed.
36
36
 
37
- Persist the verdict to PROJECT.md -> `## Project Shape`; downstream `discuss-requirements`, `discuss-milestone`, and `discuss-slice` read it from there.
37
+ Persist the verdict through `gsd_summary_save` with `artifact_type: "PROJECT"` into `## Project Shape`; downstream `discuss-requirements`, `discuss-milestone`, and `discuss-slice` read the rendered projection.
38
38
 
39
39
  ### Before deeper rounds
40
40
 
@@ -95,7 +95,7 @@ If they clarify, absorb the correction and re-verify.
95
95
 
96
96
  The depth verification is the only required confirmation gate. Do not add a second "ready to proceed?" gate after it.
97
97
 
98
- **CRITICAL — Confirmation gate:** Do not write final PROJECT.md until the user selects the "(Recommended)" option (structured path) or explicitly confirms (plain-text path). If the user declines, cancels, does not respond, or the tool fails, re-ask.
98
+ **CRITICAL — Confirmation gate:** Do not persist final PROJECT content until the user selects the "(Recommended)" option (structured path) or explicitly confirms (plain-text path). If the user declines, cancels, does not respond, or the tool fails, re-ask.
99
99
 
100
100
  ---
101
101
 
@@ -104,7 +104,7 @@ The depth verification is the only required confirmation gate. Do not add a seco
104
104
  Once the user confirms depth:
105
105
 
106
106
  1. Use the **Project** output template (inlined above).
107
- 2. Call `gsd_summary_save` with `artifact_type: "PROJECT"` and full project markdown as `content`; omit `milestone_id`. The tool writes `.gsd/PROJECT.md` and persists to DB. Preserve the user's terms and framing.
107
+ 2. Call `gsd_summary_save` with `artifact_type: "PROJECT"` and full project markdown as `content`; omit `milestone_id`. The tool persists the DB-backed PROJECT artifact and renders `.gsd/PROJECT.md`. Preserve the user's terms and framing.
108
108
  3. The `## Project Shape` section MUST contain `**Complexity:** simple` or `**Complexity:** complex` (matching the verdict you announced) plus a one-line `**Why:**` rationale. Downstream stages read this line.
109
109
  4. The `## Capability Contract` section MUST reference `.gsd/REQUIREMENTS.md` — that file does not yet exist; the next stage (`discuss-requirements`) will produce it.
110
110
  5. The `## Milestone Sequence` MUST list at least M001 with title and one-liner. Subsequent milestones may be listed as known intents; they will be elaborated in their own discuss-milestone stages.
@@ -1,6 +1,6 @@
1
1
  **Working directory:** `{{workingDirectory}}`. All file reads, writes, and shell commands MUST operate relative to this directory. Do NOT `cd` elsewhere. For `.gsd` files, use absolute paths rooted at `{{workingDirectory}}`, not `Glob`.
2
2
 
3
- Discuss **project-level requirements**. Read `.gsd/PROJECT.md` first; it is authoritative for vision, core value, anti-goals, and milestone sequence. Requirements must trace to it. Ask capability gray areas, then write `.gsd/REQUIREMENTS.md` using v2 `R###` format and the **Requirements** template.
3
+ Discuss **project-level requirements**. Read `.gsd/PROJECT.md` first; it is the rendered project artifact for vision, core value, anti-goals, and milestone sequence. Requirements must trace to it. Ask capability gray areas, then persist requirements with `gsd_requirement_save` and render `.gsd/REQUIREMENTS.md` through `gsd_summary_save` using v2 `R###` format and the **Requirements** template.
4
4
 
5
5
  This runs once after `discuss-project` and before milestone work, creating the capability contract for milestones, slices, and verification.
6
6
 
@@ -25,7 +25,7 @@ Before your first action, print this banner verbatim in chat:
25
25
  3. If `.gsd/REQUIREMENTS.md` exists, read it as the working set.
26
26
 
27
27
  **Shape-dependent cadence:**
28
- - **`simple`**: one fast pass. Extract from PROJECT.md, ask 1-2 plain-text clarifiers only when class/status is ambiguous, then write REQUIREMENTS.md.
28
+ - **`simple`**: one fast pass. Extract from PROJECT.md, ask 1-2 plain-text clarifiers only when class/status is ambiguous, then persist requirements through the DB-backed tools.
29
29
  - **`complex`**: multi-round questioning with structured 3-4-option questions where alternatives matter.
30
30
 
31
31
  ---
@@ -81,7 +81,7 @@ Before the wrap-up gate, verify: every milestone has an Active requirement; Core
81
81
 
82
82
  If they adjust, absorb and re-verify.
83
83
 
84
- **CRITICAL — Confirmation gate:** Do not write final REQUIREMENTS.md until explicit confirmation. Never rationalize past it.
84
+ **CRITICAL — Confirmation gate:** Do not persist final REQUIREMENTS content until explicit confirmation. Never rationalize past it.
85
85
 
86
86
  ---
87
87
 
@@ -26,7 +26,7 @@ Before planning, validate roadmap assumptions against code and dependency summar
26
26
 
27
27
  {{sourceFilePaths}}
28
28
 
29
- If slice research is inlined, trust it. Explore enough code to confirm paths, boundaries, and verification. Executors later get only task plans, slice excerpt, and prior summaries, so put required paths, steps, inputs, and outputs in task plans.
29
+ If slice research is inlined, trust its architectural findings, but verify every concrete file path you place in task `inputs` or `expectedOutput` against the current tree or prior/same-task outputs. Explore enough code to confirm paths, boundaries, and verification. Executors later get only task plans, slice excerpt, and prior summaries, so put required paths, steps, inputs, and outputs in task plans.
30
30
 
31
31
  {{executorContextConstraints}}
32
32
 
@@ -39,10 +39,10 @@ If slice research is inlined, trust it. Explore enough code to confirm paths, bo
39
39
  5. Define slice verification before tasks. Non-trivial slices need real tests or executable assertions; boundary contracts need contract-exercising checks. Tests must not read .gitignore/gitignored paths such as `.gsd/`, `.planning/`, or `.audits/`.
40
40
  6. Include Threat Surface (Q3), Requirement Impact (Q4), proof level, observability, integration closure, Failure Modes (Q5), Load Profile (Q6), and Negative Tests (Q7) only where applicable.
41
41
  7. Right-size tasks. Simple slices can be one task; split only when context, ownership, or verification boundaries justify it.
42
- 8. Each task needs a concrete title, Why / Files / Do / Verify / Done when, plus task-plan description, steps, must-haves, verification, inputs, and expected output. Inputs and Expected Output must include concrete backtick-wrapped paths. Use paths relative to `{{workingDirectory}}`; do not put absolute paths to the original checkout or any directory outside `{{workingDirectory}}` in `files`, `inputs`, `expectedOutput`, or verification commands. **`expected_output` must only list files the task actually creates or overwrites on disk.** Do NOT include files the task merely reads, verifies, or tests — those belong only in `inputs`. If a task is a pure verification or test task that produces no new files, its `expected_output` may be empty or limited to test-result artifacts (e.g. a log or assertion output). A file that does not yet exist on disk and is needed as an `input` must be produced by an earlier task's `expected_output` — if no prior task creates it, add a task before this one that does.
43
- 9. Persist with `gsd_plan_slice` using goal, successCriteria, optional proofLevel/integrationClosure/observabilityImpact, and tasks. `gsd_plan_slice` handles task persistence transactionally and renders `{{outputPath}}` plus task plans; do not call `gsd_plan_task`. The DB-backed tool is the canonical write path. Do **not** rely on direct `PLAN.md` writes as the source of truth.
42
+ 8. Each task needs the exact `gsd_plan_slice.tasks[]` shape: `taskId`, `title`, `description`, `estimate`, `files`, `verify`, `inputs`, `expectedOutput`, and optional `observabilityImpact`. `description` should contain the Why / Do / Done-when narrative. `files`, `inputs`, and `expectedOutput` must be JSON arrays of strings, even when there is only one path (for example, `"inputs": ["src/index.ts"]`, never `"inputs": "src/index.ts"`). Use paths relative to `{{workingDirectory}}`; do not put absolute paths to the original checkout or any directory outside `{{workingDirectory}}` in `files`, `inputs`, `expectedOutput`, or verification commands. **`expectedOutput` must only list files the task actually creates or overwrites on disk.** Do NOT include files the task merely reads, verifies, or tests — those belong only in `inputs`. If a task is a pure verification or test task that produces no new files, `expectedOutput` may be `[]` or limited to test-result artifacts (e.g. a log or assertion output). A file that does not yet exist on disk and is needed as an `input` must be produced by an earlier task's `expectedOutput` — if no prior task creates it, add a task before this one that does.
43
+ 9. Persist with `gsd_plan_slice` using `milestoneId`, `sliceId`, `goal`, optional `successCriteria`/`proofLevel`/`integrationClosure`/`observabilityImpact`, and `tasks`. `gsd_plan_slice` handles task persistence transactionally and renders `{{outputPath}}` plus task plans; do not call `gsd_plan_task`. The DB-backed tool is the canonical write path. Do **not** rely on direct `PLAN.md` writes as the source of truth.
44
44
  10. Self-audit before finishing: goal/demo closure, requirement coverage, locked decisions, concrete paths, dependency order, wiring, scope size, proof truthfulness, feature completeness, and quality gates. Quality gates: non-trivial slices/tasks include specific Q3-Q7 coverage where applicable.
45
- 11. If planning creates structural decisions, append them to `.gsd/DECISIONS.md`.
45
+ 11. If planning creates structural decisions, call `gsd_decision_save` for each; the tool persists the decision and regenerates `.gsd/DECISIONS.md`.
46
46
  12. {{commitInstruction}}
47
47
 
48
48
  The slice directory already exists. Do not mkdir.
@@ -114,10 +114,10 @@ Once the user is satisfied, in one pass for **each** new milestone:
114
114
 
115
115
  After all milestone directories and context files are written:
116
116
 
117
- 3. Update `.gsd/PROJECT.md` by adding new milestones to the Milestone Sequence. Keep existing entries exactly as-is; only add new lines.
118
- 4. If `.gsd/REQUIREMENTS.md` exists and the queued work introduces new in-scope capabilities or promotes Deferred items, update it.
119
- 5. If discussion produced decisions relevant to existing work, append to `.gsd/DECISIONS.md`.
120
- 6. Append to `.gsd/QUEUE.md`.
117
+ 3. Refresh project state through `gsd_summary_save` with `artifact_type: "PROJECT"` and full PROJECT content that includes the new milestones in the Milestone Sequence; omit `milestone_id`.
118
+ 4. If the queued work introduces new in-scope capabilities or promotes Deferred items, persist those changes with `gsd_requirement_save` or `gsd_requirement_update`, then call `gsd_summary_save` with `artifact_type: "REQUIREMENTS"` so `.gsd/REQUIREMENTS.md` renders from DB rows.
119
+ 5. If discussion produced decisions relevant to existing work, call `gsd_decision_save` for each decision; the tool regenerates `.gsd/DECISIONS.md`.
120
+ 6. If `.gsd/QUEUE.md` is maintained, update it only as an audit projection of queued intent. Runtime queue state must come from the DB-backed milestone/context tool calls above.
121
121
  7. {{commitInstruction}}
122
122
 
123
123
  **Do NOT write roadmaps for queued milestones.**
@@ -8,7 +8,7 @@
8
8
 
9
9
  You are executing **multiple tasks in parallel** for this slice. The task graph below shows which tasks are ready for simultaneous execution based on their input/output dependencies.
10
10
 
11
- **Critical rule:** Use the `subagent` tool in **parallel mode** to dispatch all ready tasks simultaneously. Each subagent gets a full `execute-task` prompt and is responsible for its own implementation, verification, task summary, and completion tool calls. The parent batch agent orchestrates, verifies, and records failures only when a dispatched task failed before it could leave its own summary behind.
11
+ **Critical rule:** Use the `subagent` tool in **parallel mode** to dispatch all ready tasks simultaneously. Each subagent gets a task-specific execution packet (task plan + dependency carry-forward + completion contract) and is responsible for its own implementation, verification, task summary, and completion tool calls. The parent batch agent orchestrates, verifies, and records failures only when a dispatched task failed before it could leave its own summary behind.
12
12
 
13
13
  ## Task Dependency Graph
14
14
 
@@ -64,10 +64,10 @@ Then:
64
64
  2. {{skillActivation}} Record the installed skills you expect executors to use in each task plan's `skills_used` frontmatter.
65
65
  3. Define slice-level verification: the objective stopping condition. Plan real test files with real assertions; for simple slices, executable commands are fine.
66
66
  4. For non-trivial slices, plan observability / proof level / integration closure, threat surface, and requirement impact. Omit entirely for simple slices.
67
- 5. Decompose the slice into tasks that fit one context window each. Every task must have Why / Files / Do / Verify / Done-when, plus a task plan with description, steps, must-haves, verification, inputs (backtick-wrapped paths), and expected output (backtick-wrapped paths).
67
+ 5. Decompose the slice into tasks that fit one context window each. Every task passed to `gsd_plan_slice` must use the exact keys `taskId`, `title`, `description`, `estimate`, `files`, `verify`, `inputs`, `expectedOutput`, and optional `observabilityImpact`. Put Why / Do / Done-when detail in `description`. `files`, `inputs`, and `expectedOutput` must be JSON arrays of strings, even for one path (for example, `"expectedOutput": ["src/index.ts"]`, never `"expectedOutput": "src/index.ts"`).
68
68
  6. **Persist planning state through `gsd_plan_slice`.** Call it with the full payload. The tool writes to the DB and renders `{{outputPath}}` and `{{slicePath}}/tasks/T##-PLAN.md` automatically. Do NOT rely on direct `PLAN.md` writes.
69
69
  7. **Self-audit the plan.** If every task were completed exactly as written, the slice goal/demo should be true. Every must-have maps to a task. Inputs and Expected Output are backtick-wrapped file paths.
70
- 8. If refinement produced structural decisions that diverge from the sketch, append them to `.gsd/DECISIONS.md`.
70
+ 8. If refinement produced structural decisions that diverge from the sketch, call `gsd_decision_save` for each; the tool persists the decision and regenerates `.gsd/DECISIONS.md`.
71
71
  9. {{commitInstruction}}
72
72
 
73
73
  The slice directory and tasks/ subdirectory already exist. Do NOT mkdir.
@@ -23,7 +23,7 @@ An override was issued by the user that changes a fundamental decision or approa
23
23
  - For DECISIONS.md: append a new decision entry documenting the override and why. Do NOT delete prior decisions — mark them as superseded with a note.
24
24
  - For slice plans (S##-PLAN.md): update Goal, Demo, and Verification sections if affected. Update Files Likely Touched if the override changes scope. Do NOT modify completed task entries.
25
25
  - For REQUIREMENTS.md: update requirement descriptions if the override changes what "done" means, but do not remove requirements.
26
- - For PROJECT.md: update if the override changes project-level facts.
26
+ - For PROJECT.md: do not edit the projection directly. If the override changes project-level facts, persist the revised Project content through `gsd_summary_save` with `artifact_type: "PROJECT"` so the DB remains authoritative.
27
27
  - Milestone context files are reference only — do not modify them.
28
28
  4. Mark all active overrides as resolved: change `**Scope:** active` to `**Scope:** resolved` in `{{overridesPath}}`
29
29
  5. Do not commit manually — the system auto-commits your changes after this unit completes.