gsd-pi 2.81.0 → 2.82.0-dev.20138ae42

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 (740) hide show
  1. package/README.md +64 -33
  2. package/dist/resources/.managed-resources-content-hash +1 -1
  3. package/dist/resources/GSD-WORKFLOW.md +10 -1
  4. package/dist/resources/extensions/browser-tools/tools/screenshot.js +1 -0
  5. package/dist/resources/extensions/browser-tools/tools/zoom.js +1 -0
  6. package/dist/resources/extensions/claude-code-cli/partial-builder.js +2 -1
  7. package/dist/resources/extensions/cmux/index.js +5 -0
  8. package/dist/resources/extensions/gsd/auto/infra-errors.js +9 -3
  9. package/dist/resources/extensions/gsd/auto/loop.js +116 -13
  10. package/dist/resources/extensions/gsd/auto/orchestrator.js +124 -6
  11. package/dist/resources/extensions/gsd/auto/phases.js +220 -98
  12. package/dist/resources/extensions/gsd/auto/run-unit.js +66 -3
  13. package/dist/resources/extensions/gsd/auto/session.js +9 -0
  14. package/dist/resources/extensions/gsd/auto/verification-retry-policy.js +43 -0
  15. package/dist/resources/extensions/gsd/auto/workflow-memory-pressure.js +12 -0
  16. package/dist/resources/extensions/gsd/auto-dashboard.js +247 -178
  17. package/dist/resources/extensions/gsd/auto-dispatch.js +27 -17
  18. package/dist/resources/extensions/gsd/auto-model-selection.js +2 -0
  19. package/dist/resources/extensions/gsd/auto-post-unit.js +240 -128
  20. package/dist/resources/extensions/gsd/auto-prompts.js +13 -5
  21. package/dist/resources/extensions/gsd/auto-recovery.js +34 -179
  22. package/dist/resources/extensions/gsd/auto-runtime-state.js +5 -0
  23. package/dist/resources/extensions/gsd/auto-start.js +105 -35
  24. package/dist/resources/extensions/gsd/auto-unit-closeout.js +33 -5
  25. package/dist/resources/extensions/gsd/auto-verification.js +38 -26
  26. package/dist/resources/extensions/gsd/auto-worktree.js +119 -1
  27. package/dist/resources/extensions/gsd/auto.js +400 -108
  28. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +38 -12
  29. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +9 -8
  30. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +17 -4
  31. package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +4 -8
  32. package/dist/resources/extensions/gsd/bootstrap/subagent-input.js +21 -9
  33. package/dist/resources/extensions/gsd/bootstrap/system-context.js +55 -12
  34. package/dist/resources/extensions/gsd/bootstrap/write-gate.js +16 -2
  35. package/dist/resources/extensions/gsd/clean-root-preflight.js +170 -8
  36. package/dist/resources/extensions/gsd/commands/catalog.js +4 -1
  37. package/dist/resources/extensions/gsd/commands/handlers/core.js +38 -1
  38. package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +4 -10
  39. package/dist/resources/extensions/gsd/commands/handlers/parallel.js +9 -0
  40. package/dist/resources/extensions/gsd/commands-bootstrap.js +5 -0
  41. package/dist/resources/extensions/gsd/commands-handlers.js +15 -2
  42. package/dist/resources/extensions/gsd/context-store.js +112 -0
  43. package/dist/resources/extensions/gsd/crash-recovery.js +31 -5
  44. package/dist/resources/extensions/gsd/db/unit-dispatches.js +3 -2
  45. package/dist/resources/extensions/gsd/db-writer.js +150 -84
  46. package/dist/resources/extensions/gsd/dispatch-guard.js +2 -2
  47. package/dist/resources/extensions/gsd/docs/preferences-reference.md +1 -1
  48. package/dist/resources/extensions/gsd/doctor-git-checks.js +41 -6
  49. package/dist/resources/extensions/gsd/doctor-runtime-checks.js +28 -11
  50. package/dist/resources/extensions/gsd/doctor.js +2 -28
  51. package/dist/resources/extensions/gsd/export-html.js +27 -425
  52. package/dist/resources/extensions/gsd/git-service.js +41 -2
  53. package/dist/resources/extensions/gsd/gsd-db.js +8 -23
  54. package/dist/resources/extensions/gsd/guided-flow.js +93 -111
  55. package/dist/resources/extensions/gsd/guided-unit-context.js +23 -0
  56. package/dist/resources/extensions/gsd/health-widget-core.js +1 -1
  57. package/dist/resources/extensions/gsd/health-widget.js +4 -10
  58. package/dist/resources/extensions/gsd/knowledge-backfill.js +144 -0
  59. package/dist/resources/extensions/gsd/knowledge-capture.js +136 -0
  60. package/dist/resources/extensions/gsd/knowledge-parser.js +154 -0
  61. package/dist/resources/extensions/gsd/knowledge-projection.js +210 -0
  62. package/dist/resources/extensions/gsd/markdown-renderer.js +6 -96
  63. package/dist/resources/extensions/gsd/md-importer.js +1 -1
  64. package/dist/resources/extensions/gsd/memory-backfill.js +73 -17
  65. package/dist/resources/extensions/gsd/memory-consolidation-scanner.js +222 -0
  66. package/dist/resources/extensions/gsd/migrate/command.js +5 -0
  67. package/dist/resources/extensions/gsd/migrate/parsers.js +10 -0
  68. package/dist/resources/extensions/gsd/migrate/preview.js +9 -0
  69. package/dist/resources/extensions/gsd/migrate/transformer.js +51 -4
  70. package/dist/resources/extensions/gsd/migrate/writer.js +11 -1
  71. package/dist/resources/extensions/gsd/migration-auto-check.js +12 -17
  72. package/dist/resources/extensions/gsd/milestone-actions.js +11 -4
  73. package/dist/resources/extensions/gsd/native-git-bridge.js +62 -26
  74. package/dist/resources/extensions/gsd/notification-overlay.js +35 -40
  75. package/dist/resources/extensions/gsd/parallel-merge.js +53 -30
  76. package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +25 -33
  77. package/dist/resources/extensions/gsd/pending-auto-start.js +52 -0
  78. package/dist/resources/extensions/gsd/post-execution-checks.js +73 -2
  79. package/dist/resources/extensions/gsd/pre-execution-checks.js +28 -1
  80. package/dist/resources/extensions/gsd/prompt-loader.js +1 -1
  81. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
  82. package/dist/resources/extensions/gsd/prompts/complete-slice.md +14 -12
  83. package/dist/resources/extensions/gsd/prompts/discuss-headless.md +28 -10
  84. package/dist/resources/extensions/gsd/prompts/discuss.md +29 -11
  85. package/dist/resources/extensions/gsd/prompts/guided-discuss-project.md +4 -4
  86. package/dist/resources/extensions/gsd/prompts/guided-discuss-requirements.md +3 -3
  87. package/dist/resources/extensions/gsd/prompts/plan-slice.md +4 -4
  88. package/dist/resources/extensions/gsd/prompts/queue.md +4 -4
  89. package/dist/resources/extensions/gsd/prompts/refine-slice.md +2 -2
  90. package/dist/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
  91. package/dist/resources/extensions/gsd/prompts/system.md +2 -2
  92. package/dist/resources/extensions/gsd/provider-switch-observer.js +146 -0
  93. package/dist/resources/extensions/gsd/recovery-classification.js +15 -1
  94. package/dist/resources/extensions/gsd/session-lock.js +40 -0
  95. package/dist/resources/extensions/gsd/smart-entry-routing.js +36 -0
  96. package/dist/resources/extensions/gsd/state-reconciliation/drift/completion.js +131 -0
  97. package/dist/resources/extensions/gsd/state-reconciliation/drift/merge-state.js +252 -0
  98. package/dist/resources/extensions/gsd/state-reconciliation/drift/project-md.js +45 -0
  99. package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +82 -0
  100. package/dist/resources/extensions/gsd/state-reconciliation/drift/sketch-flag.js +50 -0
  101. package/dist/resources/extensions/gsd/state-reconciliation/drift/stale-render.js +124 -0
  102. package/dist/resources/extensions/gsd/state-reconciliation/drift/stale-worker.js +32 -0
  103. package/dist/resources/extensions/gsd/state-reconciliation/errors.js +41 -0
  104. package/dist/resources/extensions/gsd/state-reconciliation/index.js +99 -0
  105. package/dist/resources/extensions/gsd/state-reconciliation/registry.js +24 -0
  106. package/dist/resources/extensions/gsd/state-reconciliation/spawn-gate.js +43 -0
  107. package/dist/resources/extensions/gsd/state-reconciliation/types.js +3 -0
  108. package/dist/resources/extensions/gsd/state-reconciliation.js +5 -26
  109. package/dist/resources/extensions/gsd/status-guards.js +4 -0
  110. package/dist/resources/extensions/gsd/templates/knowledge.md +2 -2
  111. package/dist/resources/extensions/gsd/templates/plan.md +8 -5
  112. package/dist/resources/extensions/gsd/templates/task-plan.md +4 -2
  113. package/dist/resources/extensions/gsd/tools/complete-milestone.js +6 -8
  114. package/dist/resources/extensions/gsd/tools/complete-slice.js +6 -8
  115. package/dist/resources/extensions/gsd/tools/plan-milestone.js +7 -1
  116. package/dist/resources/extensions/gsd/tools/plan-slice.js +89 -14
  117. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +119 -0
  118. package/dist/resources/extensions/gsd/tui/render-kit.js +74 -0
  119. package/dist/resources/extensions/gsd/unit-context-manifest.js +32 -10
  120. package/dist/resources/extensions/gsd/validation.js +23 -1
  121. package/dist/resources/extensions/gsd/verification-gate.js +68 -7
  122. package/dist/resources/extensions/gsd/verification-verdict.js +26 -0
  123. package/dist/resources/extensions/gsd/watch/header-renderer.js +92 -69
  124. package/dist/resources/extensions/gsd/watch/splash-palette.js +10 -0
  125. package/dist/resources/extensions/gsd/workflow-mcp.js +2 -2
  126. package/dist/resources/extensions/gsd/workflow-projections.js +6 -8
  127. package/dist/resources/extensions/gsd/worktree-lifecycle.js +769 -319
  128. package/dist/resources/extensions/gsd/worktree-telemetry.js +3 -1
  129. package/dist/resources/extensions/shared/html-shell.js +388 -0
  130. package/dist/resources/extensions/subagent/index.js +448 -78
  131. package/dist/resources/extensions/subagent/launch.js +77 -0
  132. package/dist/resources/extensions/subagent/run-store.js +148 -0
  133. package/dist/resources/extensions/visual-brief/artifact-policy.js +29 -0
  134. package/dist/resources/extensions/visual-brief/extension-manifest.json +8 -0
  135. package/dist/resources/extensions/visual-brief/index.js +5 -0
  136. package/dist/resources/extensions/visual-brief/page-contract.js +124 -0
  137. package/dist/resources/extensions/visual-brief/prompts.js +140 -0
  138. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  139. package/dist/web/standalone/.next/BUILD_ID +1 -1
  140. package/dist/web/standalone/.next/app-path-routes-manifest.json +10 -10
  141. package/dist/web/standalone/.next/build-manifest.json +4 -4
  142. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  143. package/dist/web/standalone/.next/react-loadable-manifest.json +3 -3
  144. package/dist/web/standalone/.next/required-server-files.json +3 -3
  145. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  146. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  147. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  148. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  149. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  150. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  151. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  152. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  153. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  154. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  155. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  156. package/dist/web/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  157. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  158. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  159. package/dist/web/standalone/.next/server/app/_not-found.rsc +4 -7
  160. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -7
  161. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  162. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +4 -5
  163. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  164. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  165. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -5
  166. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  168. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  169. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  170. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  171. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  172. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  173. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  174. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  175. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  176. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  178. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  179. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  180. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  181. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  182. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  183. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  184. package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
  185. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  186. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  187. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  188. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  189. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  190. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  191. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  192. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  193. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  194. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  195. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  196. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  197. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  198. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  199. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  200. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  201. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  202. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  203. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  204. package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
  205. package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  206. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  207. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  208. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  209. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  210. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  211. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  212. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  213. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  214. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
  215. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  216. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  217. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  218. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  219. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  220. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  221. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  222. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  223. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  224. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  225. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  226. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  227. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  228. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  229. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  230. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  231. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  232. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  233. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  234. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
  235. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  236. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  237. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  238. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
  239. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  240. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +2 -2
  241. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  242. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  243. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  244. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  245. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  246. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  247. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  248. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  249. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  250. package/dist/web/standalone/.next/server/app/index.html +1 -1
  251. package/dist/web/standalone/.next/server/app/index.rsc +5 -8
  252. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  253. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +5 -8
  254. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  255. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +4 -5
  256. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -5
  257. package/dist/web/standalone/.next/server/app/page.js +2 -2
  258. package/dist/web/standalone/.next/server/app/page.js.nft.json +1 -1
  259. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  260. package/dist/web/standalone/.next/server/app-paths-manifest.json +10 -10
  261. package/dist/web/standalone/.next/server/chunks/4266.js +2 -0
  262. package/dist/web/standalone/.next/server/chunks/63.js +3 -3
  263. package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
  264. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  265. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  266. package/dist/web/standalone/.next/server/middleware.js +2 -2
  267. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  268. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  269. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  270. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  271. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  272. package/dist/web/standalone/.next/static/chunks/2973.33f26573894b6153.js +2 -0
  273. package/dist/web/standalone/.next/static/chunks/{8359.e059d86b255fce1c.js → 8359.7eb3bb8f8ecf4c01.js} +2 -2
  274. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  275. package/dist/web/standalone/.next/static/chunks/app/layout-8c10ec293ae0f1d5.js +1 -0
  276. package/dist/web/standalone/.next/static/chunks/app/page-752f1e2ebdaa3e45.js +1 -0
  277. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  278. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  279. package/dist/web/standalone/.next/static/chunks/{webpack-de742b64187e13fe.js → webpack-9a4db269f9ed63ad.js} +1 -1
  280. package/dist/web/standalone/.next/static/css/746ee28c929d1880.css +1 -0
  281. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  282. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  283. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  284. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  285. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  286. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  287. package/dist/web/standalone/server.js +1 -1
  288. package/dist/welcome-screen.d.ts +0 -7
  289. package/dist/welcome-screen.js +60 -69
  290. package/package.json +6 -5
  291. package/packages/contracts/dist/rpc.test.js +7 -0
  292. package/packages/contracts/dist/rpc.test.js.map +1 -1
  293. package/packages/contracts/dist/workflow.d.ts +21 -0
  294. package/packages/contracts/dist/workflow.d.ts.map +1 -1
  295. package/packages/contracts/dist/workflow.js +24 -0
  296. package/packages/contracts/dist/workflow.js.map +1 -1
  297. package/packages/contracts/src/rpc.test.ts +8 -0
  298. package/packages/contracts/src/workflow.ts +24 -0
  299. package/packages/daemon/package.json +2 -2
  300. package/packages/mcp-server/README.md +14 -3
  301. package/packages/mcp-server/dist/workflow-tools.d.ts +0 -3
  302. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  303. package/packages/mcp-server/dist/workflow-tools.js +80 -0
  304. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  305. package/packages/mcp-server/package.json +2 -2
  306. package/packages/mcp-server/src/workflow-tools-parity.test.ts +244 -0
  307. package/packages/mcp-server/src/workflow-tools.test.ts +23 -1
  308. package/packages/mcp-server/src/workflow-tools.ts +168 -0
  309. package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
  310. package/packages/native/package.json +1 -1
  311. package/packages/native/tsconfig.json +2 -1
  312. package/packages/native/tsconfig.tsbuildinfo +1 -1
  313. package/packages/pi-agent-core/package.json +1 -1
  314. package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
  315. package/packages/pi-ai/dist/index.d.ts +2 -2
  316. package/packages/pi-ai/dist/index.d.ts.map +1 -1
  317. package/packages/pi-ai/dist/index.js +1 -1
  318. package/packages/pi-ai/dist/index.js.map +1 -1
  319. package/packages/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
  320. package/packages/pi-ai/dist/providers/openai-codex-responses.js +82 -1
  321. package/packages/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
  322. package/packages/pi-ai/dist/providers/openai-codex-responses.test.d.ts +2 -0
  323. package/packages/pi-ai/dist/providers/openai-codex-responses.test.d.ts.map +1 -0
  324. package/packages/pi-ai/dist/providers/openai-codex-responses.test.js +52 -0
  325. package/packages/pi-ai/dist/providers/openai-codex-responses.test.js.map +1 -0
  326. package/packages/pi-ai/dist/providers/simple-options.d.ts +2 -4
  327. package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
  328. package/packages/pi-ai/dist/providers/simple-options.js +5 -6
  329. package/packages/pi-ai/dist/providers/simple-options.js.map +1 -1
  330. package/packages/pi-ai/dist/providers/simple-options.test.d.ts +2 -0
  331. package/packages/pi-ai/dist/providers/simple-options.test.d.ts.map +1 -0
  332. package/packages/pi-ai/dist/providers/simple-options.test.js +50 -0
  333. package/packages/pi-ai/dist/providers/simple-options.test.js.map +1 -0
  334. package/packages/pi-ai/dist/providers/transform-messages.d.ts +11 -0
  335. package/packages/pi-ai/dist/providers/transform-messages.d.ts.map +1 -1
  336. package/packages/pi-ai/dist/providers/transform-messages.js +20 -0
  337. package/packages/pi-ai/dist/providers/transform-messages.js.map +1 -1
  338. package/packages/pi-ai/package.json +1 -1
  339. package/packages/pi-ai/src/index.ts +7 -2
  340. package/packages/pi-ai/src/providers/openai-codex-responses.test.ts +63 -0
  341. package/packages/pi-ai/src/providers/openai-codex-responses.ts +91 -1
  342. package/packages/pi-ai/src/providers/simple-options.test.ts +60 -0
  343. package/packages/pi-ai/src/providers/simple-options.ts +5 -6
  344. package/packages/pi-ai/src/providers/transform-messages.ts +24 -0
  345. package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
  346. package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.d.ts +2 -0
  347. package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.d.ts.map +1 -0
  348. package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.js +66 -0
  349. package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.js.map +1 -0
  350. package/packages/pi-coding-agent/dist/core/agent-session.js +1 -1
  351. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  352. package/packages/pi-coding-agent/dist/core/system-prompt.js +4 -4
  353. package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
  354. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.d.ts +2 -0
  355. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.d.ts.map +1 -0
  356. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.js +47 -0
  357. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.js.map +1 -0
  358. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +76 -9
  359. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
  360. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.d.ts +2 -0
  361. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.d.ts.map +1 -0
  362. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.js +40 -0
  363. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.js.map +1 -0
  364. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts +0 -1
  365. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts.map +1 -1
  366. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js +30 -29
  367. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -1
  368. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js +10 -3
  369. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js.map +1 -1
  370. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  371. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +13 -13
  372. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
  373. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +1 -3
  374. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  375. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +58 -3
  376. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
  377. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts +2 -2
  378. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -1
  379. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js +12 -6
  380. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js.map +1 -1
  381. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
  382. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +33 -42
  383. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
  384. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +0 -1
  385. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  386. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +86 -82
  387. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  388. package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.d.ts +35 -0
  389. package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.d.ts.map +1 -0
  390. package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.js +152 -0
  391. package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.js.map +1 -0
  392. package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.d.ts +16 -0
  393. package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.d.ts.map +1 -0
  394. package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.js +73 -0
  395. package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.js.map +1 -0
  396. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts +1 -1
  397. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  398. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js +12 -8
  399. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
  400. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.d.ts +2 -0
  401. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.d.ts.map +1 -0
  402. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.js +17 -0
  403. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.js.map +1 -0
  404. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  405. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +105 -1
  406. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  407. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  408. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +27 -26
  409. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
  410. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +9 -6
  411. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -1
  412. package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.d.ts +2 -0
  413. package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.d.ts.map +1 -0
  414. package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.js +17 -0
  415. package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.js.map +1 -0
  416. package/packages/pi-coding-agent/package.json +1 -1
  417. package/packages/pi-coding-agent/src/core/agent-session-thinking-level.test.ts +79 -0
  418. package/packages/pi-coding-agent/src/core/agent-session.ts +1 -1
  419. package/packages/pi-coding-agent/src/core/system-prompt.ts +4 -4
  420. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/assistant-message-design.test.ts +56 -0
  421. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +113 -9
  422. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/user-message-design.test.ts +48 -0
  423. package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.test.ts +10 -3
  424. package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +43 -42
  425. package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +14 -14
  426. package/packages/pi-coding-agent/src/modes/interactive/components/bash-execution.ts +64 -3
  427. package/packages/pi-coding-agent/src/modes/interactive/components/diff.ts +13 -7
  428. package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +33 -44
  429. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +84 -104
  430. package/packages/pi-coding-agent/src/modes/interactive/components/transcript-design.ts +196 -0
  431. package/packages/pi-coding-agent/src/modes/interactive/components/tui-style-kit.ts +94 -0
  432. package/packages/pi-coding-agent/src/modes/interactive/components/user-message.ts +14 -9
  433. package/packages/pi-coding-agent/src/modes/interactive/theme/theme-highlight.test.ts +23 -0
  434. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +106 -1
  435. package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +27 -26
  436. package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +9 -6
  437. package/packages/pi-coding-agent/src/tests/system-prompt-file-safety.test.ts +22 -0
  438. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
  439. package/packages/pi-tui/dist/__tests__/overlay-layout.test.js +14 -1
  440. package/packages/pi-tui/dist/__tests__/overlay-layout.test.js.map +1 -1
  441. package/packages/pi-tui/dist/overlay-layout.d.ts.map +1 -1
  442. package/packages/pi-tui/dist/overlay-layout.js +9 -6
  443. package/packages/pi-tui/dist/overlay-layout.js.map +1 -1
  444. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  445. package/packages/pi-tui/dist/tui.js +5 -0
  446. package/packages/pi-tui/dist/tui.js.map +1 -1
  447. package/packages/pi-tui/package.json +1 -1
  448. package/packages/pi-tui/src/__tests__/overlay-layout.test.ts +20 -1
  449. package/packages/pi-tui/src/overlay-layout.ts +10 -7
  450. package/packages/pi-tui/src/tui.ts +6 -0
  451. package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
  452. package/packages/rpc-client/package.json +1 -1
  453. package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
  454. package/pkg/dist/modes/interactive/theme/theme-highlight.test.d.ts +2 -0
  455. package/pkg/dist/modes/interactive/theme/theme-highlight.test.d.ts.map +1 -0
  456. package/pkg/dist/modes/interactive/theme/theme-highlight.test.js +17 -0
  457. package/pkg/dist/modes/interactive/theme/theme-highlight.test.js.map +1 -0
  458. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  459. package/pkg/dist/modes/interactive/theme/theme.js +105 -1
  460. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  461. package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  462. package/pkg/dist/modes/interactive/theme/themes.js +27 -26
  463. package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
  464. package/pkg/package.json +1 -1
  465. package/src/resources/GSD-WORKFLOW.md +10 -1
  466. package/src/resources/extensions/browser-tools/tools/screenshot.ts +1 -0
  467. package/src/resources/extensions/browser-tools/tools/zoom.ts +1 -0
  468. package/src/resources/extensions/claude-code-cli/partial-builder.ts +2 -1
  469. package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +19 -2
  470. package/src/resources/extensions/cmux/index.ts +6 -0
  471. package/src/resources/extensions/gsd/auto/contracts.ts +59 -16
  472. package/src/resources/extensions/gsd/auto/infra-errors.ts +9 -3
  473. package/src/resources/extensions/gsd/auto/loop-deps.ts +9 -5
  474. package/src/resources/extensions/gsd/auto/loop.ts +121 -14
  475. package/src/resources/extensions/gsd/auto/orchestrator.ts +129 -6
  476. package/src/resources/extensions/gsd/auto/phases.ts +180 -20
  477. package/src/resources/extensions/gsd/auto/run-unit.ts +69 -4
  478. package/src/resources/extensions/gsd/auto/session.ts +10 -0
  479. package/src/resources/extensions/gsd/auto/verification-retry-policy.ts +82 -0
  480. package/src/resources/extensions/gsd/auto/workflow-memory-pressure.ts +13 -0
  481. package/src/resources/extensions/gsd/auto-dashboard.ts +301 -183
  482. package/src/resources/extensions/gsd/auto-dispatch.ts +29 -7
  483. package/src/resources/extensions/gsd/auto-model-selection.ts +2 -1
  484. package/src/resources/extensions/gsd/auto-post-unit.ts +273 -140
  485. package/src/resources/extensions/gsd/auto-prompts.ts +13 -5
  486. package/src/resources/extensions/gsd/auto-recovery.ts +36 -209
  487. package/src/resources/extensions/gsd/auto-runtime-state.ts +5 -0
  488. package/src/resources/extensions/gsd/auto-start.ts +114 -31
  489. package/src/resources/extensions/gsd/auto-unit-closeout.ts +51 -0
  490. package/src/resources/extensions/gsd/auto-verification.ts +46 -38
  491. package/src/resources/extensions/gsd/auto-worktree.ts +127 -1
  492. package/src/resources/extensions/gsd/auto.ts +441 -107
  493. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +54 -12
  494. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +9 -8
  495. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +16 -4
  496. package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +5 -8
  497. package/src/resources/extensions/gsd/bootstrap/subagent-input.ts +19 -7
  498. package/src/resources/extensions/gsd/bootstrap/system-context.ts +58 -15
  499. package/src/resources/extensions/gsd/bootstrap/write-gate.ts +19 -3
  500. package/src/resources/extensions/gsd/clean-root-preflight.ts +174 -8
  501. package/src/resources/extensions/gsd/commands/catalog.ts +4 -1
  502. package/src/resources/extensions/gsd/commands/handlers/core.ts +41 -1
  503. package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +4 -10
  504. package/src/resources/extensions/gsd/commands/handlers/parallel.ts +12 -0
  505. package/src/resources/extensions/gsd/commands-bootstrap.ts +10 -0
  506. package/src/resources/extensions/gsd/commands-handlers.ts +19 -2
  507. package/src/resources/extensions/gsd/context-store.ts +120 -1
  508. package/src/resources/extensions/gsd/crash-recovery.ts +30 -4
  509. package/src/resources/extensions/gsd/db/unit-dispatches.ts +4 -3
  510. package/src/resources/extensions/gsd/db-writer.ts +167 -84
  511. package/src/resources/extensions/gsd/dispatch-guard.ts +2 -2
  512. package/src/resources/extensions/gsd/docs/preferences-reference.md +1 -1
  513. package/src/resources/extensions/gsd/doctor-git-checks.ts +44 -6
  514. package/src/resources/extensions/gsd/doctor-runtime-checks.ts +25 -13
  515. package/src/resources/extensions/gsd/doctor-types.ts +2 -0
  516. package/src/resources/extensions/gsd/doctor.ts +2 -27
  517. package/src/resources/extensions/gsd/export-html.ts +27 -427
  518. package/src/resources/extensions/gsd/git-service.ts +47 -1
  519. package/src/resources/extensions/gsd/gsd-db.ts +10 -23
  520. package/src/resources/extensions/gsd/guided-flow.ts +126 -128
  521. package/src/resources/extensions/gsd/guided-unit-context.ts +30 -0
  522. package/src/resources/extensions/gsd/health-widget-core.ts +1 -1
  523. package/src/resources/extensions/gsd/health-widget.ts +6 -10
  524. package/src/resources/extensions/gsd/journal.ts +2 -0
  525. package/src/resources/extensions/gsd/knowledge-backfill.ts +164 -0
  526. package/src/resources/extensions/gsd/knowledge-capture.ts +160 -0
  527. package/src/resources/extensions/gsd/knowledge-parser.ts +174 -0
  528. package/src/resources/extensions/gsd/knowledge-projection.ts +241 -0
  529. package/src/resources/extensions/gsd/markdown-renderer.ts +10 -96
  530. package/src/resources/extensions/gsd/md-importer.ts +1 -1
  531. package/src/resources/extensions/gsd/memory-backfill.ts +89 -17
  532. package/src/resources/extensions/gsd/memory-consolidation-scanner.ts +277 -0
  533. package/src/resources/extensions/gsd/migrate/command.ts +5 -0
  534. package/src/resources/extensions/gsd/migrate/parsers.ts +11 -0
  535. package/src/resources/extensions/gsd/migrate/preview.ts +10 -0
  536. package/src/resources/extensions/gsd/migrate/transformer.ts +58 -4
  537. package/src/resources/extensions/gsd/migrate/writer.ts +14 -1
  538. package/src/resources/extensions/gsd/migration-auto-check.ts +15 -23
  539. package/src/resources/extensions/gsd/milestone-actions.ts +10 -4
  540. package/src/resources/extensions/gsd/native-git-bridge.ts +68 -25
  541. package/src/resources/extensions/gsd/notification-overlay.ts +50 -46
  542. package/src/resources/extensions/gsd/parallel-merge.ts +61 -34
  543. package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +33 -35
  544. package/src/resources/extensions/gsd/pending-auto-start.ts +79 -0
  545. package/src/resources/extensions/gsd/post-execution-checks.ts +87 -2
  546. package/src/resources/extensions/gsd/pre-execution-checks.ts +32 -1
  547. package/src/resources/extensions/gsd/prompt-loader.ts +1 -1
  548. package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
  549. package/src/resources/extensions/gsd/prompts/complete-slice.md +14 -12
  550. package/src/resources/extensions/gsd/prompts/discuss-headless.md +28 -10
  551. package/src/resources/extensions/gsd/prompts/discuss.md +29 -11
  552. package/src/resources/extensions/gsd/prompts/guided-discuss-project.md +4 -4
  553. package/src/resources/extensions/gsd/prompts/guided-discuss-requirements.md +3 -3
  554. package/src/resources/extensions/gsd/prompts/plan-slice.md +4 -4
  555. package/src/resources/extensions/gsd/prompts/queue.md +4 -4
  556. package/src/resources/extensions/gsd/prompts/refine-slice.md +2 -2
  557. package/src/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
  558. package/src/resources/extensions/gsd/prompts/system.md +2 -2
  559. package/src/resources/extensions/gsd/provider-switch-observer.ts +185 -0
  560. package/src/resources/extensions/gsd/recovery-classification.ts +18 -1
  561. package/src/resources/extensions/gsd/session-lock.ts +41 -0
  562. package/src/resources/extensions/gsd/smart-entry-routing.ts +77 -0
  563. package/src/resources/extensions/gsd/state-reconciliation/drift/completion.ts +172 -0
  564. package/src/resources/extensions/gsd/state-reconciliation/drift/merge-state.ts +344 -0
  565. package/src/resources/extensions/gsd/state-reconciliation/drift/project-md.ts +66 -0
  566. package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +101 -0
  567. package/src/resources/extensions/gsd/state-reconciliation/drift/sketch-flag.ts +68 -0
  568. package/src/resources/extensions/gsd/state-reconciliation/drift/stale-render.ts +185 -0
  569. package/src/resources/extensions/gsd/state-reconciliation/drift/stale-worker.ts +46 -0
  570. package/src/resources/extensions/gsd/state-reconciliation/errors.ts +67 -0
  571. package/src/resources/extensions/gsd/state-reconciliation/index.ts +142 -0
  572. package/src/resources/extensions/gsd/state-reconciliation/registry.ts +27 -0
  573. package/src/resources/extensions/gsd/state-reconciliation/spawn-gate.ts +60 -0
  574. package/src/resources/extensions/gsd/state-reconciliation/types.ts +83 -0
  575. package/src/resources/extensions/gsd/state-reconciliation.ts +21 -53
  576. package/src/resources/extensions/gsd/status-guards.ts +5 -0
  577. package/src/resources/extensions/gsd/templates/knowledge.md +2 -2
  578. package/src/resources/extensions/gsd/templates/plan.md +8 -5
  579. package/src/resources/extensions/gsd/templates/task-plan.md +4 -2
  580. package/src/resources/extensions/gsd/tests/artifact-retry-cap.test.ts +1 -1
  581. package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +170 -0
  582. package/src/resources/extensions/gsd/tests/auto-deterministic-error-classification-4973.test.ts +116 -0
  583. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +783 -176
  584. package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +487 -4
  585. package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +292 -4
  586. package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +53 -2
  587. package/src/resources/extensions/gsd/tests/auto-post-unit-step-message.test.ts +12 -1
  588. package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +15 -1
  589. package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +20 -5
  590. package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +19 -0
  591. package/src/resources/extensions/gsd/tests/auto-unit-closeout.test.ts +68 -0
  592. package/src/resources/extensions/gsd/tests/auto-worktree-registry.test.ts +69 -1
  593. package/src/resources/extensions/gsd/tests/brief-command.test.ts +89 -0
  594. package/src/resources/extensions/gsd/tests/browser-tools-compatibility-declarations.test.ts +62 -0
  595. package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +107 -2
  596. package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +11 -2
  597. package/src/resources/extensions/gsd/tests/closeout-git-deferral.test.ts +16 -0
  598. package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +4 -1
  599. package/src/resources/extensions/gsd/tests/complete-slice.test.ts +5 -9
  600. package/src/resources/extensions/gsd/tests/complete-task.test.ts +3 -1
  601. package/src/resources/extensions/gsd/tests/context-store-decisions-from-memories.test.ts +312 -0
  602. package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +43 -2
  603. package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +28 -1
  604. package/src/resources/extensions/gsd/tests/db-authority-regression.test.ts +208 -0
  605. package/src/resources/extensions/gsd/tests/db-writer.test.ts +13 -8
  606. package/src/resources/extensions/gsd/tests/decisions-projection-from-memories.test.ts +453 -0
  607. package/src/resources/extensions/gsd/tests/decisions-stop-table-writes.test.ts +348 -0
  608. package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +79 -4
  609. package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +83 -0
  610. package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +27 -0
  611. package/src/resources/extensions/gsd/tests/evidence-cross-ref.test.ts +38 -0
  612. package/src/resources/extensions/gsd/tests/export-html-enhancements.test.ts +8 -0
  613. package/src/resources/extensions/gsd/tests/freeform-decisions.test.ts +8 -4
  614. package/src/resources/extensions/gsd/tests/gsd-tools.test.ts +11 -7
  615. package/src/resources/extensions/gsd/tests/guided-discuss-project-prompt-rendering.test.ts +2 -0
  616. package/src/resources/extensions/gsd/tests/guided-dispatch-root.test.ts +106 -0
  617. package/src/resources/extensions/gsd/tests/guided-flow-session-isolation.test.ts +59 -11
  618. package/src/resources/extensions/gsd/tests/guided-flow.test.ts +21 -0
  619. package/src/resources/extensions/gsd/tests/guided-tool-contract.test.ts +65 -0
  620. package/src/resources/extensions/gsd/tests/header-renderer.test.ts +40 -0
  621. package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +17 -7
  622. package/src/resources/extensions/gsd/tests/health-widget.test.ts +14 -4
  623. package/src/resources/extensions/gsd/tests/hook-model-resolution.test.ts +5 -0
  624. package/src/resources/extensions/gsd/tests/infra-error.test.ts +2 -2
  625. package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +9 -0
  626. package/src/resources/extensions/gsd/tests/integration/doctor-git.test.ts +44 -0
  627. package/src/resources/extensions/gsd/tests/integration/doctor-runtime.test.ts +20 -0
  628. package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +129 -1
  629. package/src/resources/extensions/gsd/tests/integration/integration-lifecycle.test.ts +13 -5
  630. package/src/resources/extensions/gsd/tests/integration/integration-proof.test.ts +1 -1
  631. package/src/resources/extensions/gsd/tests/integration/migrate-command.test.ts +48 -3
  632. package/src/resources/extensions/gsd/tests/integration/parallel-merge.test.ts +116 -24
  633. package/src/resources/extensions/gsd/tests/integration/state-machine-runtime-failures.test.ts +6 -1
  634. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +0 -1
  635. package/src/resources/extensions/gsd/tests/knowledge-backfill-projection.test.ts +323 -0
  636. package/src/resources/extensions/gsd/tests/knowledge-capture.test.ts +242 -0
  637. package/src/resources/extensions/gsd/tests/knowledge.test.ts +47 -2
  638. package/src/resources/extensions/gsd/tests/load-knowledge-block-rules-only.test.ts +209 -0
  639. package/src/resources/extensions/gsd/tests/markdown-renderer.test.ts +1 -1
  640. package/src/resources/extensions/gsd/tests/memory-consolidation-scanner.test.ts +316 -0
  641. package/src/resources/extensions/gsd/tests/merge-conflict-stops-loop.test.ts +46 -11
  642. package/src/resources/extensions/gsd/tests/migrate-transformer.test.ts +5 -1
  643. package/src/resources/extensions/gsd/tests/migrate-validator-parsers.test.ts +24 -1
  644. package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +6 -1
  645. package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +26 -18
  646. package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +63 -2
  647. package/src/resources/extensions/gsd/tests/notification-overlay.test.ts +78 -41
  648. package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +44 -0
  649. package/src/resources/extensions/gsd/tests/originalbase-path-comparison.test.ts +12 -217
  650. package/src/resources/extensions/gsd/tests/orphaned-worktree-audit.test.ts +121 -1
  651. package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +38 -6
  652. package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +55 -1
  653. package/src/resources/extensions/gsd/tests/pending-autostart-scope.test.ts +29 -5
  654. package/src/resources/extensions/gsd/tests/plan-milestone-sketch-render.test.ts +157 -0
  655. package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +26 -0
  656. package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +2 -0
  657. package/src/resources/extensions/gsd/tests/plan-slice.test.ts +225 -1
  658. package/src/resources/extensions/gsd/tests/plan-task.test.ts +17 -0
  659. package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +81 -3
  660. package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +86 -0
  661. package/src/resources/extensions/gsd/tests/post-unit-git-failure.test.ts +1 -1
  662. package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +53 -0
  663. package/src/resources/extensions/gsd/tests/progressive-planning.test.ts +1 -1
  664. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +32 -1
  665. package/src/resources/extensions/gsd/tests/prompt-loader.test.ts +23 -0
  666. package/src/resources/extensions/gsd/tests/provider-errors.test.ts +20 -1
  667. package/src/resources/extensions/gsd/tests/provider-switch-observer.test.ts +252 -0
  668. package/src/resources/extensions/gsd/tests/remediation-completion-guard.test.ts +46 -2
  669. package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +7 -3
  670. package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +6 -3
  671. package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +16 -4
  672. package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +34 -0
  673. package/src/resources/extensions/gsd/tests/smart-entry-routing.test.ts +113 -0
  674. package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +53 -2
  675. package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +71 -58
  676. package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +1048 -0
  677. package/src/resources/extensions/gsd/tests/stuck-state-via-db.test.ts +64 -1
  678. package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +7 -3
  679. package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +4 -0
  680. package/src/resources/extensions/gsd/tests/tui-header-lifecycle.test.ts +121 -1
  681. package/src/resources/extensions/gsd/tests/tui-render-kit.test.ts +66 -0
  682. package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +86 -7
  683. package/src/resources/extensions/gsd/tests/verification-gate.test.ts +110 -1
  684. package/src/resources/extensions/gsd/tests/verification-retry-policy.test.ts +83 -0
  685. package/src/resources/extensions/gsd/tests/verification-verdict.test.ts +78 -0
  686. package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +7 -1
  687. package/src/resources/extensions/gsd/tests/workflow-memory-pressure.test.ts +21 -1
  688. package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +1 -1
  689. package/src/resources/extensions/gsd/tests/worktree-git-pathspec.test.ts +39 -0
  690. package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +211 -59
  691. package/src/resources/extensions/gsd/tests/worktree-lifecycle.test.ts +597 -118
  692. package/src/resources/extensions/gsd/tests/worktree-telemetry.test.ts +59 -2
  693. package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +72 -0
  694. package/src/resources/extensions/gsd/tools/complete-milestone.ts +8 -10
  695. package/src/resources/extensions/gsd/tools/complete-slice.ts +6 -8
  696. package/src/resources/extensions/gsd/tools/plan-milestone.ts +5 -1
  697. package/src/resources/extensions/gsd/tools/plan-slice.ts +98 -12
  698. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +135 -0
  699. package/src/resources/extensions/gsd/tui/render-kit.ts +109 -0
  700. package/src/resources/extensions/gsd/types.ts +1 -1
  701. package/src/resources/extensions/gsd/unit-context-manifest.ts +47 -11
  702. package/src/resources/extensions/gsd/validation.ts +23 -1
  703. package/src/resources/extensions/gsd/verification-gate.ts +78 -6
  704. package/src/resources/extensions/gsd/verification-verdict.ts +47 -0
  705. package/src/resources/extensions/gsd/watch/header-renderer.ts +121 -79
  706. package/src/resources/extensions/gsd/watch/splash-palette.ts +11 -0
  707. package/src/resources/extensions/gsd/workflow-logger.ts +4 -0
  708. package/src/resources/extensions/gsd/workflow-mcp.ts +2 -2
  709. package/src/resources/extensions/gsd/workflow-projections.ts +6 -8
  710. package/src/resources/extensions/gsd/worktree-lifecycle.ts +1196 -518
  711. package/src/resources/extensions/gsd/worktree-telemetry.ts +7 -2
  712. package/src/resources/extensions/shared/html-shell.ts +412 -0
  713. package/src/resources/extensions/subagent/index.ts +567 -103
  714. package/src/resources/extensions/subagent/launch.ts +131 -0
  715. package/src/resources/extensions/subagent/run-store.ts +218 -0
  716. package/src/resources/extensions/subagent/tests/launch.test.ts +115 -0
  717. package/src/resources/extensions/subagent/tests/run-store.test.ts +111 -0
  718. package/src/resources/extensions/visual-brief/artifact-policy.ts +41 -0
  719. package/src/resources/extensions/visual-brief/extension-manifest.json +8 -0
  720. package/src/resources/extensions/visual-brief/index.ts +8 -0
  721. package/src/resources/extensions/visual-brief/page-contract.ts +136 -0
  722. package/src/resources/extensions/visual-brief/prompts.ts +183 -0
  723. package/src/resources/extensions/visual-brief/tests/visual-brief.test.ts +212 -0
  724. package/dist/web/standalone/.next/server/chunks/5822.js +0 -2
  725. package/dist/web/standalone/.next/static/chunks/2556.0527fea66e123b7f.js +0 -1
  726. package/dist/web/standalone/.next/static/chunks/app/layout-9ecfd95f343793f0.js +0 -1
  727. package/dist/web/standalone/.next/static/chunks/app/page-200592a7f3baf579.js +0 -1
  728. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  729. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  730. package/dist/web/standalone/.next/static/css/54ec2745c1da488b.css +0 -1
  731. package/dist/web/standalone/.next/static/css/de70bee13400563f.css +0 -1
  732. package/dist/web/standalone/.next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
  733. package/dist/web/standalone/.next/static/media/747892c23ea88013-s.woff2 +0 -0
  734. package/dist/web/standalone/.next/static/media/8d697b304b401681-s.woff2 +0 -0
  735. package/dist/web/standalone/.next/static/media/93f479601ee12b01-s.p.woff2 +0 -0
  736. package/dist/web/standalone/.next/static/media/9610d9e46709d722-s.woff2 +0 -0
  737. package/dist/web/standalone/.next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
  738. package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +0 -1544
  739. /package/dist/web/standalone/.next/static/{drLMkgfHQ8lzS229_HWYR → xRy4LqKSNKdT7y6ATYyEl}/_buildManifest.js +0 -0
  740. /package/dist/web/standalone/.next/static/{drLMkgfHQ8lzS229_HWYR → xRy4LqKSNKdT7y6ATYyEl}/_ssgManifest.js +0 -0
@@ -0,0 +1,79 @@
1
+ // GSD-2 — Pending auto-start handoff state.
2
+ // Stores discuss-to-auto handoff entries keyed by project root.
3
+
4
+ import type { ExtensionAPI, ExtensionCommandContext } from "@gsd/pi-coding-agent";
5
+ import { createWorkspace, scopeMilestone, type MilestoneScope } from "./workspace.js";
6
+
7
+ export interface PendingAutoStartEntry {
8
+ ctx: ExtensionCommandContext;
9
+ pi: ExtensionAPI;
10
+ basePath: string;
11
+ milestoneId: string;
12
+ step?: boolean;
13
+ createdAt: number;
14
+ readyRejectCount?: number;
15
+ scope: MilestoneScope;
16
+ planBlockedRecoveryCount: number;
17
+ }
18
+
19
+ export interface PendingAutoStartInput {
20
+ basePath: string;
21
+ milestoneId: string;
22
+ ctx: ExtensionCommandContext;
23
+ pi: ExtensionAPI;
24
+ step?: boolean;
25
+ createdAt?: number;
26
+ }
27
+
28
+ const pendingAutoStartMap = new Map<string, PendingAutoStartEntry>();
29
+
30
+ export function getPendingAutoStart(basePath?: string): PendingAutoStartEntry | null {
31
+ if (basePath) return pendingAutoStartMap.get(basePath) ?? null;
32
+ if (pendingAutoStartMap.size === 1) return pendingAutoStartMap.values().next().value!;
33
+ return null;
34
+ }
35
+
36
+ export const _getPendingAutoStart = getPendingAutoStart;
37
+
38
+ export function hasPendingAutoStart(basePath?: string): boolean {
39
+ if (basePath) return pendingAutoStartMap.has(basePath);
40
+ return pendingAutoStartMap.size > 0;
41
+ }
42
+
43
+ export function setPendingAutoStart(basePath: string, entry: PendingAutoStartInput): void {
44
+ if (!entry.ctx || !entry.pi) {
45
+ throw new Error("setPendingAutoStart requires ctx and pi");
46
+ }
47
+ const ws = createWorkspace(entry.basePath);
48
+ const scope = scopeMilestone(ws, entry.milestoneId);
49
+ pendingAutoStartMap.set(basePath, {
50
+ createdAt: Date.now(),
51
+ planBlockedRecoveryCount: 0,
52
+ ...entry,
53
+ scope,
54
+ ctx: entry.ctx,
55
+ pi: entry.pi,
56
+ });
57
+ }
58
+
59
+ export function deletePendingAutoStart(basePath: string): void {
60
+ pendingAutoStartMap.delete(basePath);
61
+ }
62
+
63
+ export function clearPendingAutoStart(basePath?: string): void {
64
+ if (basePath) {
65
+ pendingAutoStartMap.delete(basePath);
66
+ } else {
67
+ pendingAutoStartMap.clear();
68
+ }
69
+ }
70
+
71
+ export function getDiscussionMilestoneId(basePath?: string): string | null {
72
+ if (basePath) {
73
+ return pendingAutoStartMap.get(basePath)?.milestoneId ?? null;
74
+ }
75
+ if (pendingAutoStartMap.size === 1) {
76
+ return pendingAutoStartMap.values().next().value!.milestoneId;
77
+ }
78
+ return null;
79
+ }
@@ -46,6 +46,46 @@ export interface PostExecutionResult {
46
46
 
47
47
  // ─── Import Resolution Check ─────────────────────────────────────────────────
48
48
 
49
+ /**
50
+ * Replace the contents of single- and double-quoted string literals on a single
51
+ * source line with spaces so import patterns do not match text inside strings.
52
+ * Template-literal spans are handled separately via the inTemplateLiteral flag.
53
+ */
54
+ function stripStringLiterals(line: string): string {
55
+ let result = "";
56
+ let i = 0;
57
+
58
+ while (i < line.length) {
59
+ const ch = line[i];
60
+
61
+ if (ch === '"' || ch === "'") {
62
+ result += ch;
63
+ i++;
64
+
65
+ while (i < line.length) {
66
+ const c = line[i];
67
+
68
+ if (c === "\\" && i + 1 < line.length) {
69
+ result += " ";
70
+ i += 2;
71
+ } else if (c === ch) {
72
+ result += ch;
73
+ i++;
74
+ break;
75
+ } else {
76
+ result += " ";
77
+ i++;
78
+ }
79
+ }
80
+ } else {
81
+ result += ch;
82
+ i++;
83
+ }
84
+ }
85
+
86
+ return result;
87
+ }
88
+
49
89
  /**
50
90
  * Extract relative import paths from TypeScript/JavaScript source code.
51
91
  * Returns array of { importPath, lineNum } for relative imports.
@@ -62,14 +102,23 @@ export function extractRelativeImports(
62
102
  // import './path'
63
103
  // require('./path')
64
104
  // require("../path")
65
- const importPattern = /(?:import\s+(?:.*?\s+from\s+)?|require\s*\(\s*)(['"])(\.\.?\/[^'"]+)\1/g;
105
+ const importPattern = /(?:^|[;{}]\s*)import\s+(?:.*?\s+from\s+)?(['"])(\.\.?\/[^'"]+)\1/g;
106
+ const requirePattern = /require\s*\(\s*(['"])(\.\.?\/[^'"]+)\1/g;
66
107
 
67
108
  // Track if we're inside a block comment
68
109
  let inBlockComment = false;
110
+ let inTemplateLiteral = false;
69
111
 
70
112
  for (let i = 0; i < lines.length; i++) {
71
113
  const line = lines[i];
72
114
 
115
+ if (inTemplateLiteral) {
116
+ if ((line.match(/(?<!\\)`/g) ?? []).length % 2 === 1) {
117
+ inTemplateLiteral = false;
118
+ }
119
+ continue;
120
+ }
121
+
73
122
  // Handle block comment boundaries
74
123
  if (inBlockComment) {
75
124
  if (line.includes("*/")) {
@@ -101,10 +150,22 @@ export function extractRelativeImports(
101
150
 
102
151
  // Reset lastIndex for each line
103
152
  importPattern.lastIndex = 0;
153
+ requirePattern.lastIndex = 0;
154
+
155
+ const strippedLine = stripStringLiterals(line);
104
156
 
105
157
  while ((match = importPattern.exec(line)) !== null) {
158
+ const importOffset = match[0].indexOf("import");
159
+ const importStart = match.index + importOffset;
160
+ if (
161
+ strippedLine.slice(importStart, importStart + "import".length) !==
162
+ "import"
163
+ ) {
164
+ continue;
165
+ }
166
+
106
167
  // Check if this match is after a // comment marker on the same line
107
- const beforeMatch = line.substring(0, match.index);
168
+ const beforeMatch = strippedLine.substring(0, match.index);
108
169
  if (beforeMatch.includes("//")) {
109
170
  continue;
110
171
  }
@@ -114,6 +175,30 @@ export function extractRelativeImports(
114
175
  lineNum: i + 1,
115
176
  });
116
177
  }
178
+
179
+ while ((match = requirePattern.exec(line)) !== null) {
180
+ if (
181
+ strippedLine.slice(match.index, match.index + "require".length) !==
182
+ "require"
183
+ ) {
184
+ continue;
185
+ }
186
+
187
+ // Check if this match is after a // comment marker on the same line
188
+ const beforeMatch = strippedLine.substring(0, match.index);
189
+ if (beforeMatch.includes("//")) {
190
+ continue;
191
+ }
192
+
193
+ imports.push({
194
+ importPath: match[2],
195
+ lineNum: i + 1,
196
+ });
197
+ }
198
+
199
+ if ((strippedLine.match(/(?<!\\)`/g) ?? []).length % 2 === 1) {
200
+ inTemplateLiteral = true;
201
+ }
117
202
  }
118
203
 
119
204
  return imports;
@@ -23,6 +23,7 @@ import { homedir } from "node:os";
23
23
  import { resolve } from "node:path";
24
24
  import type { TaskRow } from "./db-task-slice-rows.js";
25
25
  import type { PreExecutionCheckJSON } from "./verification-evidence.ts";
26
+ import { validateVerificationCommand } from "./verification-gate.js";
26
27
 
27
28
  const NPM_COMMAND = process.platform === "win32" ? "npm.cmd" : "npm";
28
29
 
@@ -37,6 +38,35 @@ export interface PreExecutionResult {
37
38
  durationMs: number;
38
39
  }
39
40
 
41
+ export function checkVerificationCommands(tasks: TaskRow[]): PreExecutionCheckJSON[] {
42
+ const results: PreExecutionCheckJSON[] = [];
43
+
44
+ for (const task of tasks) {
45
+ const verify = task.verify.trim();
46
+ if (!verify) continue;
47
+
48
+ const commands = verify
49
+ .split("&&")
50
+ .map((command) => command.trim())
51
+ .filter(Boolean);
52
+
53
+ for (const command of commands) {
54
+ const validation = validateVerificationCommand(command);
55
+ if (!validation.ok) {
56
+ results.push({
57
+ category: "tool",
58
+ target: `${task.id} Verify`,
59
+ passed: false,
60
+ message: `Unsafe or non-runnable Verify command: ${command} (${validation.reason})`,
61
+ blocking: true,
62
+ });
63
+ }
64
+ }
65
+ }
66
+
67
+ return results;
68
+ }
69
+
40
70
  // ─── Package Existence Check ─────────────────────────────────────────────────
41
71
 
42
72
  /**
@@ -757,8 +787,9 @@ export async function runPreExecutionChecks(
757
787
  const fileChecks = checkFilePathConsistency(tasks, basePath);
758
788
  const orderingChecks = checkTaskOrdering(tasks, basePath);
759
789
  const contractChecks = checkInterfaceContracts(tasks, basePath);
790
+ const verificationChecks = checkVerificationCommands(tasks);
760
791
 
761
- allChecks.push(...fileChecks, ...orderingChecks, ...contractChecks);
792
+ allChecks.push(...fileChecks, ...orderingChecks, ...contractChecks, ...verificationChecks);
762
793
 
763
794
  // Run async package checks
764
795
  const packageChecks = await checkPackageExistence(tasks, basePath);
@@ -200,7 +200,7 @@ export function loadPrompt(name: string, vars: Record<string, string> = {}): str
200
200
  if (missing.length > 0) {
201
201
  throw new GSDError(
202
202
  GSD_PARSE_ERROR,
203
- `loadPrompt("${name}"): template declares {{${missing.join("}}, {{")}}}} but no value was provided. ` +
203
+ `loadPrompt("${name}"): template declares {{${missing.join("}}, {{")}}} but no value was provided. ` +
204
204
  `This usually means the extension code in memory is older than the template on disk. ` +
205
205
  `Restart pi to reload the extension.`,
206
206
  );
@@ -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}}
@@ -22,22 +22,24 @@ Use `subagent` only for fresh-context review when useful: reviewer for cross-cut
22
22
 
23
23
  1. Use the inlined Slice Summary and UAT templates.
24
24
  2. {{skillActivation}}
25
- 3. Run all slice-level verification checks from the slice plan. Fix failures before marking done; refresh current state if needed.
26
- 4. Task summaries use a flat file layout under `tasks/` such as `T01-SUMMARY.md`, not inside per-task subdirectories like `tasks/T01/SUMMARY.md`. Never use `tasks/*/SUMMARY.md`.
27
- 5. If observability/diagnostics were planned, verify them unless the slice is simple.
28
- 6. Address every gate in Gates to Close. Q8 maps to **Operational Readiness**: health signal, failure signal, recovery procedure, monitoring gaps. Empty sections are recorded as omitted.
29
- 7. If requirement status changed, call `gsd_requirement_update`; do not write `.gsd/REQUIREMENTS.md` directly.
30
- 8. Prepare `gsd_slice_complete` content with camelCase fields `milestoneId`, `sliceId`, `sliceTitle`, `oneLiner`, `narrative`, `verification`, and `uatContent`.
31
- 9. Draft concrete UAT with preconditions, numbered steps, expected outcomes, edge cases, UAT Type, and Not Proven By This UAT.
32
- 10. 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.
33
- 11. 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.
34
- 12. Do not run git commands.
35
- 13. Update `.gsd/PROJECT.md` with a full `write` only if the current project state needs refresh.
25
+ 3. Run all slice-level verification checks from the slice plan through the closeout-safe verification surface (`gsd_exec` / Context Mode verification evidence); refresh current state if needed. Do not use direct `bash` for verification commands.
26
+ 4. Complete the slice only when every required verification check passes. If verification fails or the fix requires source changes, do **not** edit source files in this unit and do **not** call `gsd_slice_complete`.
27
+ 5. For task-specific failures, call `gsd_task_reopen` with the failing completed task and a concrete reason so execution can redo the work. For plan-invalidating failures, call `gsd_replan_slice` with the blocker and updated execution tasks. Then stop with: "Slice {{sliceId}} needs execution follow-up."
28
+ 6. Task summaries use a flat file layout under `tasks/` such as `T01-SUMMARY.md`, not inside per-task subdirectories like `tasks/T01/SUMMARY.md`. Never use `tasks/*/SUMMARY.md`.
29
+ 7. If observability/diagnostics were planned, verify them unless the slice is simple.
30
+ 8. Address every gate in Gates to Close. Q8 maps to **Operational Readiness**: health signal, failure signal, recovery procedure, monitoring gaps. Empty sections are recorded as omitted.
31
+ 9. If requirement status changed, call `gsd_requirement_update`; do not write `.gsd/REQUIREMENTS.md` directly.
32
+ 10. Prepare `gsd_slice_complete` content with camelCase fields `milestoneId`, `sliceId`, `sliceTitle`, `oneLiner`, `narrative`, `verification`, and `uatContent`.
33
+ 11. Draft concrete UAT with preconditions, numbered steps, expected outcomes, edge cases, UAT Type, and Not Proven By This UAT.
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
+ 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
+ 14. Do not run git commands.
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.
36
38
 
37
39
  **Autonomous execution:** no human is available. Do not call `ask_user_questions` or `secure_env_collect`; make reasonable assumptions and document them.
38
40
 
39
41
  **File system safety:** if re-reading task summaries, use `find .gsd/milestones/{{milestoneId}}/slices/{{sliceId}}/tasks -name "*-SUMMARY.md"` or `ls .gsd/milestones/{{milestoneId}}/slices/{{sliceId}}/tasks/*-SUMMARY.md`. Never pass `{{slicePath}}` or any directory path directly to the `read` tool.
40
42
 
41
- **You MUST call `gsd_slice_complete` with summary and UAT content before finishing.**
43
+ **You MUST call `gsd_slice_complete` with summary and UAT content before finishing only after verification passes.**
42
44
 
43
45
  When done, say: "Slice {{sliceId}} complete."
@@ -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
 
@@ -129,15 +129,24 @@ If ANY box is unchecked, **STOP**. Do NOT emit the ready phrase. Emit the missin
129
129
 
130
130
  Do not announce the ready phrase as something you are "about to" do. The ready phrase is a post-write signal, not an intent signal.
131
131
 
132
- After completing steps 1–7 above, say exactly: "Milestone {{milestoneId}} ready." — nothing else. Auto-mode will start automatically.
132
+ After completing steps 1–7 above, end with this concise user-facing handoff:
133
+
134
+ ```
135
+ Milestone {{milestoneId}} ready.
136
+
137
+ Next steps:
138
+ - Run `/gsd auto` to start execution if it does not begin automatically.
139
+ - Use `/gsd status` or `/gsd visualize` to inspect the roadmap.
140
+ - Use `/gsd notifications` to review or configure delivery alerts.
141
+ ```
133
142
 
134
143
  ### Multi-Milestone
135
144
 
136
145
  #### Phase 1: Shared artifacts
137
146
 
138
147
  1. For each milestone, call `gsd_milestone_generate_id`; never invent IDs. Then `mkdir -p .gsd/milestones/<ID>/slices`.
139
- 2. Write `.gsd/PROJECT.md` use the **Project** output template below.
140
- 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.
141
150
  4. For any architectural or pattern decisions, call `gsd_decision_save` — the tool auto-assigns IDs and regenerates `.gsd/DECISIONS.md` automatically.
142
151
 
143
152
  #### Phase 2: Primary milestone
@@ -205,8 +214,8 @@ For single-milestone projects, do NOT write this file.
205
214
 
206
215
  Before emitting the ready phrase, verify in the CURRENT turn that you have:
207
216
 
208
- - [ ] Written `.gsd/PROJECT.md`
209
- - [ ] 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
210
219
  - [ ] Written the primary milestone `CONTEXT.md`
211
220
  - [ ] Called `gsd_plan_milestone` for the primary milestone
212
221
  - [ ] Written `.gsd/DISCUSSION-MANIFEST.json` with `gates_completed === total`
@@ -215,7 +224,16 @@ If ANY box is unchecked, **STOP**. Do NOT emit the ready phrase. Emit the missin
215
224
 
216
225
  Do not announce the ready phrase as something you are "about to" do. The ready phrase is a post-write signal, not an intent signal.
217
226
 
218
- After completing every step above, say exactly: "Milestone {{milestoneId}} ready." — nothing else. Auto-mode will start automatically.
227
+ After completing every step above, end with this concise user-facing handoff:
228
+
229
+ ```
230
+ Milestone {{milestoneId}} ready.
231
+
232
+ Next steps:
233
+ - Run `/gsd auto` to start execution if it does not begin automatically.
234
+ - Use `/gsd status` or `/gsd visualize` to inspect the roadmap.
235
+ - Use `/gsd notifications` to review or configure delivery alerts.
236
+ ```
219
237
 
220
238
  ## Critical Rules
221
239
 
@@ -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
 
@@ -252,7 +252,16 @@ If ANY box is unchecked, **STOP**. Do NOT emit the ready phrase. Emit the missin
252
252
 
253
253
  Do not announce the ready phrase as something you are "about to" do. It is a post-write signal, not intent.
254
254
 
255
- After completing steps 1–7 above, say exactly: "Milestone {{milestoneId}} ready." — nothing else. Auto-mode will start automatically.
255
+ After completing steps 1–7 above, end with this concise user-facing handoff:
256
+
257
+ ```
258
+ Milestone {{milestoneId}} ready.
259
+
260
+ Next steps:
261
+ - Run `/gsd auto` to start execution if it does not begin automatically.
262
+ - Use `/gsd status` or `/gsd visualize` to inspect the roadmap.
263
+ - Use `/gsd notifications` to review or configure delivery alerts.
264
+ ```
256
265
 
257
266
  ### Multi-Milestone
258
267
 
@@ -261,8 +270,8 @@ Once the user confirms the milestone split:
261
270
  #### Phase 1: Shared artifacts
262
271
 
263
272
  1. For each milestone, call `gsd_milestone_generate_id`; never invent IDs. Then `mkdir -p .gsd/milestones/<ID>/slices`.
264
- 2. Write `.gsd/PROJECT.md` use the **Project** output template below.
265
- 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.
266
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.
267
276
 
268
277
  #### Phase 2: Primary milestone
@@ -335,8 +344,8 @@ For single-milestone projects, do NOT write this file.
335
344
 
336
345
  Before emitting the ready phrase, verify in the CURRENT turn that you have:
337
346
 
338
- - [ ] Written `.gsd/PROJECT.md` (Phase 1)
339
- - [ ] 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)
340
349
  - [ ] Written primary-milestone `CONTEXT.md` (Phase 2)
341
350
  - [ ] Called `gsd_plan_milestone` for the primary milestone (Phase 2)
342
351
  - [ ] Written `.gsd/DISCUSSION-MANIFEST.json` with `gates_completed === total` (Phase 3)
@@ -345,6 +354,15 @@ If ANY box is unchecked, **STOP**. Do NOT emit the ready phrase. Emit the missin
345
354
 
346
355
  Do not announce the ready phrase as something you are "about to" do. It is a post-write signal, not intent.
347
356
 
348
- After completing all phases above, say exactly: "Milestone M001 ready." — nothing else. Auto-mode will start automatically.
357
+ After completing all phases above, end with this concise user-facing handoff:
358
+
359
+ ```
360
+ Milestone M001 ready.
361
+
362
+ Next steps:
363
+ - Run `/gsd auto` to start execution if it does not begin automatically.
364
+ - Use `/gsd status` or `/gsd visualize` to inspect the roadmap.
365
+ - Use `/gsd notifications` to review or configure delivery alerts.
366
+ ```
349
367
 
350
368
  {{inlinedTemplates}}
@@ -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.**
@@ -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.