gsd-pi 2.81.0 → 2.82.0-dev.2841a1e44

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 (572) hide show
  1. package/README.md +63 -32
  2. package/dist/resources/.managed-resources-content-hash +1 -1
  3. package/dist/resources/GSD-WORKFLOW.md +3 -1
  4. package/dist/resources/extensions/browser-tools/tools/screenshot.js +1 -0
  5. package/dist/resources/extensions/browser-tools/tools/zoom.js +1 -0
  6. package/dist/resources/extensions/cmux/index.js +5 -0
  7. package/dist/resources/extensions/gsd/auto/loop.js +111 -8
  8. package/dist/resources/extensions/gsd/auto/orchestrator.js +113 -6
  9. package/dist/resources/extensions/gsd/auto/phases.js +199 -97
  10. package/dist/resources/extensions/gsd/auto/run-unit.js +66 -3
  11. package/dist/resources/extensions/gsd/auto/session.js +9 -0
  12. package/dist/resources/extensions/gsd/auto/verification-retry-policy.js +43 -0
  13. package/dist/resources/extensions/gsd/auto-dashboard.js +182 -178
  14. package/dist/resources/extensions/gsd/auto-dispatch.js +14 -11
  15. package/dist/resources/extensions/gsd/auto-post-unit.js +176 -125
  16. package/dist/resources/extensions/gsd/auto-prompts.js +13 -5
  17. package/dist/resources/extensions/gsd/auto-recovery.js +6 -181
  18. package/dist/resources/extensions/gsd/auto-runtime-state.js +5 -0
  19. package/dist/resources/extensions/gsd/auto-start.js +20 -23
  20. package/dist/resources/extensions/gsd/auto-unit-closeout.js +33 -5
  21. package/dist/resources/extensions/gsd/auto-verification.js +38 -26
  22. package/dist/resources/extensions/gsd/auto-worktree.js +8 -0
  23. package/dist/resources/extensions/gsd/auto.js +371 -106
  24. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +13 -6
  25. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +13 -2
  26. package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +4 -8
  27. package/dist/resources/extensions/gsd/bootstrap/subagent-input.js +16 -7
  28. package/dist/resources/extensions/gsd/bootstrap/system-context.js +55 -12
  29. package/dist/resources/extensions/gsd/bootstrap/write-gate.js +3 -1
  30. package/dist/resources/extensions/gsd/clean-root-preflight.js +170 -8
  31. package/dist/resources/extensions/gsd/commands/catalog.js +4 -1
  32. package/dist/resources/extensions/gsd/commands/handlers/core.js +22 -1
  33. package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +4 -10
  34. package/dist/resources/extensions/gsd/commands/handlers/parallel.js +9 -0
  35. package/dist/resources/extensions/gsd/commands-bootstrap.js +5 -0
  36. package/dist/resources/extensions/gsd/commands-handlers.js +15 -2
  37. package/dist/resources/extensions/gsd/context-store.js +112 -0
  38. package/dist/resources/extensions/gsd/db-writer.js +150 -84
  39. package/dist/resources/extensions/gsd/docs/preferences-reference.md +1 -1
  40. package/dist/resources/extensions/gsd/doctor-git-checks.js +41 -6
  41. package/dist/resources/extensions/gsd/git-service.js +2 -1
  42. package/dist/resources/extensions/gsd/gsd-db.js +7 -23
  43. package/dist/resources/extensions/gsd/health-widget-core.js +1 -1
  44. package/dist/resources/extensions/gsd/health-widget.js +4 -10
  45. package/dist/resources/extensions/gsd/knowledge-backfill.js +144 -0
  46. package/dist/resources/extensions/gsd/knowledge-capture.js +136 -0
  47. package/dist/resources/extensions/gsd/knowledge-parser.js +154 -0
  48. package/dist/resources/extensions/gsd/knowledge-projection.js +210 -0
  49. package/dist/resources/extensions/gsd/markdown-renderer.js +6 -96
  50. package/dist/resources/extensions/gsd/md-importer.js +1 -1
  51. package/dist/resources/extensions/gsd/memory-backfill.js +73 -17
  52. package/dist/resources/extensions/gsd/memory-consolidation-scanner.js +222 -0
  53. package/dist/resources/extensions/gsd/migrate/command.js +5 -0
  54. package/dist/resources/extensions/gsd/migrate/preview.js +9 -0
  55. package/dist/resources/extensions/gsd/migrate/transformer.js +51 -4
  56. package/dist/resources/extensions/gsd/migrate/writer.js +11 -1
  57. package/dist/resources/extensions/gsd/native-git-bridge.js +14 -14
  58. package/dist/resources/extensions/gsd/notification-overlay.js +35 -40
  59. package/dist/resources/extensions/gsd/parallel-merge.js +53 -30
  60. package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +25 -33
  61. package/dist/resources/extensions/gsd/prompts/complete-slice.md +14 -12
  62. package/dist/resources/extensions/gsd/prompts/discuss-headless.md +20 -2
  63. package/dist/resources/extensions/gsd/prompts/discuss.md +20 -2
  64. package/dist/resources/extensions/gsd/prompts/system.md +2 -2
  65. package/dist/resources/extensions/gsd/provider-switch-observer.js +146 -0
  66. package/dist/resources/extensions/gsd/recovery-classification.js +15 -1
  67. package/dist/resources/extensions/gsd/session-lock.js +40 -0
  68. package/dist/resources/extensions/gsd/state-reconciliation/drift/completion.js +131 -0
  69. package/dist/resources/extensions/gsd/state-reconciliation/drift/merge-state.js +247 -0
  70. package/dist/resources/extensions/gsd/state-reconciliation/drift/project-md.js +50 -0
  71. package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +87 -0
  72. package/dist/resources/extensions/gsd/state-reconciliation/drift/sketch-flag.js +50 -0
  73. package/dist/resources/extensions/gsd/state-reconciliation/drift/stale-render.js +124 -0
  74. package/dist/resources/extensions/gsd/state-reconciliation/drift/stale-worker.js +32 -0
  75. package/dist/resources/extensions/gsd/state-reconciliation/errors.js +41 -0
  76. package/dist/resources/extensions/gsd/state-reconciliation/index.js +99 -0
  77. package/dist/resources/extensions/gsd/state-reconciliation/registry.js +24 -0
  78. package/dist/resources/extensions/gsd/state-reconciliation/spawn-gate.js +43 -0
  79. package/dist/resources/extensions/gsd/state-reconciliation/types.js +3 -0
  80. package/dist/resources/extensions/gsd/state-reconciliation.js +5 -26
  81. package/dist/resources/extensions/gsd/templates/knowledge.md +2 -2
  82. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +119 -0
  83. package/dist/resources/extensions/gsd/tui/render-kit.js +74 -0
  84. package/dist/resources/extensions/gsd/unit-context-manifest.js +25 -2
  85. package/dist/resources/extensions/gsd/verification-verdict.js +26 -0
  86. package/dist/resources/extensions/gsd/watch/header-renderer.js +92 -69
  87. package/dist/resources/extensions/gsd/watch/splash-palette.js +10 -0
  88. package/dist/resources/extensions/gsd/workflow-mcp.js +2 -2
  89. package/dist/resources/extensions/gsd/worktree-lifecycle.js +743 -318
  90. package/dist/resources/extensions/gsd/worktree-telemetry.js +3 -1
  91. package/dist/resources/extensions/subagent/index.js +448 -78
  92. package/dist/resources/extensions/subagent/launch.js +77 -0
  93. package/dist/resources/extensions/subagent/run-store.js +148 -0
  94. package/dist/resources/extensions/visual-brief/artifact-policy.js +29 -0
  95. package/dist/resources/extensions/visual-brief/extension-manifest.json +8 -0
  96. package/dist/resources/extensions/visual-brief/index.js +5 -0
  97. package/dist/resources/extensions/visual-brief/page-contract.js +122 -0
  98. package/dist/resources/extensions/visual-brief/prompts.js +111 -0
  99. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  100. package/dist/web/standalone/.next/BUILD_ID +1 -1
  101. package/dist/web/standalone/.next/app-path-routes-manifest.json +11 -11
  102. package/dist/web/standalone/.next/build-manifest.json +4 -4
  103. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  104. package/dist/web/standalone/.next/react-loadable-manifest.json +3 -3
  105. package/dist/web/standalone/.next/required-server-files.json +3 -3
  106. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  107. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  108. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  109. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  110. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  111. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  112. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  113. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  114. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  115. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  116. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  117. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  118. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  119. package/dist/web/standalone/.next/server/app/_not-found.rsc +4 -4
  120. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  121. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  122. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  123. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  124. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  125. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  126. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  127. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  128. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  129. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  130. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  131. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  132. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  133. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  134. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  135. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  136. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  137. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  138. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  139. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  140. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  141. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  142. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  143. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  144. package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
  145. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  146. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  147. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  148. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  149. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  150. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  151. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  152. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  153. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  154. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  155. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  156. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  157. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  158. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  159. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  160. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  161. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  162. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  163. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  164. package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
  165. package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  166. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  168. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  169. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  170. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  171. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  172. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  173. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  174. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
  175. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  176. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  178. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  179. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  180. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  181. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  182. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  183. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  184. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  185. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  186. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  187. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  188. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  189. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  190. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  191. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  192. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  193. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  194. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
  195. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  196. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  197. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  198. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
  199. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  200. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +2 -2
  201. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  202. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  203. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  204. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  205. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  206. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  207. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  208. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  209. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  210. package/dist/web/standalone/.next/server/app/index.html +1 -1
  211. package/dist/web/standalone/.next/server/app/index.rsc +5 -5
  212. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  213. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +5 -5
  214. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  215. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +4 -4
  216. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  217. package/dist/web/standalone/.next/server/app/page.js +2 -2
  218. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  219. package/dist/web/standalone/.next/server/app-paths-manifest.json +11 -11
  220. package/dist/web/standalone/.next/server/chunks/63.js +3 -3
  221. package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
  222. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  223. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  224. package/dist/web/standalone/.next/server/middleware.js +2 -2
  225. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  226. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  227. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  228. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  229. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  230. package/dist/web/standalone/.next/static/chunks/2973.33f26573894b6153.js +2 -0
  231. package/dist/web/standalone/.next/static/chunks/{8359.e059d86b255fce1c.js → 8359.7eb3bb8f8ecf4c01.js} +2 -2
  232. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  233. package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
  234. package/dist/web/standalone/.next/static/chunks/app/page-752f1e2ebdaa3e45.js +1 -0
  235. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  236. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  237. package/dist/web/standalone/.next/static/chunks/{webpack-de742b64187e13fe.js → webpack-6a95bc41e0f7ec89.js} +1 -1
  238. package/dist/web/standalone/.next/static/css/0262768ec1b89d34.css +1 -0
  239. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  240. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  241. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  242. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  243. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  244. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  245. package/dist/web/standalone/server.js +1 -1
  246. package/dist/welcome-screen.d.ts +0 -7
  247. package/dist/welcome-screen.js +60 -69
  248. package/package.json +5 -4
  249. package/packages/contracts/dist/rpc.test.js +7 -0
  250. package/packages/contracts/dist/rpc.test.js.map +1 -1
  251. package/packages/contracts/dist/workflow.d.ts +21 -0
  252. package/packages/contracts/dist/workflow.d.ts.map +1 -1
  253. package/packages/contracts/dist/workflow.js +24 -0
  254. package/packages/contracts/dist/workflow.js.map +1 -1
  255. package/packages/contracts/src/rpc.test.ts +8 -0
  256. package/packages/contracts/src/workflow.ts +24 -0
  257. package/packages/daemon/package.json +2 -2
  258. package/packages/mcp-server/README.md +14 -3
  259. package/packages/mcp-server/dist/workflow-tools.d.ts +0 -3
  260. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  261. package/packages/mcp-server/dist/workflow-tools.js +80 -0
  262. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  263. package/packages/mcp-server/package.json +2 -2
  264. package/packages/mcp-server/src/workflow-tools-parity.test.ts +244 -0
  265. package/packages/mcp-server/src/workflow-tools.test.ts +22 -0
  266. package/packages/mcp-server/src/workflow-tools.ts +168 -0
  267. package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
  268. package/packages/native/package.json +1 -1
  269. package/packages/pi-agent-core/package.json +1 -1
  270. package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
  271. package/packages/pi-ai/dist/index.d.ts +2 -2
  272. package/packages/pi-ai/dist/index.d.ts.map +1 -1
  273. package/packages/pi-ai/dist/index.js +1 -1
  274. package/packages/pi-ai/dist/index.js.map +1 -1
  275. package/packages/pi-ai/dist/providers/transform-messages.d.ts +11 -0
  276. package/packages/pi-ai/dist/providers/transform-messages.d.ts.map +1 -1
  277. package/packages/pi-ai/dist/providers/transform-messages.js +20 -0
  278. package/packages/pi-ai/dist/providers/transform-messages.js.map +1 -1
  279. package/packages/pi-ai/package.json +1 -1
  280. package/packages/pi-ai/src/index.ts +7 -2
  281. package/packages/pi-ai/src/providers/transform-messages.ts +24 -0
  282. package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
  283. package/packages/pi-coding-agent/dist/core/system-prompt.js +4 -4
  284. package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
  285. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.d.ts +2 -0
  286. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.d.ts.map +1 -0
  287. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.js +47 -0
  288. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.js.map +1 -0
  289. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +76 -9
  290. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
  291. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.d.ts +2 -0
  292. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.d.ts.map +1 -0
  293. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.js +40 -0
  294. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.js.map +1 -0
  295. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts +0 -1
  296. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts.map +1 -1
  297. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js +30 -29
  298. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -1
  299. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js +10 -3
  300. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js.map +1 -1
  301. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  302. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +13 -13
  303. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
  304. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +1 -3
  305. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  306. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +58 -3
  307. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
  308. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts +2 -2
  309. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -1
  310. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js +12 -6
  311. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js.map +1 -1
  312. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
  313. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +14 -41
  314. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
  315. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +0 -1
  316. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  317. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +86 -82
  318. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  319. package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.d.ts +35 -0
  320. package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.d.ts.map +1 -0
  321. package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.js +152 -0
  322. package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.js.map +1 -0
  323. package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.d.ts +16 -0
  324. package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.d.ts.map +1 -0
  325. package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.js +73 -0
  326. package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.js.map +1 -0
  327. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts +1 -1
  328. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  329. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js +12 -8
  330. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
  331. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.d.ts +2 -0
  332. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.d.ts.map +1 -0
  333. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.js +17 -0
  334. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.js.map +1 -0
  335. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  336. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +105 -1
  337. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  338. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  339. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +27 -26
  340. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
  341. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +9 -6
  342. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -1
  343. package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.d.ts +2 -0
  344. package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.d.ts.map +1 -0
  345. package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.js +17 -0
  346. package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.js.map +1 -0
  347. package/packages/pi-coding-agent/package.json +1 -1
  348. package/packages/pi-coding-agent/src/core/system-prompt.ts +4 -4
  349. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/assistant-message-design.test.ts +56 -0
  350. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +113 -9
  351. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/user-message-design.test.ts +48 -0
  352. package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.test.ts +10 -3
  353. package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +43 -42
  354. package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +14 -14
  355. package/packages/pi-coding-agent/src/modes/interactive/components/bash-execution.ts +64 -3
  356. package/packages/pi-coding-agent/src/modes/interactive/components/diff.ts +13 -7
  357. package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +15 -42
  358. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +84 -104
  359. package/packages/pi-coding-agent/src/modes/interactive/components/transcript-design.ts +196 -0
  360. package/packages/pi-coding-agent/src/modes/interactive/components/tui-style-kit.ts +94 -0
  361. package/packages/pi-coding-agent/src/modes/interactive/components/user-message.ts +14 -9
  362. package/packages/pi-coding-agent/src/modes/interactive/theme/theme-highlight.test.ts +23 -0
  363. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +106 -1
  364. package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +27 -26
  365. package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +9 -6
  366. package/packages/pi-coding-agent/src/tests/system-prompt-file-safety.test.ts +22 -0
  367. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
  368. package/packages/pi-tui/dist/__tests__/overlay-layout.test.js +14 -1
  369. package/packages/pi-tui/dist/__tests__/overlay-layout.test.js.map +1 -1
  370. package/packages/pi-tui/dist/overlay-layout.d.ts.map +1 -1
  371. package/packages/pi-tui/dist/overlay-layout.js +9 -6
  372. package/packages/pi-tui/dist/overlay-layout.js.map +1 -1
  373. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  374. package/packages/pi-tui/dist/tui.js +5 -0
  375. package/packages/pi-tui/dist/tui.js.map +1 -1
  376. package/packages/pi-tui/package.json +1 -1
  377. package/packages/pi-tui/src/__tests__/overlay-layout.test.ts +20 -1
  378. package/packages/pi-tui/src/overlay-layout.ts +10 -7
  379. package/packages/pi-tui/src/tui.ts +6 -0
  380. package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
  381. package/packages/rpc-client/package.json +1 -1
  382. package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
  383. package/pkg/dist/modes/interactive/theme/theme-highlight.test.d.ts +2 -0
  384. package/pkg/dist/modes/interactive/theme/theme-highlight.test.d.ts.map +1 -0
  385. package/pkg/dist/modes/interactive/theme/theme-highlight.test.js +17 -0
  386. package/pkg/dist/modes/interactive/theme/theme-highlight.test.js.map +1 -0
  387. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  388. package/pkg/dist/modes/interactive/theme/theme.js +105 -1
  389. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  390. package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  391. package/pkg/dist/modes/interactive/theme/themes.js +27 -26
  392. package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
  393. package/pkg/package.json +1 -1
  394. package/src/resources/GSD-WORKFLOW.md +3 -1
  395. package/src/resources/extensions/browser-tools/tools/screenshot.ts +1 -0
  396. package/src/resources/extensions/browser-tools/tools/zoom.ts +1 -0
  397. package/src/resources/extensions/cmux/index.ts +6 -0
  398. package/src/resources/extensions/gsd/auto/contracts.ts +46 -11
  399. package/src/resources/extensions/gsd/auto/loop-deps.ts +9 -5
  400. package/src/resources/extensions/gsd/auto/loop.ts +113 -9
  401. package/src/resources/extensions/gsd/auto/orchestrator.ts +118 -6
  402. package/src/resources/extensions/gsd/auto/phases.ts +158 -19
  403. package/src/resources/extensions/gsd/auto/run-unit.ts +69 -4
  404. package/src/resources/extensions/gsd/auto/session.ts +10 -0
  405. package/src/resources/extensions/gsd/auto/verification-retry-policy.ts +82 -0
  406. package/src/resources/extensions/gsd/auto-dashboard.ts +230 -183
  407. package/src/resources/extensions/gsd/auto-dispatch.ts +15 -1
  408. package/src/resources/extensions/gsd/auto-post-unit.ts +201 -138
  409. package/src/resources/extensions/gsd/auto-prompts.ts +13 -5
  410. package/src/resources/extensions/gsd/auto-recovery.ts +7 -209
  411. package/src/resources/extensions/gsd/auto-runtime-state.ts +5 -0
  412. package/src/resources/extensions/gsd/auto-start.ts +22 -22
  413. package/src/resources/extensions/gsd/auto-unit-closeout.ts +51 -0
  414. package/src/resources/extensions/gsd/auto-verification.ts +46 -38
  415. package/src/resources/extensions/gsd/auto-worktree.ts +8 -0
  416. package/src/resources/extensions/gsd/auto.ts +411 -106
  417. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +21 -6
  418. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +12 -2
  419. package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +5 -8
  420. package/src/resources/extensions/gsd/bootstrap/subagent-input.ts +16 -6
  421. package/src/resources/extensions/gsd/bootstrap/system-context.ts +58 -15
  422. package/src/resources/extensions/gsd/bootstrap/write-gate.ts +3 -2
  423. package/src/resources/extensions/gsd/clean-root-preflight.ts +174 -8
  424. package/src/resources/extensions/gsd/commands/catalog.ts +4 -1
  425. package/src/resources/extensions/gsd/commands/handlers/core.ts +25 -1
  426. package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +4 -10
  427. package/src/resources/extensions/gsd/commands/handlers/parallel.ts +12 -0
  428. package/src/resources/extensions/gsd/commands-bootstrap.ts +10 -0
  429. package/src/resources/extensions/gsd/commands-handlers.ts +19 -2
  430. package/src/resources/extensions/gsd/context-store.ts +120 -1
  431. package/src/resources/extensions/gsd/db-writer.ts +167 -84
  432. package/src/resources/extensions/gsd/docs/preferences-reference.md +1 -1
  433. package/src/resources/extensions/gsd/doctor-git-checks.ts +44 -6
  434. package/src/resources/extensions/gsd/doctor-types.ts +2 -0
  435. package/src/resources/extensions/gsd/git-service.ts +2 -0
  436. package/src/resources/extensions/gsd/gsd-db.ts +7 -23
  437. package/src/resources/extensions/gsd/health-widget-core.ts +1 -1
  438. package/src/resources/extensions/gsd/health-widget.ts +6 -10
  439. package/src/resources/extensions/gsd/journal.ts +2 -0
  440. package/src/resources/extensions/gsd/knowledge-backfill.ts +164 -0
  441. package/src/resources/extensions/gsd/knowledge-capture.ts +160 -0
  442. package/src/resources/extensions/gsd/knowledge-parser.ts +174 -0
  443. package/src/resources/extensions/gsd/knowledge-projection.ts +241 -0
  444. package/src/resources/extensions/gsd/markdown-renderer.ts +10 -96
  445. package/src/resources/extensions/gsd/md-importer.ts +1 -1
  446. package/src/resources/extensions/gsd/memory-backfill.ts +89 -17
  447. package/src/resources/extensions/gsd/memory-consolidation-scanner.ts +277 -0
  448. package/src/resources/extensions/gsd/migrate/command.ts +5 -0
  449. package/src/resources/extensions/gsd/migrate/preview.ts +10 -0
  450. package/src/resources/extensions/gsd/migrate/transformer.ts +58 -4
  451. package/src/resources/extensions/gsd/migrate/writer.ts +14 -1
  452. package/src/resources/extensions/gsd/native-git-bridge.ts +14 -13
  453. package/src/resources/extensions/gsd/notification-overlay.ts +50 -46
  454. package/src/resources/extensions/gsd/parallel-merge.ts +61 -34
  455. package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +33 -35
  456. package/src/resources/extensions/gsd/prompts/complete-slice.md +14 -12
  457. package/src/resources/extensions/gsd/prompts/discuss-headless.md +20 -2
  458. package/src/resources/extensions/gsd/prompts/discuss.md +20 -2
  459. package/src/resources/extensions/gsd/prompts/system.md +2 -2
  460. package/src/resources/extensions/gsd/provider-switch-observer.ts +185 -0
  461. package/src/resources/extensions/gsd/recovery-classification.ts +18 -1
  462. package/src/resources/extensions/gsd/session-lock.ts +41 -0
  463. package/src/resources/extensions/gsd/state-reconciliation/drift/completion.ts +172 -0
  464. package/src/resources/extensions/gsd/state-reconciliation/drift/merge-state.ts +337 -0
  465. package/src/resources/extensions/gsd/state-reconciliation/drift/project-md.ts +69 -0
  466. package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +109 -0
  467. package/src/resources/extensions/gsd/state-reconciliation/drift/sketch-flag.ts +68 -0
  468. package/src/resources/extensions/gsd/state-reconciliation/drift/stale-render.ts +185 -0
  469. package/src/resources/extensions/gsd/state-reconciliation/drift/stale-worker.ts +46 -0
  470. package/src/resources/extensions/gsd/state-reconciliation/errors.ts +67 -0
  471. package/src/resources/extensions/gsd/state-reconciliation/index.ts +142 -0
  472. package/src/resources/extensions/gsd/state-reconciliation/registry.ts +27 -0
  473. package/src/resources/extensions/gsd/state-reconciliation/spawn-gate.ts +60 -0
  474. package/src/resources/extensions/gsd/state-reconciliation/types.ts +83 -0
  475. package/src/resources/extensions/gsd/state-reconciliation.ts +21 -53
  476. package/src/resources/extensions/gsd/templates/knowledge.md +2 -2
  477. package/src/resources/extensions/gsd/tests/artifact-retry-cap.test.ts +1 -1
  478. package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +99 -0
  479. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +729 -176
  480. package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +408 -4
  481. package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +292 -4
  482. package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +20 -5
  483. package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +18 -0
  484. package/src/resources/extensions/gsd/tests/auto-unit-closeout.test.ts +68 -0
  485. package/src/resources/extensions/gsd/tests/brief-command.test.ts +89 -0
  486. package/src/resources/extensions/gsd/tests/browser-tools-compatibility-declarations.test.ts +62 -0
  487. package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +107 -2
  488. package/src/resources/extensions/gsd/tests/closeout-git-deferral.test.ts +16 -0
  489. package/src/resources/extensions/gsd/tests/context-store-decisions-from-memories.test.ts +312 -0
  490. package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +28 -1
  491. package/src/resources/extensions/gsd/tests/db-writer.test.ts +13 -8
  492. package/src/resources/extensions/gsd/tests/decisions-projection-from-memories.test.ts +453 -0
  493. package/src/resources/extensions/gsd/tests/decisions-stop-table-writes.test.ts +348 -0
  494. package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +20 -2
  495. package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +44 -0
  496. package/src/resources/extensions/gsd/tests/evidence-cross-ref.test.ts +38 -0
  497. package/src/resources/extensions/gsd/tests/freeform-decisions.test.ts +8 -4
  498. package/src/resources/extensions/gsd/tests/gsd-tools.test.ts +11 -7
  499. package/src/resources/extensions/gsd/tests/header-renderer.test.ts +40 -0
  500. package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +10 -0
  501. package/src/resources/extensions/gsd/tests/health-widget.test.ts +14 -4
  502. package/src/resources/extensions/gsd/tests/integration/doctor-git.test.ts +44 -0
  503. package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +26 -0
  504. package/src/resources/extensions/gsd/tests/integration/integration-lifecycle.test.ts +13 -5
  505. package/src/resources/extensions/gsd/tests/integration/integration-proof.test.ts +1 -1
  506. package/src/resources/extensions/gsd/tests/integration/migrate-command.test.ts +48 -3
  507. package/src/resources/extensions/gsd/tests/integration/parallel-merge.test.ts +116 -24
  508. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +0 -1
  509. package/src/resources/extensions/gsd/tests/knowledge-backfill-projection.test.ts +323 -0
  510. package/src/resources/extensions/gsd/tests/knowledge-capture.test.ts +242 -0
  511. package/src/resources/extensions/gsd/tests/knowledge.test.ts +47 -2
  512. package/src/resources/extensions/gsd/tests/load-knowledge-block-rules-only.test.ts +209 -0
  513. package/src/resources/extensions/gsd/tests/markdown-renderer.test.ts +1 -1
  514. package/src/resources/extensions/gsd/tests/memory-consolidation-scanner.test.ts +316 -0
  515. package/src/resources/extensions/gsd/tests/merge-conflict-stops-loop.test.ts +46 -11
  516. package/src/resources/extensions/gsd/tests/migrate-transformer.test.ts +5 -1
  517. package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +6 -1
  518. package/src/resources/extensions/gsd/tests/notification-overlay.test.ts +78 -41
  519. package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +44 -0
  520. package/src/resources/extensions/gsd/tests/originalbase-path-comparison.test.ts +12 -217
  521. package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +38 -6
  522. package/src/resources/extensions/gsd/tests/plan-milestone-sketch-render.test.ts +157 -0
  523. package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +81 -3
  524. package/src/resources/extensions/gsd/tests/progressive-planning.test.ts +1 -1
  525. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +32 -1
  526. package/src/resources/extensions/gsd/tests/provider-switch-observer.test.ts +252 -0
  527. package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +7 -3
  528. package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +6 -3
  529. package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +16 -4
  530. package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +24 -0
  531. package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +71 -58
  532. package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +952 -0
  533. package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +4 -0
  534. package/src/resources/extensions/gsd/tests/tui-header-lifecycle.test.ts +121 -1
  535. package/src/resources/extensions/gsd/tests/tui-render-kit.test.ts +66 -0
  536. package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +21 -0
  537. package/src/resources/extensions/gsd/tests/verification-retry-policy.test.ts +83 -0
  538. package/src/resources/extensions/gsd/tests/verification-verdict.test.ts +78 -0
  539. package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +6 -0
  540. package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +158 -58
  541. package/src/resources/extensions/gsd/tests/worktree-lifecycle.test.ts +597 -118
  542. package/src/resources/extensions/gsd/tests/worktree-telemetry.test.ts +59 -2
  543. package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +34 -0
  544. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +135 -0
  545. package/src/resources/extensions/gsd/tui/render-kit.ts +109 -0
  546. package/src/resources/extensions/gsd/unit-context-manifest.ts +35 -2
  547. package/src/resources/extensions/gsd/verification-verdict.ts +47 -0
  548. package/src/resources/extensions/gsd/watch/header-renderer.ts +121 -79
  549. package/src/resources/extensions/gsd/watch/splash-palette.ts +11 -0
  550. package/src/resources/extensions/gsd/workflow-logger.ts +4 -0
  551. package/src/resources/extensions/gsd/workflow-mcp.ts +2 -2
  552. package/src/resources/extensions/gsd/worktree-lifecycle.ts +1171 -526
  553. package/src/resources/extensions/gsd/worktree-telemetry.ts +7 -2
  554. package/src/resources/extensions/subagent/index.ts +567 -103
  555. package/src/resources/extensions/subagent/launch.ts +131 -0
  556. package/src/resources/extensions/subagent/run-store.ts +218 -0
  557. package/src/resources/extensions/subagent/tests/launch.test.ts +115 -0
  558. package/src/resources/extensions/subagent/tests/run-store.test.ts +111 -0
  559. package/src/resources/extensions/visual-brief/artifact-policy.ts +41 -0
  560. package/src/resources/extensions/visual-brief/extension-manifest.json +8 -0
  561. package/src/resources/extensions/visual-brief/index.ts +8 -0
  562. package/src/resources/extensions/visual-brief/page-contract.ts +134 -0
  563. package/src/resources/extensions/visual-brief/prompts.ts +147 -0
  564. package/src/resources/extensions/visual-brief/tests/visual-brief.test.ts +172 -0
  565. package/dist/web/standalone/.next/static/chunks/2556.0527fea66e123b7f.js +0 -1
  566. package/dist/web/standalone/.next/static/chunks/app/page-200592a7f3baf579.js +0 -1
  567. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  568. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  569. package/dist/web/standalone/.next/static/css/54ec2745c1da488b.css +0 -1
  570. package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +0 -1544
  571. /package/dist/web/standalone/.next/static/{drLMkgfHQ8lzS229_HWYR → Qgr2B_MRhPxC0z8fwv4vT}/_buildManifest.js +0 -0
  572. /package/dist/web/standalone/.next/static/{drLMkgfHQ8lzS229_HWYR → Qgr2B_MRhPxC0z8fwv4vT}/_ssgManifest.js +0 -0
package/README.md CHANGED
@@ -27,36 +27,56 @@ 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.80
30
+ ## What's New in v2.82
31
31
 
32
- ### DB-Authoritative Context
32
+ ### State Reconciliation & Drift Detection (ADR-017)
33
33
 
34
- - **UOK contracts are DB-authoritative** — runtime contract state now flows through the database instead of file-first projections.
35
- - **Auto-run context mode fully wired** — context-mode execution is connected end-to-end for auto runs.
36
- - **Planned slice recovery** — planned slices recover correctly after artifact writes.
34
+ - **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.
35
+ - **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.
36
+ - **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.
37
+ - **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.
38
+ - **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 (a bug in the first cut nested task iteration behind slice completion).
39
+ - **Parallel spawns reconcile before fanning out** — `/gsd parallel start` and slice-parallel-dispatch now run reconciliation at the parent before spawning auto-loop workers, so workers don't independently race on shared drift. Gate failures surface a typed exit reason (`slice-parallel-reconciliation-failed`) and a user-visible message instead of a confused hang.
37
40
 
38
- ### Auto, Deep Mode & Gates
41
+ ### Worktree Lifecycle Refactor (ADR-016 — final phases)
39
42
 
40
- - **Deep queued milestones continue** — deep project milestones can resume through queued work instead of stalling.
41
- - **Deep project registration** — deep project milestones are registered as part of the workflow.
42
- - **Depth-verification gate fixes** — gate workflow regressions were closed, including case-insensitive plan-slice artifact resolution.
43
- - **Task commits bound to milestone completion** — automated task commits now respect the milestone completion guard.
43
+ - **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, and the stop-path routes through `restoreToProjectRoot` instead of ad-hoc cleanup. `mergeMilestoneStandalone` was extracted and `mergeMilestoneToMain` was privatized.
44
+ - **Phase 3 closes strict-closure residuals** — dead defensive `s.basePath = s.originalBasePath` fallbacks were removed from both auto.ts stop-path catch blocks (the verb assigns `basePath` before any throwable work, so the fallback was unreachable). The public `WorktreeLifecycleDeps` interface dropped 15 `@deprecated` optional fields; the active dep bag is now three fields (`gitServiceFactory`, `worktreeProjection`, `mergeMilestoneToMain`). Test fixtures move to a dedicated `WorktreeLifecycleTestOverrides` type.
44
45
 
45
- ### MCP, Post-Exec & Cross-Platform
46
+ ### Auto-Mode Reliability
46
47
 
47
- - **Post-exec import hardening** — explicit extension fallbacks, dotted module stems, React Router `+types`, and `+types` guards are handled more carefully.
48
- - **MCP write gating** — `gsd_exec` writes are gated, with Windows path-separator test coverage tightened.
49
- - **Project saves stay successful** — saving a project no longer fails just because registration fails.
50
- - **Home-directory fallback** — `currentDirectoryRoot` uses `homedir()` fallback behavior for better cross-platform consistency.
48
+ - **`complete-slice` closeout is read-only** — the closeout prompt is no longer allowed to write project files, removing a class of races where closeout edits could fight with the next slice's setup. Write-gate planning and prompt contracts were updated to enforce this.
49
+ - **Verification retries back off properly** — a new `verification-retry-policy.ts` adds bounded exponential backoff and runs stuck detection between attempts, so transient verification failures (slow tools, flaky LLM calls) no longer spin in tight retry loops.
50
+ - **Auto-loop exit paths are journaled end-to-end** — post-unit finalize stops, all unit-end iteration exits, and the run-unit failsafe now journal cleanly. Auto-timeout recovery journaling completes its handoff record. The run-unit failsafe also defers when a recovery is already in flight to avoid double-firing.
51
+ - **Ghost completions and stale telemetry are guarded** — auto-mode no longer stops on ghost completions before a milestone stop has actually fired, and unmerged-exit telemetry is gated on active worktrees so closed sessions don't generate noise.
52
+ - **Session-switch hygiene** — completed-content aborts that fire while the session is switching are ignored instead of being misclassified as user aborts. Auto-commit skips `.gitignore`d task key files so the working tree stays clean across slices.
51
53
 
52
- ### Reliability & Review Hardening
54
+ ### TUI & Operator Experience
53
55
 
54
- - **Auto orchestration seams and contracts** — orchestration boundaries were made more explicit and review feedback was folded in.
55
- - **Cancellation context preserved** — auto-mode pauses keep cancellation context instead of dropping it.
56
- - **Recovery stop lifecycle** — recovery stop now emits the expected lifecycle event.
57
- - **Trace and cleanup fixes** — trace correlation, cleanup-on-throw, audit context reset, and `onTurnResult` phase-result guards were tightened.
56
+ - **Operations console redesign** — the auto-mode dashboard, notification overlay, parallel-monitor overlay, health widget, header renderer, and welcome screen were all rebuilt against a new shared `render-kit`. The result is a more consistent visual language across overlays, with refreshed reference designs (`docs/dev/tui-recommended-design.html`, `tui-render-options.html`) and expanded test coverage for the new components.
57
+ - **Milestone completion rollup** — at the boundary between milestones, auto-mode now renders a `CompletionDashboardSnapshot` summarizing success criteria results, definition-of-done results, requirement outcomes, deviations, follow-ups, key decisions, key files, lessons learned, total cost, total tokens, cache hit rate, and slice progress. You no longer have to scroll back through the transcript to see what a milestone actually delivered.
58
58
 
59
- See the full [Changelog](./CHANGELOG.md) for the complete v2.80 entry and prior releases.
59
+ See the full [Changelog](./CHANGELOG.md) for the complete v2.82 entry and prior releases.
60
+
61
+ <details>
62
+ <summary>v2.81 highlights</summary>
63
+
64
+ - **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.
65
+ - **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.
66
+ - **TUI polish** — compact tool output with targets, refreshed chat/tool cards, adaptive refresher layouts, stable welcome/header lifecycle, and bottom-anchored auto-mode rendering.
67
+ - **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.
68
+
69
+ </details>
70
+
71
+ <details>
72
+ <summary>v2.80 highlights</summary>
73
+
74
+ - **DB-authoritative context** — UOK contracts moved through database-backed runtime state, auto-run context mode was wired end-to-end, and planned slices recover after artifact writes.
75
+ - **Auto, deep mode, and gates** — deep queued milestones continue, deep project milestones register cleanly, depth-verification regressions were closed, and task commits respect the milestone completion guard.
76
+ - **MCP, post-exec, and cross-platform hardening** — post-exec import fallback handling, React Router `+types` imports, `gsd_exec` write gating, project-save behavior, and home-directory fallback behavior were tightened.
77
+ - **Reliability and review hardening** — auto orchestration contracts, cancellation context preservation, recovery stop lifecycle events, trace correlation, cleanup-on-throw, and phase-result guards were improved.
78
+
79
+ </details>
60
80
 
61
81
  <details>
62
82
  <summary>v2.79 highlights</summary>
@@ -96,7 +116,7 @@ See the full [Changelog](./CHANGELOG.md) for the complete v2.80 entry and prior
96
116
 
97
117
  - **Context Mode** — dispatch builds task-ready context automatically (artifacts, prior session, milestone/slice signals, execution metadata); enabled by default for new projects
98
118
  - **Sandboxed execution tools** — `gsd_exec_search`, `gsd_resume`, and sandboxed tool-output paths for context-mode flows
99
- - **Memory architecture (ADR-013)** — `memories` table is now authoritative; `structured_fields` adds typed metadata; dual-write migration landed with decisions backfill
119
+ - **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
100
120
  - **Skill coverage** — 9 gap-closing skills landed plus 6 planning/design skills surfaced
101
121
  - **Hook stack** — Layer 0 shell hooks and additional Layer 2 lifecycle events
102
122
  - **TUI polish** — dedicated chat-frame style for skill invocations; active-row overflow fixes
@@ -316,7 +336,9 @@ Plan (with integrated research) → Execute (per task) → Complete → Reassess
316
336
  Validate Milestone → Complete Milestone
317
337
  ```
318
338
 
319
- **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.
339
+ **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.
340
+
341
+ 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.
320
342
 
321
343
  ### `/gsd auto` — The Main Event
322
344
 
@@ -328,7 +350,9 @@ This is what makes GSD different. Run it, walk away, come back to built software
328
350
 
329
351
  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.
330
352
 
331
- 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.
353
+ 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, project-root DB state remains authoritative and worktree markdown projections are not synced back as state.
354
+
355
+ `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.
332
356
 
333
357
  **What happens under the hood:**
334
358
 
@@ -346,13 +370,13 @@ The database is authoritative for milestones, slices, tasks, requirements, decis
346
370
 
347
371
  7. **Stuck and artifact detection** — A sliding-window detector identifies repeated dispatch patterns (including multi-unit cycles). Missing expected artifacts use a separate bounded path: GSD retries artifact verification up to 3 times with failure context, then pauses auto mode with the missing artifact error instead of looping indefinitely.
348
372
 
349
- 8. **Timeout supervision** — Soft timeout warns the LLM to wrap up. Idle watchdog detects stalls. Hard timeout pauses auto mode. Recovery steering nudges the LLM to finish durable output before giving up.
373
+ 8. **Timeout supervision** — Soft timeout warns the LLM to wrap up. Idle watchdog detects stalls. Hard timeout starts recovery and only pauses auto mode if durable progress cannot be made. Runtime progress is recorded under `.gsd/runtime/`, and journal events close out unit, finalize, and iteration phases for later forensics.
350
374
 
351
375
  9. **Cost tracking** — Every unit's token usage and cost is captured, broken down by phase, slice, and model. The dashboard shows running totals and projections. Budget ceilings can pause auto mode before overspending.
352
376
 
353
377
  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.
354
378
 
355
- 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.
379
+ 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. 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` 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.
356
380
 
357
381
  12. **Milestone validation** — After all slices complete, a `validate-milestone` gate compares roadmap success criteria against actual results before sealing the milestone.
358
382
 
@@ -478,6 +502,7 @@ On first run, GSD launches a branded setup wizard that walks you through LLM pro
478
502
  | `/gsd rethink` | Conversational project reorganization |
479
503
  | `/gsd mcp` | MCP server status and connectivity |
480
504
  | `/gsd status` | Progress dashboard |
505
+ | `/gsd brief <mode>` | Generate a visual HTML brief (diagram, plan, diff, recap, table, slides) |
481
506
  | `/gsd queue` | Queue future milestones (safe during auto mode) |
482
507
  | `/gsd prefs` | Model selection, timeouts, budget ceiling |
483
508
  | `/gsd migrate` | Migrate a v1 `.planning` directory to `.gsd` format |
@@ -522,13 +547,13 @@ Every dispatch is carefully constructed. The LLM never wastes tool calls on orie
522
547
  | `gsd.db` | Authoritative runtime state for hierarchy and completion |
523
548
  | `PROJECT.md` | Living doc — what the project is right now |
524
549
  | `REQUIREMENTS.md` | Project-level capability contract and out-of-scope list |
525
- | `DECISIONS.md` | Append-only register of architectural decisions |
526
- | `KNOWLEDGE.md` | Cross-session rules, patterns, and lessons learned |
550
+ | `DECISIONS.md` | Projected register of memory-backed architectural decisions |
551
+ | `KNOWLEDGE.md` | Hybrid knowledge projection: manual Rules plus memory-backed Patterns/Lessons |
527
552
  | `RUNTIME.md` | Runtime context — API endpoints, env vars, services (v2.39) |
528
553
  | `runtime/research-decision.json` | Deep-mode marker for project research vs skip |
529
554
  | `research/*.md` | Optional deep-mode project research: stack, features, architecture, pitfalls |
530
555
  | `STATE.md` | Quick-glance dashboard rendered from the database |
531
- | `M001-ROADMAP.md` | Milestone plan with slice checkboxes, risk levels, dependencies |
556
+ | `M001-ROADMAP.md` | Milestone plan with slice checkboxes, risk levels, dependencies, and `` `[sketch]` `` badges for slices awaiting `refine-slice` |
532
557
  | `M001-CONTEXT.md` | User decisions from the discuss phase |
533
558
  | `M001-RESEARCH.md` | Codebase and ecosystem research |
534
559
  | `S01-PLAN.md` | Slice task decomposition with must-haves |
@@ -565,6 +590,12 @@ Every task has must-haves — mechanically checkable outcomes:
565
590
 
566
591
  The verification ladder: static checks → command execution → behavioral testing → human review (only when the agent genuinely can't verify itself).
567
592
 
593
+ ### Project Knowledge
594
+
595
+ `.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.
596
+
597
+ 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.
598
+
568
599
  ### Dashboard
569
600
 
570
601
  `Ctrl+Alt+G` or `/gsd status` opens a real-time overlay showing:
@@ -738,7 +769,7 @@ The best practice for working in teams is to ensure unique milestone names acros
738
769
  .gsd/metrics.json
739
770
  # Raw JSONL session dumps — crash recovery forensics, auto-pruned
740
771
  .gsd/activity/
741
- # Unit execution records — dispatch phase, timeouts, and recovery tracking
772
+ # Unit execution records — dispatch phase, timeout recovery progress, and finalize tracking
742
773
  .gsd/runtime/
743
774
  # Git worktree working copies
744
775
  .gsd/worktrees/
@@ -746,7 +777,7 @@ The best practice for working in teams is to ensure unique milestone names acros
746
777
  .gsd/parallel/
747
778
  # SQLite database and WAL sidecars — authoritative runtime state, local only
748
779
  .gsd/gsd.db*
749
- # Daily-rotated event journal — structured event log for forensics
780
+ # Daily-rotated event journal — structured unit/finalize/iteration event log for forensics
750
781
  .gsd/journal/
751
782
  # Doctor run history — diagnostic check results
752
783
  .gsd/doctor-history.jsonl
@@ -809,7 +840,7 @@ gsd (CLI binary)
809
840
  - **`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.
810
841
  - **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.
811
842
  - **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.
812
- - **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.
843
+ - **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.
813
844
 
814
845
  ---
815
846
 
@@ -1 +1 @@
1
- 195cc0a83851a027
1
+ 0829fe9060dc3f75
@@ -560,7 +560,7 @@ In all modes, slices and tasks commit sequentially on the active branch; there a
560
560
 
561
561
  1. **Milestone starts** → capture the current integration branch.
562
562
  2. **Optional isolation** → create `milestone/M001` only when `git.isolation` is `worktree` or `branch`.
563
- 3. **Per-task commits** — atomic, descriptive, bisectable.
563
+ 3. **Per-task commits** — atomic, descriptive, bisectable, and published only after execute-task verification passes.
564
564
  4. **Slice completes** → write slice summary, UAT script, roadmap checkbox, and milestone summary.
565
565
  5. **Milestone completes** → if isolated, squash-merge the milestone branch back to the captured integration branch and clean up the worktree/branch.
566
566
 
@@ -574,6 +574,8 @@ fix: handle empty state rebuild
574
574
 
575
575
  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
576
 
577
+ 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.
578
+
577
579
  ### Commit Conventions
578
580
 
579
581
  | 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." }),
@@ -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);
@@ -287,6 +287,13 @@ export async function autoLoop(ctx, pi, s, deps, options) {
287
287
  }
288
288
  let dispatchId = null;
289
289
  let dispatchSettled = false;
290
+ let iterationEndEmitted = false;
291
+ const emitIterationEnd = (details = {}) => {
292
+ if (iterationEndEmitted)
293
+ return;
294
+ iterationEndEmitted = true;
295
+ journalReporter.emit("iteration-end", { iteration, ...details });
296
+ };
290
297
  const completeIteration = () => {
291
298
  completeWorkflowIteration({
292
299
  get consecutiveErrors() { return consecutiveErrors; },
@@ -295,11 +302,15 @@ export async function autoLoop(ctx, pi, s, deps, options) {
295
302
  set consecutiveCooldowns(value) { consecutiveCooldowns = value; },
296
303
  recentErrorMessages,
297
304
  }, {
298
- emitIterationEnd: () => journalReporter.emit("iteration-end", { iteration }),
305
+ emitIterationEnd: () => emitIterationEnd(),
299
306
  saveStuckState: () => saveStuckState(s, loopState),
300
307
  logIterationComplete: () => debugLog("autoLoop", { phase: "iteration-complete", iteration }),
301
308
  });
302
309
  };
310
+ const finishIncompleteIteration = (details) => {
311
+ emitIterationEnd(details);
312
+ saveStuckState(s, loopState);
313
+ };
303
314
  try {
304
315
  // ── Blanket try/catch: one bad iteration must not kill the session
305
316
  const prefs = deps.loadEffectiveGSDPreferences()?.preferences;
@@ -373,6 +384,7 @@ export async function autoLoop(ctx, pi, s, deps, options) {
373
384
  });
374
385
  if (engineState.isComplete) {
375
386
  finishTurn("completed");
387
+ emitIterationEnd({ status: "completed", reason: "custom-engine-complete" });
376
388
  await deps.stopAuto(ctx, pi, "Workflow complete");
377
389
  break;
378
390
  }
@@ -389,15 +401,22 @@ export async function autoLoop(ctx, pi, s, deps, options) {
389
401
  });
390
402
  if (dispatchFlow.action === "break") {
391
403
  finishTurn("stopped", "manual-attention", "custom-engine-dispatch-stop");
404
+ finishIncompleteIteration({
405
+ status: "stopped",
406
+ reason: "custom-engine-dispatch-stop",
407
+ failureClass: "manual-attention",
408
+ });
392
409
  break;
393
410
  }
394
411
  if (dispatchFlow.action === "continue") {
395
412
  finishTurn("skipped");
413
+ emitIterationEnd({ status: "skipped", reason: "custom-engine-dispatch-skip" });
396
414
  continue;
397
415
  }
398
416
  // dispatch.action === "dispatch"
399
417
  if (dispatch.action !== "dispatch") {
400
418
  finishTurn("skipped");
419
+ emitIterationEnd({ status: "skipped", reason: "custom-engine-dispatch-mismatch" });
401
420
  continue;
402
421
  }
403
422
  const step = dispatch.step;
@@ -424,6 +443,13 @@ export async function autoLoop(ctx, pi, s, deps, options) {
424
443
  });
425
444
  if (guardsResult.action === "break") {
426
445
  finishTurn("stopped", "manual-attention", "guard-break");
446
+ finishIncompleteIteration({
447
+ status: "stopped",
448
+ reason: "guard-break",
449
+ unitType: iterData.unitType,
450
+ unitId: iterData.unitId,
451
+ failureClass: "manual-attention",
452
+ });
427
453
  break;
428
454
  }
429
455
  // ── Unit execution (shared with dev path) ──
@@ -449,6 +475,13 @@ export async function autoLoop(ctx, pi, s, deps, options) {
449
475
  unitId: iterData.unitId,
450
476
  });
451
477
  if (unitPhaseResult.action === "break") {
478
+ finishIncompleteIteration({
479
+ status: "stopped",
480
+ reason: unitPhaseResult.reason ?? "unit-break",
481
+ unitType: iterData.unitType,
482
+ unitId: iterData.unitId,
483
+ failureClass: "execution",
484
+ });
452
485
  finishTurn("stopped", "execution", "unit-break");
453
486
  break;
454
487
  }
@@ -466,8 +499,16 @@ export async function autoLoop(ctx, pi, s, deps, options) {
466
499
  finishTurn,
467
500
  },
468
501
  });
469
- if (verifyFlow.action === "break")
502
+ if (verifyFlow.action === "break") {
503
+ finishIncompleteIteration({
504
+ status: "paused",
505
+ reason: "custom-engine-verify-pause",
506
+ unitType: iterData.unitType,
507
+ unitId: iterData.unitId,
508
+ failureClass: "manual-attention",
509
+ });
470
510
  break;
511
+ }
471
512
  }
472
513
  if (verifyResult === "retry") {
473
514
  const retryOutcome = await handleCustomEngineVerifyRetry({
@@ -501,8 +542,22 @@ export async function autoLoop(ctx, pi, s, deps, options) {
501
542
  finishTurn,
502
543
  },
503
544
  });
504
- if (retryFlow.action === "break")
545
+ if (retryFlow.action === "break") {
546
+ finishIncompleteIteration({
547
+ status: retryOutcome.action === "stop" ? "stopped" : "paused",
548
+ reason: retryOutcome.action === "retry" ? "custom-engine-verify-retry" : retryOutcome.turnError,
549
+ unitType: iterData.unitType,
550
+ unitId: iterData.unitId,
551
+ failureClass: "manual-attention",
552
+ });
505
553
  break;
554
+ }
555
+ finishIncompleteIteration({
556
+ status: "retry",
557
+ reason: "custom-engine-verify-retry",
558
+ unitType: iterData.unitType,
559
+ unitId: iterData.unitId,
560
+ });
506
561
  continue;
507
562
  }
508
563
  // Verification passed — mark step complete
@@ -694,16 +749,36 @@ export async function autoLoop(ctx, pi, s, deps, options) {
694
749
  markFailed: markDispatchFailed,
695
750
  logWriteFailure: logDispatchLedgerWriteFailure,
696
751
  }) || dispatchSettled;
752
+ finishIncompleteIteration({
753
+ status: "stopped",
754
+ reason: unitPhaseResult.reason ?? "unit-break",
755
+ unitType: iterData.unitType,
756
+ unitId: iterData.unitId,
757
+ failureClass: "execution",
758
+ });
697
759
  finishTurn("stopped", "execution", "unit-break");
698
760
  break;
699
761
  }
700
762
  // ── Phase 5: Finalize ───────────────────────────────────────────────
701
763
  let finalizeResult;
764
+ journalReporter.emit("post-unit-finalize-start", {
765
+ iteration,
766
+ unitType: iterData.unitType,
767
+ unitId: iterData.unitId,
768
+ });
702
769
  try {
703
770
  finalizeResult = await runFinalize(ic, iterData, loopState, sidecarItem);
704
771
  }
705
772
  catch (err) {
706
- dispatchSettled = settleDispatchFailed(dispatchId, formatDispatchExceptionSummary({ error: err }), {
773
+ const error = formatDispatchExceptionSummary({ error: err });
774
+ journalReporter.emit("post-unit-finalize-end", {
775
+ iteration,
776
+ unitType: iterData.unitType,
777
+ unitId: iterData.unitId,
778
+ status: "failed",
779
+ error,
780
+ });
781
+ dispatchSettled = settleDispatchFailed(dispatchId, error, {
707
782
  markFailed: markDispatchFailed,
708
783
  logWriteFailure: logDispatchLedgerWriteFailure,
709
784
  }) || dispatchSettled;
@@ -713,6 +788,15 @@ export async function autoLoop(ctx, pi, s, deps, options) {
713
788
  unitType: iterData.unitType,
714
789
  unitId: iterData.unitId,
715
790
  });
791
+ const finalizeReason = finalizeResult.action === "break" ? finalizeResult.reason : undefined;
792
+ journalReporter.emit("post-unit-finalize-end", {
793
+ iteration,
794
+ unitType: iterData.unitType,
795
+ unitId: iterData.unitId,
796
+ status: finalizeResult.action === "next" ? "completed" : finalizeResult.action === "continue" ? "retry" : "stopped",
797
+ action: finalizeResult.action,
798
+ ...(finalizeReason ? { reason: finalizeReason } : {}),
799
+ });
716
800
  const finalizeDecision = decideFinalizeResult(finalizeResult.action === "break"
717
801
  ? { action: "break", reason: finalizeResult.reason }
718
802
  : finalizeResult.action === "continue"
@@ -723,6 +807,13 @@ export async function autoLoop(ctx, pi, s, deps, options) {
723
807
  markFailed: markDispatchFailed,
724
808
  logWriteFailure: logDispatchLedgerWriteFailure,
725
809
  }) || dispatchSettled;
810
+ finishIncompleteIteration({
811
+ status: "stopped",
812
+ reason: finalizeReason ?? "finalize-break",
813
+ unitType: iterData.unitType,
814
+ unitId: iterData.unitId,
815
+ failureClass: finalizeDecision.failureClass,
816
+ });
726
817
  finishTurn("stopped", finalizeDecision.failureClass, finalizeDecision.turnError);
727
818
  break;
728
819
  }
@@ -731,6 +822,12 @@ export async function autoLoop(ctx, pi, s, deps, options) {
731
822
  markFailed: markDispatchFailed,
732
823
  logWriteFailure: logDispatchLedgerWriteFailure,
733
824
  }) || dispatchSettled;
825
+ finishIncompleteIteration({
826
+ status: "retry",
827
+ reason: "finalize-retry",
828
+ unitType: iterData.unitType,
829
+ unitId: iterData.unitId,
830
+ });
734
831
  finishTurn("retry");
735
832
  continue;
736
833
  }
@@ -750,10 +847,6 @@ export async function autoLoop(ctx, pi, s, deps, options) {
750
847
  logWriteFailure: logDispatchLedgerWriteFailure,
751
848
  }) || dispatchSettled;
752
849
  }
753
- // Always emit iteration-end on error so the journal records iteration
754
- // completion even on failure (#2344). Without this, errors in
755
- // runFinalize leave the journal incomplete, making diagnosis harder.
756
- journalReporter.emit("iteration-end", { iteration, error: msg });
757
850
  // ── Pre-send model-policy block: not a retryable error (#4959 / #4850) ──
758
851
  // The model-policy gate runs before the prompt is sent. When every
759
852
  // candidate model is denied (cross-provider disabled + flat-rate
@@ -778,6 +871,12 @@ export async function autoLoop(ctx, pi, s, deps, options) {
778
871
  });
779
872
  ctx.ui.notify(policyDecision.notifyMessage, "error");
780
873
  journalReporter.emit("unit-end", policyDecision.journalData);
874
+ finishIncompleteIteration({
875
+ status: "blocked",
876
+ reason: "model-policy-dispatch-blocked",
877
+ unitType: loopErr.unitType,
878
+ unitId: loopErr.unitId,
879
+ });
781
880
  // Carry the blocked unit identity into the turn-result observer:
782
881
  // the throw originated inside dispatch, so observedUnitType/Id were
783
882
  // not assigned by the success path at lines 453/631/647 — but the
@@ -790,6 +889,10 @@ export async function autoLoop(ctx, pi, s, deps, options) {
790
889
  // not a transient runtime fault.
791
890
  break;
792
891
  }
892
+ // Always emit iteration-end on error so the journal records iteration
893
+ // completion even on failure (#2344). Without this, errors in
894
+ // runFinalize leave the journal incomplete, making diagnosis harder.
895
+ finishIncompleteIteration({ status: "failed", error: msg });
793
896
  // ── Infrastructure errors: immediate stop, no retry ──
794
897
  // These are unrecoverable (disk full, OOM, etc.). Retrying just burns
795
898
  // LLM budget on guaranteed failures.