gsd-pi 2.45.0 → 2.46.0-dev.cc9d310

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 (347) hide show
  1. package/dist/help-text.js +1 -1
  2. package/dist/loader.js +34 -0
  3. package/dist/resources/extensions/gsd/auto/phases.js +27 -42
  4. package/dist/resources/extensions/gsd/auto/run-unit.js +6 -3
  5. package/dist/resources/extensions/gsd/auto/session.js +0 -11
  6. package/dist/resources/extensions/gsd/auto-artifact-paths.js +112 -0
  7. package/dist/resources/extensions/gsd/auto-post-unit.js +25 -96
  8. package/dist/resources/extensions/gsd/auto-start.js +2 -3
  9. package/dist/resources/extensions/gsd/auto-worktree.js +5 -4
  10. package/dist/resources/extensions/gsd/auto.js +12 -57
  11. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +15 -12
  12. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +18 -0
  13. package/dist/resources/extensions/gsd/commands/context.js +0 -4
  14. package/dist/resources/extensions/gsd/commands/handlers/parallel.js +1 -1
  15. package/dist/resources/extensions/gsd/crash-recovery.js +2 -4
  16. package/dist/resources/extensions/gsd/dashboard-overlay.js +0 -44
  17. package/dist/resources/extensions/gsd/db-writer.js +9 -9
  18. package/dist/resources/extensions/gsd/doctor-checks.js +167 -2
  19. package/dist/resources/extensions/gsd/doctor.js +5 -3
  20. package/dist/resources/extensions/gsd/gsd-db.js +16 -3
  21. package/dist/resources/extensions/gsd/guided-flow.js +1 -2
  22. package/dist/resources/extensions/gsd/parallel-merge.js +1 -1
  23. package/dist/resources/extensions/gsd/parallel-orchestrator.js +5 -18
  24. package/dist/resources/extensions/gsd/preferences-types.js +2 -2
  25. package/dist/resources/extensions/gsd/preferences.js +8 -4
  26. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +21 -8
  27. package/dist/resources/extensions/gsd/prompts/complete-slice.md +10 -23
  28. package/dist/resources/extensions/gsd/prompts/discuss.md +2 -2
  29. package/dist/resources/extensions/gsd/prompts/execute-task.md +5 -15
  30. package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +1 -1
  31. package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +1 -1
  32. package/dist/resources/extensions/gsd/prompts/guided-plan-slice.md +1 -1
  33. package/dist/resources/extensions/gsd/prompts/guided-research-slice.md +1 -1
  34. package/dist/resources/extensions/gsd/prompts/plan-milestone.md +1 -1
  35. package/dist/resources/extensions/gsd/prompts/plan-slice.md +4 -2
  36. package/dist/resources/extensions/gsd/prompts/queue.md +2 -2
  37. package/dist/resources/extensions/gsd/prompts/quick-task.md +2 -0
  38. package/dist/resources/extensions/gsd/prompts/reactive-execute.md +1 -1
  39. package/dist/resources/extensions/gsd/prompts/research-slice.md +3 -3
  40. package/dist/resources/extensions/gsd/prompts/rethink.md +7 -2
  41. package/dist/resources/extensions/gsd/prompts/system.md +1 -1
  42. package/dist/resources/extensions/gsd/session-lock.js +1 -3
  43. package/dist/resources/extensions/gsd/state.js +7 -0
  44. package/dist/resources/extensions/gsd/sync-lock.js +89 -0
  45. package/dist/resources/extensions/gsd/tools/complete-milestone.js +61 -11
  46. package/dist/resources/extensions/gsd/tools/complete-slice.js +56 -11
  47. package/dist/resources/extensions/gsd/tools/complete-task.js +50 -2
  48. package/dist/resources/extensions/gsd/tools/plan-milestone.js +37 -1
  49. package/dist/resources/extensions/gsd/tools/plan-slice.js +30 -1
  50. package/dist/resources/extensions/gsd/tools/plan-task.js +27 -1
  51. package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +32 -2
  52. package/dist/resources/extensions/gsd/tools/reopen-slice.js +86 -0
  53. package/dist/resources/extensions/gsd/tools/reopen-task.js +90 -0
  54. package/dist/resources/extensions/gsd/tools/replan-slice.js +32 -2
  55. package/dist/resources/extensions/gsd/unit-ownership.js +85 -0
  56. package/dist/resources/extensions/gsd/workflow-events.js +102 -0
  57. package/dist/resources/extensions/gsd/workflow-logger.js +193 -0
  58. package/dist/resources/extensions/gsd/workflow-manifest.js +244 -0
  59. package/dist/resources/extensions/gsd/workflow-migration.js +280 -0
  60. package/dist/resources/extensions/gsd/workflow-projections.js +373 -0
  61. package/dist/resources/extensions/gsd/workflow-reconcile.js +411 -0
  62. package/dist/resources/extensions/gsd/worktree-manager.js +4 -3
  63. package/dist/resources/extensions/gsd/worktree-resolver.js +37 -0
  64. package/dist/resources/extensions/gsd/write-intercept.js +84 -0
  65. package/dist/resources/extensions/voice/index.js +11 -16
  66. package/dist/resources/extensions/voice/linux-ready.js +67 -0
  67. package/dist/web/standalone/.next/BUILD_ID +1 -1
  68. package/dist/web/standalone/.next/app-path-routes-manifest.json +17 -17
  69. package/dist/web/standalone/.next/build-manifest.json +3 -3
  70. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  71. package/dist/web/standalone/.next/required-server-files.json +3 -3
  72. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  73. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  74. package/dist/web/standalone/.next/server/app/_global-error.html +2 -2
  75. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  76. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  77. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  78. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  79. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  80. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  81. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  82. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  83. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  84. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  85. package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
  86. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  87. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  88. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  89. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  90. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  91. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  92. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  93. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  94. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  95. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  96. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  97. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  98. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  99. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  100. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  101. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  102. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  103. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  104. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  105. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  106. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  107. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  108. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  109. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  110. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  111. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  112. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  113. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  114. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  115. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  116. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  117. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  118. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  119. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  120. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  121. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  122. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  123. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  124. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  125. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  126. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  127. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  128. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  129. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  130. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  131. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  132. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  133. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  134. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  135. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  136. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +5 -5
  137. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  138. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  139. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  140. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  141. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  142. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  143. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  144. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  145. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  146. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  147. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  148. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  149. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  150. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  151. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  152. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  153. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  154. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  155. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  156. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
  157. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  158. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  159. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  160. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
  161. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  162. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
  163. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  164. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  165. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  166. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  168. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  169. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  170. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  171. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  172. package/dist/web/standalone/.next/server/app/index.html +1 -1
  173. package/dist/web/standalone/.next/server/app/index.rsc +4 -4
  174. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  175. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  176. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  177. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
  178. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  179. package/dist/web/standalone/.next/server/app/page.js +2 -2
  180. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  181. package/dist/web/standalone/.next/server/app-paths-manifest.json +17 -17
  182. package/dist/web/standalone/.next/server/chunks/229.js +1 -1
  183. package/dist/web/standalone/.next/server/chunks/471.js +3 -3
  184. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  185. package/dist/web/standalone/.next/server/middleware.js +2 -2
  186. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  187. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  188. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  189. package/dist/web/standalone/.next/server/pages/500.html +2 -2
  190. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  191. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  192. package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
  193. package/dist/web/standalone/.next/static/chunks/app/page-6654a8cca61a3d1c.js +1 -0
  194. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  195. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  196. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  197. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  198. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  199. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  200. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  201. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  202. package/dist/web/standalone/server.js +1 -1
  203. package/package.json +2 -1
  204. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts.map +1 -1
  205. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js +2 -0
  206. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js.map +1 -1
  207. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +2 -1
  208. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  209. package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  210. package/packages/pi-coding-agent/dist/core/lifecycle-hooks.d.ts +4 -0
  211. package/packages/pi-coding-agent/dist/core/lifecycle-hooks.d.ts.map +1 -1
  212. package/packages/pi-coding-agent/dist/core/lifecycle-hooks.js +10 -5
  213. package/packages/pi-coding-agent/dist/core/lifecycle-hooks.js.map +1 -1
  214. package/packages/pi-coding-agent/dist/core/lifecycle-hooks.test.d.ts +2 -0
  215. package/packages/pi-coding-agent/dist/core/lifecycle-hooks.test.d.ts.map +1 -0
  216. package/packages/pi-coding-agent/dist/core/lifecycle-hooks.test.js +185 -0
  217. package/packages/pi-coding-agent/dist/core/lifecycle-hooks.test.js.map +1 -0
  218. package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +239 -10
  219. package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -1
  220. package/packages/pi-coding-agent/dist/core/model-registry.d.ts +2 -1
  221. package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
  222. package/packages/pi-coding-agent/dist/core/model-registry.js +20 -2
  223. package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
  224. package/packages/pi-coding-agent/dist/core/package-commands.test.js +206 -195
  225. package/packages/pi-coding-agent/dist/core/package-commands.test.js.map +1 -1
  226. package/packages/pi-coding-agent/package.json +1 -1
  227. package/packages/pi-coding-agent/src/core/compaction-orchestrator.ts +2 -0
  228. package/packages/pi-coding-agent/src/core/extensions/types.ts +2 -1
  229. package/packages/pi-coding-agent/src/core/lifecycle-hooks.test.ts +227 -0
  230. package/packages/pi-coding-agent/src/core/lifecycle-hooks.ts +11 -5
  231. package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +297 -11
  232. package/packages/pi-coding-agent/src/core/model-registry.ts +30 -3
  233. package/packages/pi-coding-agent/src/core/package-commands.test.ts +227 -205
  234. package/pkg/package.json +1 -1
  235. package/src/resources/extensions/gsd/auto/loop-deps.ts +0 -19
  236. package/src/resources/extensions/gsd/auto/phases.ts +24 -44
  237. package/src/resources/extensions/gsd/auto/run-unit.ts +6 -3
  238. package/src/resources/extensions/gsd/auto/session.ts +0 -18
  239. package/src/resources/extensions/gsd/auto-artifact-paths.ts +131 -0
  240. package/src/resources/extensions/gsd/auto-dashboard.ts +0 -1
  241. package/src/resources/extensions/gsd/auto-post-unit.ts +25 -106
  242. package/src/resources/extensions/gsd/auto-start.ts +1 -3
  243. package/src/resources/extensions/gsd/auto-worktree.ts +8 -5
  244. package/src/resources/extensions/gsd/auto.ts +7 -83
  245. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +15 -12
  246. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +22 -0
  247. package/src/resources/extensions/gsd/commands/context.ts +0 -5
  248. package/src/resources/extensions/gsd/commands/handlers/parallel.ts +1 -1
  249. package/src/resources/extensions/gsd/crash-recovery.ts +1 -5
  250. package/src/resources/extensions/gsd/dashboard-overlay.ts +0 -50
  251. package/src/resources/extensions/gsd/db-writer.ts +9 -17
  252. package/src/resources/extensions/gsd/doctor-checks.ts +180 -2
  253. package/src/resources/extensions/gsd/doctor-types.ts +7 -1
  254. package/src/resources/extensions/gsd/doctor.ts +6 -3
  255. package/src/resources/extensions/gsd/gsd-db.ts +16 -3
  256. package/src/resources/extensions/gsd/guided-flow.ts +1 -2
  257. package/src/resources/extensions/gsd/journal.ts +6 -1
  258. package/src/resources/extensions/gsd/parallel-merge.ts +1 -1
  259. package/src/resources/extensions/gsd/parallel-orchestrator.ts +5 -21
  260. package/src/resources/extensions/gsd/preferences-types.ts +2 -2
  261. package/src/resources/extensions/gsd/preferences.ts +7 -3
  262. package/src/resources/extensions/gsd/prompts/complete-milestone.md +21 -8
  263. package/src/resources/extensions/gsd/prompts/complete-slice.md +10 -23
  264. package/src/resources/extensions/gsd/prompts/discuss.md +2 -2
  265. package/src/resources/extensions/gsd/prompts/execute-task.md +5 -15
  266. package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +1 -1
  267. package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +1 -1
  268. package/src/resources/extensions/gsd/prompts/guided-plan-slice.md +1 -1
  269. package/src/resources/extensions/gsd/prompts/guided-research-slice.md +1 -1
  270. package/src/resources/extensions/gsd/prompts/plan-milestone.md +1 -1
  271. package/src/resources/extensions/gsd/prompts/plan-slice.md +4 -2
  272. package/src/resources/extensions/gsd/prompts/queue.md +2 -2
  273. package/src/resources/extensions/gsd/prompts/quick-task.md +2 -0
  274. package/src/resources/extensions/gsd/prompts/reactive-execute.md +1 -1
  275. package/src/resources/extensions/gsd/prompts/research-slice.md +3 -3
  276. package/src/resources/extensions/gsd/prompts/rethink.md +7 -2
  277. package/src/resources/extensions/gsd/prompts/system.md +1 -1
  278. package/src/resources/extensions/gsd/session-lock.ts +0 -4
  279. package/src/resources/extensions/gsd/state.ts +8 -0
  280. package/src/resources/extensions/gsd/sync-lock.ts +94 -0
  281. package/src/resources/extensions/gsd/tests/auto-lock-creation.test.ts +5 -13
  282. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +6 -10
  283. package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +96 -0
  284. package/src/resources/extensions/gsd/tests/complete-slice.test.ts +264 -228
  285. package/src/resources/extensions/gsd/tests/complete-task.test.ts +317 -250
  286. package/src/resources/extensions/gsd/tests/crash-recovery.test.ts +2 -8
  287. package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +0 -3
  288. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +1 -1
  289. package/src/resources/extensions/gsd/tests/idle-recovery.test.ts +1 -1
  290. package/src/resources/extensions/gsd/tests/integration-proof.test.ts +15 -24
  291. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +0 -3
  292. package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
  293. package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
  294. package/src/resources/extensions/gsd/tests/merge-conflict-stops-loop.test.ts +1 -1
  295. package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +8 -9
  296. package/src/resources/extensions/gsd/tests/none-mode-gates.test.ts +42 -3
  297. package/src/resources/extensions/gsd/tests/parallel-budget-atomicity.test.ts +0 -1
  298. package/src/resources/extensions/gsd/tests/parallel-crash-recovery.test.ts +0 -7
  299. package/src/resources/extensions/gsd/tests/parallel-merge.test.ts +7 -8
  300. package/src/resources/extensions/gsd/tests/parallel-orchestration.test.ts +20 -24
  301. package/src/resources/extensions/gsd/tests/parallel-worker-monitoring.test.ts +0 -2
  302. package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +9 -6
  303. package/src/resources/extensions/gsd/tests/post-mutation-hook.test.ts +171 -0
  304. package/src/resources/extensions/gsd/tests/preferences.test.ts +7 -9
  305. package/src/resources/extensions/gsd/tests/projection-regression.test.ts +174 -0
  306. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +15 -14
  307. package/src/resources/extensions/gsd/tests/reopen-slice.test.ts +155 -0
  308. package/src/resources/extensions/gsd/tests/reopen-task.test.ts +165 -0
  309. package/src/resources/extensions/gsd/tests/session-lock-regression.test.ts +1 -4
  310. package/src/resources/extensions/gsd/tests/stop-auto-remote.test.ts +2 -3
  311. package/src/resources/extensions/gsd/tests/sync-lock.test.ts +122 -0
  312. package/src/resources/extensions/gsd/tests/unit-ownership.test.ts +175 -0
  313. package/src/resources/extensions/gsd/tests/workflow-events.test.ts +205 -0
  314. package/src/resources/extensions/gsd/tests/workflow-logger.test.ts +275 -0
  315. package/src/resources/extensions/gsd/tests/workflow-manifest.test.ts +186 -0
  316. package/src/resources/extensions/gsd/tests/workflow-projections.test.ts +171 -0
  317. package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +220 -0
  318. package/src/resources/extensions/gsd/tests/write-intercept.test.ts +76 -0
  319. package/src/resources/extensions/gsd/tools/complete-milestone.ts +74 -11
  320. package/src/resources/extensions/gsd/tools/complete-slice.ts +68 -11
  321. package/src/resources/extensions/gsd/tools/complete-task.ts +63 -1
  322. package/src/resources/extensions/gsd/tools/plan-milestone.ts +45 -0
  323. package/src/resources/extensions/gsd/tools/plan-slice.ts +38 -0
  324. package/src/resources/extensions/gsd/tools/plan-task.ts +35 -1
  325. package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +39 -1
  326. package/src/resources/extensions/gsd/tools/reopen-slice.ts +125 -0
  327. package/src/resources/extensions/gsd/tools/reopen-task.ts +129 -0
  328. package/src/resources/extensions/gsd/tools/replan-slice.ts +38 -1
  329. package/src/resources/extensions/gsd/types.ts +8 -0
  330. package/src/resources/extensions/gsd/unit-ownership.ts +104 -0
  331. package/src/resources/extensions/gsd/workflow-events.ts +154 -0
  332. package/src/resources/extensions/gsd/workflow-logger.ts +243 -0
  333. package/src/resources/extensions/gsd/workflow-manifest.ts +334 -0
  334. package/src/resources/extensions/gsd/workflow-migration.ts +345 -0
  335. package/src/resources/extensions/gsd/workflow-projections.ts +425 -0
  336. package/src/resources/extensions/gsd/workflow-reconcile.ts +503 -0
  337. package/src/resources/extensions/gsd/worktree-manager.ts +4 -9
  338. package/src/resources/extensions/gsd/worktree-resolver.ts +37 -0
  339. package/src/resources/extensions/gsd/write-intercept.ts +90 -0
  340. package/src/resources/extensions/voice/index.ts +11 -21
  341. package/src/resources/extensions/voice/linux-ready.ts +87 -0
  342. package/src/resources/extensions/voice/tests/linux-ready.test.ts +124 -0
  343. package/dist/web/standalone/.next/static/chunks/app/page-12dd5ece0df4badc.js +0 -1
  344. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  345. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  346. /package/dist/web/standalone/.next/static/{wUzEX1U3CmFcMry2SUDJn → ZIDqryyYDroh_8AnaAOSG}/_buildManifest.js +0 -0
  347. /package/dist/web/standalone/.next/static/{wUzEX1U3CmFcMry2SUDJn → ZIDqryyYDroh_8AnaAOSG}/_ssgManifest.js +0 -0
@@ -3,7 +3,7 @@ import { basename, dirname, join, sep } from "node:path";
3
3
  import { readRepoMeta, externalProjectsRoot, cleanNumberedGsdVariants } from "./repo-identity.js";
4
4
  import { loadFile } from "./files.js";
5
5
  import { parseRoadmap as parseLegacyRoadmap } from "./parsers-legacy.js";
6
- import { isDbAvailable, getMilestoneSlices } from "./gsd-db.js";
6
+ import { isDbAvailable, _getAdapter, getMilestoneSlices } from "./gsd-db.js";
7
7
  import { resolveMilestoneFile, milestonesDir, gsdRoot, resolveGsdRootFile } from "./paths.js";
8
8
  import { deriveState, isMilestoneComplete } from "./state.js";
9
9
  import { saveFile } from "./files.js";
@@ -17,7 +17,9 @@ import { getAllWorktreeHealth } from "./worktree-health.js";
17
17
  import { readAllSessionStatuses, isSessionStale, removeSessionStatus } from "./session-status-io.js";
18
18
  import { recoverFailedMigration } from "./migrate-external.js";
19
19
  import { loadEffectiveGSDPreferences } from "./preferences.js";
20
- export async function checkGitHealth(basePath, issues, fixesApplied, shouldFix, isolationMode = "worktree") {
20
+ import { readEvents } from "./workflow-events.js";
21
+ import { renderAllProjections } from "./workflow-projections.js";
22
+ export async function checkGitHealth(basePath, issues, fixesApplied, shouldFix, isolationMode = "none") {
21
23
  // Degrade gracefully if not a git repo
22
24
  if (!nativeIsRepo(basePath)) {
23
25
  return; // Not a git repo — skip all git health checks
@@ -1067,3 +1069,166 @@ export async function checkGlobalHealth(issues, fixesApplied, shouldFix) {
1067
1069
  // Non-fatal — global health check must not block per-project doctor
1068
1070
  }
1069
1071
  }
1072
+ // ── Engine Health Checks ────────────────────────────────────────────────────
1073
+ // DB constraint violation detection and projection drift checks.
1074
+ export async function checkEngineHealth(basePath, issues, fixesApplied) {
1075
+ // ── DB constraint violation detection (full doctor only, not pre-dispatch per D-10) ──
1076
+ try {
1077
+ if (isDbAvailable()) {
1078
+ const adapter = _getAdapter();
1079
+ // a. Orphaned tasks (task.slice_id points to non-existent slice)
1080
+ try {
1081
+ const orphanedTasks = adapter
1082
+ .prepare(`SELECT t.id, t.slice_id, t.milestone_id
1083
+ FROM tasks t
1084
+ LEFT JOIN slices s ON t.milestone_id = s.milestone_id AND t.slice_id = s.id
1085
+ WHERE s.id IS NULL`)
1086
+ .all();
1087
+ for (const row of orphanedTasks) {
1088
+ issues.push({
1089
+ severity: "error",
1090
+ code: "db_orphaned_task",
1091
+ scope: "task",
1092
+ unitId: `${row.milestone_id}/${row.slice_id}/${row.id}`,
1093
+ message: `Task ${row.id} references slice ${row.slice_id} in milestone ${row.milestone_id} but no such slice exists in the database`,
1094
+ fixable: false,
1095
+ });
1096
+ }
1097
+ }
1098
+ catch {
1099
+ // Non-fatal — orphaned task check failed
1100
+ }
1101
+ // b. Orphaned slices (slice.milestone_id points to non-existent milestone)
1102
+ try {
1103
+ const orphanedSlices = adapter
1104
+ .prepare(`SELECT s.id, s.milestone_id
1105
+ FROM slices s
1106
+ LEFT JOIN milestones m ON s.milestone_id = m.id
1107
+ WHERE m.id IS NULL`)
1108
+ .all();
1109
+ for (const row of orphanedSlices) {
1110
+ issues.push({
1111
+ severity: "error",
1112
+ code: "db_orphaned_slice",
1113
+ scope: "slice",
1114
+ unitId: `${row.milestone_id}/${row.id}`,
1115
+ message: `Slice ${row.id} references milestone ${row.milestone_id} but no such milestone exists in the database`,
1116
+ fixable: false,
1117
+ });
1118
+ }
1119
+ }
1120
+ catch {
1121
+ // Non-fatal — orphaned slice check failed
1122
+ }
1123
+ // c. Tasks marked complete without summaries
1124
+ try {
1125
+ const doneTasks = adapter
1126
+ .prepare(`SELECT id, slice_id, milestone_id FROM tasks
1127
+ WHERE status = 'done' AND (summary IS NULL OR summary = '')`)
1128
+ .all();
1129
+ for (const row of doneTasks) {
1130
+ issues.push({
1131
+ severity: "warning",
1132
+ code: "db_done_task_no_summary",
1133
+ scope: "task",
1134
+ unitId: `${row.milestone_id}/${row.slice_id}/${row.id}`,
1135
+ message: `Task ${row.id} is marked done but has no summary in the database`,
1136
+ fixable: false,
1137
+ });
1138
+ }
1139
+ }
1140
+ catch {
1141
+ // Non-fatal — done-task-no-summary check failed
1142
+ }
1143
+ // d. Duplicate entity IDs (safety check)
1144
+ try {
1145
+ const dupMilestones = adapter
1146
+ .prepare("SELECT id, COUNT(*) as cnt FROM milestones GROUP BY id HAVING cnt > 1")
1147
+ .all();
1148
+ for (const row of dupMilestones) {
1149
+ issues.push({
1150
+ severity: "error",
1151
+ code: "db_duplicate_id",
1152
+ scope: "milestone",
1153
+ unitId: row.id,
1154
+ message: `Duplicate milestone ID "${row.id}" appears ${row.cnt} times in the database`,
1155
+ fixable: false,
1156
+ });
1157
+ }
1158
+ const dupSlices = adapter
1159
+ .prepare("SELECT id, milestone_id, COUNT(*) as cnt FROM slices GROUP BY id, milestone_id HAVING cnt > 1")
1160
+ .all();
1161
+ for (const row of dupSlices) {
1162
+ issues.push({
1163
+ severity: "error",
1164
+ code: "db_duplicate_id",
1165
+ scope: "slice",
1166
+ unitId: `${row.milestone_id}/${row.id}`,
1167
+ message: `Duplicate slice ID "${row.id}" in milestone ${row.milestone_id} appears ${row.cnt} times`,
1168
+ fixable: false,
1169
+ });
1170
+ }
1171
+ const dupTasks = adapter
1172
+ .prepare("SELECT id, slice_id, milestone_id, COUNT(*) as cnt FROM tasks GROUP BY id, slice_id, milestone_id HAVING cnt > 1")
1173
+ .all();
1174
+ for (const row of dupTasks) {
1175
+ issues.push({
1176
+ severity: "error",
1177
+ code: "db_duplicate_id",
1178
+ scope: "task",
1179
+ unitId: `${row.milestone_id}/${row.slice_id}/${row.id}`,
1180
+ message: `Duplicate task ID "${row.id}" in slice ${row.slice_id} appears ${row.cnt} times`,
1181
+ fixable: false,
1182
+ });
1183
+ }
1184
+ }
1185
+ catch {
1186
+ // Non-fatal — duplicate ID check failed
1187
+ }
1188
+ }
1189
+ }
1190
+ catch {
1191
+ // Non-fatal — DB constraint checks failed entirely
1192
+ }
1193
+ // ── Projection drift detection ──────────────────────────────────────────
1194
+ // If the DB is available, check whether markdown projections are stale
1195
+ // relative to the event log and re-render them.
1196
+ try {
1197
+ if (isDbAvailable()) {
1198
+ const eventLogPath = join(basePath, ".gsd", "event-log.jsonl");
1199
+ const events = readEvents(eventLogPath);
1200
+ if (events.length > 0) {
1201
+ const lastEventTs = new Date(events[events.length - 1].ts).getTime();
1202
+ const state = await deriveState(basePath);
1203
+ for (const milestone of state.registry) {
1204
+ if (milestone.status === "complete")
1205
+ continue;
1206
+ const roadmapPath = resolveMilestoneFile(basePath, milestone.id, "ROADMAP");
1207
+ if (!roadmapPath || !existsSync(roadmapPath)) {
1208
+ try {
1209
+ await renderAllProjections(basePath, milestone.id);
1210
+ fixesApplied.push(`re-rendered missing projections for ${milestone.id}`);
1211
+ }
1212
+ catch {
1213
+ // Non-fatal — projection re-render failed
1214
+ }
1215
+ continue;
1216
+ }
1217
+ const projectionMtime = statSync(roadmapPath).mtimeMs;
1218
+ if (lastEventTs > projectionMtime) {
1219
+ try {
1220
+ await renderAllProjections(basePath, milestone.id);
1221
+ fixesApplied.push(`re-rendered stale projections for ${milestone.id}`);
1222
+ }
1223
+ catch {
1224
+ // Non-fatal — projection re-render failed
1225
+ }
1226
+ }
1227
+ }
1228
+ }
1229
+ }
1230
+ }
1231
+ catch {
1232
+ // Non-fatal — projection drift check must never block doctor
1233
+ }
1234
+ }
@@ -8,7 +8,7 @@ import { deriveState, isMilestoneComplete } from "./state.js";
8
8
  import { invalidateAllCaches } from "./cache.js";
9
9
  import { loadEffectiveGSDPreferences } from "./preferences.js";
10
10
  import { GLOBAL_STATE_CODES } from "./doctor-types.js";
11
- import { checkGitHealth, checkRuntimeHealth, checkGlobalHealth } from "./doctor-checks.js";
11
+ import { checkGitHealth, checkRuntimeHealth, checkGlobalHealth, checkEngineHealth } from "./doctor-checks.js";
12
12
  import { checkEnvironmentHealth } from "./doctor-environment.js";
13
13
  import { runProviderChecks } from "./doctor-providers.js";
14
14
  export { summarizeDoctorIssues, filterDoctorIssues, formatDoctorReport, formatDoctorIssuesForPrompt, formatDoctorReportJson } from "./doctor-format.js";
@@ -332,8 +332,8 @@ export async function runGSDDoctor(basePath, options) {
332
332
  // Git health checks — timed
333
333
  const t0git = Date.now();
334
334
  const isolationMode = options?.isolationMode ??
335
- (prefs?.preferences?.git?.isolation === "none" ? "none" :
336
- prefs?.preferences?.git?.isolation === "branch" ? "branch" : "worktree");
335
+ (prefs?.preferences?.git?.isolation === "worktree" ? "worktree" :
336
+ prefs?.preferences?.git?.isolation === "branch" ? "branch" : "none");
337
337
  await checkGitHealth(basePath, issues, fixesApplied, shouldFix, isolationMode);
338
338
  const gitMs = Date.now() - t0git;
339
339
  // Runtime health checks — timed
@@ -350,6 +350,8 @@ export async function runGSDDoctor(basePath, options) {
350
350
  includeTests: options?.includeTests,
351
351
  });
352
352
  const envMs = Date.now() - t0env;
353
+ // Engine health checks — DB constraints and projection drift
354
+ await checkEngineHealth(basePath, issues, fixesApplied);
353
355
  const milestonesPath = milestonesDir(basePath);
354
356
  if (!existsSync(milestonesPath)) {
355
357
  const report = { ok: issues.every(i => i.severity !== "error"), basePath, issues, fixesApplied, timing: { git: gitMs, runtime: runtimeMs, environment: envMs, gsdState: 0 } };
@@ -56,7 +56,11 @@ function loadProvider() {
56
56
  catch {
57
57
  // unavailable
58
58
  }
59
- process.stderr.write("gsd-db: No SQLite provider available (tried node:sqlite, better-sqlite3)\n");
59
+ const nodeMajor = parseInt(process.versions.node.split(".")[0], 10);
60
+ const versionHint = nodeMajor < 22
61
+ ? ` GSD requires Node >= 22.0.0 (current: v${process.versions.node}). Upgrade Node to fix this.`
62
+ : "";
63
+ process.stderr.write(`gsd-db: No SQLite provider available (tried node:sqlite, better-sqlite3).${versionHint}\n`);
60
64
  }
61
65
  function normalizeRow(row) {
62
66
  if (row == null)
@@ -105,7 +109,7 @@ function openRawDb(path) {
105
109
  const Database = providerModule;
106
110
  return new Database(path);
107
111
  }
108
- const SCHEMA_VERSION = 10;
112
+ const SCHEMA_VERSION = 11;
109
113
  function initSchema(db, fileBacked) {
110
114
  if (fileBacked)
111
115
  db.exec("PRAGMA journal_mode=WAL");
@@ -545,6 +549,13 @@ function migrateSchema(db) {
545
549
  }
546
550
  if (currentVersion < 11) {
547
551
  ensureColumn(db, "tasks", "full_plan_md", `ALTER TABLE tasks ADD COLUMN full_plan_md TEXT NOT NULL DEFAULT ''`);
552
+ // Add unique constraint to replan_history for idempotency:
553
+ // one replan record per blocker task per slice per milestone.
554
+ db.exec(`
555
+ CREATE UNIQUE INDEX IF NOT EXISTS idx_replan_history_unique
556
+ ON replan_history(milestone_id, slice_id, task_id)
557
+ WHERE slice_id IS NOT NULL AND task_id IS NOT NULL
558
+ `);
548
559
  db.prepare("INSERT INTO schema_version (version, applied_at) VALUES (:version, :applied_at)").run({
549
560
  ":version": 11,
550
561
  ":applied_at": new Date().toISOString(),
@@ -1311,7 +1322,9 @@ export function reconcileWorktreeDb(mainDbPath, worktreeDbPath) {
1311
1322
  export function insertReplanHistory(entry) {
1312
1323
  if (!currentDb)
1313
1324
  throw new GSDError(GSD_STALE_STATE, "gsd-db: No database open");
1314
- currentDb.prepare(`INSERT INTO replan_history (milestone_id, slice_id, task_id, summary, previous_artifact_path, replacement_artifact_path, created_at)
1325
+ // INSERT OR REPLACE: idempotent on (milestone_id, slice_id, task_id) via schema v11 unique index.
1326
+ // Retrying the same replan silently updates summary instead of accumulating duplicate rows.
1327
+ currentDb.prepare(`INSERT OR REPLACE INTO replan_history (milestone_id, slice_id, task_id, summary, previous_artifact_path, replacement_artifact_path, created_at)
1315
1328
  VALUES (:milestone_id, :slice_id, :task_id, :summary, :previous_artifact_path, :replacement_artifact_path, :created_at)`).run({
1316
1329
  ":milestone_id": entry.milestoneId,
1317
1330
  ":slice_id": entry.sliceId ?? null,
@@ -755,8 +755,7 @@ export async function showSmartEntry(ctx, pi, basePath, options) {
755
755
  // when the user exits during init wizard or discuss phase before any
756
756
  // real auto-mode work begins.
757
757
  const isBootstrapCrash = crashLock.unitType === "starting"
758
- && crashLock.unitId === "bootstrap"
759
- && crashLock.completedUnits === 0;
758
+ && crashLock.unitId === "bootstrap";
760
759
  if (!isBootstrapCrash) {
761
760
  const resume = await showNextAction(ctx, {
762
761
  title: "GSD — Interrupted Session Detected",
@@ -17,7 +17,7 @@ import { getErrorMessage } from "./error-utils.js";
17
17
  * By-completion: merge in the order milestones finished.
18
18
  */
19
19
  export function determineMergeOrder(workers, order = "sequential") {
20
- const completed = workers.filter(w => w.state === "stopped" && w.completedUnits > 0);
20
+ const completed = workers.filter(w => w.state === "stopped");
21
21
  if (order === "by-completion") {
22
22
  return completed
23
23
  .sort((a, b) => a.startedAt - b.startedAt) // earliest first
@@ -47,7 +47,6 @@ export function persistState(basePath) {
47
47
  worktreePath: w.worktreePath,
48
48
  startedAt: w.startedAt,
49
49
  state: w.state,
50
- completedUnits: w.completedUnits,
51
50
  cost: w.cost,
52
51
  })),
53
52
  totalCost: state.totalCost,
@@ -158,7 +157,6 @@ function restoreRuntimeState(basePath) {
158
157
  worktreePath: diskStatus?.worktreePath ?? w.worktreePath,
159
158
  startedAt: w.startedAt,
160
159
  state: diskStatus?.state ?? w.state,
161
- completedUnits: diskStatus?.completedUnits ?? w.completedUnits,
162
160
  cost: diskStatus?.cost ?? w.cost,
163
161
  });
164
162
  }
@@ -189,7 +187,6 @@ function restoreRuntimeState(basePath) {
189
187
  worktreePath: status.worktreePath,
190
188
  startedAt: status.startedAt,
191
189
  state: status.state,
192
- completedUnits: status.completedUnits,
193
190
  cost: status.cost,
194
191
  });
195
192
  state.totalCost += status.cost;
@@ -296,7 +293,6 @@ export async function startParallel(basePath, milestoneIds, prefs) {
296
293
  worktreePath: w.worktreePath,
297
294
  startedAt: w.startedAt,
298
295
  state: "running",
299
- completedUnits: w.completedUnits,
300
296
  cost: w.cost,
301
297
  });
302
298
  adopted.push(w.milestoneId);
@@ -341,7 +337,6 @@ export async function startParallel(basePath, milestoneIds, prefs) {
341
337
  worktreePath: wtPath,
342
338
  startedAt: now,
343
339
  state: "running",
344
- completedUnits: 0,
345
340
  cost: 0,
346
341
  };
347
342
  state.workers.set(mid, worker);
@@ -486,7 +481,7 @@ export function spawnWorker(basePath, milestoneId) {
486
481
  pid: worker.pid,
487
482
  state: "running",
488
483
  currentUnit: null,
489
- completedUnits: worker.completedUnits,
484
+ completedUnits: 0,
490
485
  cost: worker.cost,
491
486
  lastHeartbeat: Date.now(),
492
487
  startedAt: worker.startedAt,
@@ -527,7 +522,7 @@ export function spawnWorker(basePath, milestoneId) {
527
522
  pid: w.pid,
528
523
  state: w.state,
529
524
  currentUnit: null,
530
- completedUnits: w.completedUnits,
525
+ completedUnits: 0,
531
526
  cost: w.cost,
532
527
  lastHeartbeat: Date.now(),
533
528
  startedAt: w.startedAt,
@@ -602,13 +597,6 @@ function processWorkerLine(basePath, milestoneId, line) {
602
597
  }
603
598
  }
604
599
  }
605
- // Track completed units (each message_end from assistant = progress)
606
- if (msg.role === "assistant") {
607
- const worker = state.workers.get(milestoneId);
608
- if (worker) {
609
- worker.completedUnits++;
610
- }
611
- }
612
600
  // Update session status file so dashboard sees live cost
613
601
  const worker = state.workers.get(milestoneId);
614
602
  if (worker) {
@@ -617,7 +605,7 @@ function processWorkerLine(basePath, milestoneId, line) {
617
605
  pid: worker.pid,
618
606
  state: worker.state,
619
607
  currentUnit: null,
620
- completedUnits: worker.completedUnits,
608
+ completedUnits: 0,
621
609
  cost: worker.cost,
622
610
  lastHeartbeat: Date.now(),
623
611
  startedAt: worker.startedAt,
@@ -635,7 +623,7 @@ function processWorkerLine(basePath, milestoneId, line) {
635
623
  pid: worker.pid,
636
624
  state: worker.state,
637
625
  currentUnit: null,
638
- completedUnits: worker.completedUnits,
626
+ completedUnits: 0,
639
627
  cost: worker.cost,
640
628
  lastHeartbeat: Date.now(),
641
629
  startedAt: worker.startedAt,
@@ -776,13 +764,12 @@ export function refreshWorkerStatuses(basePath, options = {}) {
776
764
  if (!isPidAlive(worker.pid)) {
777
765
  worker.cleanup?.();
778
766
  worker.cleanup = undefined;
779
- worker.state = worker.completedUnits > 0 ? "stopped" : "error";
767
+ worker.state = "error";
780
768
  worker.process = null;
781
769
  }
782
770
  continue;
783
771
  }
784
772
  worker.state = diskStatus.state;
785
- worker.completedUnits = diskStatus.completedUnits;
786
773
  worker.cost = diskStatus.cost;
787
774
  worker.pid = diskStatus.pid;
788
775
  }
@@ -13,7 +13,7 @@ export const MODE_DEFAULTS = {
13
13
  push_branches: false,
14
14
  pre_merge_check: false,
15
15
  merge_strategy: "squash",
16
- isolation: "worktree",
16
+ isolation: "none",
17
17
  },
18
18
  unique_milestone_ids: false,
19
19
  },
@@ -23,7 +23,7 @@ export const MODE_DEFAULTS = {
23
23
  push_branches: true,
24
24
  pre_merge_check: true,
25
25
  merge_strategy: "squash",
26
- isolation: "worktree",
26
+ isolation: "none",
27
27
  },
28
28
  unique_milestone_ids: true,
29
29
  },
@@ -393,15 +393,19 @@ export function resolvePreDispatchHooks() {
393
393
  // ─── Isolation & Parallel ─────────────────────────────────────────────────────
394
394
  /**
395
395
  * Resolve the effective git isolation mode from preferences.
396
- * Returns "worktree" (default), "branch", or "none".
396
+ * Returns "none" (default), "worktree", or "branch".
397
+ *
398
+ * Default is "none" so GSD works out of the box without preferences.md.
399
+ * Worktree isolation requires explicit opt-in because it depends on git
400
+ * branch infrastructure that must be set up before use.
397
401
  */
398
402
  export function getIsolationMode() {
399
403
  const prefs = loadEffectiveGSDPreferences()?.preferences?.git;
400
- if (prefs?.isolation === "none")
401
- return "none";
404
+ if (prefs?.isolation === "worktree")
405
+ return "worktree";
402
406
  if (prefs?.isolation === "branch")
403
407
  return "branch";
404
- return "worktree"; // default
408
+ return "none"; // default — no isolation, work on current branch
405
409
  }
406
410
  export function resolveParallelConfig(prefs) {
407
411
  return {
@@ -17,18 +17,31 @@ All relevant context has been preloaded below — the roadmap, all slice summari
17
17
  Then:
18
18
  1. Use the **Milestone Summary** output template from the inlined context above
19
19
  2. {{skillActivation}}
20
- 3. **Verify code changes exist.** Run `git diff --stat HEAD $(git merge-base HEAD main) -- ':!.gsd/'` (or the equivalent for the integration branch). If no non-`.gsd/` files appear in the diff, the milestone produced only planning artifacts and no actual code. In that case, do NOT mark the milestone as passing verification — document the gap clearly in the summary and state that implementation is missing.
21
- 4. Verify each **success criterion** from the milestone definition in `{{roadmapPath}}`. For each criterion, confirm it was met with specific evidence from slice summaries, test results, or observable behavior. List any criterion that was NOT met.
22
- 5. Verify the milestone's **definition of done** — all slices are `[x]`, all slice summaries exist, and any cross-slice integration points work correctly.
20
+ 3. **Verify code changes exist.** Run `git diff --stat HEAD $(git merge-base HEAD main) -- ':!.gsd/'` (or the equivalent for the integration branch). If no non-`.gsd/` files appear in the diff, the milestone produced only planning artifacts and no actual code. Record this as a **verification failure**.
21
+ 4. Verify each **success criterion** from the milestone definition in `{{roadmapPath}}`. For each criterion, confirm it was met with specific evidence from slice summaries, test results, or observable behavior. Record any criterion that was NOT met as a **verification failure**.
22
+ 5. Verify the milestone's **definition of done** — all slices are `[x]`, all slice summaries exist, and any cross-slice integration points work correctly. Record any unmet items as a **verification failure**.
23
23
  6. Validate **requirement status transitions**. For each requirement that changed status during this milestone, confirm the transition is supported by evidence. Requirements can move between Active, Validated, Deferred, Blocked, or Out of Scope — but only with proof.
24
- 7. **Persist completion through `gsd_complete_milestone`.** Call it with: `milestoneId`, `title`, `oneLiner`, `narrative`, `successCriteriaResults`, `definitionOfDoneResults`, `requirementOutcomes`, `keyDecisions`, `keyFiles`, `lessonsLearned`, `followUps`, `deviations`. The tool updates the milestone status in the DB, renders `{{milestoneSummaryPath}}`, and validates all slices are complete before proceeding.
25
- 8. Update `.gsd/REQUIREMENTS.md` if any requirement status transitions were validated in step 6.
24
+
25
+ ### Verification Gate STOP if verification failed
26
+
27
+ **If ANY verification failure was recorded in steps 3, 4, or 5, you MUST follow the failure path below. Do NOT proceed to step 7.**
28
+
29
+ **Failure path** (verification failed):
30
+ - Do NOT call `gsd_complete_milestone` — the milestone must not be marked as complete.
31
+ - Do NOT update `.gsd/PROJECT.md` to reflect completion.
32
+ - Do NOT update `.gsd/REQUIREMENTS.md` to mark requirements as validated.
33
+ - Write a clear summary of what failed and why to help the next attempt.
34
+ - Say: "Milestone {{milestoneId}} verification FAILED — not complete." and stop.
35
+
36
+ **Success path** (all verifications passed — continue with steps 7–11):
37
+
38
+ 7. **Persist completion through `gsd_complete_milestone`.** Call it with: `milestoneId`, `title`, `oneLiner`, `narrative`, `successCriteriaResults`, `definitionOfDoneResults`, `requirementOutcomes`, `keyDecisions`, `keyFiles`, `lessonsLearned`, `followUps`, `deviations`, `verificationPassed: true`. The tool updates the milestone status in the DB, renders `{{milestoneSummaryPath}}`, and validates all slices are complete before proceeding.
39
+ 8. For each requirement whose status changed in step 6, call `gsd_requirement_update` with the requirement ID and updated `status` and `validation` fields — the tool regenerates `.gsd/REQUIREMENTS.md` automatically.
26
40
  9. Update `.gsd/PROJECT.md` to reflect milestone completion and current project state.
27
41
  10. Review all slice summaries for cross-cutting lessons, patterns, or gotchas that emerged during this milestone. Append any non-obvious, reusable insights to `.gsd/KNOWLEDGE.md`.
28
42
  11. Do not commit manually — the system auto-commits your changes after this unit completes.
43
+ - Say: "Milestone {{milestoneId}} complete."
29
44
 
30
- **Important:** Do NOT skip the code change verification, success criteria, or definition of done verification (steps 3-5). The milestone summary must reflect actual verified outcomes, not assumed success. If any criterion was not met or no code changes exist, document it clearly in the summary and do not mark the milestone as passing verification.
45
+ **Important:** Do NOT skip the code change verification, success criteria, or definition of done verification (steps 3-5). The milestone summary must reflect actual verified outcomes, not assumed success. Verification failures BLOCK completion there is no override. The milestone stays in its current state until issues are resolved and verification is re-run.
31
46
 
32
47
  **File system safety:** When scanning milestone directories for evidence, use `ls` or `find` to list directory contents first — never pass a directory path (e.g. `tasks/`, `slices/`) directly to the `read` tool. The `read` tool only accepts file paths, not directories.
33
-
34
- When done, say: "Milestone {{milestoneId}} complete."
@@ -23,28 +23,15 @@ Then:
23
23
  2. {{skillActivation}}
24
24
  3. Run all slice-level verification checks defined in the slice plan. All must pass before marking the slice done. If any fail, fix them first.
25
25
  4. If the slice plan includes observability/diagnostic surfaces, confirm they work. Skip this for simple slices that don't have observability sections.
26
- 5. If `.gsd/REQUIREMENTS.md` exists, update it based on what this slice actually proved. Move requirements between Active, Validated, Deferred, Blocked, or Out of Scope only when the evidence from execution supports that change.
27
- 6. Call the `gsd_slice_complete` tool (alias: `gsd_complete_slice`) to record the slice as complete. The tool validates all tasks are complete, updates the slice status in the DB, renders the summary to `{{sliceSummaryPath}}`, UAT to `{{sliceUatPath}}`, and re-renders `{{roadmapPath}}` — all atomically. Read the summary and UAT templates at `~/.gsd/agent/extensions/gsd/templates/` to understand the expected structure, then pass the following parameters:
28
-
29
- **Identity:** `sliceId`, `milestoneId`, `sliceTitle`
30
-
31
- **Narrative:** `oneLiner` (one-line summary of what the slice accomplished), `narrative` (detailed account of what happened across all tasks), `verification` (what was verified and how), `deviations` (deviations from plan, or "None."), `knownLimitations` (gaps or limitations, or "None."), `followUps` (follow-up work discovered, or "None.")
32
-
33
- **Files:** `keyFiles` (array of key file paths), `filesModified` (array of `{path, description}` objects for all files changed)
34
-
35
- **Requirements:** `requirementsAdvanced` (array of `{id, how}`), `requirementsValidated` (array of `{id, proof}`), `requirementsInvalidated` (array of `{id, what}`), `requirementsSurfaced` (array of new requirement strings)
36
-
37
- **Patterns & decisions:** `keyDecisions` (array of decision strings), `patternsEstablished` (array), `observabilitySurfaces` (array)
38
-
39
- **Dependencies:** `provides` (what this slice provides downstream), `affects` (downstream slice IDs affected), `requires` (array of `{slice, provides}` for upstream dependencies consumed), `drillDownPaths` (paths to task summaries)
40
-
41
- **UAT content:** `uatContent` — the UAT markdown body. This must be a concrete UAT script with real test cases derived from the slice plan and task summaries. Include preconditions, numbered steps with expected outcomes, and edge cases. This must NOT be a placeholder or generic template — tailor every test case to what this slice actually built. The tool writes it to `{{sliceUatPath}}`.
42
-
43
- 7. Review task summaries for `key_decisions`. Append any significant decisions to `.gsd/DECISIONS.md` if missing.
44
- 8. Review task summaries for patterns, gotchas, or non-obvious lessons learned. If any would save future agents from repeating investigation or hitting the same issues, append them to `.gsd/KNOWLEDGE.md`. Only add entries that are genuinely useful — don't pad with obvious observations.
45
- 9. Do not run git commands — the system commits your changes and handles any merge after this unit succeeds.
46
- 10. Update `.gsd/PROJECT.md` if it exists — refresh current state if needed.
47
-
48
- **You MUST call `gsd_slice_complete` before finishing.** The tool handles writing `{{sliceSummaryPath}}`, `{{sliceUatPath}}`, and updating `{{roadmapPath}}` atomically. You must still review decisions and knowledge manually (steps 7-8).
26
+ 5. If this slice produced evidence that a requirement changed status (Active Validated, Active Deferred, etc.), call `gsd_save_decision` with scope="requirement", decision="{requirement-id}", choice="{new-status}", rationale="{evidence}". Do NOT write `.gsd/REQUIREMENTS.md` directly — the engine renders it from the database.
27
+ 6. Write `{{sliceSummaryPath}}` (compress all task summaries).
28
+ 7. Write `{{sliceUatPath}}` — a concrete UAT script with real test cases derived from the slice plan and task summaries. Include preconditions, numbered steps with expected outcomes, and edge cases. This must NOT be a placeholder or generic template — tailor every test case to what this slice actually built.
29
+ 8. Review task summaries for `key_decisions`. Append any significant decisions to `.gsd/DECISIONS.md` if missing.
30
+ 9. Review task summaries for patterns, gotchas, or non-obvious lessons learned. If any would save future agents from repeating investigation or hitting the same issues, append them to `.gsd/KNOWLEDGE.md`. Only add entries that are genuinely useful — don't pad with obvious observations.
31
+ 10. Call `gsd_complete_slice` with milestone_id, slice_id, the slice summary, and the UAT result. Do NOT manually mark the roadmap checkbox the tool writes to the DB and renders the ROADMAP.md projection automatically.
32
+ 11. Do not run git commands — the system commits your changes and handles any merge after this unit succeeds.
33
+ 12. Update `.gsd/PROJECT.md` if it exists refresh current state if needed.
34
+
35
+ **You MUST do ALL THREE before finishing: (1) write `{{sliceSummaryPath}}`, (2) write `{{sliceUatPath}}`, (3) call `gsd_complete_slice`. The unit will not be marked complete if any of these are missing.**
49
36
 
50
37
  When done, say: "Slice {{sliceId}} complete."
@@ -203,7 +203,7 @@ When writing context.md, preserve the user's exact terminology, emphasis, and sp
203
203
 
204
204
  4. Write `{{contextPath}}` — use the **Context** output template below. Preserve key risks, unknowns, existing codebase constraints, integration points, and relevant requirements surfaced during discussion.
205
205
  5. Call `gsd_plan_milestone` to create the roadmap. Decompose into demoable vertical slices with risk, depends, demo sentences, proof strategy, verification classes, milestone definition of done, requirement coverage, and a boundary map. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice that proves the assembled system works end-to-end in a real environment. Use the **Roadmap** output template below to structure the tool call parameters.
206
- 6. Seed `.gsd/DECISIONS.md` use the **Decisions** output template below. Append rows for any architectural or pattern decisions made during discussion.
206
+ 6. For each architectural or pattern decision made during discussion, call `gsd_decision_save` the tool auto-assigns IDs and regenerates `.gsd/DECISIONS.md` automatically.
207
207
  7. {{commitInstruction}}
208
208
 
209
209
  After writing the files, say exactly: "Milestone {{milestoneId}} ready." — nothing else. Auto-mode will start automatically.
@@ -217,7 +217,7 @@ Once the user confirms the milestone split:
217
217
  1. For each milestone, call `gsd_milestone_generate_id` to get its ID — never invent milestone IDs manually. Then `mkdir -p .gsd/milestones/<ID>/slices`.
218
218
  2. Write `.gsd/PROJECT.md` — use the **Project** output template below.
219
219
  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.
220
- 4. Seed `.gsd/DECISIONS.md` — use the **Decisions** output template below.
220
+ 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.
221
221
 
222
222
  #### Phase 2: Primary milestone
223
223
 
@@ -63,23 +63,13 @@ Then:
63
63
  11. **Blocker discovery:** If execution reveals that the remaining slice plan is fundamentally invalid — not just a bug or minor deviation, but a plan-invalidating finding like a wrong API, missing capability, or architectural mismatch — set `blocker_discovered: true` in the task summary frontmatter and describe the blocker clearly in the summary narrative. Do NOT set `blocker_discovered: true` for ordinary debugging, minor deviations, or issues that can be fixed within the current task or the remaining plan. This flag triggers an automatic replan of the slice.
64
64
  12. If you made an architectural, pattern, library, or observability decision during this task that downstream work should know about, append it to `.gsd/DECISIONS.md` (read the template at `~/.gsd/agent/extensions/gsd/templates/decisions.md` if the file doesn't exist yet). Not every task produces decisions — only append when a meaningful choice was made.
65
65
  13. If you discover a non-obvious rule, recurring gotcha, or useful pattern during execution, append it to `.gsd/KNOWLEDGE.md`. Only add entries that would save future agents from repeating your investigation. Don't add obvious things.
66
- 14. Call the `gsd_task_complete` tool (alias: `gsd_complete_task`) to record the task completion. This single tool call atomically updates the task status in the DB, renders the summary file to `{{taskSummaryPath}}`, and re-renders the plan file at `{{planPath}}`. Read the summary template at `~/.gsd/agent/extensions/gsd/templates/task-summary.md` to understand the expected structure — but pass the content as tool parameters, not as a file write. The tool parameters are:
67
- - `taskId`: "{{taskId}}"
68
- - `sliceId`: "{{sliceId}}"
69
- - `milestoneId`: "{{milestoneId}}"
70
- - `oneLiner`: One-line summary of what was accomplished (becomes the commit message)
71
- - `narrative`: Detailed narrative of what happened during the task
72
- - `verification`: What was verified and how — commands run, tests passed, behavior confirmed
73
- - `deviations`: Deviations from the task plan, or "None."
74
- - `knownIssues`: Known issues discovered but not fixed, or "None."
75
- - `keyFiles`: Array of key files created or modified
76
- - `keyDecisions`: Array of key decisions made during this task
77
- - `blockerDiscovered`: Whether a plan-invalidating blocker was discovered (boolean)
78
- - `verificationEvidence`: Array of `{ command, exitCode, verdict, durationMs }` objects from the verification gate
79
- 15. Do not run git commands — the system reads your task summary after completion and creates a meaningful commit from it (type inferred from title, message from your one-liner, key files from frontmatter). Write a clear, specific one-liner in the summary — it becomes the commit message.
66
+ 14. Read the template at `~/.gsd/agent/extensions/gsd/templates/task-summary.md`
67
+ 15. Write `{{taskSummaryPath}}`
68
+ 16. Call `gsd_complete_task` with milestone_id, slice_id, task_id, and a summary of what was accomplished. This is your final required step — do NOT manually edit PLAN.md checkboxes. The tool marks the task complete, updates the DB, and renders PLAN.md automatically.
69
+ 17. Do not run git commands — the system reads your task summary after completion and creates a meaningful commit from it (type inferred from title, message from your one-liner, key files from frontmatter). Write a clear, specific one-liner in the summary — it becomes the commit message.
80
70
 
81
71
  All work stays in your working directory: `{{workingDirectory}}`.
82
72
 
83
- **You MUST call `gsd_task_complete` before finishing.** The tool handles writing `{{taskSummaryPath}}` and updating the plan file at `{{planPath}}` — do not write the summary file or modify the plan file manually.
73
+ **You MUST call `gsd_complete_task` AND write `{{taskSummaryPath}}` before finishing.**
84
74
 
85
75
  When done, say: "Task {{taskId}} complete."
@@ -105,6 +105,6 @@ Once the user confirms depth:
105
105
 
106
106
  1. Use the **Context** output template below
107
107
  2. `mkdir -p` the milestone directory if needed
108
- 3. Write `{{milestoneId}}-CONTEXT.md` — preserve the user's exact terminology, emphasis, and framing. Do not paraphrase nuance into generic summaries. The context file is downstream agents' only window into this conversation.
108
+ 3. Call `gsd_summary_save` with `milestone_id: {{milestoneId}}`, `artifact_type: "CONTEXT"`, and the full context markdown as `content`the tool writes the file to disk and persists to DB. Preserve the user's exact terminology, emphasis, and framing in the content. Do not paraphrase nuance into generic summaries. The context file is downstream agents' only window into this conversation.
109
109
  4. {{commitInstruction}}
110
110
  5. Say exactly: `"{{milestoneId}} context written."` — nothing else.
@@ -48,7 +48,7 @@ Once the user is ready to wrap up:
48
48
 
49
49
  1. Use the **Slice Context** output template below
50
50
  2. `mkdir -p {{sliceDirPath}}`
51
- 3. Write `{{contextPath}}` — use the template structure, filling in:
51
+ 3. Call `gsd_summary_save` with `milestone_id: {{milestoneId}}`, `slice_id: {{sliceId}}`, `artifact_type: "CONTEXT"`, and the context as `content` the tool writes the file to disk and persists to DB. Use the template structure, filling in:
52
52
  - **Goal** — one sentence: what this slice delivers
53
53
  - **Why this Slice** — why now, what it unblocks
54
54
  - **Scope / In Scope** — what was confirmed in scope during the interview
@@ -1,3 +1,3 @@
1
- Plan slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.gsd/DECISIONS.md` if it exists — respect existing decisions. Read `.gsd/REQUIREMENTS.md` if it exists — identify which Active requirements the roadmap says this slice owns or supports, and ensure the plan delivers them. Read the roadmap boundary map, any existing context/research files, and dependency summaries. Use the **Slice Plan** and **Task Plan** output templates below. Decompose into tasks with must-haves. Fill the `Proof Level` and `Integration Closure` sections truthfully so the plan says what class of proof this slice really delivers and what end-to-end wiring still remains. Write `{{sliceId}}-PLAN.md` and individual `T##-PLAN.md` files in the `tasks/` subdirectory. If planning produces structural decisions, append them to `.gsd/DECISIONS.md`. {{skillActivation}} Before committing, self-audit the plan: every must-have maps to at least one task, every task has complete sections (steps, must-haves, verification, observability impact, inputs, and expected output), task ordering is consistent with no circular references, every pair of artifacts that must connect has an explicit wiring step, task scope targets 2–5 steps and 3–8 files (6–8 steps or 8–10 files — consider splitting; 10+ steps or 12+ files — must split), the plan honors locked decisions from context/research/decisions artifacts, the proof-level wording does not overclaim live integration if only fixture/contract proof is planned, every Active requirement this slice owns has at least one task with verification that proves it is met, and every task produces real user-facing progress — if the slice has a UI surface at least one task builds the real UI, if it has an API at least one task connects it to a real data source, and showing the completed result to a non-technical stakeholder would demonstrate real product progress rather than developer artifacts.
1
+ Plan slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.gsd/DECISIONS.md` if it exists — respect existing decisions. Read `.gsd/REQUIREMENTS.md` if it exists — identify which Active requirements the roadmap says this slice owns or supports, and ensure the plan delivers them. Read the roadmap boundary map, any existing context/research files, and dependency summaries. Use the **Slice Plan** and **Task Plan** output templates below. Decompose into tasks with must-haves. Fill the `Proof Level` and `Integration Closure` sections truthfully so the plan says what class of proof this slice really delivers and what end-to-end wiring still remains. Call `gsd_plan_slice` to persist the slice plan — the tool writes `{{sliceId}}-PLAN.md` and individual `T##-PLAN.md` files to disk and persists to DB. Do **not** write plan files manually — use the DB-backed tool so state stays consistent. If planning produces structural decisions, call `gsd_decision_save` for each — the tool auto-assigns IDs and regenerates `.gsd/DECISIONS.md` automatically. {{skillActivation}} Before finishing, self-audit the plan: every must-have maps to at least one task, every task has complete sections (steps, must-haves, verification, observability impact, inputs, and expected output), task ordering is consistent with no circular references, every pair of artifacts that must connect has an explicit wiring step, task scope targets 2–5 steps and 3–8 files (6–8 steps or 8–10 files — consider splitting; 10+ steps or 12+ files — must split), the plan honors locked decisions from context/research/decisions artifacts, the proof-level wording does not overclaim live integration if only fixture/contract proof is planned, every Active requirement this slice owns has at least one task with verification that proves it is met, and every task produces real user-facing progress — if the slice has a UI surface at least one task builds the real UI, if it has an API at least one task connects it to a real data source, and showing the completed result to a non-technical stakeholder would demonstrate real product progress rather than developer artifacts.
2
2
 
3
3
  {{inlinedTemplates}}
@@ -1,4 +1,4 @@
1
- Research slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.gsd/DECISIONS.md` if it exists — respect existing decisions, don't contradict them. Read `.gsd/REQUIREMENTS.md` if it exists — identify which Active requirements this slice owns or supports and target research toward risks, unknowns, and constraints that could affect delivery of those requirements. {{skillActivation}} Explore the relevant code — use `rg`/`find` for targeted reads, or `scout` if the area is broad or unfamiliar. Check libraries with `resolve_library`/`get_library_docs` — skip this for libraries already used in the codebase. Use the **Research** output template below. Write `{{sliceId}}-RESEARCH.md` in the slice directory.
1
+ Research slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.gsd/DECISIONS.md` if it exists — respect existing decisions, don't contradict them. Read `.gsd/REQUIREMENTS.md` if it exists — identify which Active requirements this slice owns or supports and target research toward risks, unknowns, and constraints that could affect delivery of those requirements. {{skillActivation}} Explore the relevant code — use `rg`/`find` for targeted reads, or `scout` if the area is broad or unfamiliar. Check libraries with `resolve_library`/`get_library_docs` — skip this for libraries already used in the codebase. Use the **Research** output template below. Call `gsd_summary_save` with `milestone_id: {{milestoneId}}`, `slice_id: {{sliceId}}`, `artifact_type: "RESEARCH"`, and the research content — the tool writes the file to disk and persists to DB.
2
2
 
3
3
  **You are the scout.** A planner agent reads your output in a fresh context to decompose this slice into tasks. Write for the planner — surface key files, where the work divides naturally, what to build first, and how to verify. If the research doc is vague, the planner re-explores code you already read. If it's precise, the planner decomposes immediately.
4
4