gsd-pi 2.82.0 → 3.0.0-dev.8b8d129d7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (744) hide show
  1. package/README.md +125 -32
  2. package/dist/cli.js +20 -9
  3. package/dist/headless.js +9 -2
  4. package/dist/resources/.managed-resources-content-hash +1 -1
  5. package/dist/resources/GSD-WORKFLOW.md +10 -1
  6. package/dist/resources/extensions/browser-tools/tools/screenshot.js +1 -0
  7. package/dist/resources/extensions/browser-tools/tools/zoom.js +1 -0
  8. package/dist/resources/extensions/claude-code-cli/partial-builder.js +2 -1
  9. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +44 -6
  10. package/dist/resources/extensions/cmux/index.js +5 -0
  11. package/dist/resources/extensions/gsd/auto/infra-errors.js +9 -3
  12. package/dist/resources/extensions/gsd/auto/loop.js +110 -37
  13. package/dist/resources/extensions/gsd/auto/orchestrator.js +124 -6
  14. package/dist/resources/extensions/gsd/auto/phases.js +106 -38
  15. package/dist/resources/extensions/gsd/auto/session.js +6 -0
  16. package/dist/resources/extensions/gsd/auto/workflow-kernel.js +3 -0
  17. package/dist/resources/extensions/gsd/auto/workflow-memory-pressure.js +12 -0
  18. package/dist/resources/extensions/gsd/auto-dashboard.js +66 -1
  19. package/dist/resources/extensions/gsd/auto-direct-dispatch.js +1 -0
  20. package/dist/resources/extensions/gsd/auto-dispatch.js +20 -19
  21. package/dist/resources/extensions/gsd/auto-model-selection.js +2 -0
  22. package/dist/resources/extensions/gsd/auto-post-unit.js +278 -137
  23. package/dist/resources/extensions/gsd/auto-prompts.js +47 -13
  24. package/dist/resources/extensions/gsd/auto-recovery.js +79 -14
  25. package/dist/resources/extensions/gsd/auto-start.js +87 -14
  26. package/dist/resources/extensions/gsd/auto-timers.js +11 -3
  27. package/dist/resources/extensions/gsd/auto-verification.js +102 -34
  28. package/dist/resources/extensions/gsd/auto-worktree.js +178 -11
  29. package/dist/resources/extensions/gsd/auto.js +216 -81
  30. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +31 -7
  31. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +10 -9
  32. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +10 -4
  33. package/dist/resources/extensions/gsd/bootstrap/subagent-input.js +21 -9
  34. package/dist/resources/extensions/gsd/bootstrap/system-context.js +55 -12
  35. package/dist/resources/extensions/gsd/bootstrap/write-gate.js +24 -9
  36. package/dist/resources/extensions/gsd/clean-root-preflight.js +170 -8
  37. package/dist/resources/extensions/gsd/commands/catalog.js +10 -1
  38. package/dist/resources/extensions/gsd/commands/handlers/core.js +39 -1
  39. package/dist/resources/extensions/gsd/commands/handlers/ops.js +20 -0
  40. package/dist/resources/extensions/gsd/commands-bootstrap.js +5 -0
  41. package/dist/resources/extensions/gsd/commands-handlers.js +17 -2
  42. package/dist/resources/extensions/gsd/commands-mcp-status.js +9 -0
  43. package/dist/resources/extensions/gsd/commands-prefs-wizard.js +7 -2
  44. package/dist/resources/extensions/gsd/commands-verdict.js +139 -0
  45. package/dist/resources/extensions/gsd/context-store.js +112 -0
  46. package/dist/resources/extensions/gsd/crash-recovery.js +43 -5
  47. package/dist/resources/extensions/gsd/db/milestone-leases.js +24 -0
  48. package/dist/resources/extensions/gsd/db/unit-dispatches.js +3 -2
  49. package/dist/resources/extensions/gsd/db-base-schema.js +2 -0
  50. package/dist/resources/extensions/gsd/db-migration-steps.js +4 -0
  51. package/dist/resources/extensions/gsd/db-task-slice-rows.js +2 -0
  52. package/dist/resources/extensions/gsd/db-writer.js +150 -84
  53. package/dist/resources/extensions/gsd/dispatch-guard.js +46 -2
  54. package/dist/resources/extensions/gsd/docs/preferences-reference.md +9 -1
  55. package/dist/resources/extensions/gsd/doctor-git-checks.js +87 -7
  56. package/dist/resources/extensions/gsd/doctor-runtime-checks.js +28 -11
  57. package/dist/resources/extensions/gsd/doctor.js +2 -28
  58. package/dist/resources/extensions/gsd/export-html.js +27 -425
  59. package/dist/resources/extensions/gsd/forensics.js +8 -3
  60. package/dist/resources/extensions/gsd/git-service.js +138 -10
  61. package/dist/resources/extensions/gsd/gsd-db.js +76 -33
  62. package/dist/resources/extensions/gsd/guided-flow-queue.js +4 -3
  63. package/dist/resources/extensions/gsd/guided-flow.js +110 -117
  64. package/dist/resources/extensions/gsd/guided-unit-context.js +23 -0
  65. package/dist/resources/extensions/gsd/init-wizard.js +17 -2
  66. package/dist/resources/extensions/gsd/knowledge-backfill.js +144 -0
  67. package/dist/resources/extensions/gsd/knowledge-capture.js +136 -0
  68. package/dist/resources/extensions/gsd/knowledge-parser.js +154 -0
  69. package/dist/resources/extensions/gsd/knowledge-projection.js +210 -0
  70. package/dist/resources/extensions/gsd/markdown-renderer.js +16 -9
  71. package/dist/resources/extensions/gsd/mcp-filter.js +58 -0
  72. package/dist/resources/extensions/gsd/md-importer.js +1 -1
  73. package/dist/resources/extensions/gsd/memory-backfill.js +73 -17
  74. package/dist/resources/extensions/gsd/memory-consolidation-scanner.js +222 -0
  75. package/dist/resources/extensions/gsd/migrate/command.js +5 -0
  76. package/dist/resources/extensions/gsd/migrate/parsers.js +10 -0
  77. package/dist/resources/extensions/gsd/migrate/preview.js +9 -0
  78. package/dist/resources/extensions/gsd/migrate/transformer.js +51 -4
  79. package/dist/resources/extensions/gsd/migrate/writer.js +11 -1
  80. package/dist/resources/extensions/gsd/migration-auto-check.js +12 -17
  81. package/dist/resources/extensions/gsd/milestone-actions.js +11 -4
  82. package/dist/resources/extensions/gsd/native-git-bridge.js +57 -14
  83. package/dist/resources/extensions/gsd/parallel-orchestrator.js +3 -0
  84. package/dist/resources/extensions/gsd/paths.js +4 -0
  85. package/dist/resources/extensions/gsd/pending-auto-start.js +52 -0
  86. package/dist/resources/extensions/gsd/planning-path-scope.js +9 -3
  87. package/dist/resources/extensions/gsd/post-execution-checks.js +73 -9
  88. package/dist/resources/extensions/gsd/pre-execution-checks.js +38 -11
  89. package/dist/resources/extensions/gsd/preferences-mcp.js +19 -0
  90. package/dist/resources/extensions/gsd/preferences-types.js +2 -0
  91. package/dist/resources/extensions/gsd/preferences-validation.js +138 -0
  92. package/dist/resources/extensions/gsd/preferences.js +2 -0
  93. package/dist/resources/extensions/gsd/prompt-loader.js +1 -1
  94. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
  95. package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -1
  96. package/dist/resources/extensions/gsd/prompts/discuss-headless.md +8 -8
  97. package/dist/resources/extensions/gsd/prompts/discuss.md +9 -9
  98. package/dist/resources/extensions/gsd/prompts/forensics.md +3 -3
  99. package/dist/resources/extensions/gsd/prompts/guided-discuss-project.md +4 -4
  100. package/dist/resources/extensions/gsd/prompts/guided-discuss-requirements.md +3 -3
  101. package/dist/resources/extensions/gsd/prompts/plan-slice.md +4 -4
  102. package/dist/resources/extensions/gsd/prompts/queue.md +4 -4
  103. package/dist/resources/extensions/gsd/prompts/reactive-execute.md +1 -1
  104. package/dist/resources/extensions/gsd/prompts/refine-slice.md +2 -2
  105. package/dist/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
  106. package/dist/resources/extensions/gsd/prompts/system.md +2 -2
  107. package/dist/resources/extensions/gsd/provider-switch-observer.js +146 -0
  108. package/dist/resources/extensions/gsd/queue-reorder-ui.js +30 -13
  109. package/dist/resources/extensions/gsd/repository-registry.js +44 -0
  110. package/dist/resources/extensions/gsd/safety/evidence-collector.js +2 -0
  111. package/dist/resources/extensions/gsd/safety/evidence-cross-ref.js +42 -18
  112. package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +59 -2
  113. package/dist/resources/extensions/gsd/smart-entry-routing.js +36 -0
  114. package/dist/resources/extensions/gsd/state-reconciliation/drift/merge-state.js +6 -1
  115. package/dist/resources/extensions/gsd/state-reconciliation/drift/project-md.js +9 -14
  116. package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +19 -24
  117. package/dist/resources/extensions/gsd/state.js +14 -4
  118. package/dist/resources/extensions/gsd/status-guards.js +14 -2
  119. package/dist/resources/extensions/gsd/templates/knowledge.md +2 -2
  120. package/dist/resources/extensions/gsd/templates/plan.md +9 -5
  121. package/dist/resources/extensions/gsd/templates/task-plan.md +10 -2
  122. package/dist/resources/extensions/gsd/tools/complete-milestone.js +6 -8
  123. package/dist/resources/extensions/gsd/tools/complete-slice.js +6 -8
  124. package/dist/resources/extensions/gsd/tools/plan-milestone.js +7 -1
  125. package/dist/resources/extensions/gsd/tools/plan-slice.js +151 -15
  126. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +119 -0
  127. package/dist/resources/extensions/gsd/unit-context-manifest.js +36 -17
  128. package/dist/resources/extensions/gsd/validation.js +23 -1
  129. package/dist/resources/extensions/gsd/verification-gate.js +142 -7
  130. package/dist/resources/extensions/gsd/verification-verdict.js +26 -0
  131. package/dist/resources/extensions/gsd/workflow-manifest.js +2 -0
  132. package/dist/resources/extensions/gsd/workflow-mcp.js +17 -1
  133. package/dist/resources/extensions/gsd/workflow-projections.js +6 -8
  134. package/dist/resources/extensions/gsd/worktree-lifecycle.js +54 -10
  135. package/dist/resources/extensions/gsd/worktree-manager.js +1 -1
  136. package/dist/resources/extensions/gsd/worktree-state-projection.js +31 -0
  137. package/dist/resources/extensions/shared/html-shell.js +388 -0
  138. package/dist/resources/extensions/shared/interview-ui.js +6 -4
  139. package/dist/resources/extensions/subagent/index.js +448 -78
  140. package/dist/resources/extensions/subagent/launch.js +77 -0
  141. package/dist/resources/extensions/subagent/run-store.js +148 -0
  142. package/dist/resources/extensions/ttsr/ttsr-manager.js +3 -1
  143. package/dist/resources/extensions/visual-brief/artifact-policy.js +29 -0
  144. package/dist/resources/extensions/visual-brief/extension-manifest.json +8 -0
  145. package/dist/resources/extensions/visual-brief/index.js +5 -0
  146. package/dist/resources/extensions/visual-brief/page-contract.js +124 -0
  147. package/dist/resources/extensions/visual-brief/prompts.js +140 -0
  148. package/dist/resources/skills/forensics/SKILL.md +1 -1
  149. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  150. package/dist/web/standalone/.next/BUILD_ID +1 -1
  151. package/dist/web/standalone/.next/app-path-routes-manifest.json +9 -9
  152. package/dist/web/standalone/.next/build-manifest.json +4 -4
  153. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  154. package/dist/web/standalone/.next/react-loadable-manifest.json +5 -5
  155. package/dist/web/standalone/.next/required-server-files.json +3 -3
  156. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  157. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  158. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  159. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  160. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  161. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  162. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  163. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  164. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  165. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  166. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  167. package/dist/web/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  168. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  169. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  170. package/dist/web/standalone/.next/server/app/_not-found.rsc +4 -7
  171. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -7
  172. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  173. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +4 -5
  174. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  175. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  176. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -5
  177. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  178. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  179. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  180. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  181. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  182. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  183. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  184. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  185. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  186. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  187. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  188. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  189. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  190. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  191. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  192. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  193. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  194. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  195. package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
  196. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  197. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  198. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  199. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  200. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  201. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  202. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  203. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  204. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  205. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  206. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  207. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  208. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  209. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  210. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  211. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  212. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  213. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  214. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  215. package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
  216. package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  217. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  218. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  219. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  220. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  221. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  222. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  223. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  224. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  225. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
  226. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  227. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  228. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  229. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  230. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  231. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  232. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  233. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  234. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  235. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  236. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  237. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  238. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  239. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  240. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  241. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  242. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  243. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  244. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  245. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
  246. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  247. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  248. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  249. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
  250. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  251. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +2 -2
  252. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  253. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  254. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  255. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  256. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  257. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  258. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  259. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  260. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  261. package/dist/web/standalone/.next/server/app/index.html +1 -1
  262. package/dist/web/standalone/.next/server/app/index.rsc +5 -8
  263. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  264. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +5 -8
  265. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  266. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +4 -5
  267. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -5
  268. package/dist/web/standalone/.next/server/app/page.js +2 -2
  269. package/dist/web/standalone/.next/server/app/page.js.nft.json +1 -1
  270. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  271. package/dist/web/standalone/.next/server/app-paths-manifest.json +9 -9
  272. package/dist/web/standalone/.next/server/chunks/4266.js +2 -0
  273. package/dist/web/standalone/.next/server/chunks/63.js +3 -3
  274. package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
  275. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  276. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  277. package/dist/web/standalone/.next/server/middleware.js +2 -2
  278. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  279. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  280. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  281. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  282. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  283. package/dist/web/standalone/.next/static/chunks/2973.33f26573894b6153.js +2 -0
  284. package/dist/web/standalone/.next/static/chunks/8359.65b24fac92188a6b.js +10 -0
  285. package/dist/web/standalone/.next/static/chunks/9441.ff70bb53f6835771.js +1 -0
  286. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  287. package/dist/web/standalone/.next/static/chunks/app/layout-8c10ec293ae0f1d5.js +1 -0
  288. package/dist/web/standalone/.next/static/chunks/app/page-752f1e2ebdaa3e45.js +1 -0
  289. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  290. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  291. package/dist/web/standalone/.next/static/chunks/{webpack-de742b64187e13fe.js → webpack-855d616060cb6e59.js} +1 -1
  292. package/dist/web/standalone/.next/static/css/746ee28c929d1880.css +1 -0
  293. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  294. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  295. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  296. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  297. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  298. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  299. package/dist/web/standalone/server.js +1 -1
  300. package/package.json +6 -5
  301. package/packages/contracts/dist/rpc.test.js +7 -0
  302. package/packages/contracts/dist/rpc.test.js.map +1 -1
  303. package/packages/contracts/dist/workflow.d.ts +21 -0
  304. package/packages/contracts/dist/workflow.d.ts.map +1 -1
  305. package/packages/contracts/dist/workflow.js +24 -0
  306. package/packages/contracts/dist/workflow.js.map +1 -1
  307. package/packages/contracts/src/rpc.test.ts +8 -0
  308. package/packages/contracts/src/workflow.ts +24 -0
  309. package/packages/daemon/package.json +2 -2
  310. package/packages/mcp-server/README.md +14 -3
  311. package/packages/mcp-server/dist/workflow-tools.d.ts +0 -3
  312. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  313. package/packages/mcp-server/dist/workflow-tools.js +80 -0
  314. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  315. package/packages/mcp-server/package.json +2 -2
  316. package/packages/mcp-server/src/workflow-tools-parity.test.ts +244 -0
  317. package/packages/mcp-server/src/workflow-tools.test.ts +23 -1
  318. package/packages/mcp-server/src/workflow-tools.ts +168 -0
  319. package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
  320. package/packages/native/package.json +1 -1
  321. package/packages/native/tsconfig.json +2 -1
  322. package/packages/native/tsconfig.tsbuildinfo +1 -1
  323. package/packages/pi-agent-core/package.json +1 -1
  324. package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
  325. package/packages/pi-ai/dist/index.d.ts +2 -2
  326. package/packages/pi-ai/dist/index.d.ts.map +1 -1
  327. package/packages/pi-ai/dist/index.js +1 -1
  328. package/packages/pi-ai/dist/index.js.map +1 -1
  329. package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts.map +1 -1
  330. package/packages/pi-ai/dist/providers/google-gemini-cli.js +5 -0
  331. package/packages/pi-ai/dist/providers/google-gemini-cli.js.map +1 -1
  332. package/packages/pi-ai/dist/providers/google-gemini-cli.test.d.ts +2 -0
  333. package/packages/pi-ai/dist/providers/google-gemini-cli.test.d.ts.map +1 -0
  334. package/packages/pi-ai/dist/providers/google-gemini-cli.test.js +41 -0
  335. package/packages/pi-ai/dist/providers/google-gemini-cli.test.js.map +1 -0
  336. package/packages/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
  337. package/packages/pi-ai/dist/providers/openai-codex-responses.js +82 -1
  338. package/packages/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
  339. package/packages/pi-ai/dist/providers/openai-codex-responses.test.d.ts +2 -0
  340. package/packages/pi-ai/dist/providers/openai-codex-responses.test.d.ts.map +1 -0
  341. package/packages/pi-ai/dist/providers/openai-codex-responses.test.js +52 -0
  342. package/packages/pi-ai/dist/providers/openai-codex-responses.test.js.map +1 -0
  343. package/packages/pi-ai/dist/providers/simple-options.d.ts +2 -4
  344. package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
  345. package/packages/pi-ai/dist/providers/simple-options.js +5 -6
  346. package/packages/pi-ai/dist/providers/simple-options.js.map +1 -1
  347. package/packages/pi-ai/dist/providers/simple-options.test.d.ts +2 -0
  348. package/packages/pi-ai/dist/providers/simple-options.test.d.ts.map +1 -0
  349. package/packages/pi-ai/dist/providers/simple-options.test.js +50 -0
  350. package/packages/pi-ai/dist/providers/simple-options.test.js.map +1 -0
  351. package/packages/pi-ai/dist/providers/transform-messages.d.ts +11 -0
  352. package/packages/pi-ai/dist/providers/transform-messages.d.ts.map +1 -1
  353. package/packages/pi-ai/dist/providers/transform-messages.js +20 -0
  354. package/packages/pi-ai/dist/providers/transform-messages.js.map +1 -1
  355. package/packages/pi-ai/package.json +1 -1
  356. package/packages/pi-ai/src/index.ts +7 -2
  357. package/packages/pi-ai/src/providers/google-gemini-cli.test.ts +49 -0
  358. package/packages/pi-ai/src/providers/google-gemini-cli.ts +7 -0
  359. package/packages/pi-ai/src/providers/openai-codex-responses.test.ts +63 -0
  360. package/packages/pi-ai/src/providers/openai-codex-responses.ts +91 -1
  361. package/packages/pi-ai/src/providers/simple-options.test.ts +60 -0
  362. package/packages/pi-ai/src/providers/simple-options.ts +5 -6
  363. package/packages/pi-ai/src/providers/transform-messages.ts +24 -0
  364. package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
  365. package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.d.ts +2 -0
  366. package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.d.ts.map +1 -0
  367. package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.js +66 -0
  368. package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.js.map +1 -0
  369. package/packages/pi-coding-agent/dist/core/agent-session.js +1 -1
  370. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  371. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +44 -3
  372. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
  373. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +6 -1
  374. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
  375. package/packages/pi-coding-agent/dist/core/compaction/compaction.js +7 -2
  376. package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
  377. package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js +14 -1
  378. package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js.map +1 -1
  379. package/packages/pi-coding-agent/dist/core/sdk.js +1 -1
  380. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
  381. package/packages/pi-coding-agent/dist/core/system-prompt.js +4 -4
  382. package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
  383. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
  384. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +24 -6
  385. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
  386. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  387. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +71 -97
  388. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  389. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js +7 -7
  390. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js.map +1 -1
  391. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +11 -0
  392. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
  393. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.js +25 -1
  394. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.js.map +1 -1
  395. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +2 -0
  396. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  397. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +24 -10
  398. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  399. package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.d.ts +2 -0
  400. package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.d.ts.map +1 -0
  401. package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.js +17 -0
  402. package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.js.map +1 -0
  403. package/packages/pi-coding-agent/package.json +1 -1
  404. package/packages/pi-coding-agent/src/core/agent-session-thinking-level.test.ts +79 -0
  405. package/packages/pi-coding-agent/src/core/agent-session.ts +1 -1
  406. package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +53 -3
  407. package/packages/pi-coding-agent/src/core/compaction/compaction.test.ts +23 -1
  408. package/packages/pi-coding-agent/src/core/compaction/compaction.ts +7 -2
  409. package/packages/pi-coding-agent/src/core/sdk.ts +1 -1
  410. package/packages/pi-coding-agent/src/core/system-prompt.ts +4 -4
  411. package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +23 -7
  412. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +75 -102
  413. package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +15 -1
  414. package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.ts +9 -9
  415. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-ordering.test.ts +30 -1
  416. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +29 -10
  417. package/packages/pi-coding-agent/src/tests/system-prompt-file-safety.test.ts +22 -0
  418. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
  419. package/packages/pi-tui/dist/__tests__/terminal.test.d.ts +2 -0
  420. package/packages/pi-tui/dist/__tests__/terminal.test.d.ts.map +1 -0
  421. package/packages/pi-tui/dist/__tests__/terminal.test.js +103 -0
  422. package/packages/pi-tui/dist/__tests__/terminal.test.js.map +1 -0
  423. package/packages/pi-tui/dist/__tests__/tui.test.js +45 -2
  424. package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
  425. package/packages/pi-tui/dist/terminal.d.ts +2 -0
  426. package/packages/pi-tui/dist/terminal.d.ts.map +1 -1
  427. package/packages/pi-tui/dist/terminal.js +12 -0
  428. package/packages/pi-tui/dist/terminal.js.map +1 -1
  429. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  430. package/packages/pi-tui/dist/tui.js +108 -24
  431. package/packages/pi-tui/dist/tui.js.map +1 -1
  432. package/packages/pi-tui/package.json +1 -1
  433. package/packages/pi-tui/src/__tests__/terminal.test.ts +121 -0
  434. package/packages/pi-tui/src/__tests__/tui.test.ts +59 -2
  435. package/packages/pi-tui/src/terminal.ts +11 -0
  436. package/packages/pi-tui/src/tui.ts +111 -24
  437. package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
  438. package/packages/rpc-client/package.json +1 -1
  439. package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
  440. package/pkg/package.json +1 -1
  441. package/src/resources/GSD-WORKFLOW.md +10 -1
  442. package/src/resources/extensions/browser-tools/tools/screenshot.ts +1 -0
  443. package/src/resources/extensions/browser-tools/tools/zoom.ts +1 -0
  444. package/src/resources/extensions/claude-code-cli/partial-builder.ts +2 -1
  445. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +52 -6
  446. package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +19 -2
  447. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +49 -2
  448. package/src/resources/extensions/cmux/index.ts +6 -0
  449. package/src/resources/extensions/gsd/auto/contracts.ts +62 -16
  450. package/src/resources/extensions/gsd/auto/infra-errors.ts +9 -3
  451. package/src/resources/extensions/gsd/auto/loop.ts +111 -38
  452. package/src/resources/extensions/gsd/auto/orchestrator.ts +129 -6
  453. package/src/resources/extensions/gsd/auto/phases.ts +129 -49
  454. package/src/resources/extensions/gsd/auto/session.ts +16 -0
  455. package/src/resources/extensions/gsd/auto/types.ts +3 -0
  456. package/src/resources/extensions/gsd/auto/workflow-kernel.ts +5 -1
  457. package/src/resources/extensions/gsd/auto/workflow-memory-pressure.ts +13 -0
  458. package/src/resources/extensions/gsd/auto-dashboard.ts +72 -1
  459. package/src/resources/extensions/gsd/auto-direct-dispatch.ts +1 -0
  460. package/src/resources/extensions/gsd/auto-dispatch.ts +21 -19
  461. package/src/resources/extensions/gsd/auto-model-selection.ts +2 -1
  462. package/src/resources/extensions/gsd/auto-post-unit.ts +312 -148
  463. package/src/resources/extensions/gsd/auto-prompts.ts +47 -16
  464. package/src/resources/extensions/gsd/auto-recovery.ts +83 -11
  465. package/src/resources/extensions/gsd/auto-start.ts +94 -12
  466. package/src/resources/extensions/gsd/auto-timers.ts +10 -3
  467. package/src/resources/extensions/gsd/auto-verification.ts +124 -42
  468. package/src/resources/extensions/gsd/auto-worktree.ts +195 -11
  469. package/src/resources/extensions/gsd/auto.ts +217 -70
  470. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +42 -7
  471. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +10 -9
  472. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +11 -4
  473. package/src/resources/extensions/gsd/bootstrap/subagent-input.ts +19 -7
  474. package/src/resources/extensions/gsd/bootstrap/system-context.ts +58 -15
  475. package/src/resources/extensions/gsd/bootstrap/write-gate.ts +27 -10
  476. package/src/resources/extensions/gsd/clean-root-preflight.ts +174 -8
  477. package/src/resources/extensions/gsd/commands/catalog.ts +10 -1
  478. package/src/resources/extensions/gsd/commands/handlers/core.ts +42 -1
  479. package/src/resources/extensions/gsd/commands/handlers/ops.ts +21 -0
  480. package/src/resources/extensions/gsd/commands-bootstrap.ts +10 -0
  481. package/src/resources/extensions/gsd/commands-handlers.ts +21 -2
  482. package/src/resources/extensions/gsd/commands-mcp-status.ts +8 -0
  483. package/src/resources/extensions/gsd/commands-prefs-wizard.ts +8 -3
  484. package/src/resources/extensions/gsd/commands-verdict.ts +202 -0
  485. package/src/resources/extensions/gsd/context-store.ts +120 -1
  486. package/src/resources/extensions/gsd/crash-recovery.ts +44 -4
  487. package/src/resources/extensions/gsd/db/milestone-leases.ts +26 -0
  488. package/src/resources/extensions/gsd/db/unit-dispatches.ts +4 -3
  489. package/src/resources/extensions/gsd/db-base-schema.ts +2 -0
  490. package/src/resources/extensions/gsd/db-migration-steps.ts +5 -0
  491. package/src/resources/extensions/gsd/db-task-slice-rows.ts +4 -0
  492. package/src/resources/extensions/gsd/db-writer.ts +167 -84
  493. package/src/resources/extensions/gsd/dispatch-guard.ts +60 -2
  494. package/src/resources/extensions/gsd/docs/preferences-reference.md +9 -1
  495. package/src/resources/extensions/gsd/doctor-git-checks.ts +89 -7
  496. package/src/resources/extensions/gsd/doctor-runtime-checks.ts +25 -13
  497. package/src/resources/extensions/gsd/doctor-types.ts +3 -0
  498. package/src/resources/extensions/gsd/doctor.ts +2 -27
  499. package/src/resources/extensions/gsd/export-html.ts +27 -427
  500. package/src/resources/extensions/gsd/forensics.ts +7 -3
  501. package/src/resources/extensions/gsd/git-service.ts +166 -11
  502. package/src/resources/extensions/gsd/gsd-db.ts +80 -31
  503. package/src/resources/extensions/gsd/guided-flow-queue.ts +4 -3
  504. package/src/resources/extensions/gsd/guided-flow.ts +142 -134
  505. package/src/resources/extensions/gsd/guided-unit-context.ts +30 -0
  506. package/src/resources/extensions/gsd/init-wizard.ts +17 -2
  507. package/src/resources/extensions/gsd/journal.ts +8 -1
  508. package/src/resources/extensions/gsd/knowledge-backfill.ts +164 -0
  509. package/src/resources/extensions/gsd/knowledge-capture.ts +160 -0
  510. package/src/resources/extensions/gsd/knowledge-parser.ts +174 -0
  511. package/src/resources/extensions/gsd/knowledge-projection.ts +241 -0
  512. package/src/resources/extensions/gsd/markdown-renderer.ts +16 -9
  513. package/src/resources/extensions/gsd/mcp-filter.ts +80 -0
  514. package/src/resources/extensions/gsd/md-importer.ts +1 -1
  515. package/src/resources/extensions/gsd/memory-backfill.ts +89 -17
  516. package/src/resources/extensions/gsd/memory-consolidation-scanner.ts +277 -0
  517. package/src/resources/extensions/gsd/migrate/command.ts +5 -0
  518. package/src/resources/extensions/gsd/migrate/parsers.ts +11 -0
  519. package/src/resources/extensions/gsd/migrate/preview.ts +10 -0
  520. package/src/resources/extensions/gsd/migrate/transformer.ts +58 -4
  521. package/src/resources/extensions/gsd/migrate/writer.ts +14 -1
  522. package/src/resources/extensions/gsd/migration-auto-check.ts +15 -23
  523. package/src/resources/extensions/gsd/milestone-actions.ts +10 -4
  524. package/src/resources/extensions/gsd/native-git-bridge.ts +63 -14
  525. package/src/resources/extensions/gsd/parallel-orchestrator.ts +3 -0
  526. package/src/resources/extensions/gsd/paths.ts +5 -0
  527. package/src/resources/extensions/gsd/pending-auto-start.ts +79 -0
  528. package/src/resources/extensions/gsd/planning-path-scope.ts +10 -2
  529. package/src/resources/extensions/gsd/post-execution-checks.ts +87 -12
  530. package/src/resources/extensions/gsd/pre-execution-checks.ts +49 -11
  531. package/src/resources/extensions/gsd/preferences-mcp.ts +27 -0
  532. package/src/resources/extensions/gsd/preferences-types.ts +33 -0
  533. package/src/resources/extensions/gsd/preferences-validation.ts +145 -0
  534. package/src/resources/extensions/gsd/preferences.ts +5 -0
  535. package/src/resources/extensions/gsd/prompt-loader.ts +1 -1
  536. package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
  537. package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -1
  538. package/src/resources/extensions/gsd/prompts/discuss-headless.md +8 -8
  539. package/src/resources/extensions/gsd/prompts/discuss.md +9 -9
  540. package/src/resources/extensions/gsd/prompts/forensics.md +3 -3
  541. package/src/resources/extensions/gsd/prompts/guided-discuss-project.md +4 -4
  542. package/src/resources/extensions/gsd/prompts/guided-discuss-requirements.md +3 -3
  543. package/src/resources/extensions/gsd/prompts/plan-slice.md +4 -4
  544. package/src/resources/extensions/gsd/prompts/queue.md +4 -4
  545. package/src/resources/extensions/gsd/prompts/reactive-execute.md +1 -1
  546. package/src/resources/extensions/gsd/prompts/refine-slice.md +2 -2
  547. package/src/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
  548. package/src/resources/extensions/gsd/prompts/system.md +2 -2
  549. package/src/resources/extensions/gsd/provider-switch-observer.ts +185 -0
  550. package/src/resources/extensions/gsd/queue-reorder-ui.ts +31 -13
  551. package/src/resources/extensions/gsd/repository-registry.ts +77 -0
  552. package/src/resources/extensions/gsd/safety/evidence-collector.ts +2 -0
  553. package/src/resources/extensions/gsd/safety/evidence-cross-ref.ts +54 -19
  554. package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +52 -1
  555. package/src/resources/extensions/gsd/smart-entry-routing.ts +77 -0
  556. package/src/resources/extensions/gsd/state-reconciliation/drift/merge-state.ts +8 -1
  557. package/src/resources/extensions/gsd/state-reconciliation/drift/project-md.ts +12 -15
  558. package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +17 -25
  559. package/src/resources/extensions/gsd/state.ts +15 -4
  560. package/src/resources/extensions/gsd/status-guards.ts +16 -2
  561. package/src/resources/extensions/gsd/templates/knowledge.md +2 -2
  562. package/src/resources/extensions/gsd/templates/plan.md +9 -5
  563. package/src/resources/extensions/gsd/templates/task-plan.md +10 -2
  564. package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +71 -0
  565. package/src/resources/extensions/gsd/tests/auto-deterministic-error-classification-4973.test.ts +116 -0
  566. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +375 -1
  567. package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +578 -8
  568. package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +151 -12
  569. package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +53 -2
  570. package/src/resources/extensions/gsd/tests/auto-post-unit-step-message.test.ts +18 -6
  571. package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +129 -6
  572. package/src/resources/extensions/gsd/tests/auto-retry-mcp-churn-fixes.test.ts +12 -0
  573. package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +4 -4
  574. package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +1 -0
  575. package/src/resources/extensions/gsd/tests/auto-stop-notification.test.ts +20 -0
  576. package/src/resources/extensions/gsd/tests/auto-worktree-registry.test.ts +69 -1
  577. package/src/resources/extensions/gsd/tests/autocomplete-regressions-1675.test.ts +21 -0
  578. package/src/resources/extensions/gsd/tests/brief-command.test.ts +89 -0
  579. package/src/resources/extensions/gsd/tests/browser-tools-compatibility-declarations.test.ts +62 -0
  580. package/src/resources/extensions/gsd/tests/checkout-branch-stash-guard.test.ts +87 -0
  581. package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +107 -2
  582. package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +32 -4
  583. package/src/resources/extensions/gsd/tests/closeout-git-deferral.test.ts +16 -0
  584. package/src/resources/extensions/gsd/tests/commands-verdict.test.ts +378 -0
  585. package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +4 -1
  586. package/src/resources/extensions/gsd/tests/complete-slice.test.ts +5 -9
  587. package/src/resources/extensions/gsd/tests/complete-task.test.ts +3 -1
  588. package/src/resources/extensions/gsd/tests/context-store-decisions-from-memories.test.ts +312 -0
  589. package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +86 -2
  590. package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +2 -0
  591. package/src/resources/extensions/gsd/tests/db-authority-regression.test.ts +208 -0
  592. package/src/resources/extensions/gsd/tests/db-task-slice-rows.test.ts +1 -0
  593. package/src/resources/extensions/gsd/tests/db-writer.test.ts +13 -8
  594. package/src/resources/extensions/gsd/tests/decisions-projection-from-memories.test.ts +453 -0
  595. package/src/resources/extensions/gsd/tests/decisions-stop-table-writes.test.ts +348 -0
  596. package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +61 -2
  597. package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +66 -0
  598. package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +68 -1
  599. package/src/resources/extensions/gsd/tests/doctor-empty-worktree.test.ts +65 -0
  600. package/src/resources/extensions/gsd/tests/doctor-forensics-db-open-regression.test.ts +50 -0
  601. package/src/resources/extensions/gsd/tests/evidence-cross-ref.test.ts +97 -0
  602. package/src/resources/extensions/gsd/tests/export-html-enhancements.test.ts +8 -0
  603. package/src/resources/extensions/gsd/tests/freeform-decisions.test.ts +8 -4
  604. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +28 -0
  605. package/src/resources/extensions/gsd/tests/gsd-tools.test.ts +11 -7
  606. package/src/resources/extensions/gsd/tests/gsdroot-worktree-detection.test.ts +5 -2
  607. package/src/resources/extensions/gsd/tests/guided-discuss-project-prompt-rendering.test.ts +2 -0
  608. package/src/resources/extensions/gsd/tests/guided-dispatch-root.test.ts +106 -0
  609. package/src/resources/extensions/gsd/tests/guided-flow-session-isolation.test.ts +59 -11
  610. package/src/resources/extensions/gsd/tests/guided-flow.test.ts +21 -0
  611. package/src/resources/extensions/gsd/tests/guided-tool-contract.test.ts +65 -0
  612. package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +7 -7
  613. package/src/resources/extensions/gsd/tests/hook-model-resolution.test.ts +5 -0
  614. package/src/resources/extensions/gsd/tests/infra-error.test.ts +2 -2
  615. package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +9 -0
  616. package/src/resources/extensions/gsd/tests/init-prefs-routing.test.ts +22 -0
  617. package/src/resources/extensions/gsd/tests/integration/doctor-git.test.ts +44 -0
  618. package/src/resources/extensions/gsd/tests/integration/doctor-runtime.test.ts +20 -0
  619. package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +199 -2
  620. package/src/resources/extensions/gsd/tests/integration/integration-lifecycle.test.ts +13 -5
  621. package/src/resources/extensions/gsd/tests/integration/migrate-command.test.ts +48 -3
  622. package/src/resources/extensions/gsd/tests/integration/state-machine-runtime-failures.test.ts +6 -1
  623. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +49 -3
  624. package/src/resources/extensions/gsd/tests/journal.test.ts +32 -0
  625. package/src/resources/extensions/gsd/tests/knowledge-backfill-projection.test.ts +323 -0
  626. package/src/resources/extensions/gsd/tests/knowledge-capture.test.ts +242 -0
  627. package/src/resources/extensions/gsd/tests/knowledge.test.ts +47 -2
  628. package/src/resources/extensions/gsd/tests/load-knowledge-block-rules-only.test.ts +209 -0
  629. package/src/resources/extensions/gsd/tests/mcp-filter.test.ts +287 -0
  630. package/src/resources/extensions/gsd/tests/mcp-status.test.ts +11 -0
  631. package/src/resources/extensions/gsd/tests/memory-consolidation-scanner.test.ts +316 -0
  632. package/src/resources/extensions/gsd/tests/merge-db-cycle.test.ts +179 -0
  633. package/src/resources/extensions/gsd/tests/migrate-transformer.test.ts +5 -1
  634. package/src/resources/extensions/gsd/tests/migrate-validator-parsers.test.ts +24 -1
  635. package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +6 -1
  636. package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +26 -18
  637. package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +80 -2
  638. package/src/resources/extensions/gsd/tests/orphaned-worktree-audit.test.ts +121 -1
  639. package/src/resources/extensions/gsd/tests/parallel-orchestrator-zombie-cleanup.test.ts +55 -0
  640. package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +55 -1
  641. package/src/resources/extensions/gsd/tests/pending-autostart-scope.test.ts +29 -5
  642. package/src/resources/extensions/gsd/tests/pipeline-variant-dispatch.test.ts +2 -1
  643. package/src/resources/extensions/gsd/tests/plan-milestone-sketch-render.test.ts +157 -0
  644. package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +26 -0
  645. package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +2 -0
  646. package/src/resources/extensions/gsd/tests/plan-slice.test.ts +343 -3
  647. package/src/resources/extensions/gsd/tests/plan-task.test.ts +18 -1
  648. package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +79 -1
  649. package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +105 -3
  650. package/src/resources/extensions/gsd/tests/post-unit-git-failure.test.ts +1 -1
  651. package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +84 -0
  652. package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +59 -0
  653. package/src/resources/extensions/gsd/tests/pre-execution-pause-wiring.test.ts +54 -0
  654. package/src/resources/extensions/gsd/tests/preferences-mcp.test.ts +128 -0
  655. package/src/resources/extensions/gsd/tests/preferences.test.ts +75 -0
  656. package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +70 -0
  657. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +8 -0
  658. package/src/resources/extensions/gsd/tests/prompt-loader.test.ts +23 -0
  659. package/src/resources/extensions/gsd/tests/provider-errors.test.ts +37 -1
  660. package/src/resources/extensions/gsd/tests/provider-switch-observer.test.ts +252 -0
  661. package/src/resources/extensions/gsd/tests/quality-gates.test.ts +6 -0
  662. package/src/resources/extensions/gsd/tests/queue-reorder-ui.test.ts +54 -0
  663. package/src/resources/extensions/gsd/tests/remediation-completion-guard.test.ts +89 -2
  664. package/src/resources/extensions/gsd/tests/repository-registry.test.ts +52 -0
  665. package/src/resources/extensions/gsd/tests/run-uat-replay-cap.test.ts +2 -3
  666. package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +16 -4
  667. package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +10 -0
  668. package/src/resources/extensions/gsd/tests/slice-parallel-orchestrator.test.ts +72 -1
  669. package/src/resources/extensions/gsd/tests/smart-entry-routing.test.ts +113 -0
  670. package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +53 -2
  671. package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +6 -0
  672. package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +119 -23
  673. package/src/resources/extensions/gsd/tests/status-guards.test.ts +17 -1
  674. package/src/resources/extensions/gsd/tests/stuck-state-via-db.test.ts +64 -1
  675. package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +2 -1
  676. package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +7 -3
  677. package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +128 -9
  678. package/src/resources/extensions/gsd/tests/uok-gitops-turn-action.test.ts +111 -1
  679. package/src/resources/extensions/gsd/tests/validate-milestone-stuck-guard.test.ts +29 -2
  680. package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +42 -1
  681. package/src/resources/extensions/gsd/tests/verification-gate.test.ts +173 -1
  682. package/src/resources/extensions/gsd/tests/verification-verdict.test.ts +78 -0
  683. package/src/resources/extensions/gsd/tests/workflow-kernel.test.ts +7 -0
  684. package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +19 -1
  685. package/src/resources/extensions/gsd/tests/workflow-memory-pressure.test.ts +21 -1
  686. package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +1 -1
  687. package/src/resources/extensions/gsd/tests/worktree-git-pathspec.test.ts +39 -0
  688. package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +64 -12
  689. package/src/resources/extensions/gsd/tests/worktree-lifecycle.test.ts +25 -0
  690. package/src/resources/extensions/gsd/tests/worktree-preferences-sync.test.ts +25 -0
  691. package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +95 -0
  692. package/src/resources/extensions/gsd/tests/worktree-write-gate.test.ts +27 -0
  693. package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +59 -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 +172 -12
  698. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +135 -0
  699. package/src/resources/extensions/gsd/types.ts +1 -1
  700. package/src/resources/extensions/gsd/unit-context-manifest.ts +51 -18
  701. package/src/resources/extensions/gsd/validation.ts +23 -1
  702. package/src/resources/extensions/gsd/verification-gate.ts +170 -6
  703. package/src/resources/extensions/gsd/verification-verdict.ts +47 -0
  704. package/src/resources/extensions/gsd/workflow-logger.ts +4 -0
  705. package/src/resources/extensions/gsd/workflow-manifest.ts +2 -0
  706. package/src/resources/extensions/gsd/workflow-mcp.ts +18 -1
  707. package/src/resources/extensions/gsd/workflow-projections.ts +6 -8
  708. package/src/resources/extensions/gsd/worktree-lifecycle.ts +61 -10
  709. package/src/resources/extensions/gsd/worktree-manager.ts +1 -1
  710. package/src/resources/extensions/gsd/worktree-state-projection.ts +43 -0
  711. package/src/resources/extensions/shared/html-shell.ts +412 -0
  712. package/src/resources/extensions/shared/interview-ui.ts +6 -4
  713. package/src/resources/extensions/shared/tests/interview-notes-loop.test.ts +15 -0
  714. package/src/resources/extensions/subagent/index.ts +567 -103
  715. package/src/resources/extensions/subagent/launch.ts +131 -0
  716. package/src/resources/extensions/subagent/run-store.ts +218 -0
  717. package/src/resources/extensions/subagent/tests/launch.test.ts +115 -0
  718. package/src/resources/extensions/subagent/tests/run-store.test.ts +111 -0
  719. package/src/resources/extensions/ttsr/ttsr-manager.ts +5 -1
  720. package/src/resources/extensions/visual-brief/artifact-policy.ts +41 -0
  721. package/src/resources/extensions/visual-brief/extension-manifest.json +8 -0
  722. package/src/resources/extensions/visual-brief/index.ts +8 -0
  723. package/src/resources/extensions/visual-brief/page-contract.ts +136 -0
  724. package/src/resources/extensions/visual-brief/prompts.ts +183 -0
  725. package/src/resources/extensions/visual-brief/tests/visual-brief.test.ts +212 -0
  726. package/src/resources/skills/forensics/SKILL.md +1 -1
  727. package/dist/web/standalone/.next/server/chunks/5822.js +0 -2
  728. package/dist/web/standalone/.next/static/chunks/2556.0527fea66e123b7f.js +0 -1
  729. package/dist/web/standalone/.next/static/chunks/8359.e059d86b255fce1c.js +0 -10
  730. package/dist/web/standalone/.next/static/chunks/9441.1081da1125d1764f.js +0 -1
  731. package/dist/web/standalone/.next/static/chunks/app/layout-9ecfd95f343793f0.js +0 -1
  732. package/dist/web/standalone/.next/static/chunks/app/page-200592a7f3baf579.js +0 -1
  733. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  734. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  735. package/dist/web/standalone/.next/static/css/54ec2745c1da488b.css +0 -1
  736. package/dist/web/standalone/.next/static/css/de70bee13400563f.css +0 -1
  737. package/dist/web/standalone/.next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
  738. package/dist/web/standalone/.next/static/media/747892c23ea88013-s.woff2 +0 -0
  739. package/dist/web/standalone/.next/static/media/8d697b304b401681-s.woff2 +0 -0
  740. package/dist/web/standalone/.next/static/media/93f479601ee12b01-s.p.woff2 +0 -0
  741. package/dist/web/standalone/.next/static/media/9610d9e46709d722-s.woff2 +0 -0
  742. package/dist/web/standalone/.next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
  743. /package/dist/web/standalone/.next/static/{S44UQTFCUdA44dkjfYt6S → _kljR-_Miq_YV1IW0wpRO}/_buildManifest.js +0 -0
  744. /package/dist/web/standalone/.next/static/{S44UQTFCUdA44dkjfYt6S → _kljR-_Miq_YV1IW0wpRO}/_ssgManifest.js +0 -0
package/README.md CHANGED
@@ -27,38 +27,120 @@ One command. Walk away. Come back to a built project with clean git history.
27
27
 
28
28
  ---
29
29
 
30
- ## What's New in v2.81
30
+ ## What's New in v3.0
31
31
 
32
- ### Worktree Safety & Projection
32
+ The v3.0 release closes the single-writer engine v3 control plane, finishes the ADR-013 memory cutover, and adds two new top-level commands. It also lands a long list of dispatch-ordering, recovery, and cross-platform fixes that have been accumulating since the v2.82 cut.
33
33
 
34
- - **Worktree safety is now fail-closed** — write/edit operations enforce the worktree-isolation contract before touching project files. If GSD cannot prove the active worktree is healthy, rooted correctly, and attached to the intended milestone, it stops instead of guessing.
35
- - **Custom-engine bypasses are explicit** — custom workflow units can opt out of worktree safety checks only through the dedicated path for that runtime. That keeps normal auto-mode writes protected while avoiding false failures for engines that do not use the same worktree lifecycle.
36
- - **Lifecycle and projection are split into dedicated modules** — worktree entry, exit, root projection, and merge finalization now flow through clearer boundaries. This makes it easier to reason about when state is copied into a milestone worktree, when it is projected back to the project root, and which module owns each step.
37
- - **Milestone merge closeout is harder to wedge** — stale leases, orphaned preflight stashes, branch-mode drift, reused branches, and wrong-branch merges are detected or recovered more reliably. If GSD finds completed work stranded in a milestone branch or preflight stash, startup and closeout paths now have better recovery hooks.
38
- - **Projection bypasses were closed** — post-unit and phase flows now route through the Worktree State Projection path instead of ad hoc file movement. That keeps database state, milestone artifacts, and root projections aligned during long-running auto-mode sessions.
34
+ ### New Commands
39
35
 
40
- ### Memory, Context & Token Control
36
+ - **`/gsd verdict <pass|needs-attention|needs-remediation>`** — manually override the recorded milestone validation verdict when auto-mode pauses with a non-passing verdict. Previously the only recovery path was hand-editing `VALIDATION.md` frontmatter or hand-crafting a seven-field `gsd_validate_milestone` call. The new command resolves the active milestone if `--milestone` is omitted, preserves every other section of the existing validation file, and requires `--rationale` for non-pass verdicts. Paused-state messages now reference the command directly instead of "update the verdict manually."
37
+ - **`/gsd brief <mode>`** — generate a visual HTML brief in one of six modes (`diagram`, `plan`, `diff`, `recap`, `table`, `slides`). The HTML shell is unified with `/gsd export` so both surfaces produce consistent output.
38
+ - **ROADMAP `[sketch]` badges** (ADR-011) — slices that have not been refined past sketch level are now badged in the rendered roadmap, so it's obvious at a glance which slices still need planning work.
41
39
 
42
- - **Memory relevance improved** — artifacts now carry integrity fingerprints, memories track last-hit time, and relevance scoring uses time decay. Recent, repeatedly useful memories can rank higher, while stale or superseded context is less likely to crowd out the current task.
43
- - **Artifact integrity is easier to preserve** — content hashes are retained through worktree reconciliation, so GSD can detect whether projected artifacts still match the state it expects. This supports safer recovery and reduces accidental drift between root and worktree state.
44
- - **Fallback memory search is safer** when FTS5 is unavailable, LIKE-based fallback scans are capped and surfaced with warnings instead of silently becoming expensive. Memory ranking also guards against invalid decay settings producing unusable scores.
45
- - **Provider tools are scoped per request** — tool availability is narrowed at request time, with provider-boundary token audit support. The model sees the tools relevant to the current provider and task instead of carrying broad tool definitions through every request.
46
- - **Prompt and workflow context got leaner** — repeated workflow context is capped, prompt templates use portable paths, and many high-volume workflow prompts were compacted. The goal is less repeated instruction text in long sessions without removing the guardrails that keep planning, execution, and closeout on track.
47
- - **Token accounting is more accurate** — session tokens are reported separately from context in VS Code, the token encoder warms at startup, and provider-boundary audit hooks make it easier to understand where request size is coming from.
40
+ ### Auto Orchestration Parity (Single-Writer Engine v3 Control Plane)
41
+
42
+ The v2.x dispatch layer accumulated parallel code paths between the legacy `auto.ts` loop and the newer Auto Orchestration kernel. v3.0 closes that gap:
43
+
44
+ - **Dispatch adapter receives full session inputs** — the adapter now gets the same context the orchestrator does, eliminating a class of "the new path is missing X" bugs.
45
+ - **Orchestrator reaches `runPreDispatch` parity** — pre-dispatch validation runs through the orchestrator path with the same checks the legacy path has, so behavior no longer depends on which entry point fired.
46
+ - **Stuck-loop detection moved into Auto Orchestration** — previously partly in the legacy loop; now owned by the orchestrator so stuck detection participates in the same lifecycle as everything else.
47
+ - **`AutoAdvanceResult` widened with `unit` and `action`** — callers can now branch on the actual outcome of an advance without re-deriving it.
48
+
49
+ ### Dispatch & Recovery Reliability
50
+
51
+ - **State mutations now happen after pre-dispatch validation** — previously, auto-mode would mutate session state and emit journal events before pre-dispatch validation passed, so a failed validation could leave the journal believing a unit had dispatched. State writes now wait until validation succeeds.
52
+ - **Provider 500 errors pause and retry instead of aborting** — auto-mode used to hard-stop the loop when a model provider returned a 5xx. The dispatch path now pauses with a retry budget so transient provider outages don't lose session state.
53
+ - **`needs-attention` and `needs-remediation` verdicts guarded in dispatch** — completing-milestone no longer falsely loops when validation produced a non-pass terminal verdict. Combined with `/gsd verdict`, paused milestones are unstuck-able without hand-editing files.
54
+ - **`validate-milestone` infinite-loop guard** — when an LLM failed to call `gsd_validate_milestone` and the unit ran without an artifact, dispatch would re-fire forever. The unit now fails closed with a recoverable error instead of looping.
55
+ - **Empty milestone worktree recovery** — milestones that were entered, paused, and resumed against an empty/orphaned worktree now recover cleanly instead of stalling.
56
+ - **Stuck-detection key consistency across sessions** — derived keys now match how DB persistence records them (bare `unitId`), so cross-session stuck detection actually fires.
57
+ - **DB-backed stale worker cleanup also covers hook dispatchers** — previously could leave crashed hook-dispatch rows active and poison the next session.
58
+ - **Stale lock detection when worker PID is dead** — `clearLock()` now marks the DB worker as stopping so resume after a crash isn't blocked until the 30-minute stale window expires.
59
+ - **Auto-mode crash on MCP tool resolution failure** — research-slice no longer reports false success when an MCP tool fails to resolve; the dispatch loop catches the failure instead of treating it as a completion.
60
+ - **Auto-commit submodule + empty `keyFiles` handling** — `git add -- (none)` no longer crashes auto-commit, and `keyFiles` that live inside a submodule no longer throw `pathspec is in submodule`.
61
+
62
+ ### Verification & Safety
63
+
64
+ - **Reject unsafe verify commands before execution** — the verification gate now refuses to run commands that violate the tools policy, instead of executing first and failing the gate afterwards.
65
+ - **Reconcile preflight stash collisions** — milestone-entry stash now reconciles with pre-existing stashes instead of silently overwriting them.
66
+ - **Execute-task verification fails closed** — when verification cannot reach a definitive verdict, it fails the task instead of optimistically passing.
67
+ - **Read-required-before-write in prompts** — prompt contracts now require reading a file before writing it, reducing the rate of clobbered edits.
68
+ - **Doctor blocks snapshots that contain conflict markers** — `/gsd doctor` refuses to take a snapshot of a working tree with unresolved merge conflicts.
69
+
70
+ ### Memory Architecture Cutover (ADR-013)
71
+
72
+ The v2.77 introduction of the memories table is now fully load-bearing. Decisions and KNOWLEDGE patterns/lessons read from and write to memories first, with `DECISIONS.md` and `KNOWLEDGE.md` projected from that source:
73
+
74
+ - **Stage 1** — prompt-inline decisions read from memories.
75
+ - **Stage 2a–2c** — `DECISIONS.md` projection sources from memories; `KNOWLEDGE.md` backfill + hybrid projection; `/gsd knowledge` routes patterns and lessons into memories.
76
+ - **Stage 3** — `gsd_save_decision` no longer writes to the legacy decisions table.
77
+ - **Preflight scanner** — detects pre-cutover artifacts and warns before they cause divergence.
78
+
79
+ ### Cross-Platform & Infrastructure
80
+
81
+ - **gsd.db on WSL2 9p mounts** — WAL+mmap pragmas were corrupting `gsd.db` on `/mnt/c` and `/mnt/d`. The database layer now detects 9p mounts and uses safer pragmas.
82
+ - **Milestone merge on Windows** — silent failure when `gsd.db` held a SQLite WAL lock is now surfaced as a recoverable error instead of an empty merge.
83
+ - **Web UI multi-drive access** — Windows users can now point the web UI at projects outside the `C:` drive.
84
+ - **Bedrock context overflow in `--print` mode** — fixed; long contexts no longer crash headless runs against Bedrock models.
85
+ - **OpenAI Codex 429 retries** — no longer fire inside the provider cooldown window (Gemini path was already correct).
86
+ - **Antigravity model removal** — the misleading 404 from Cloud Code Assist when Antigravity models are removed is now a clear error message.
87
+ - **cmux usability after exit** — GSD no longer leaves cmux in a broken terminal state after exit.
88
+
89
+ ### TUI, Web, and Visualizer
90
+
91
+ - **Web visualizer tabs updated** — refreshed tab set across the 10-tab visualizer.
92
+ - **Auto resume blocker surface** — when resume is blocked (e.g., needs-remediation + all slices complete), the blocker reason is shown prominently instead of buried.
93
+ - **Pi-coding-agent rendering** — empty reasoning blocks no longer render a blank assistant rail for GPT-5.5 tool-only turns; interactive tool output defaults to expanded.
94
+ - **Step-mode polish** — completion surface preserved across step-mode boundary; next-action guidance clarified after pause.
95
+ - **HTML shell unified across `/gsd export` and `/gsd brief`** — one shared visual language for generated reports.
96
+
97
+ ### Subagent Telemetry
98
+
99
+ - **Random tracking names** — subagent runs get human-readable random names that show up in dashboards, making it easier to trace a specific run across logs.
100
+ - **Resumable isolated launches** — subagent launch records persist, so a crashed subagent can be resumed instead of restarted from scratch.
101
+
102
+ See the full [Changelog](./CHANGELOG.md) for the complete v3.0 entry and prior releases.
103
+
104
+ <details>
105
+ <summary>v2.82 highlights</summary>
106
+
107
+ ### State Reconciliation & Drift Detection (ADR-017)
108
+
109
+ - **Unified drift-detection framework** — a new state-reconciliation layer replaces ad-hoc recovery checks. Each drift kind (stale worker, unregistered milestone, roadmap divergence, missing completion timestamp, merge-state, stale render) is owned by a focused detector + idempotent repair handler registered in a single registry, with a cap=2 retry contract that ensures repair-then-retry settles cleanly.
110
+ - **Stale session locks no longer block resume** — when a `/gsd auto` process is SIGKILL'd, sleep-killed, or otherwise crashes, the `auto.lock` file is left behind with a dead PID. Previously you had to wait out a 30-minute stale window before `/gsd` would resume. The new `stale-worker` drift handler verifies the PID is alive and clears orphaned locks proactively on startup.
111
+ - **Unregistered milestones get imported automatically** — if you scaffold a milestone directory (with `ROADMAP.md`/`CONTEXT.md`/`SUMMARY.md`) but never re-imported, dispatch couldn't see it. The `unregistered-milestone` handler now imports those rows idempotently before dispatch.
112
+ - **ROADMAP and DB stay in sync** — divergence between `ROADMAP.md` (parsed slice sequence + `depends` declarations) and the corresponding DB slice rows is detected per-milestone and reconciled via importer upserts plus an explicit `syncSliceDependencies` pass.
113
+ - **Missing completion timestamps backfill from disk** — entities marked complete in the DB but with a null `completed_at` are now backfilled from `SUMMARY.md` mtime, deterministically and idempotently. Tasks are checked independently of their parent slice status.
114
+ - **Parallel spawns reconcile before fanning out** — `/gsd parallel start` and slice-parallel-dispatch now run reconciliation at the parent before spawning auto-loop workers. Gate failures surface a typed exit reason (`slice-parallel-reconciliation-failed`) and a user-visible message.
115
+
116
+ ### Worktree Lifecycle Refactor (ADR-016 — final phases)
117
+
118
+ - **Phase 2 complete** — the worktree-manager module finished absorbing fs primitives, git-CLI primitives, worktree-manager helpers, cache/preferences/paths, and the final `gitServiceFactory`. Lifecycle verbs are now first-class: `adoptOrphanWorktree`, `adoptSessionRoot`, `resumeFromPausedSession`, and `restoreToProjectRoot` are explicit entry points.
119
+ - **Phase 3 closes strict-closure residuals** — dead defensive fallbacks removed from `auto.ts` stop-path catch blocks. The public `WorktreeLifecycleDeps` interface dropped 15 `@deprecated` optional fields; the active dep bag is now three fields.
120
+
121
+ ### Auto-Mode Reliability
122
+
123
+ - **`complete-slice` closeout is read-only** — closeout prompts can no longer write project files, removing closeout-vs-next-slice races.
124
+ - **Verification retries back off properly** — bounded exponential backoff with stuck detection between attempts; transient failures no longer spin.
125
+ - **Auto-loop exit paths are journaled end-to-end** — post-unit finalize stops, all unit-end exits, and the run-unit failsafe now journal cleanly.
126
+ - **Ghost completions and stale telemetry are guarded** — no stops on ghost completions before milestone stops fire; unmerged-exit telemetry gated on active worktrees.
48
127
 
49
128
  ### TUI & Operator Experience
50
129
 
51
- - **Compact tool output is more useful** compact cards show tool targets and low-signal tool output can roll up by phase.
52
- - **Terminal UI refreshed** — chat/tool cards align with the terminal design, adaptive refresher layouts landed, and the welcome/header lifecycle is more stable.
53
- - **Auto-mode stays anchored** — bottom anchoring, direct tool execution rollups, and lifecycle hook shutdown behavior were tightened.
130
+ - **Operations console redesign** auto-mode dashboard, notification overlay, parallel-monitor overlay, health widget, header renderer, and welcome screen rebuilt against a shared `render-kit`.
131
+ - **Milestone completion rollup** — `CompletionDashboardSnapshot` summarizes success criteria, DoD, requirements, deviations, follow-ups, key decisions, key files, lessons, cost, tokens, cache hit rate, and slice progress at milestone boundaries.
132
+
133
+ </details>
54
134
 
55
- ### Reliability, Tests & CI
135
+ <details>
136
+ <summary>v2.81 highlights</summary>
56
137
 
57
- - **Auto-mode recovery tightened** — crash recovery, session handoff, stale milestone completion replay, stale leases, and complete-project restart loops were all hardened.
58
- - **E2E coverage expanded** — real-process MCP, fake LLM, native ABI, schema migration, Docker runtime, Windows runner, and multi-iteration loop coverage landed.
59
- - **CI is faster and less noisy** merge/build gates were simplified, expensive PR jobs are gated, and merge-conflict PRs skip heavy jobs.
138
+ - **Worktree safety is fail-closed** — write/edit operations enforce the worktree-isolation contract; lifecycle and projection split into dedicated modules; milestone merge closeout is harder to wedge.
139
+ - **Memory, context, and token control** — artifact integrity fingerprints, time-decay memory ranking, safer FTS5 fallback, request-time tool scoping, leaner workflow prompts, and more accurate session/context token accounting.
140
+ - **TUI polish** compact tool output with targets, refreshed chat/tool cards, adaptive refresher layouts, stable welcome/header lifecycle, and bottom-anchored auto-mode rendering.
141
+ - **Reliability, tests, and CI** — auto-mode recovery and session handoff hardened, broad E2E coverage expansion (real-process MCP, fake LLM, native ABI, Docker, Windows), and a faster, less-noisy CI gate setup.
60
142
 
61
- See the full [Changelog](./CHANGELOG.md) for the complete v2.81 entry and prior releases.
143
+ </details>
62
144
 
63
145
  <details>
64
146
  <summary>v2.80 highlights</summary>
@@ -108,7 +190,7 @@ See the full [Changelog](./CHANGELOG.md) for the complete v2.81 entry and prior
108
190
 
109
191
  - **Context Mode** — dispatch builds task-ready context automatically (artifacts, prior session, milestone/slice signals, execution metadata); enabled by default for new projects
110
192
  - **Sandboxed execution tools** — `gsd_exec_search`, `gsd_resume`, and sandboxed tool-output paths for context-mode flows
111
- - **Memory architecture (ADR-013)** — `memories` table is now authoritative; `structured_fields` adds typed metadata; dual-write migration landed with decisions backfill
193
+ - **Memory architecture (ADR-013)** — `memories` table is now authoritative; `structured_fields` adds typed metadata; decisions and KNOWLEDGE patterns/lessons are memory-backed projections after the cutover
112
194
  - **Skill coverage** — 9 gap-closing skills landed plus 6 planning/design skills surfaced
113
195
  - **Hook stack** — Layer 0 shell hooks and additional Layer 2 lifecycle events
114
196
  - **TUI polish** — dedicated chat-frame style for skill invocations; active-row overflow fixes
@@ -328,7 +410,9 @@ Plan (with integrated research) → Execute (per task) → Complete → Reassess
328
410
  Validate Milestone → Complete Milestone
329
411
  ```
330
412
 
331
- **Plan** scouts the codebase, researches relevant docs, and decomposes the slice into tasks with must-haves (mechanically verifiable outcomes). **Execute** runs each task in a fresh context window with only the relevant files pre-loaded then runs configured verification commands (lint, test, etc.) with auto-fix retries. **Complete** writes the summary, UAT script, marks the roadmap, and commits with meaningful messages derived from task summaries. **Reassess** checks if the roadmap still makes sense given what was learned. **Validate Milestone** runs a reconciliation gate after all slices complete — comparing roadmap success criteria against actual results before sealing the milestone.
413
+ **Plan** scouts the codebase, researches relevant docs, and decomposes the slice into tasks with must-haves (mechanically verifiable outcomes). **Execute** runs each task in a fresh context window with only the relevant files pre-loaded, then runs configured verification commands (lint, test, etc.) with auto-fix retries before the task closeout commit or snapshot is published. Failed or incomplete verification blocks execute-task closeout. **Complete** writes the summary, UAT script, marks the roadmap, and commits with meaningful messages derived from task summaries. **Reassess** checks if the roadmap still makes sense given what was learned. **Validate Milestone** runs a reconciliation gate after all slices complete — comparing roadmap success criteria against actual results before sealing the milestone.
414
+
415
+ When progressive planning is enabled, the first slice is fully planned up front while later slices may appear in `M###-ROADMAP.md` with a `` `[sketch]` `` badge. A sketch slice has an approved title, dependency shape, demo line, and scope boundary, but it has not yet been expanded into task plans; auto mode runs `refine-slice` just before execution to turn the sketch into a full slice plan using the latest prior-slice summaries.
332
416
 
333
417
  ### `/gsd auto` — The Main Event
334
418
 
@@ -340,7 +424,9 @@ This is what makes GSD different. Run it, walk away, come back to built software
340
424
 
341
425
  Auto mode is a state machine driven by the GSD database at the project root. It derives the next unit of work from authoritative SQLite state, creates a fresh agent session, injects a focused prompt with all relevant context pre-inlined, and lets the LLM execute. When the LLM finishes, auto mode persists the result to the database, refreshes markdown projections such as `STATE.md`, and dispatches the next unit.
342
426
 
343
- The database is authoritative for milestones, slices, tasks, requirements, decisions, summaries, and completion status. Markdown under `.gsd/` is a rendered projection for review, prompts, and git-friendly history; it is not a runtime fallback unless you explicitly run a recovery/import command. In worktree mode, project-root DB state remains authoritative and worktree markdown projections are not synced back as state.
427
+ The database is authoritative for milestones, slices, tasks, requirements, summaries, and completion status. Durable decisions and project knowledge are stored in the `memories` table: decisions are `architecture` memories, and KNOWLEDGE patterns/lessons are `pattern`/`gotcha` memories. Markdown under `.gsd/` is a rendered projection for review, prompts, and git-friendly history; it is not a runtime fallback unless you explicitly run a recovery/import command. In worktree mode, artifact/projection writes are rendered under the active worktree-local `.gsd/`, while the project-root DB remains authoritative runtime state.
428
+
429
+ `KNOWLEDGE.md` is hybrid: rules remain file-canonical, while patterns and lessons are stored in the `memories` table and rendered back into `KNOWLEDGE.md` on the next session-start projection. Existing pattern and lesson rows are backfilled into memories before projection, so newly captured patterns and lessons may appear in memory-backed prompt context before the file view refreshes.
344
430
 
345
431
  **What happens under the hood:**
346
432
 
@@ -364,7 +450,7 @@ The database is authoritative for milestones, slices, tasks, requirements, decis
364
450
 
365
451
  10. **Adaptive replanning** — After each slice completes, the roadmap is reassessed. If the work revealed new information that changes the plan, slices are reordered, added, or removed before continuing.
366
452
 
367
- 11. **Verification enforcement** — Configure shell commands (`npm run lint`, `npm run test`, etc.) that run automatically after task execution. Failures trigger auto-fix retries before advancing. Auto-discovered checks from `package.json` run in advisory mode — they log warnings but don't block on pre-existing errors. Configurable via `verification_commands`, `verification_auto_fix`, and `verification_max_retries` preferences.
453
+ 11. **Verification enforcement** — Configure simple executable commands (`npm run lint`, `npm run test`, etc.) that run automatically after task execution. Verification commands must not use shell composition or control syntax such as pipes, redirects, semicolons, backticks, or command substitution. Failures trigger auto-fix retries before advancing. Execute-task commits and snapshots are deferred until verification passes; failed or incomplete verification blocks closeout instead of publishing changes. Auto-discovered checks from `package.json` and Python pytest project markers (`python-project`) run in advisory mode — they log warnings but don't block on pre-existing errors. Configurable via `verification_commands`, `verification_auto_fix`, and `verification_max_retries` preferences.
368
454
 
369
455
  12. **Milestone validation** — After all slices complete, a `validate-milestone` gate compares roadmap success criteria against actual results before sealing the milestone.
370
456
 
@@ -490,7 +576,8 @@ On first run, GSD launches a branded setup wizard that walks you through LLM pro
490
576
  | `/gsd rethink` | Conversational project reorganization |
491
577
  | `/gsd mcp` | MCP server status and connectivity |
492
578
  | `/gsd status` | Progress dashboard |
493
- | `/gsd queue` | Queue future milestones (safe during auto mode) |
579
+ | `/gsd brief <mode>` | Generate a visual HTML brief (diagram, plan, diff, recap, table, slides) |
580
+ | `/gsd queue` | Queue/reorder future milestones (`pending`, `queued`, or legacy `planned`; safe during auto mode) |
494
581
  | `/gsd prefs` | Model selection, timeouts, budget ceiling |
495
582
  | `/gsd migrate` | Migrate a v1 `.planning` directory to `.gsd` format |
496
583
  | `/gsd help` | Categorized command reference for all GSD subcommands |
@@ -534,13 +621,13 @@ Every dispatch is carefully constructed. The LLM never wastes tool calls on orie
534
621
  | `gsd.db` | Authoritative runtime state for hierarchy and completion |
535
622
  | `PROJECT.md` | Living doc — what the project is right now |
536
623
  | `REQUIREMENTS.md` | Project-level capability contract and out-of-scope list |
537
- | `DECISIONS.md` | Append-only register of architectural decisions |
538
- | `KNOWLEDGE.md` | Cross-session rules, patterns, and lessons learned |
624
+ | `DECISIONS.md` | Projected register of memory-backed architectural decisions |
625
+ | `KNOWLEDGE.md` | Hybrid knowledge projection: manual Rules plus memory-backed Patterns/Lessons |
539
626
  | `RUNTIME.md` | Runtime context — API endpoints, env vars, services (v2.39) |
540
627
  | `runtime/research-decision.json` | Deep-mode marker for project research vs skip |
541
628
  | `research/*.md` | Optional deep-mode project research: stack, features, architecture, pitfalls |
542
629
  | `STATE.md` | Quick-glance dashboard rendered from the database |
543
- | `M001-ROADMAP.md` | Milestone plan with slice checkboxes, risk levels, dependencies |
630
+ | `M001-ROADMAP.md` | Milestone plan with slice checkboxes, risk levels, dependencies, and `` `[sketch]` `` badges for slices awaiting `refine-slice` |
544
631
  | `M001-CONTEXT.md` | User decisions from the discuss phase |
545
632
  | `M001-RESEARCH.md` | Codebase and ecosystem research |
546
633
  | `S01-PLAN.md` | Slice task decomposition with must-haves |
@@ -577,6 +664,12 @@ Every task has must-haves — mechanically checkable outcomes:
577
664
 
578
665
  The verification ladder: static checks → command execution → behavioral testing → human review (only when the agent genuinely can't verify itself).
579
666
 
667
+ ### Project Knowledge
668
+
669
+ `.gsd/KNOWLEDGE.md` remains the human-readable register for durable project knowledge, but the memory store is now authoritative for generated Patterns and Lessons. On startup, GSD backfills existing `## Patterns` and `## Lessons Learned` rows into `gsd.db` memories, then rewrites `KNOWLEDGE.md` as a hybrid projection: the manual `## Rules` section is preserved from the file, while Patterns and Lessons are rendered from the backfilled memory rows.
670
+
671
+ Keep hand-authored operating rules in `## Rules` or add them with `/gsd knowledge rule`. Patterns and Lessons that agents discover are retrieved through the memory system for prompts and projected back into `KNOWLEDGE.md` for review, reports, and git history.
672
+
580
673
  ### Dashboard
581
674
 
582
675
  `Ctrl+Alt+G` or `/gsd status` opens a real-time overlay showing:
@@ -651,7 +744,7 @@ auto_report: true
651
744
  | `context_mode.exec_stdout_cap_bytes` | Persisted stdout cap for `gsd_exec` output (default: 1048576) |
652
745
  | `context_mode.exec_digest_chars` | Trailing stdout characters returned to the agent context (default: 300) |
653
746
  | `context_mode.exec_env_allowlist` | Environment variables forwarded to sandboxed `gsd_exec` runs in addition to `PATH` and `HOME` |
654
- | `verification_commands` | Array of shell commands to run after task execution (e.g., `["npm run lint", "npm run test"]`) |
747
+ | `verification_commands` | Array of simple executable commands to run after task execution (e.g., `["npm run lint", "npm run test"]`); avoid pipes, redirects, semicolons, backticks, and command substitution |
655
748
  | `verification_auto_fix` | Auto-retry on verification failures (default: true) |
656
749
  | `verification_max_retries` | Max retries for verification failures (default: 2) |
657
750
  | `phases.require_slice_discussion` | Pause auto-mode before each slice for human discussion review |
@@ -821,7 +914,7 @@ gsd (CLI binary)
821
914
  - **`pkg/` shim directory** — `PI_PACKAGE_DIR` points here (not project root) to avoid Pi's theme resolution collision with our `src/` directory. Contains only `piConfig` and theme assets.
822
915
  - **Two-file loader pattern** — `loader.ts` sets all env vars with zero SDK imports, then dynamic-imports `cli.ts` which does static SDK imports. This ensures `PI_PACKAGE_DIR` is set before any SDK code evaluates.
823
916
  - **Always-overwrite sync** — `npm update -g` takes effect immediately. Bundled extensions and agents are synced to `~/.gsd/agent/` on every launch, not just first run.
824
- - **DB-authoritative state** — the project-root GSD database is the runtime source of truth. `.gsd/` markdown files are rendered projections for review, prompt context, and git history. No in-memory state survives across sessions.
917
+ - **DB-authoritative state** — the project-root GSD database is the runtime source of truth. `.gsd/` markdown files are rendered projections for review, prompt context, and git history. `KNOWLEDGE.md` keeps rules file-canonical and projects patterns/lessons from `memories` at session start. No in-memory state survives across sessions.
825
918
 
826
919
  ---
827
920
 
package/dist/cli.js CHANGED
@@ -114,6 +114,24 @@ async function reapplyValidatedModelOnFallback(session, modelRegistry, settingsM
114
114
  // Provider not ready — leave session on its current model
115
115
  }
116
116
  }
117
+ /**
118
+ * Apply the --model CLI flag override to the active session.
119
+ * Searches available models by exact id or provider/id pattern and warns
120
+ * on stderr when the requested model is not found in the registry.
121
+ */
122
+ function applyModelOverride(session, modelRegistry, modelFlag) {
123
+ if (!modelFlag)
124
+ return;
125
+ const available = modelRegistry.getAvailable();
126
+ const match = available.find((m) => m.id === modelFlag) ||
127
+ available.find((m) => `${m.provider}/${m.id}` === modelFlag);
128
+ if (match) {
129
+ void session.setModel(match);
130
+ }
131
+ else {
132
+ process.stderr.write(`[gsd] Warning: Model "${modelFlag}" not found. Using configured default.\n`);
133
+ }
134
+ }
117
135
  const cliFlags = parseCliArgs(process.argv);
118
136
  const isPrintMode = cliFlags.print || cliFlags.mode !== undefined;
119
137
  // `gsd [subcommand] --help` / `-h` — print help before any subcommand runs.
@@ -597,15 +615,7 @@ if (isPrintMode) {
597
615
  await reapplyValidatedModelOnFallback(session, modelRegistry, settingsManager, modelFallbackMessage);
598
616
  printExtensionErrors(extensionsResult.errors);
599
617
  printExtensionWarnings(extensionsResult.warnings);
600
- // Apply --model override if specified
601
- if (cliFlags.model) {
602
- const available = modelRegistry.getAvailable();
603
- const match = available.find((m) => m.id === cliFlags.model) ||
604
- available.find((m) => `${m.provider}/${m.id}` === cliFlags.model);
605
- if (match) {
606
- session.setModel(match);
607
- }
608
- }
618
+ applyModelOverride(session, modelRegistry, cliFlags.model);
609
619
  const mode = cliFlags.mode || 'text';
610
620
  if (mode === 'rpc') {
611
621
  printStartupTimings();
@@ -711,6 +721,7 @@ validateConfiguredModel(modelRegistry, settingsManager);
711
721
  await reapplyValidatedModelOnFallback(session, modelRegistry, settingsManager, interactiveFallbackMsg);
712
722
  printExtensionErrors(extensionsResult.errors);
713
723
  printExtensionWarnings(extensionsResult.warnings);
724
+ applyModelOverride(session, modelRegistry, cliFlags.model);
714
725
  // Restore scoped models from settings on startup.
715
726
  // The upstream InteractiveMode reads enabledModels from settings when /scoped-models is opened,
716
727
  // but doesn't apply them to the session at startup — so Ctrl+P cycles all models instead of
package/dist/headless.js CHANGED
@@ -410,11 +410,16 @@ async function runHeadlessOnce(options, restartCount) {
410
410
  });
411
411
  // Idle timeout — fallback completion detection
412
412
  let idleTimer = null;
413
- const effectiveIdleTimeout = isNewMilestone ? NEW_MILESTONE_IDLE_TIMEOUT_MS : IDLE_TIMEOUT_MS;
413
+ let effectiveIdleTimeout = isNewMilestone
414
+ ? NEW_MILESTONE_IDLE_TIMEOUT_MS
415
+ : isAutoMode
416
+ ? 0
417
+ : IDLE_TIMEOUT_MS;
414
418
  function resetIdleTimer() {
415
419
  if (idleTimer)
416
420
  clearTimeout(idleTimer);
417
- if (shouldArmHeadlessIdleTimeout(toolCallCount, interactiveToolCallIds.size)) {
421
+ if (effectiveIdleTimeout > 0 &&
422
+ shouldArmHeadlessIdleTimeout(toolCallCount, interactiveToolCallIds.size)) {
418
423
  idleTimer = setTimeout(() => {
419
424
  completed = true;
420
425
  resolveCompletion();
@@ -814,6 +819,8 @@ async function runHeadlessOnce(options, restartCount) {
814
819
  completed = false;
815
820
  milestoneReady = false;
816
821
  blocked = false;
822
+ effectiveIdleTimeout = 0;
823
+ resetIdleTimer();
817
824
  const autoCompletionPromise = new Promise((resolve) => {
818
825
  resolveCompletion = resolve;
819
826
  });
@@ -1 +1 @@
1
- cec78fe13fe69412
1
+ f8af4a31f1e89c7d
@@ -448,6 +448,13 @@ What differed from the plan and why (or "None").
448
448
 
449
449
  The one-liner must be substantive: "JWT auth with refresh rotation using jose" not "Authentication implemented."
450
450
 
451
+ When `key_files` or `key_decisions` are empty, render them as empty YAML lists:
452
+
453
+ ```yaml
454
+ key_files: []
455
+ key_decisions: []
456
+ ```
457
+
451
458
  **Slice summary:** Written when all tasks in a slice complete. Compresses all task summaries. Includes `drill_down_paths` to each task summary. During slice completion, review task summaries for `key_decisions` and ensure any significant ones are captured in `.gsd/DECISIONS.md`.
452
459
 
453
460
  **Milestone summary:** Updated each time a slice completes. Compresses all slice summaries. This is what gets injected into later slice planning instead of loading many individual summaries.
@@ -560,7 +567,7 @@ In all modes, slices and tasks commit sequentially on the active branch; there a
560
567
 
561
568
  1. **Milestone starts** → capture the current integration branch.
562
569
  2. **Optional isolation** → create `milestone/M001` only when `git.isolation` is `worktree` or `branch`.
563
- 3. **Per-task commits** — atomic, descriptive, bisectable.
570
+ 3. **Per-task commits** — atomic, descriptive, bisectable, and published only after execute-task verification passes.
564
571
  4. **Slice completes** → write slice summary, UAT script, roadmap checkbox, and milestone summary.
565
572
  5. **Milestone completes** → if isolated, squash-merge the milestone branch back to the captured integration branch and clean up the worktree/branch.
566
573
 
@@ -574,6 +581,8 @@ fix: handle empty state rebuild
574
581
 
575
582
  In `none` mode these commits land directly on the current branch. In isolated modes they land on `milestone/<MID>` and are squashed back at milestone completion.
576
583
 
584
+ Execute-task closeout is fail-closed: the system writes verification evidence first, defers the task commit or snapshot until verification passes, and pauses instead of publishing changes when verification fails or cannot complete.
585
+
577
586
  ### Commit Conventions
578
587
 
579
588
  | When | Format | Example |
@@ -5,6 +5,7 @@ export function registerScreenshotTools(pi, deps) {
5
5
  name: "browser_screenshot",
6
6
  label: "Browser Screenshot",
7
7
  description: "Take a screenshot of the current browser page and return it as an inline image. Uses JPEG for viewport/fullpage (smaller, configurable quality) and PNG for element crops (preserves transparency). Optionally crop to a specific element by CSS selector.",
8
+ compatibility: { producesImages: true },
8
9
  parameters: Type.Object({
9
10
  fullPage: Type.Optional(Type.Boolean({ description: "Capture the full scrollable page (default: false)" })),
10
11
  selector: Type.Optional(Type.String({
@@ -9,6 +9,7 @@ export function registerZoomTools(pi, deps) {
9
9
  description: "Capture and optionally upscale a specific rectangular region of the page for detailed inspection. " +
10
10
  "Useful for dense UIs where full-page screenshots have text too small to read. " +
11
11
  "Returns the region as an inline image, same as browser_screenshot.",
12
+ compatibility: { producesImages: true },
12
13
  parameters: Type.Object({
13
14
  x: Type.Number({ description: "Left coordinate of the region in CSS pixels." }),
14
15
  y: Type.Number({ description: "Top coordinate of the region in CSS pixels." }),
@@ -105,9 +105,10 @@ export function mapUsage(sdkUsage, totalCostUsd) {
105
105
  output: sdkUsage.output_tokens,
106
106
  cacheRead: sdkUsage.cache_read_input_tokens,
107
107
  cacheWrite: sdkUsage.cache_creation_input_tokens,
108
+ // Claude Agent SDK result usage is cumulative across its internal loop;
109
+ // repeated cache reads do not represent additional live context.
108
110
  totalTokens: sdkUsage.input_tokens +
109
111
  sdkUsage.output_tokens +
110
- sdkUsage.cache_read_input_tokens +
111
112
  sdkUsage.cache_creation_input_tokens,
112
113
  cost: {
113
114
  input: 0,
@@ -16,6 +16,8 @@ import { createRequire } from "node:module";
16
16
  import { dirname, join } from "node:path";
17
17
  import { PartialMessageBuilder, ZERO_USAGE, mapUsage } from "./partial-builder.js";
18
18
  import { buildWorkflowMcpServers } from "../gsd/workflow-mcp.js";
19
+ import { loadProjectGSDPreferences } from "../gsd/preferences.js";
20
+ import { discoverMcpServerNames, computeMcpDisallowedTools } from "../gsd/mcp-filter.js";
19
21
  import { showInterviewRound } from "../shared/tui.js";
20
22
  /** Resolve the workspace root for local Claude Code process execution. */
21
23
  export function resolveClaudeCodeCwd(options) {
@@ -110,9 +112,9 @@ export function normalizeClaudePathForSdk(resolvedPath, platform = process.platf
110
112
  if (platform !== "win32")
111
113
  return resolvedPath;
112
114
  if (/\.exe$/i.test(resolvedPath))
113
- return resolvedPath;
115
+ return resolvedPath.replaceAll("\\", "/");
114
116
  if (bundledCliPath)
115
- return bundledCliPath;
117
+ return bundledCliPath.replaceAll("\\", "/");
116
118
  return resolvedPath;
117
119
  }
118
120
  /** Resolve the path passed to `pathToClaudeCodeExecutable`. */
@@ -172,6 +174,18 @@ export function buildPromptFromContext(context) {
172
174
  "Respond only to the final user message below. " +
173
175
  "Do not emit <user_message>, <assistant_message>, or <prior_system_context> tags in your response.",
174
176
  ];
177
+ // The prior system context lists pi-native tool names (lowercase: bash, read, gsd_exec, etc.)
178
+ // but this process runs inside Claude Code where tool names differ. Inject a remapping note
179
+ // before the prior context so the model uses correct names regardless of what the prior
180
+ // context describes.
181
+ parts.push("<tool_context>\n" +
182
+ "You are running inside Claude Code. Use these exact tool names — do not use lowercase or pi-native names:\n" +
183
+ "- Shell commands: 'Bash' (not 'bash')\n" +
184
+ "- File operations: 'Read', 'Write', 'Edit', 'Glob', 'Grep' (PascalCase, not lowercase)\n" +
185
+ "- GSD workflow tools (gsd_exec, gsd_slice_complete, gsd_task_complete, gsd_plan_slice, etc.) " +
186
+ "are MCP tools — call them as mcp__gsd-workflow__<tool_name> " +
187
+ "(e.g. mcp__gsd-workflow__gsd_exec, mcp__gsd-workflow__gsd_slice_complete)\n" +
188
+ "</tool_context>");
175
189
  if (context.systemPrompt) {
176
190
  parts.push(`<prior_system_context>\n${context.systemPrompt}\n</prior_system_context>`);
177
191
  }
@@ -269,7 +283,7 @@ function makeErrorMessage(model, errorMsg) {
269
283
  export function isClaudeCodeAbortErrorMessage(message) {
270
284
  if (!message)
271
285
  return false;
272
- return /\b(?:claude code process aborted by user|request aborted by user|process aborted by user)\b/i.test(message);
286
+ return /\b(?:claude code process aborted by user|request aborted by user|process aborted by user|aborterror)\b/i.test(message);
273
287
  }
274
288
  function isBareClaudeCodeAbortErrorMessage(message) {
275
289
  if (!message)
@@ -1060,13 +1074,37 @@ export function buildSdkOptions(modelId, prompt, overrides, extraOptions = {}) {
1060
1074
  const sdkCwd = typeof cwd === "string" && cwd.trim().length > 0 ? cwd : process.cwd();
1061
1075
  const mcpServers = buildWorkflowMcpServers(sdkCwd);
1062
1076
  const permissionMode = overrides?.permissionMode ?? "bypassPermissions";
1077
+ const preferences = loadProjectGSDPreferences(sdkCwd);
1078
+ const mcpConfig = preferences?.preferences.claude_code_mcp;
1079
+ const workflowServerName = mcpServers ? Object.keys(mcpServers)[0] : undefined;
1080
+ // Always discover project MCPs — needed for both duplicate detection and filtering.
1081
+ const discovered = discoverMcpServerNames(sdkCwd);
1082
+ // If the workflow MCP is already declared in the project's .mcp.json or
1083
+ // .claude/settings.json, do not inject it again via mcpServers. Passing the
1084
+ // same server name from two sources causes a duplicate registration conflict
1085
+ // that prevents the MCP server from loading (tools become unavailable).
1086
+ const workflowAlreadyInProject = workflowServerName !== undefined && discovered.includes(workflowServerName);
1087
+ let filteredMcpServers = workflowAlreadyInProject ? undefined : mcpServers;
1088
+ let extraDisallowedTools = [];
1089
+ let workflowExplicitlyBlocked = false;
1090
+ if (mcpConfig) {
1091
+ extraDisallowedTools = computeMcpDisallowedTools(modelId, mcpConfig, discovered, workflowServerName);
1092
+ if (workflowServerName && extraDisallowedTools.includes(`mcp__${workflowServerName}__*`)) {
1093
+ filteredMcpServers = undefined;
1094
+ workflowExplicitlyBlocked = true;
1095
+ }
1096
+ }
1063
1097
  // Globally unblock the tools GSD expects Claude Code to run. When the
1064
1098
  // workflow MCP server is available, prefer its `ask_user_questions` tool over
1065
1099
  // Claude Code's native `AskUserQuestion`; the MCP path carries stable IDs and
1066
1100
  // routes responses through the GSD elicitation bridge.
1067
1101
  // Opt back into gated mode with GSD_CLAUDE_CODE_PERMISSION_MODE=acceptEdits.
1068
- const workflowMcpTools = mcpServers ? Object.keys(mcpServers).map((serverName) => `mcp__${serverName}__*`) : [];
1069
- const disallowedTools = workflowMcpTools.length > 0 ? ["AskUserQuestion"] : [];
1102
+ // Include the workflow pattern in allowedTools whether the server is GSD-injected
1103
+ // or declared in the project config but not if explicitly blocked by user prefs.
1104
+ const workflowMcpTools = filteredMcpServers
1105
+ ? Object.keys(filteredMcpServers).map((serverName) => `mcp__${serverName}__*`)
1106
+ : (!workflowExplicitlyBlocked && workflowServerName ? [`mcp__${workflowServerName}__*`] : []);
1107
+ const disallowedTools = [...(workflowMcpTools.length > 0 ? ["AskUserQuestion"] : []), ...extraDisallowedTools];
1070
1108
  const allowedTools = [
1071
1109
  "Read",
1072
1110
  "Write",
@@ -1103,7 +1141,7 @@ export function buildSdkOptions(modelId, prompt, overrides, extraOptions = {}) {
1103
1141
  systemPrompt: { type: "preset", preset: "claude_code" },
1104
1142
  disallowedTools,
1105
1143
  ...(allowedTools.length > 0 ? { allowedTools } : {}),
1106
- ...(mcpServers ? { mcpServers } : {}),
1144
+ ...(filteredMcpServers ? { mcpServers: filteredMcpServers } : {}),
1107
1145
  betas: (modelId.includes("sonnet") || modelId.includes("opus-4-7") || modelId.includes("opus-4.7")) ? ["context-1m-2025-08-07"] : [],
1108
1146
  ...(thinkingConfig ?? {}),
1109
1147
  ...(effort ? { effort } : {}),
@@ -319,6 +319,11 @@ export class CmuxClient {
319
319
  const stdout = await this.runAsync(["send-surface", "--surface", surfaceId, payload]);
320
320
  return stdout !== null;
321
321
  }
322
+ // Send Ctrl-C (ETX) to a surface to interrupt the running command.
323
+ async sendInterrupt(surfaceId) {
324
+ const stdout = await this.runAsync(["send-surface", "--surface", surfaceId, "\x03"]);
325
+ return stdout !== null;
326
+ }
322
327
  }
323
328
  export function syncCmuxSidebar(preferences, state) {
324
329
  const client = CmuxClient.fromPreferences(preferences);
@@ -6,9 +6,14 @@
6
6
  * failures that merit retry.
7
7
  */
8
8
  /**
9
- * Error codes indicating infrastructure failures that cannot be recovered by
10
- * retrying. Each retry re-dispatches the unit at full LLM cost, so we bail
11
- * immediately rather than burning budget on guaranteed failures.
9
+ * Error codes indicating infrastructure-level failures from the OS,
10
+ * filesystem, or network. This set includes permanent resource failures
11
+ * (ENOSPC, ENOMEM, EROFS), transient resource exhaustion (EAGAIN, ENOBUFS),
12
+ * and network/offline errors (ECONNREFUSED, ENOTFOUND, ENETUNREACH).
13
+ *
14
+ * Transient git failures are retried separately through
15
+ * TRANSIENT_GIT_RETRY_CODES in native-git-bridge.ts before escalating to the
16
+ * auto-loop.
12
17
  */
13
18
  export const INFRA_ERROR_CODES = new Set([
14
19
  "ENOSPC", // disk full
@@ -18,6 +23,7 @@ export const INFRA_ERROR_CODES = new Set([
18
23
  "EMFILE", // too many open files (process)
19
24
  "ENFILE", // too many open files (system)
20
25
  "EAGAIN", // resource temporarily unavailable (resource exhaustion)
26
+ "ENOBUFS", // no buffer space available (transient pipe exhaustion)
21
27
  "ECONNREFUSED", // connection refused (offline / local server down)
22
28
  "ENOTFOUND", // DNS lookup failed (offline / no network)
23
29
  "ENETUNREACH", // network unreachable (offline / no route)