gsd-pi 2.81.0 → 2.82.0

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 (290) hide show
  1. package/README.md +36 -24
  2. package/dist/resources/.managed-resources-content-hash +1 -1
  3. package/dist/resources/extensions/gsd/auto/loop.js +111 -8
  4. package/dist/resources/extensions/gsd/auto/phases.js +190 -97
  5. package/dist/resources/extensions/gsd/auto/run-unit.js +66 -3
  6. package/dist/resources/extensions/gsd/auto/session.js +9 -0
  7. package/dist/resources/extensions/gsd/auto/verification-retry-policy.js +43 -0
  8. package/dist/resources/extensions/gsd/auto-dashboard.js +182 -178
  9. package/dist/resources/extensions/gsd/auto-dispatch.js +14 -11
  10. package/dist/resources/extensions/gsd/auto-post-unit.js +7 -1
  11. package/dist/resources/extensions/gsd/auto-recovery.js +6 -181
  12. package/dist/resources/extensions/gsd/auto-runtime-state.js +5 -0
  13. package/dist/resources/extensions/gsd/auto-start.js +20 -23
  14. package/dist/resources/extensions/gsd/auto-unit-closeout.js +33 -5
  15. package/dist/resources/extensions/gsd/auto-verification.js +12 -6
  16. package/dist/resources/extensions/gsd/auto-worktree.js +8 -0
  17. package/dist/resources/extensions/gsd/auto.js +265 -76
  18. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +13 -6
  19. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +8 -2
  20. package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +4 -8
  21. package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +4 -10
  22. package/dist/resources/extensions/gsd/commands/handlers/parallel.js +9 -0
  23. package/dist/resources/extensions/gsd/git-service.js +2 -1
  24. package/dist/resources/extensions/gsd/gsd-db.js +7 -23
  25. package/dist/resources/extensions/gsd/health-widget-core.js +1 -1
  26. package/dist/resources/extensions/gsd/health-widget.js +4 -10
  27. package/dist/resources/extensions/gsd/markdown-renderer.js +0 -95
  28. package/dist/resources/extensions/gsd/native-git-bridge.js +14 -14
  29. package/dist/resources/extensions/gsd/notification-overlay.js +35 -40
  30. package/dist/resources/extensions/gsd/parallel-merge.js +53 -30
  31. package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +25 -33
  32. package/dist/resources/extensions/gsd/prompts/complete-slice.md +14 -12
  33. package/dist/resources/extensions/gsd/prompts/discuss-headless.md +20 -2
  34. package/dist/resources/extensions/gsd/prompts/discuss.md +20 -2
  35. package/dist/resources/extensions/gsd/recovery-classification.js +15 -1
  36. package/dist/resources/extensions/gsd/session-lock.js +40 -0
  37. package/dist/resources/extensions/gsd/state-reconciliation/drift/completion.js +131 -0
  38. package/dist/resources/extensions/gsd/state-reconciliation/drift/merge-state.js +247 -0
  39. package/dist/resources/extensions/gsd/state-reconciliation/drift/project-md.js +50 -0
  40. package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +87 -0
  41. package/dist/resources/extensions/gsd/state-reconciliation/drift/sketch-flag.js +50 -0
  42. package/dist/resources/extensions/gsd/state-reconciliation/drift/stale-render.js +124 -0
  43. package/dist/resources/extensions/gsd/state-reconciliation/drift/stale-worker.js +32 -0
  44. package/dist/resources/extensions/gsd/state-reconciliation/errors.js +41 -0
  45. package/dist/resources/extensions/gsd/state-reconciliation/index.js +99 -0
  46. package/dist/resources/extensions/gsd/state-reconciliation/registry.js +24 -0
  47. package/dist/resources/extensions/gsd/state-reconciliation/spawn-gate.js +43 -0
  48. package/dist/resources/extensions/gsd/state-reconciliation/types.js +3 -0
  49. package/dist/resources/extensions/gsd/state-reconciliation.js +5 -26
  50. package/dist/resources/extensions/gsd/tui/render-kit.js +74 -0
  51. package/dist/resources/extensions/gsd/watch/header-renderer.js +92 -69
  52. package/dist/resources/extensions/gsd/watch/splash-palette.js +10 -0
  53. package/dist/resources/extensions/gsd/workflow-mcp.js +2 -2
  54. package/dist/resources/extensions/gsd/worktree-lifecycle.js +722 -316
  55. package/dist/resources/extensions/gsd/worktree-telemetry.js +3 -1
  56. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  57. package/dist/web/standalone/.next/BUILD_ID +1 -1
  58. package/dist/web/standalone/.next/app-path-routes-manifest.json +9 -9
  59. package/dist/web/standalone/.next/build-manifest.json +2 -2
  60. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  61. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  62. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  63. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  64. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  65. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  66. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  67. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  68. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  69. package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
  70. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  71. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  72. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  73. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  74. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  75. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  76. package/dist/web/standalone/.next/server/app/index.html +1 -1
  77. package/dist/web/standalone/.next/server/app/index.rsc +1 -1
  78. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  79. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
  80. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  81. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  82. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  83. package/dist/web/standalone/.next/server/app-paths-manifest.json +9 -9
  84. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  85. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  86. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  87. package/dist/welcome-screen.d.ts +0 -7
  88. package/dist/welcome-screen.js +60 -69
  89. package/package.json +1 -1
  90. package/packages/daemon/package.json +2 -2
  91. package/packages/mcp-server/package.json +2 -2
  92. package/packages/native/package.json +1 -1
  93. package/packages/pi-agent-core/package.json +1 -1
  94. package/packages/pi-ai/package.json +1 -1
  95. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.d.ts +2 -0
  96. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.d.ts.map +1 -0
  97. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.js +47 -0
  98. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.js.map +1 -0
  99. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +76 -9
  100. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
  101. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.d.ts +2 -0
  102. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.d.ts.map +1 -0
  103. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.js +40 -0
  104. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.js.map +1 -0
  105. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts +0 -1
  106. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts.map +1 -1
  107. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js +30 -29
  108. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -1
  109. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js +10 -3
  110. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js.map +1 -1
  111. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  112. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +13 -13
  113. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
  114. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +1 -3
  115. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  116. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +58 -3
  117. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
  118. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts +2 -2
  119. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -1
  120. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js +12 -6
  121. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js.map +1 -1
  122. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
  123. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +14 -41
  124. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
  125. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +0 -1
  126. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  127. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +86 -82
  128. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  129. package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.d.ts +35 -0
  130. package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.d.ts.map +1 -0
  131. package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.js +152 -0
  132. package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.js.map +1 -0
  133. package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.d.ts +16 -0
  134. package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.d.ts.map +1 -0
  135. package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.js +73 -0
  136. package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.js.map +1 -0
  137. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts +1 -1
  138. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  139. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js +12 -8
  140. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
  141. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.d.ts +2 -0
  142. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.d.ts.map +1 -0
  143. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.js +17 -0
  144. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.js.map +1 -0
  145. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  146. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +105 -1
  147. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  148. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  149. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +27 -26
  150. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
  151. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +9 -6
  152. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -1
  153. package/packages/pi-coding-agent/package.json +1 -1
  154. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/assistant-message-design.test.ts +56 -0
  155. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +113 -9
  156. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/user-message-design.test.ts +48 -0
  157. package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.test.ts +10 -3
  158. package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +43 -42
  159. package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +14 -14
  160. package/packages/pi-coding-agent/src/modes/interactive/components/bash-execution.ts +64 -3
  161. package/packages/pi-coding-agent/src/modes/interactive/components/diff.ts +13 -7
  162. package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +15 -42
  163. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +84 -104
  164. package/packages/pi-coding-agent/src/modes/interactive/components/transcript-design.ts +196 -0
  165. package/packages/pi-coding-agent/src/modes/interactive/components/tui-style-kit.ts +94 -0
  166. package/packages/pi-coding-agent/src/modes/interactive/components/user-message.ts +14 -9
  167. package/packages/pi-coding-agent/src/modes/interactive/theme/theme-highlight.test.ts +23 -0
  168. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +106 -1
  169. package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +27 -26
  170. package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +9 -6
  171. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
  172. package/packages/pi-tui/dist/__tests__/overlay-layout.test.js +14 -1
  173. package/packages/pi-tui/dist/__tests__/overlay-layout.test.js.map +1 -1
  174. package/packages/pi-tui/dist/overlay-layout.d.ts.map +1 -1
  175. package/packages/pi-tui/dist/overlay-layout.js +9 -6
  176. package/packages/pi-tui/dist/overlay-layout.js.map +1 -1
  177. package/packages/pi-tui/package.json +1 -1
  178. package/packages/pi-tui/src/__tests__/overlay-layout.test.ts +20 -1
  179. package/packages/pi-tui/src/overlay-layout.ts +10 -7
  180. package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
  181. package/packages/rpc-client/package.json +1 -1
  182. package/pkg/dist/modes/interactive/theme/theme-highlight.test.d.ts +2 -0
  183. package/pkg/dist/modes/interactive/theme/theme-highlight.test.d.ts.map +1 -0
  184. package/pkg/dist/modes/interactive/theme/theme-highlight.test.js +17 -0
  185. package/pkg/dist/modes/interactive/theme/theme-highlight.test.js.map +1 -0
  186. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  187. package/pkg/dist/modes/interactive/theme/theme.js +105 -1
  188. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  189. package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  190. package/pkg/dist/modes/interactive/theme/themes.js +27 -26
  191. package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
  192. package/pkg/package.json +1 -1
  193. package/src/resources/extensions/gsd/auto/loop-deps.ts +9 -5
  194. package/src/resources/extensions/gsd/auto/loop.ts +113 -9
  195. package/src/resources/extensions/gsd/auto/phases.ts +144 -19
  196. package/src/resources/extensions/gsd/auto/run-unit.ts +69 -4
  197. package/src/resources/extensions/gsd/auto/session.ts +10 -0
  198. package/src/resources/extensions/gsd/auto/verification-retry-policy.ts +82 -0
  199. package/src/resources/extensions/gsd/auto-dashboard.ts +230 -183
  200. package/src/resources/extensions/gsd/auto-dispatch.ts +15 -1
  201. package/src/resources/extensions/gsd/auto-post-unit.ts +7 -1
  202. package/src/resources/extensions/gsd/auto-recovery.ts +7 -209
  203. package/src/resources/extensions/gsd/auto-runtime-state.ts +5 -0
  204. package/src/resources/extensions/gsd/auto-start.ts +22 -22
  205. package/src/resources/extensions/gsd/auto-unit-closeout.ts +51 -0
  206. package/src/resources/extensions/gsd/auto-verification.ts +12 -6
  207. package/src/resources/extensions/gsd/auto-worktree.ts +8 -0
  208. package/src/resources/extensions/gsd/auto.ts +295 -75
  209. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +21 -6
  210. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +6 -2
  211. package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +5 -8
  212. package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +4 -10
  213. package/src/resources/extensions/gsd/commands/handlers/parallel.ts +12 -0
  214. package/src/resources/extensions/gsd/git-service.ts +2 -0
  215. package/src/resources/extensions/gsd/gsd-db.ts +7 -23
  216. package/src/resources/extensions/gsd/health-widget-core.ts +1 -1
  217. package/src/resources/extensions/gsd/health-widget.ts +6 -10
  218. package/src/resources/extensions/gsd/journal.ts +2 -0
  219. package/src/resources/extensions/gsd/markdown-renderer.ts +4 -95
  220. package/src/resources/extensions/gsd/native-git-bridge.ts +14 -13
  221. package/src/resources/extensions/gsd/notification-overlay.ts +50 -46
  222. package/src/resources/extensions/gsd/parallel-merge.ts +61 -34
  223. package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +33 -35
  224. package/src/resources/extensions/gsd/prompts/complete-slice.md +14 -12
  225. package/src/resources/extensions/gsd/prompts/discuss-headless.md +20 -2
  226. package/src/resources/extensions/gsd/prompts/discuss.md +20 -2
  227. package/src/resources/extensions/gsd/recovery-classification.ts +18 -1
  228. package/src/resources/extensions/gsd/session-lock.ts +41 -0
  229. package/src/resources/extensions/gsd/state-reconciliation/drift/completion.ts +172 -0
  230. package/src/resources/extensions/gsd/state-reconciliation/drift/merge-state.ts +337 -0
  231. package/src/resources/extensions/gsd/state-reconciliation/drift/project-md.ts +69 -0
  232. package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +109 -0
  233. package/src/resources/extensions/gsd/state-reconciliation/drift/sketch-flag.ts +68 -0
  234. package/src/resources/extensions/gsd/state-reconciliation/drift/stale-render.ts +185 -0
  235. package/src/resources/extensions/gsd/state-reconciliation/drift/stale-worker.ts +46 -0
  236. package/src/resources/extensions/gsd/state-reconciliation/errors.ts +67 -0
  237. package/src/resources/extensions/gsd/state-reconciliation/index.ts +142 -0
  238. package/src/resources/extensions/gsd/state-reconciliation/registry.ts +27 -0
  239. package/src/resources/extensions/gsd/state-reconciliation/spawn-gate.ts +60 -0
  240. package/src/resources/extensions/gsd/state-reconciliation/types.ts +83 -0
  241. package/src/resources/extensions/gsd/state-reconciliation.ts +21 -53
  242. package/src/resources/extensions/gsd/tests/artifact-retry-cap.test.ts +1 -1
  243. package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +99 -0
  244. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +654 -176
  245. package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +291 -4
  246. package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +16 -1
  247. package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +18 -0
  248. package/src/resources/extensions/gsd/tests/auto-unit-closeout.test.ts +68 -0
  249. package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +28 -1
  250. package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +20 -2
  251. package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +44 -0
  252. package/src/resources/extensions/gsd/tests/header-renderer.test.ts +40 -0
  253. package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +10 -0
  254. package/src/resources/extensions/gsd/tests/health-widget.test.ts +14 -4
  255. package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +26 -0
  256. package/src/resources/extensions/gsd/tests/integration/integration-proof.test.ts +1 -1
  257. package/src/resources/extensions/gsd/tests/integration/parallel-merge.test.ts +116 -24
  258. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +0 -1
  259. package/src/resources/extensions/gsd/tests/markdown-renderer.test.ts +1 -1
  260. package/src/resources/extensions/gsd/tests/merge-conflict-stops-loop.test.ts +46 -11
  261. package/src/resources/extensions/gsd/tests/notification-overlay.test.ts +78 -41
  262. package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +44 -0
  263. package/src/resources/extensions/gsd/tests/originalbase-path-comparison.test.ts +12 -217
  264. package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +38 -6
  265. package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +2 -2
  266. package/src/resources/extensions/gsd/tests/progressive-planning.test.ts +1 -1
  267. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +24 -1
  268. package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +7 -3
  269. package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +6 -3
  270. package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +24 -0
  271. package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +65 -58
  272. package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +952 -0
  273. package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +4 -0
  274. package/src/resources/extensions/gsd/tests/tui-header-lifecycle.test.ts +121 -1
  275. package/src/resources/extensions/gsd/tests/tui-render-kit.test.ts +66 -0
  276. package/src/resources/extensions/gsd/tests/verification-retry-policy.test.ts +83 -0
  277. package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +6 -0
  278. package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +158 -58
  279. package/src/resources/extensions/gsd/tests/worktree-lifecycle.test.ts +572 -118
  280. package/src/resources/extensions/gsd/tests/worktree-telemetry.test.ts +59 -2
  281. package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +18 -0
  282. package/src/resources/extensions/gsd/tui/render-kit.ts +109 -0
  283. package/src/resources/extensions/gsd/watch/header-renderer.ts +121 -79
  284. package/src/resources/extensions/gsd/watch/splash-palette.ts +11 -0
  285. package/src/resources/extensions/gsd/workflow-mcp.ts +2 -2
  286. package/src/resources/extensions/gsd/worktree-lifecycle.ts +1151 -524
  287. package/src/resources/extensions/gsd/worktree-telemetry.ts +7 -2
  288. package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +0 -1544
  289. /package/dist/web/standalone/.next/static/{drLMkgfHQ8lzS229_HWYR → S44UQTFCUdA44dkjfYt6S}/_buildManifest.js +0 -0
  290. /package/dist/web/standalone/.next/static/{drLMkgfHQ8lzS229_HWYR → S44UQTFCUdA44dkjfYt6S}/_ssgManifest.js +0 -0
package/README.md CHANGED
@@ -27,36 +27,48 @@ 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.81
31
31
 
32
- ### DB-Authoritative Context
32
+ ### Worktree Safety & Projection
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
+ - **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.
37
39
 
38
- ### Auto, Deep Mode & Gates
40
+ ### Memory, Context & Token Control
39
41
 
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.
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.
44
48
 
45
- ### MCP, Post-Exec & Cross-Platform
49
+ ### TUI & Operator Experience
46
50
 
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.
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.
51
54
 
52
- ### Reliability & Review Hardening
55
+ ### Reliability, Tests & CI
53
56
 
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.
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.
58
60
 
59
- See the full [Changelog](./CHANGELOG.md) for the complete v2.80 entry and prior releases.
61
+ See the full [Changelog](./CHANGELOG.md) for the complete v2.81 entry and prior releases.
62
+
63
+ <details>
64
+ <summary>v2.80 highlights</summary>
65
+
66
+ - **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.
67
+ - **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.
68
+ - **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.
69
+ - **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.
70
+
71
+ </details>
60
72
 
61
73
  <details>
62
74
  <summary>v2.79 highlights</summary>
@@ -346,7 +358,7 @@ The database is authoritative for milestones, slices, tasks, requirements, decis
346
358
 
347
359
  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
360
 
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.
361
+ 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
362
 
351
363
  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
364
 
@@ -738,7 +750,7 @@ The best practice for working in teams is to ensure unique milestone names acros
738
750
  .gsd/metrics.json
739
751
  # Raw JSONL session dumps — crash recovery forensics, auto-pruned
740
752
  .gsd/activity/
741
- # Unit execution records — dispatch phase, timeouts, and recovery tracking
753
+ # Unit execution records — dispatch phase, timeout recovery progress, and finalize tracking
742
754
  .gsd/runtime/
743
755
  # Git worktree working copies
744
756
  .gsd/worktrees/
@@ -746,7 +758,7 @@ The best practice for working in teams is to ensure unique milestone names acros
746
758
  .gsd/parallel/
747
759
  # SQLite database and WAL sidecars — authoritative runtime state, local only
748
760
  .gsd/gsd.db*
749
- # Daily-rotated event journal — structured event log for forensics
761
+ # Daily-rotated event journal — structured unit/finalize/iteration event log for forensics
750
762
  .gsd/journal/
751
763
  # Doctor run history — diagnostic check results
752
764
  .gsd/doctor-history.jsonl
@@ -1 +1 @@
1
- 195cc0a83851a027
1
+ cec78fe13fe69412
@@ -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.