gsd-pi 2.79.0-dev.ece5fd8ba → 2.80.0-dev.710c06e97

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 (644) hide show
  1. package/dist/resources/.managed-resources-content-hash +1 -1
  2. package/dist/resources/extensions/github-sync/templates.js +90 -74
  3. package/dist/resources/extensions/gsd/auto/contracts.js +1 -0
  4. package/dist/resources/extensions/gsd/auto/custom-verify-retry-store.js +53 -0
  5. package/dist/resources/extensions/gsd/auto/loop.js +365 -522
  6. package/dist/resources/extensions/gsd/auto/orchestrator.js +146 -0
  7. package/dist/resources/extensions/gsd/auto/phases.js +55 -6
  8. package/dist/resources/extensions/gsd/auto/run-unit.js +19 -15
  9. package/dist/resources/extensions/gsd/auto/session.js +8 -0
  10. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-dispatch-outcome.js +12 -0
  11. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-iteration.js +24 -0
  12. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-reconcile-outcome.js +33 -0
  13. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-reconcile.js +26 -0
  14. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-retry.js +49 -0
  15. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-verify-outcome.js +25 -0
  16. package/dist/resources/extensions/gsd/auto/workflow-dispatch-claim.js +48 -0
  17. package/dist/resources/extensions/gsd/auto/workflow-dispatch-ledger.js +26 -0
  18. package/dist/resources/extensions/gsd/auto/workflow-iteration-completion.js +10 -0
  19. package/dist/resources/extensions/gsd/auto/workflow-journal-reporter.js +16 -0
  20. package/dist/resources/extensions/gsd/auto/workflow-kernel.js +263 -0
  21. package/dist/resources/extensions/gsd/auto/workflow-memory-pressure.js +36 -0
  22. package/dist/resources/extensions/gsd/auto/workflow-phase-reporter.js +9 -0
  23. package/dist/resources/extensions/gsd/auto/workflow-session-lock.js +35 -0
  24. package/dist/resources/extensions/gsd/auto/workflow-sidecar-iteration.js +24 -0
  25. package/dist/resources/extensions/gsd/auto/workflow-sidecar-queue.js +26 -0
  26. package/dist/resources/extensions/gsd/auto/workflow-turn-reporter.js +36 -0
  27. package/dist/resources/extensions/gsd/auto/workflow-unit-dispatch.js +44 -0
  28. package/dist/resources/extensions/gsd/auto/workflow-worker-heartbeat.js +15 -0
  29. package/dist/resources/extensions/gsd/auto-dashboard.js +54 -15
  30. package/dist/resources/extensions/gsd/auto-prompts.js +168 -3
  31. package/dist/resources/extensions/gsd/auto-recovery.js +72 -55
  32. package/dist/resources/extensions/gsd/auto-runtime-state.js +4 -0
  33. package/dist/resources/extensions/gsd/auto-verification.js +2 -11
  34. package/dist/resources/extensions/gsd/auto-worktree.js +87 -38
  35. package/dist/resources/extensions/gsd/auto.js +159 -2
  36. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +24 -2
  37. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +10 -0
  38. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +22 -6
  39. package/dist/resources/extensions/gsd/bootstrap/write-gate.js +129 -1
  40. package/dist/resources/extensions/gsd/commands-ship.js +23 -46
  41. package/dist/resources/extensions/gsd/commands-workflow-templates.js +12 -7
  42. package/dist/resources/extensions/gsd/component-loader.js +5 -11
  43. package/dist/resources/extensions/gsd/custom-workflow-engine.js +25 -1
  44. package/dist/resources/extensions/gsd/db-adapter.js +47 -0
  45. package/dist/resources/extensions/gsd/db-base-schema.js +337 -0
  46. package/dist/resources/extensions/gsd/db-connection-cache.js +31 -0
  47. package/dist/resources/extensions/gsd/db-coordination-schema.js +104 -0
  48. package/dist/resources/extensions/gsd/db-decision-requirement-rows.js +71 -0
  49. package/dist/resources/extensions/gsd/db-gate-rows.js +16 -0
  50. package/dist/resources/extensions/gsd/db-lightweight-query-rows.js +29 -0
  51. package/dist/resources/extensions/gsd/db-memory-fts-schema.js +56 -0
  52. package/dist/resources/extensions/gsd/db-migration-backup.js +22 -0
  53. package/dist/resources/extensions/gsd/db-migration-steps.js +394 -0
  54. package/dist/resources/extensions/gsd/db-milestone-artifact-rows.js +35 -0
  55. package/dist/resources/extensions/gsd/db-open-state.js +32 -0
  56. package/dist/resources/extensions/gsd/db-provider.js +108 -0
  57. package/dist/resources/extensions/gsd/db-runtime-kv-schema.js +27 -0
  58. package/dist/resources/extensions/gsd/db-schema-metadata.js +23 -0
  59. package/dist/resources/extensions/gsd/db-task-slice-rows.js +86 -0
  60. package/dist/resources/extensions/gsd/db-transaction.js +63 -0
  61. package/dist/resources/extensions/gsd/db-verification-evidence-rows.js +3 -0
  62. package/dist/resources/extensions/gsd/db-verification-evidence-schema.js +19 -0
  63. package/dist/resources/extensions/gsd/escalation.js +2 -0
  64. package/dist/resources/extensions/gsd/graph.js +9 -3
  65. package/dist/resources/extensions/gsd/gsd-db.js +215 -1519
  66. package/dist/resources/extensions/gsd/legacy-telemetry.js +70 -0
  67. package/dist/resources/extensions/gsd/markdown-renderer.js +2 -0
  68. package/dist/resources/extensions/gsd/model-router.js +9 -6
  69. package/dist/resources/extensions/gsd/notification-widget.js +21 -3
  70. package/dist/resources/extensions/gsd/post-execution-checks.js +27 -6
  71. package/dist/resources/extensions/gsd/pr-evidence.js +117 -0
  72. package/dist/resources/extensions/gsd/pre-execution-checks.js +2 -0
  73. package/dist/resources/extensions/gsd/process-task-path.js +61 -0
  74. package/dist/resources/extensions/gsd/prompt-loader.js +9 -5
  75. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +32 -30
  76. package/dist/resources/extensions/gsd/prompts/complete-slice.md +23 -34
  77. package/dist/resources/extensions/gsd/prompts/discuss-headless.md +50 -96
  78. package/dist/resources/extensions/gsd/prompts/discuss.md +81 -181
  79. package/dist/resources/extensions/gsd/prompts/execute-task.md +40 -67
  80. package/dist/resources/extensions/gsd/prompts/forensics.md +41 -84
  81. package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +29 -39
  82. package/dist/resources/extensions/gsd/prompts/guided-discuss-project.md +30 -65
  83. package/dist/resources/extensions/gsd/prompts/guided-discuss-requirements.md +25 -52
  84. package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +36 -36
  85. package/dist/resources/extensions/gsd/prompts/guided-research-project.md +20 -38
  86. package/dist/resources/extensions/gsd/prompts/plan-milestone.md +45 -59
  87. package/dist/resources/extensions/gsd/prompts/plan-slice.md +25 -87
  88. package/dist/resources/extensions/gsd/prompts/queue.md +46 -53
  89. package/dist/resources/extensions/gsd/prompts/refine-slice.md +23 -23
  90. package/dist/resources/extensions/gsd/prompts/research-slice.md +23 -23
  91. package/dist/resources/extensions/gsd/prompts/rethink.md +10 -10
  92. package/dist/resources/extensions/gsd/prompts/system.md +65 -107
  93. package/dist/resources/extensions/gsd/prompts/triage-captures.md +15 -15
  94. package/dist/resources/extensions/gsd/prompts/validate-milestone.md +24 -24
  95. package/dist/resources/extensions/gsd/prompts/worktree-merge.md +35 -35
  96. package/dist/resources/extensions/gsd/state.js +4 -0
  97. package/dist/resources/extensions/gsd/tools/complete-milestone.js +14 -9
  98. package/dist/resources/extensions/gsd/tools/complete-task.js +2 -0
  99. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +6 -1
  100. package/dist/resources/extensions/gsd/unit-context-composer.js +1 -1
  101. package/dist/resources/extensions/gsd/uok/kernel.js +8 -3
  102. package/dist/resources/extensions/gsd/uok/plan-v2.js +2 -0
  103. package/dist/resources/extensions/gsd/workflow-logger.js +13 -13
  104. package/dist/resources/extensions/gsd/workflow-manifest.js +2 -0
  105. package/dist/resources/extensions/gsd/workflow-projections.js +2 -0
  106. package/dist/resources/extensions/gsd/workflow-templates.js +9 -0
  107. package/dist/resources/extensions/gsd/working-output-messages.js +64 -0
  108. package/dist/resources/extensions/shared/interview-ui.js +15 -4
  109. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  110. package/dist/web/standalone/.next/BUILD_ID +1 -1
  111. package/dist/web/standalone/.next/app-path-routes-manifest.json +14 -14
  112. package/dist/web/standalone/.next/build-manifest.json +3 -3
  113. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  114. package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
  115. package/dist/web/standalone/.next/required-server-files.json +1 -1
  116. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  117. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  118. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  119. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  120. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  121. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  122. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  123. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  124. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  125. package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
  126. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  127. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  128. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  129. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  130. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  131. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  132. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  133. package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +1 -1
  134. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  135. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
  136. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  137. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
  138. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +1 -1
  139. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
  140. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  141. package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +1 -1
  142. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  143. package/dist/web/standalone/.next/server/app/api/cleanup/route.js.nft.json +1 -1
  144. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  145. package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
  164. package/dist/web/standalone/.next/server/app/api/notifications/route.js +1 -1
  165. package/dist/web/standalone/.next/server/app/api/notifications/route.js.nft.json +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.js.nft.json +1 -1
  168. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  169. package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  170. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  171. package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
  172. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  173. package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
  174. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  175. package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
  176. package/dist/web/standalone/.next/server/app/api/session/events/route.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
  178. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  179. package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
  180. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  181. package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
  182. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  183. package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
  184. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  185. package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
  186. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  187. package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
  188. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
  189. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
  190. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +1 -1
  191. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
  192. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  193. package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
  194. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  195. package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +1 -1
  196. package/dist/web/standalone/.next/server/app/index.html +1 -1
  197. package/dist/web/standalone/.next/server/app/index.rsc +1 -1
  198. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  199. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
  200. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  201. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  202. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  203. package/dist/web/standalone/.next/server/app-paths-manifest.json +14 -14
  204. package/dist/web/standalone/.next/server/chunks/167.js +2 -0
  205. package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
  206. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  207. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  208. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  209. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  210. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  211. package/dist/web/standalone/.next/static/chunks/{8336.6f6f30e410419aff.js → 8336.631939fb583761fa.js} +1 -1
  212. package/dist/web/standalone/.next/static/chunks/{webpack-d82dbee6356c1733.js → webpack-0481f1221120a7c6.js} +1 -1
  213. package/dist/web/standalone/package.json +1 -0
  214. package/dist/web/standalone/server.js +1 -1
  215. package/package.json +15 -6
  216. package/packages/contracts/dist/index.d.ts +3 -0
  217. package/packages/contracts/dist/index.d.ts.map +1 -0
  218. package/packages/contracts/dist/index.js +5 -0
  219. package/packages/contracts/dist/index.js.map +1 -0
  220. package/packages/contracts/dist/rpc.d.ts +549 -0
  221. package/packages/contracts/dist/rpc.d.ts.map +1 -0
  222. package/packages/contracts/dist/rpc.js +53 -0
  223. package/packages/contracts/dist/rpc.js.map +1 -0
  224. package/packages/contracts/dist/rpc.test.d.ts +2 -0
  225. package/packages/contracts/dist/rpc.test.d.ts.map +1 -0
  226. package/packages/contracts/dist/rpc.test.js +47 -0
  227. package/packages/contracts/dist/rpc.test.js.map +1 -0
  228. package/packages/contracts/dist/workflow.d.ts +180 -0
  229. package/packages/contracts/dist/workflow.d.ts.map +1 -0
  230. package/packages/contracts/dist/workflow.js +201 -0
  231. package/packages/contracts/dist/workflow.js.map +1 -0
  232. package/packages/contracts/package.json +39 -0
  233. package/packages/contracts/src/index.ts +5 -0
  234. package/packages/contracts/src/rpc.test.ts +72 -0
  235. package/packages/contracts/src/rpc.ts +286 -0
  236. package/packages/contracts/src/workflow.ts +213 -0
  237. package/packages/contracts/tsconfig.json +25 -0
  238. package/packages/daemon/package.json +3 -2
  239. package/packages/daemon/src/event-bridge.test.ts +2 -1
  240. package/packages/daemon/src/event-bridge.ts +1 -1
  241. package/packages/daemon/src/event-formatter.test.ts +1 -2
  242. package/packages/daemon/src/event-formatter.ts +1 -2
  243. package/packages/daemon/src/session-manager.ts +2 -2
  244. package/packages/daemon/src/types.ts +3 -18
  245. package/packages/mcp-server/dist/server.d.ts +13 -0
  246. package/packages/mcp-server/dist/server.d.ts.map +1 -1
  247. package/packages/mcp-server/dist/server.js +77 -0
  248. package/packages/mcp-server/dist/server.js.map +1 -1
  249. package/packages/mcp-server/dist/session-manager.js +1 -1
  250. package/packages/mcp-server/dist/session-manager.js.map +1 -1
  251. package/packages/mcp-server/dist/types.d.ts +3 -11
  252. package/packages/mcp-server/dist/types.d.ts.map +1 -1
  253. package/packages/mcp-server/dist/types.js.map +1 -1
  254. package/packages/mcp-server/dist/workflow-tools.d.ts +1 -1
  255. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  256. package/packages/mcp-server/dist/workflow-tools.js +2 -40
  257. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  258. package/packages/mcp-server/package.json +3 -2
  259. package/packages/mcp-server/src/mcp-server.test.ts +138 -0
  260. package/packages/mcp-server/src/server.ts +99 -1
  261. package/packages/mcp-server/src/session-manager.ts +2 -2
  262. package/packages/mcp-server/src/types.ts +7 -18
  263. package/packages/mcp-server/src/workflow-tools.ts +2 -40
  264. package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
  265. package/packages/native/package.json +1 -1
  266. package/packages/pi-agent-core/package.json +1 -1
  267. package/packages/pi-ai/dist/models/fake-model.d.ts +12 -0
  268. package/packages/pi-ai/dist/models/fake-model.d.ts.map +1 -0
  269. package/packages/pi-ai/dist/models/fake-model.js +27 -0
  270. package/packages/pi-ai/dist/models/fake-model.js.map +1 -0
  271. package/packages/pi-ai/dist/models/index.d.ts.map +1 -1
  272. package/packages/pi-ai/dist/models/index.js +8 -0
  273. package/packages/pi-ai/dist/models/index.js.map +1 -1
  274. package/packages/pi-ai/dist/providers/fake.d.ts +42 -0
  275. package/packages/pi-ai/dist/providers/fake.d.ts.map +1 -0
  276. package/packages/pi-ai/dist/providers/fake.js +319 -0
  277. package/packages/pi-ai/dist/providers/fake.js.map +1 -0
  278. package/packages/pi-ai/dist/providers/register-builtins.d.ts.map +1 -1
  279. package/packages/pi-ai/dist/providers/register-builtins.js +24 -0
  280. package/packages/pi-ai/dist/providers/register-builtins.js.map +1 -1
  281. package/packages/pi-ai/package.json +1 -1
  282. package/packages/pi-ai/src/models/fake-model.ts +30 -0
  283. package/packages/pi-ai/src/models/index.ts +9 -0
  284. package/packages/pi-ai/src/providers/fake.ts +376 -0
  285. package/packages/pi-ai/src/providers/register-builtins.ts +23 -0
  286. package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
  287. package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
  288. package/packages/pi-coding-agent/dist/core/model-registry.js +5 -0
  289. package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
  290. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +4 -0
  291. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  292. package/packages/pi-coding-agent/dist/core/settings-manager.js +8 -0
  293. package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  294. package/packages/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
  295. package/packages/pi-coding-agent/dist/core/slash-commands.js +1 -0
  296. package/packages/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
  297. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +22 -0
  298. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
  299. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts +26 -0
  300. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts.map +1 -0
  301. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js +112 -0
  302. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -0
  303. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.d.ts +2 -0
  304. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.d.ts.map +1 -0
  305. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js +51 -0
  306. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js.map +1 -0
  307. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +8 -8
  308. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
  309. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +3 -0
  310. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  311. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +11 -0
  312. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
  313. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +20 -0
  314. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -1
  315. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +4 -0
  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 +48 -15
  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/controllers/chat-controller.d.ts.map +1 -1
  320. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +1 -0
  321. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  322. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +40 -1
  323. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -1
  324. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +1 -0
  325. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
  326. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts +1 -0
  327. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -1
  328. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.js.map +1 -1
  329. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +12 -1
  330. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  331. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +54 -10
  332. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  333. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -1
  334. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +20 -0
  335. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
  336. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.d.ts +2 -0
  337. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.d.ts.map +1 -0
  338. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.js +79 -0
  339. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.js.map +1 -0
  340. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +12 -0
  341. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
  342. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +13 -0
  343. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -1
  344. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +1 -1
  345. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  346. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +18 -1
  347. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  348. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.d.ts +11 -0
  349. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.d.ts.map +1 -0
  350. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.js +18 -0
  351. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.js.map +1 -0
  352. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.d.ts +2 -0
  353. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.d.ts.map +1 -0
  354. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +27 -0
  355. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -0
  356. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts +1 -512
  357. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  358. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js +3 -7
  359. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js.map +1 -1
  360. package/packages/pi-coding-agent/package.json +2 -1
  361. package/packages/pi-coding-agent/src/core/model-registry.ts +4 -0
  362. package/packages/pi-coding-agent/src/core/settings-manager.ts +12 -0
  363. package/packages/pi-coding-agent/src/core/slash-commands.ts +1 -0
  364. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +37 -2
  365. package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.test.ts +59 -0
  366. package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +160 -0
  367. package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +8 -8
  368. package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +15 -0
  369. package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +31 -0
  370. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +50 -15
  371. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +43 -1
  372. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +1 -0
  373. package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +1 -0
  374. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-state.ts +1 -1
  375. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +75 -9
  376. package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.test.ts +95 -0
  377. package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +24 -1
  378. package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.ts +13 -0
  379. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +32 -2
  380. package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +40 -0
  381. package/packages/pi-coding-agent/src/modes/interactive/tui-mode.ts +29 -0
  382. package/packages/pi-coding-agent/src/modes/rpc/rpc-types.ts +3 -336
  383. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
  384. package/packages/pi-tui/dist/__tests__/style.test.d.ts +2 -0
  385. package/packages/pi-tui/dist/__tests__/style.test.d.ts.map +1 -0
  386. package/packages/pi-tui/dist/__tests__/style.test.js +63 -0
  387. package/packages/pi-tui/dist/__tests__/style.test.js.map +1 -0
  388. package/packages/pi-tui/dist/__tests__/tui.test.js +24 -3
  389. package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
  390. package/packages/pi-tui/dist/index.d.ts +1 -0
  391. package/packages/pi-tui/dist/index.d.ts.map +1 -1
  392. package/packages/pi-tui/dist/index.js +2 -0
  393. package/packages/pi-tui/dist/index.js.map +1 -1
  394. package/packages/pi-tui/dist/style.d.ts +41 -0
  395. package/packages/pi-tui/dist/style.d.ts.map +1 -0
  396. package/packages/pi-tui/dist/style.js +158 -0
  397. package/packages/pi-tui/dist/style.js.map +1 -0
  398. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  399. package/packages/pi-tui/dist/tui.js +1 -0
  400. package/packages/pi-tui/dist/tui.js.map +1 -1
  401. package/packages/pi-tui/package.json +1 -1
  402. package/packages/pi-tui/src/__tests__/style.test.ts +76 -0
  403. package/packages/pi-tui/src/__tests__/tui.test.ts +29 -3
  404. package/packages/pi-tui/src/index.ts +9 -0
  405. package/packages/pi-tui/src/style.ts +225 -0
  406. package/packages/pi-tui/src/tui.ts +1 -0
  407. package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
  408. package/packages/rpc-client/README.md +3 -3
  409. package/packages/rpc-client/dist/index.d.ts +1 -1
  410. package/packages/rpc-client/dist/index.d.ts.map +1 -1
  411. package/packages/rpc-client/dist/index.js.map +1 -1
  412. package/packages/rpc-client/dist/rpc-client.d.ts +2 -6
  413. package/packages/rpc-client/dist/rpc-client.d.ts.map +1 -1
  414. package/packages/rpc-client/dist/rpc-client.js.map +1 -1
  415. package/packages/rpc-client/dist/rpc-types.d.ts +1 -565
  416. package/packages/rpc-client/dist/rpc-types.d.ts.map +1 -1
  417. package/packages/rpc-client/dist/rpc-types.js +3 -11
  418. package/packages/rpc-client/dist/rpc-types.js.map +1 -1
  419. package/packages/rpc-client/package.json +4 -1
  420. package/packages/rpc-client/src/index.ts +1 -1
  421. package/packages/rpc-client/src/rpc-client.ts +3 -6
  422. package/packages/rpc-client/src/rpc-types.ts +3 -398
  423. package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
  424. package/pkg/dist/modes/interactive/theme/theme-schema.d.ts +12 -0
  425. package/pkg/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
  426. package/pkg/dist/modes/interactive/theme/theme-schema.js +13 -0
  427. package/pkg/dist/modes/interactive/theme/theme-schema.js.map +1 -1
  428. package/pkg/dist/modes/interactive/theme/theme.d.ts +1 -1
  429. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  430. package/pkg/dist/modes/interactive/theme/theme.js +18 -1
  431. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  432. package/pkg/package.json +1 -1
  433. package/src/resources/extensions/github-sync/templates.ts +93 -88
  434. package/src/resources/extensions/github-sync/tests/inline-code.test.ts +66 -0
  435. package/src/resources/extensions/github-sync/tests/templates.test.ts +10 -2
  436. package/src/resources/extensions/gsd/auto/contracts.ts +87 -0
  437. package/src/resources/extensions/gsd/auto/custom-verify-retry-store.ts +72 -0
  438. package/src/resources/extensions/gsd/auto/loop-deps.ts +10 -3
  439. package/src/resources/extensions/gsd/auto/loop.ts +416 -596
  440. package/src/resources/extensions/gsd/auto/orchestrator.ts +161 -0
  441. package/src/resources/extensions/gsd/auto/phases.ts +82 -8
  442. package/src/resources/extensions/gsd/auto/run-unit.ts +24 -14
  443. package/src/resources/extensions/gsd/auto/session.ts +11 -0
  444. package/src/resources/extensions/gsd/auto/workflow-custom-engine-dispatch-outcome.ts +28 -0
  445. package/src/resources/extensions/gsd/auto/workflow-custom-engine-iteration.ts +52 -0
  446. package/src/resources/extensions/gsd/auto/workflow-custom-engine-reconcile-outcome.ts +58 -0
  447. package/src/resources/extensions/gsd/auto/workflow-custom-engine-reconcile.ts +71 -0
  448. package/src/resources/extensions/gsd/auto/workflow-custom-engine-retry.ts +90 -0
  449. package/src/resources/extensions/gsd/auto/workflow-custom-engine-verify-outcome.ts +50 -0
  450. package/src/resources/extensions/gsd/auto/workflow-dispatch-claim.ts +97 -0
  451. package/src/resources/extensions/gsd/auto/workflow-dispatch-ledger.ts +45 -0
  452. package/src/resources/extensions/gsd/auto/workflow-iteration-completion.ts +26 -0
  453. package/src/resources/extensions/gsd/auto/workflow-journal-reporter.ts +33 -0
  454. package/src/resources/extensions/gsd/auto/workflow-kernel.ts +520 -0
  455. package/src/resources/extensions/gsd/auto/workflow-memory-pressure.ts +58 -0
  456. package/src/resources/extensions/gsd/auto/workflow-phase-reporter.ts +22 -0
  457. package/src/resources/extensions/gsd/auto/workflow-session-lock.ts +68 -0
  458. package/src/resources/extensions/gsd/auto/workflow-sidecar-iteration.ts +46 -0
  459. package/src/resources/extensions/gsd/auto/workflow-sidecar-queue.ts +46 -0
  460. package/src/resources/extensions/gsd/auto/workflow-turn-reporter.ts +68 -0
  461. package/src/resources/extensions/gsd/auto/workflow-unit-dispatch.ts +89 -0
  462. package/src/resources/extensions/gsd/auto/workflow-worker-heartbeat.ts +38 -0
  463. package/src/resources/extensions/gsd/auto-dashboard.ts +61 -8
  464. package/src/resources/extensions/gsd/auto-prompts.ts +170 -3
  465. package/src/resources/extensions/gsd/auto-recovery.ts +67 -53
  466. package/src/resources/extensions/gsd/auto-runtime-state.ts +7 -0
  467. package/src/resources/extensions/gsd/auto-verification.ts +5 -1
  468. package/src/resources/extensions/gsd/auto-worktree.ts +85 -36
  469. package/src/resources/extensions/gsd/auto.ts +167 -1
  470. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +30 -2
  471. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +11 -0
  472. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +30 -6
  473. package/src/resources/extensions/gsd/bootstrap/write-gate.ts +135 -1
  474. package/src/resources/extensions/gsd/commands-ship.ts +24 -51
  475. package/src/resources/extensions/gsd/commands-workflow-templates.ts +13 -0
  476. package/src/resources/extensions/gsd/component-loader.ts +5 -11
  477. package/src/resources/extensions/gsd/custom-workflow-engine.ts +29 -0
  478. package/src/resources/extensions/gsd/db-adapter.ts +75 -0
  479. package/src/resources/extensions/gsd/db-base-schema.ts +368 -0
  480. package/src/resources/extensions/gsd/db-connection-cache.ts +45 -0
  481. package/src/resources/extensions/gsd/db-coordination-schema.ts +109 -0
  482. package/src/resources/extensions/gsd/db-decision-requirement-rows.ts +77 -0
  483. package/src/resources/extensions/gsd/db-gate-rows.ts +19 -0
  484. package/src/resources/extensions/gsd/db-lightweight-query-rows.ts +50 -0
  485. package/src/resources/extensions/gsd/db-memory-fts-schema.ts +66 -0
  486. package/src/resources/extensions/gsd/db-migration-backup.ts +34 -0
  487. package/src/resources/extensions/gsd/db-migration-steps.ts +434 -0
  488. package/src/resources/extensions/gsd/db-milestone-artifact-rows.ts +70 -0
  489. package/src/resources/extensions/gsd/db-open-state.ts +47 -0
  490. package/src/resources/extensions/gsd/db-provider.ts +148 -0
  491. package/src/resources/extensions/gsd/db-runtime-kv-schema.ts +30 -0
  492. package/src/resources/extensions/gsd/db-schema-metadata.ts +33 -0
  493. package/src/resources/extensions/gsd/db-task-slice-rows.ts +146 -0
  494. package/src/resources/extensions/gsd/db-transaction.ts +76 -0
  495. package/src/resources/extensions/gsd/db-verification-evidence-rows.ts +14 -0
  496. package/src/resources/extensions/gsd/db-verification-evidence-schema.ts +22 -0
  497. package/src/resources/extensions/gsd/escalation.ts +3 -1
  498. package/src/resources/extensions/gsd/graph.ts +12 -5
  499. package/src/resources/extensions/gsd/gsd-db.ts +260 -1659
  500. package/src/resources/extensions/gsd/interrupted-session.ts +1 -0
  501. package/src/resources/extensions/gsd/legacy-telemetry.ts +99 -0
  502. package/src/resources/extensions/gsd/markdown-renderer.ts +4 -1
  503. package/src/resources/extensions/gsd/model-router.ts +10 -6
  504. package/src/resources/extensions/gsd/notification-widget.ts +25 -4
  505. package/src/resources/extensions/gsd/post-execution-checks.ts +35 -7
  506. package/src/resources/extensions/gsd/pr-evidence.ts +182 -0
  507. package/src/resources/extensions/gsd/pre-execution-checks.ts +4 -1
  508. package/src/resources/extensions/gsd/process-task-path.ts +81 -0
  509. package/src/resources/extensions/gsd/prompt-loader.ts +9 -5
  510. package/src/resources/extensions/gsd/prompts/complete-milestone.md +32 -30
  511. package/src/resources/extensions/gsd/prompts/complete-slice.md +23 -34
  512. package/src/resources/extensions/gsd/prompts/discuss-headless.md +50 -96
  513. package/src/resources/extensions/gsd/prompts/discuss.md +81 -181
  514. package/src/resources/extensions/gsd/prompts/execute-task.md +40 -67
  515. package/src/resources/extensions/gsd/prompts/forensics.md +41 -84
  516. package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +29 -39
  517. package/src/resources/extensions/gsd/prompts/guided-discuss-project.md +30 -65
  518. package/src/resources/extensions/gsd/prompts/guided-discuss-requirements.md +25 -52
  519. package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +36 -36
  520. package/src/resources/extensions/gsd/prompts/guided-research-project.md +20 -38
  521. package/src/resources/extensions/gsd/prompts/plan-milestone.md +45 -59
  522. package/src/resources/extensions/gsd/prompts/plan-slice.md +25 -87
  523. package/src/resources/extensions/gsd/prompts/queue.md +46 -53
  524. package/src/resources/extensions/gsd/prompts/refine-slice.md +23 -23
  525. package/src/resources/extensions/gsd/prompts/research-slice.md +23 -23
  526. package/src/resources/extensions/gsd/prompts/rethink.md +10 -10
  527. package/src/resources/extensions/gsd/prompts/system.md +65 -107
  528. package/src/resources/extensions/gsd/prompts/triage-captures.md +15 -15
  529. package/src/resources/extensions/gsd/prompts/validate-milestone.md +24 -24
  530. package/src/resources/extensions/gsd/prompts/worktree-merge.md +35 -35
  531. package/src/resources/extensions/gsd/state.ts +6 -3
  532. package/src/resources/extensions/gsd/tests/auto-abort-pause-regression.test.ts +38 -0
  533. package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +98 -0
  534. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +117 -0
  535. package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +353 -0
  536. package/src/resources/extensions/gsd/tests/auto-pr-bugs.test.ts +19 -0
  537. package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +45 -0
  538. package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +39 -0
  539. package/src/resources/extensions/gsd/tests/auto-session-encapsulation.test.ts +3 -0
  540. package/src/resources/extensions/gsd/tests/commands-eval-review.test.ts +2 -2
  541. package/src/resources/extensions/gsd/tests/commands-ship-eval-warn.test.ts +3 -2
  542. package/src/resources/extensions/gsd/tests/complete-milestone-prompt-rendering.test.ts +47 -0
  543. package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +19 -5
  544. package/src/resources/extensions/gsd/tests/component-loader.test.ts +2 -9
  545. package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +144 -0
  546. package/src/resources/extensions/gsd/tests/custom-verify-retry-store.test.ts +139 -0
  547. package/src/resources/extensions/gsd/tests/custom-workflow-engine.test.ts +50 -0
  548. package/src/resources/extensions/gsd/tests/dashboard-custom-engine.test.ts +3 -3
  549. package/src/resources/extensions/gsd/tests/db-adapter.test.ts +82 -0
  550. package/src/resources/extensions/gsd/tests/db-base-schema.test.ts +62 -0
  551. package/src/resources/extensions/gsd/tests/db-connection-cache.test.ts +60 -0
  552. package/src/resources/extensions/gsd/tests/db-coordination-schema.test.ts +39 -0
  553. package/src/resources/extensions/gsd/tests/db-decision-requirement-rows.test.ts +135 -0
  554. package/src/resources/extensions/gsd/tests/db-gate-rows.test.ts +53 -0
  555. package/src/resources/extensions/gsd/tests/db-lightweight-query-rows.test.ts +45 -0
  556. package/src/resources/extensions/gsd/tests/db-memory-fts-schema.test.ts +86 -0
  557. package/src/resources/extensions/gsd/tests/db-migration-backup.test.ts +105 -0
  558. package/src/resources/extensions/gsd/tests/db-migration-steps.integration.test.ts +428 -0
  559. package/src/resources/extensions/gsd/tests/db-migration-steps.test.ts +159 -0
  560. package/src/resources/extensions/gsd/tests/db-milestone-artifact-rows.test.ts +53 -0
  561. package/src/resources/extensions/gsd/tests/db-open-state.test.ts +56 -0
  562. package/src/resources/extensions/gsd/tests/db-provider.test.ts +105 -0
  563. package/src/resources/extensions/gsd/tests/db-runtime-kv-schema.test.ts +37 -0
  564. package/src/resources/extensions/gsd/tests/db-schema-metadata.test.ts +115 -0
  565. package/src/resources/extensions/gsd/tests/db-task-slice-rows.test.ts +128 -0
  566. package/src/resources/extensions/gsd/tests/db-transaction.test.ts +110 -0
  567. package/src/resources/extensions/gsd/tests/db-verification-evidence-schema.test.ts +76 -0
  568. package/src/resources/extensions/gsd/tests/discuss-headless-rendering.test.ts +37 -0
  569. package/src/resources/extensions/gsd/tests/execute-task-rendering.test.ts +59 -0
  570. package/src/resources/extensions/gsd/tests/fixtures/pr-body/commands-ship-basic.md +52 -0
  571. package/src/resources/extensions/gsd/tests/fixtures/pr-body/commands-ship-empty-optionals.md +42 -0
  572. package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-no-blockers.md +55 -0
  573. package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-with-blockers.md +60 -0
  574. package/src/resources/extensions/gsd/tests/forensics-prompt-rendering.test.ts +36 -0
  575. package/src/resources/extensions/gsd/tests/graph-operations.test.ts +10 -0
  576. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +95 -0
  577. package/src/resources/extensions/gsd/tests/guided-discuss-milestone-prompt-rendering.test.ts +43 -0
  578. package/src/resources/extensions/gsd/tests/guided-discuss-project-prompt-rendering.test.ts +41 -0
  579. package/src/resources/extensions/gsd/tests/guided-discuss-requirements-prompt-rendering.test.ts +45 -0
  580. package/src/resources/extensions/gsd/tests/integration/auto-recovery.test.ts +79 -0
  581. package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +37 -0
  582. package/src/resources/extensions/gsd/tests/integration/state-machine-live-validation.test.ts +5 -3
  583. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +134 -0
  584. package/src/resources/extensions/gsd/tests/legacy-component-format-telemetry.test.ts +62 -0
  585. package/src/resources/extensions/gsd/tests/legacy-telemetry.test.ts +144 -0
  586. package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +40 -16
  587. package/src/resources/extensions/gsd/tests/model-router.test.ts +33 -12
  588. package/src/resources/extensions/gsd/tests/notification-store.test.ts +8 -0
  589. package/src/resources/extensions/gsd/tests/notification-widget.test.ts +40 -1
  590. package/src/resources/extensions/gsd/tests/paused-session-via-db.test.ts +2 -0
  591. package/src/resources/extensions/gsd/tests/plan-milestone-rendering.test.ts +45 -0
  592. package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +65 -16
  593. package/src/resources/extensions/gsd/tests/plan-slice.test.ts +27 -0
  594. package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +46 -0
  595. package/src/resources/extensions/gsd/tests/pr-evidence-equivalence.test.ts +102 -0
  596. package/src/resources/extensions/gsd/tests/pr-evidence-hardening.test.ts +165 -0
  597. package/src/resources/extensions/gsd/tests/pr-evidence.test.ts +79 -0
  598. package/src/resources/extensions/gsd/tests/process-task-path.test.ts +51 -0
  599. package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +16 -1
  600. package/src/resources/extensions/gsd/tests/queue-prompt-rendering.test.ts +37 -0
  601. package/src/resources/extensions/gsd/tests/tool-naming.test.ts +32 -9
  602. package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +6 -6
  603. package/src/resources/extensions/gsd/tests/uok-kernel-path.test.ts +12 -0
  604. package/src/resources/extensions/gsd/tests/workflow-custom-engine-dispatch-outcome.test.ts +55 -0
  605. package/src/resources/extensions/gsd/tests/workflow-custom-engine-iteration.test.ts +93 -0
  606. package/src/resources/extensions/gsd/tests/workflow-custom-engine-reconcile-outcome.test.ts +108 -0
  607. package/src/resources/extensions/gsd/tests/workflow-custom-engine-reconcile.test.ts +146 -0
  608. package/src/resources/extensions/gsd/tests/workflow-custom-engine-retry.test.ts +136 -0
  609. package/src/resources/extensions/gsd/tests/workflow-custom-engine-verify-outcome.test.ts +95 -0
  610. package/src/resources/extensions/gsd/tests/workflow-dispatch-claim.test.ts +158 -0
  611. package/src/resources/extensions/gsd/tests/workflow-dispatch-ledger.test.ts +82 -0
  612. package/src/resources/extensions/gsd/tests/workflow-iteration-completion.test.ts +44 -0
  613. package/src/resources/extensions/gsd/tests/workflow-journal-reporter.test.ts +49 -0
  614. package/src/resources/extensions/gsd/tests/workflow-kernel.test.ts +607 -0
  615. package/src/resources/extensions/gsd/tests/workflow-logger.test.ts +20 -4
  616. package/src/resources/extensions/gsd/tests/workflow-memory-pressure.test.ts +71 -0
  617. package/src/resources/extensions/gsd/tests/workflow-phase-reporter.test.ts +40 -0
  618. package/src/resources/extensions/gsd/tests/workflow-session-lock.test.ts +135 -0
  619. package/src/resources/extensions/gsd/tests/workflow-sidecar-iteration.test.ts +110 -0
  620. package/src/resources/extensions/gsd/tests/workflow-sidecar-queue.test.ts +116 -0
  621. package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +21 -0
  622. package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +32 -0
  623. package/src/resources/extensions/gsd/tests/workflow-turn-reporter.test.ts +87 -0
  624. package/src/resources/extensions/gsd/tests/workflow-unit-dispatch.test.ts +160 -0
  625. package/src/resources/extensions/gsd/tests/workflow-worker-heartbeat.test.ts +123 -0
  626. package/src/resources/extensions/gsd/tests/working-output-messages.test.ts +93 -0
  627. package/src/resources/extensions/gsd/tests/worktree-submodule-safety.test.ts +17 -33
  628. package/src/resources/extensions/gsd/tests/worktree-write-gate.test.ts +179 -0
  629. package/src/resources/extensions/gsd/tools/complete-milestone.ts +15 -9
  630. package/src/resources/extensions/gsd/tools/complete-task.ts +4 -1
  631. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +6 -1
  632. package/src/resources/extensions/gsd/unit-context-composer.ts +1 -1
  633. package/src/resources/extensions/gsd/uok/kernel.ts +10 -3
  634. package/src/resources/extensions/gsd/uok/plan-v2.ts +5 -1
  635. package/src/resources/extensions/gsd/workflow-logger.ts +13 -13
  636. package/src/resources/extensions/gsd/workflow-manifest.ts +6 -15
  637. package/src/resources/extensions/gsd/workflow-projections.ts +5 -1
  638. package/src/resources/extensions/gsd/workflow-templates.ts +11 -0
  639. package/src/resources/extensions/gsd/working-output-messages.ts +120 -0
  640. package/src/resources/extensions/shared/interview-ui.ts +18 -5
  641. package/src/resources/extensions/shared/tests/interview-notes-loop.test.ts +41 -0
  642. package/dist/web/standalone/.next/server/chunks/6336.js +0 -1
  643. /package/dist/web/standalone/.next/static/{TzEVJ1Lh8vbez4n4Q9TqQ → CaMwumvGbBPZrJicfsCzV}/_buildManifest.js +0 -0
  644. /package/dist/web/standalone/.next/static/{TzEVJ1Lh8vbez4n4Q9TqQ → CaMwumvGbBPZrJicfsCzV}/_ssgManifest.js +0 -0
@@ -2,7 +2,7 @@ You are triaging user-captured thoughts during a GSD session.
2
2
 
3
3
  ## UNIT: Triage Captures
4
4
 
5
- The user captured thoughts during execution using `/gsd capture`. Your job is to classify each capture, present your proposals, get user confirmation, and update CAPTURES.md with the final classifications.
5
+ The user captured thoughts with `/gsd capture`. Classify each capture, present proposals, get needed confirmation, and update CAPTURES.md with final classifications.
6
6
 
7
7
  ## Pending Captures
8
8
 
@@ -18,24 +18,24 @@ The user captured thoughts during execution using `/gsd capture`. Your job is to
18
18
 
19
19
  ## Classification Criteria
20
20
 
21
- For each capture, classify it as one of:
21
+ Classify each capture as one of:
22
22
 
23
- - **stop**: User directive to halt auto-mode immediately. Use when the user says "stop", "halt", "abort", "don't continue", "pause", or otherwise wants execution to cease. Auto-mode will pause after the current unit completes. Examples: "stop running", "halt execution", "don't continue".
24
- - **backtrack**: User directive to abandon the current milestone and return to a previous one. The user believes earlier milestones missed critical features or need rework. Include the target milestone ID (e.g., M003) in the Resolution field. Auto-mode will pause and write a regression marker. Examples: "restart from M003", "go back to milestone 3", "M004 and M005 failed, restart from M003".
25
- - **quick-task**: Small, self-contained, no downstream impact. Can be done in minutes without modifying the plan. Examples: fix a typo, add a missing import, tweak a config value.
26
- - **inject**: Belongs in the current slice but wasn't planned. Needs a new task added to the slice plan. Examples: add error handling to a module being built, add a missing test case for current work.
27
- - **defer**: Belongs in a future slice or milestone. Not urgent for current work. Examples: performance optimization, feature that depends on unbuilt infrastructure, nice-to-have enhancement.
28
- - **replan**: Changes the shape of remaining work in the current slice. Existing incomplete tasks may need rewriting. Examples: "the approach is wrong, we need to use X instead of Y", discovering a fundamental constraint.
29
- - **note**: Informational only. No action needed right now. Good context for future reference. Examples: "remember that the API has a rate limit", observations about code quality.
23
+ - **stop**: Halt/pause auto-mode immediately after the current unit. Examples: "stop", "halt", "abort", "don't continue".
24
+ - **backtrack**: Abandon current milestone and return to an earlier one. Include target milestone ID (e.g., M003) in Resolution. Auto-mode pauses and writes a regression marker.
25
+ - **quick-task**: Small, self-contained, no downstream impact; minutes of work without plan changes.
26
+ - **inject**: Belongs in current slice but was not planned; needs a new task.
27
+ - **defer**: Belongs in a future slice/milestone; not urgent for current work.
28
+ - **replan**: Changes remaining work shape in the current slice; incomplete tasks may need rewriting.
29
+ - **note**: Informational only; useful future context with no immediate action.
30
30
 
31
31
  ## Decision Guidelines
32
32
 
33
- - **ALWAYS classify as stop** when the user explicitly says "stop", "halt", "abort", or "don't continue". Never shoe-horn a stop directive into "replan" or "note".
34
- - **ALWAYS classify as backtrack** when the user references returning to a previous milestone, restarting from an earlier point, or abandoning current milestone work. Include the target milestone ID in the Resolution field (e.g., "Backtrack to M003").
33
+ - **ALWAYS classify as stop** when the user says "stop", "halt", "abort", or "don't continue". Never shoe-horn stop into "replan" or "note".
34
+ - **ALWAYS classify as backtrack** when the user references returning to a previous milestone, restarting earlier, or abandoning current milestone work. Include target milestone ID in Resolution (e.g., "Backtrack to M003").
35
35
  - Prefer **quick-task** when the work is clearly small and self-contained.
36
36
  - Prefer **inject** over **replan** when only a new task is needed, not rewriting existing ones.
37
37
  - Prefer **defer** over **inject** when the work doesn't belong in the current slice's scope.
38
- - Use **replan** only when remaining incomplete tasks in the *current slice* need to change not for cross-milestone issues.
38
+ - Use **replan** only when remaining incomplete tasks in the *current slice* need to change, not for cross-milestone issues.
39
39
  - Use **note** for observations that don't require action.
40
40
  - When unsure between quick-task and inject, consider: will this take more than 10 minutes? If yes, inject.
41
41
 
@@ -49,8 +49,8 @@ For each capture, classify it as one of:
49
49
  - Your rationale
50
50
  - If applicable, which files would be affected
51
51
 
52
- For captures classified as **note** or **defer**, auto-confirm without asking — these are low-impact.
53
- For captures classified as **stop** or **backtrack**, auto-confirm without asking — these are urgent user directives that must be honored immediately.
52
+ Auto-confirm **note** and **defer** because they are low-impact.
53
+ Auto-confirm **stop** and **backtrack** because they are urgent user directives.
54
54
  For captures classified as **quick-task**, **inject**, or **replan**, ask the user to confirm or choose a different classification. **Non-bypassable:** If `ask_user_questions` fails, errors, or the user does not respond, you MUST re-ask — never auto-confirm these classifications without explicit user approval.
55
55
 
56
56
  3. **Update** `.gsd/CAPTURES.md` — for each capture, update its section with the confirmed classification:
@@ -61,7 +61,7 @@ For each capture, classify it as one of:
61
61
  - Add `**Resolved:** <current ISO timestamp>`
62
62
  - Add `**Milestone:** <current milestone ID>` (e.g., `**Milestone:** M003`)
63
63
 
64
- 4. **Summarize** what was triaged: how many captures, what classifications were assigned, and what actions are pending (e.g., "2 quick-tasks ready for execution, 1 deferred to S03").
64
+ 4. **Summarize** count, assigned classifications, and pending actions (e.g., "2 quick-tasks ready, 1 deferred to S03").
65
65
 
66
66
  **Important:** Do NOT execute any resolutions. Only classify and update CAPTURES.md. Resolution execution happens separately (in auto-mode dispatch or manually by the user).
67
67
 
@@ -1,20 +1,20 @@
1
- # Milestone Validation Parallel Review
1
+ # Milestone Validation - Parallel Review
2
2
 
3
- You are the validation orchestrator for **{{milestoneId}} {{milestoneTitle}}**.
3
+ You are the validation orchestrator for **{{milestoneId}} - {{milestoneTitle}}**.
4
4
 
5
5
  ## Working Directory
6
6
 
7
- Your working directory is `{{workingDirectory}}`. All file reads, writes, and shell commands MUST operate relative to this directory. Do NOT `cd` to any other directory.
7
+ Work in `{{workingDirectory}}`. All reads, writes, and shell commands MUST stay relative to it. Do NOT `cd` elsewhere.
8
8
 
9
9
  ## Mission
10
10
 
11
- Dispatch 3 independent parallel reviewers, then synthesize their findings into the final VALIDATION verdict.
11
+ Dispatch 3 independent parallel reviewers, then synthesize the final VALIDATION verdict.
12
12
 
13
- This is remediation round {{remediationRound}}. If this is round 0, this is the first validation pass. If > 0, prior validation found issues and remediation slices were added and executed — verify those remediation slices resolved the issues.
13
+ Remediation round: {{remediationRound}}. Round 0 is the first pass; later rounds must verify remediation slices resolved prior findings.
14
14
 
15
15
  ## Context
16
16
 
17
- All relevant context has been preloaded below — the roadmap, all slice summaries, assessment results, requirements, decisions, and project context are inlined. Start working immediately without re-reading these files.
17
+ Roadmap, slice summaries, assessments, requirements, decisions, and project context are inlined. Start immediately.
18
18
 
19
19
  {{inlinedContext}}
20
20
 
@@ -22,29 +22,29 @@ All relevant context has been preloaded below — the roadmap, all slice summari
22
22
 
23
23
  ## Execution Protocol
24
24
 
25
- ### Step 1 Dispatch Parallel Reviewers
25
+ ### Step 1 - Dispatch Parallel Reviewers
26
26
 
27
27
  Call `subagent` with `tasks: [...]` containing ALL THREE reviewers simultaneously:
28
28
 
29
- **Reviewer A Requirements Coverage**
30
- Prompt: "Review milestone {{milestoneId}} requirements coverage. Working directory: {{workingDirectory}}. Read `.gsd/{{milestoneId}}/REQUIREMENTS.md` (or equivalent requirements file). For each requirement, check the slice SUMMARY files in `.gsd/{{milestoneId}}/` to determine if it is: COVERED (clearly demonstrated), PARTIAL (mentioned but not fully demonstrated), or MISSING (no evidence). Output a markdown table with columns: Requirement | Status | Evidence. End with a one-line verdict: PASS if all covered, NEEDS-ATTENTION if partials exist, FAIL if any missing."
29
+ **Reviewer A - Requirements Coverage**
30
+ Prompt: "Review milestone {{milestoneId}} requirements coverage. Working directory: {{workingDirectory}}. Read `.gsd/{{milestoneId}}/REQUIREMENTS.md` or equivalent. For each requirement, check slice SUMMARY files in `.gsd/{{milestoneId}}/` and mark COVERED, PARTIAL, or MISSING. Output table: Requirement | Status | Evidence. End with one-line verdict: PASS if all covered, NEEDS-ATTENTION if partials exist, FAIL if any missing."
31
31
 
32
- **Reviewer B Cross-Slice Integration**
33
- Prompt: "Review milestone {{milestoneId}} cross-slice integration. Working directory: {{workingDirectory}}. Read `{{roadmapPath}}` and find the boundary map (produces/consumes contracts). For each boundary, check that the producing slice's SUMMARY confirms it produced the artifact, and the consuming slice's SUMMARY confirms it consumed it. Output a markdown table: Boundary | Producer Summary | Consumer Summary | Status. End with a one-line verdict: PASS if all boundaries honored, NEEDS-ATTENTION if any gaps."
32
+ **Reviewer B - Cross-Slice Integration**
33
+ Prompt: "Review milestone {{milestoneId}} cross-slice integration. Working directory: {{workingDirectory}}. Read `{{roadmapPath}}` and find the boundary map (produces/consumes contracts). For each boundary, confirm producer SUMMARY produced the artifact and consumer SUMMARY consumed it. Output table: Boundary | Producer Summary | Consumer Summary | Status. End with one-line verdict: PASS if all boundaries honored, NEEDS-ATTENTION if any gaps."
34
34
 
35
- **Reviewer C Assessment & Acceptance Criteria**
36
- Prompt: "Review milestone {{milestoneId}} assessment evidence and acceptance criteria. Working directory: {{workingDirectory}}. Read `.gsd/{{milestoneId}}/CONTEXT.md` for acceptance criteria. Check for ASSESSMENT files in each slice directory. Verify each acceptance criterion maps to either a passing assessment result or clear SUMMARY evidence. Then review the inlined milestone verification classes from planning. For each non-empty planned class, output a markdown table: Class | Planned Check | Evidence | Verdict. Use the exact class names `Contract`, `Integration`, `Operational`, and `UAT` whenever those classes are present. If no verification classes were planned, say that explicitly. Output two sections: `Acceptance Criteria` with a checklist `[ ] Criterion | Evidence`, and `Verification Classes` with the table. End with a one-line verdict: PASS if all criteria and verification classes are covered, NEEDS-ATTENTION if gaps exist."
35
+ **Reviewer C - Assessment & Acceptance Criteria**
36
+ Prompt: "Review milestone {{milestoneId}} assessment evidence and acceptance criteria. Working directory: {{workingDirectory}}. Read `.gsd/{{milestoneId}}/CONTEXT.md` for criteria. Check slice ASSESSMENT files. Verify each criterion maps to a passing assessment or clear SUMMARY evidence. Then review inlined milestone verification classes. For each non-empty planned class, output table: Class | Planned Check | Evidence | Verdict. Use the exact class names `Contract`, `Integration`, `Operational`, and `UAT` whenever those classes are present. If no verification classes were planned, say that explicitly. Output sections `Acceptance Criteria` with checklist `[ ] Criterion | Evidence`, and `Verification Classes` with the table. End with one-line verdict: PASS if all criteria and classes are covered, NEEDS-ATTENTION if gaps exist."
37
37
 
38
- ### Step 2 Synthesize Findings
38
+ ### Step 2 - Synthesize Findings
39
39
 
40
- After all reviewers complete, aggregate their verdicts:
41
- - If ALL reviewers say PASS overall verdict: `pass`
42
- - If any reviewer says NEEDS-ATTENTION overall verdict: `needs-attention`
43
- - If any reviewer says FAIL overall verdict: `needs-remediation`
40
+ Aggregate reviewer verdicts:
41
+ - ALL PASS -> `pass`
42
+ - Any NEEDS-ATTENTION -> `needs-attention`
43
+ - Any FAIL -> `needs-remediation`
44
44
 
45
- ### Step 3 Persist Validation
45
+ ### Step 3 - Persist Validation
46
46
 
47
- Prepare the validation content you will pass to `gsd_validate_milestone`. Do **not** manually write `{{validationPath}}` the DB-backed tool is the canonical write path and renders the validation file for you.
47
+ Prepare validation content for `gsd_validate_milestone`. Do **not** manually write `{{validationPath}}` - the DB-backed tool is the canonical write path and renders the file.
48
48
 
49
49
  ```markdown
50
50
  ---
@@ -65,7 +65,7 @@ reviewers: 3
65
65
  <paste Reviewer C output>
66
66
 
67
67
  ## Synthesis
68
- <2-3 sentences summarizing overall findings and verdict rationale>
68
+ <2-3 sentence verdict rationale>
69
69
 
70
70
  ## Remediation Plan
71
71
  <if verdict is not pass: specific actions required>
@@ -74,14 +74,14 @@ reviewers: 3
74
74
  Call `gsd_validate_milestone` with the camelCase fields `milestoneId`, `verdict`, `remediationRound`, `successCriteriaChecklist`, `sliceDeliveryAudit`, `crossSliceIntegration`, `requirementCoverage`, `verdictRationale`, and `remediationPlan` when needed. If you include verification-class analysis, pass it in `verificationClasses`.
75
75
  Extract the `Verification Classes` subsection from Reviewer C and pass it verbatim in `verificationClasses` so the persisted validation output uses the canonical class names `Contract`, `Integration`, `Operational`, and `UAT`.
76
76
 
77
- **DB access safety:** Do NOT query `.gsd/gsd.db` directly via `sqlite3` or `node -e require('better-sqlite3')` the engine owns the WAL connection. Use `gsd_milestone_status` to read milestone and slice state. All data you need is already inlined in the context above or accessible via the `gsd_*` tools. Direct DB access corrupts the WAL and bypasses tool-level validation.
77
+ **DB access safety:** Do NOT query `.gsd/gsd.db` directly via `sqlite3` or `node -e require('better-sqlite3')` - the engine owns the WAL connection. Use `gsd_milestone_status` for milestone and slice state. Data is already inlined or available via `gsd_*` tools. Direct DB access risks WAL corruption and bypasses validation.
78
78
 
79
79
  If verdict is `needs-remediation`:
80
- - Use `gsd_reassess_roadmap` to add the remediation slices instead of editing `{{roadmapPath}}` manually
80
+ - Use `gsd_reassess_roadmap` to add remediation slices instead of editing `{{roadmapPath}}` manually.
81
81
  - Those slices will be planned and executed before validation re-runs
82
82
 
83
83
  **You MUST call `gsd_validate_milestone` before finishing. Do not manually write `{{validationPath}}`.**
84
84
 
85
- **File system safety:** When scanning milestone directories for evidence, use `ls` or `find` to list directory contents first never pass a directory path (e.g. `tasks/`, `slices/`) directly to the `read` tool. The `read` tool only accepts file paths, not directories.
85
+ **File system safety:** When scanning milestone directories, use `ls` or `find` first. Never pass a directory path such as `tasks/` or `slices/` directly to `read`; it only accepts files.
86
86
 
87
87
  When done, say: "Milestone {{milestoneId}} validation complete — verdict: <verdict>."
@@ -1,16 +1,16 @@
1
- You are merging changes from worktree **{{worktreeName}}** (branch `{{worktreeBranch}}`) into target branch `{{mainBranch}}`.
1
+ You are merging worktree **{{worktreeName}}** (branch `{{worktreeBranch}}`) into target branch `{{mainBranch}}`.
2
2
 
3
3
  ## Working Directory
4
4
 
5
- Your current working directory has been set to the **main project tree** at `{{mainTreePath}}`. You are on the `{{mainBranch}}` branch. All git and file commands run from here.
5
+ Your CWD is the **main project tree** at `{{mainTreePath}}` on `{{mainBranch}}`. Run all git and file commands here.
6
6
 
7
- - **Main tree (CWD):** `{{mainTreePath}}` — this is where you run `git merge`, read main-branch files, and commit
8
- - **Worktree directory:** `{{worktreePath}}` — the worktree's working copy; read files here to inspect worktree versions before merging
7
+ - **Main tree (CWD):** `{{mainTreePath}}` — run `git merge`, read main files, commit.
8
+ - **Worktree directory:** `{{worktreePath}}` — inspect worktree versions before merging.
9
9
  - **Worktree branch:** `{{worktreeBranch}}`
10
10
 
11
11
  ## Context
12
12
 
13
- The worktree was created as a parallel workspace. It may contain code changes, new milestones, updated roadmaps, new plans, research, decisions, or other artifacts that need to be merged into the target branch.
13
+ The worktree may contain code, milestones, roadmaps, plans, research, decisions, requirements, or other artifacts to merge.
14
14
 
15
15
  ### Commit History (worktree)
16
16
 
@@ -43,50 +43,50 @@ The worktree was created as a parallel workspace. It may contain code changes, n
43
43
 
44
44
  ## Your Task
45
45
 
46
- Analyze the changes and guide the merge. Follow these steps exactly:
46
+ Analyze and guide the merge exactly:
47
47
 
48
48
  ### Step 1: Categorize Changes
49
49
 
50
- Classify each changed file:
50
+ Classify each changed file.
51
51
 
52
52
  **Code changes:**
53
- - **New source files** — new modules, components, utilities, tests
54
- - **Modified source files** — changes to existing code
53
+ - **New source files** — modules, components, utilities, tests.
54
+ - **Modified source files** — existing code changes.
55
55
  - **Config changes** — package.json, tsconfig, build config, etc.
56
- - **Deleted files** — removed source or config files
56
+ - **Deleted files** — removed source/config.
57
57
 
58
58
  **GSD artifact changes:**
59
- - **New milestones** — entirely new M###/ directories with roadmaps
60
- - **New slices/tasks** — new planning artifacts within existing milestones
61
- - **Updated roadmaps** — modifications to existing M###-ROADMAP.md files
62
- - **Updated plans** — modifications to existing slice or task plans
63
- - **Research/context** — new or updated RESEARCH.md, CONTEXT.md files
59
+ - **New milestones** — new M###/ directories with roadmaps.
60
+ - **New slices/tasks** — planning artifacts inside existing milestones.
61
+ - **Updated roadmaps** — changed M###-ROADMAP.md files.
62
+ - **Updated plans** — changed slice/task plans.
63
+ - **Research/context** — new or updated RESEARCH.md, CONTEXT.md.
64
64
  - **Decisions** — changes to DECISIONS.md
65
65
  - **Requirements** — changes to REQUIREMENTS.md
66
66
  - **Other** — anything else
67
67
 
68
68
  ### Step 2: Conflict Assessment
69
69
 
70
- For each **modified** file, check whether the main branch version has also changed since the worktree branched off. Flag any files where both branches have diverged — these need manual reconciliation.
70
+ For each **modified** file, check whether main also changed since the worktree branched. Flag diverged files for manual reconciliation.
71
71
 
72
72
  To compare versions:
73
- - **Main-branch version:** read the file at its normal path (your CWD is the main tree)
74
- - **Worktree version:** read the file at `{{worktreePath}}/<relative-path>`
75
- - Use `git merge-base {{mainBranch}} {{worktreeBranch}}` to find the common ancestor if needed
73
+ - **Main version:** read normal path from CWD.
74
+ - **Worktree version:** read `{{worktreePath}}/<relative-path>`.
75
+ - Use `git merge-base {{mainBranch}} {{worktreeBranch}}` if needed.
76
76
 
77
77
  Classify each modified file:
78
- - **Clean merges** — main hasn't changed, worktree changes can apply directly
79
- - **Conflicts** — both branches changed the same file; needs reconciliation
80
- - **Stale changes** — worktree modified a file that main has since replaced or removed
78
+ - **Clean merges** — main unchanged; apply worktree changes directly.
79
+ - **Conflicts** — both changed same file; reconcile.
80
+ - **Stale changes** — main replaced/removed a file the worktree modified.
81
81
 
82
82
  ### Step 3: Merge Strategy
83
83
 
84
- Present a merge plan to the user:
84
+ Present a merge plan:
85
85
 
86
- 1. For **clean merges**: list files that will merge without conflict
87
- 2. For **conflicts**: show both versions side-by-side and propose a reconciled version
88
- 3. For **new files**: confirm they should be added to the main branch
89
- 4. For **removed files**: confirm the removals are intentional
86
+ 1. **Clean merges:** files expected to merge without conflict.
87
+ 2. **Conflicts:** show both versions side-by-side and propose reconciliation.
88
+ 3. **New files:** confirm they should be added.
89
+ 4. **Removed files:** confirm removals are intentional.
90
90
 
91
91
  Ask the user to confirm the merge plan before proceeding.
92
92
 
@@ -97,17 +97,17 @@ Ask the user to confirm the merge plan before proceeding.
97
97
  Once the user has explicitly confirmed, run all commands from `{{mainTreePath}}` (your CWD):
98
98
 
99
99
  1. Ensure you are on the target branch: `git checkout {{mainBranch}}`
100
- 2. If there are conflicts requiring manual reconciliation, apply the reconciled versions first
100
+ 2. If conflicts require manual reconciliation, apply reconciled versions first
101
101
  3. Run `git merge --squash {{worktreeBranch}}` to bring in all changes
102
- 4. Review the staged changes if any reconciled files need adjustment, apply them now
102
+ 4. Review staged changes; adjust reconciled files if needed
103
103
  5. Commit with message: `merge(worktree/{{worktreeName}}): <summary of what was merged>`
104
104
  6. Report what was merged
105
105
 
106
106
  ### Step 5: Cleanup Prompt
107
107
 
108
108
  After a successful merge, ask the user whether to:
109
- - **Remove the worktree** — delete the worktree directory and the `{{worktreeBranch}}` branch
110
- - **Keep the worktree** — leave it for continued parallel work
109
+ - **Remove the worktree** — delete the worktree directory and `{{worktreeBranch}}`.
110
+ - **Keep the worktree** — leave it for continued parallel work.
111
111
 
112
112
  If the user chooses to remove it, run these commands from `{{mainTreePath}}`:
113
113
  ```
@@ -119,7 +119,7 @@ git branch -D {{worktreeBranch}}
119
119
 
120
120
  ## Important
121
121
 
122
- - Never silently discard changes from either branch
123
- - When in doubt about a conflict, show both versions and ask the user
124
- - Preserve all GSD artifact formatting conventions (frontmatter, section structure, checkbox states)
125
- - If the worktree introduced new milestone IDs that conflict with main, flag this immediately
122
+ - Never silently discard changes from either branch.
123
+ - When in doubt, show both versions and ask.
124
+ - Preserve GSD artifact formatting: frontmatter, sections, checkbox states.
125
+ - If new milestone IDs conflict with main, flag immediately.
@@ -1,3 +1,5 @@
1
+ // Project/App: GSD-2
2
+ // File Purpose: Runtime state derivation from GSD workflow database and legacy files.
1
3
  // GSD Extension — State Derivation
2
4
  // DB-authoritative runtime derivation with explicit legacy filesystem fallback.
3
5
  // Pure TypeScript, zero Pi dependencies.
@@ -46,6 +48,7 @@ import { logWarning } from './workflow-logger.js';
46
48
  import { extractVerdict } from './verdict-parser.js';
47
49
  import { detectPendingEscalation } from './escalation.js';
48
50
  import { isTerminalMilestoneSummaryContent } from './milestone-summary-classifier.js';
51
+ import { incrementLegacyTelemetry } from './legacy-telemetry.js';
49
52
 
50
53
  import {
51
54
  isDbAvailable,
@@ -59,10 +62,9 @@ import {
59
62
  getRequirementCounts,
60
63
  getLatestAssessmentByScope,
61
64
  getPendingGateCountForTurn,
62
- type MilestoneRow,
63
- type SliceRow,
64
- type TaskRow,
65
65
  } from './gsd-db.js';
66
+ import type { MilestoneRow } from './db-milestone-artifact-rows.js';
67
+ import type { SliceRow, TaskRow } from './db-task-slice-rows.js';
66
68
 
67
69
  /**
68
70
  * A "ghost" milestone directory contains only META.json (and no substantive
@@ -331,6 +333,7 @@ export async function deriveState(
331
333
  }
332
334
  result = await _deriveStateImpl(basePath, opts);
333
335
  _telemetry.markdownDeriveCount++;
336
+ incrementLegacyTelemetry("legacy.markdownFallbackUsed");
334
337
  } else {
335
338
  if (wasDbOpenAttempted()) {
336
339
  logWarning("state", "DB unavailable — refusing implicit markdown state derivation");
@@ -0,0 +1,38 @@
1
+ import test from "node:test";
2
+ import assert from "node:assert/strict";
3
+
4
+ import { _buildAbortedPauseContext, isUserInitiatedAbortMessage } from "../bootstrap/agent-end-recovery.js";
5
+ import { _buildCancelledUnitStopReason } from "../auto/phases.js";
6
+
7
+ test("aborted agent_end maps errorMessage into structured aborted pause context", () => {
8
+ const withMessage = _buildAbortedPauseContext({ errorMessage: "provider aborted request" });
9
+ assert.deepEqual(withMessage, {
10
+ message: "provider aborted request",
11
+ category: "aborted",
12
+ isTransient: true,
13
+ });
14
+
15
+ const withoutMessage = _buildAbortedPauseContext({});
16
+ assert.deepEqual(withoutMessage, {
17
+ message: "Operation aborted",
18
+ category: "aborted",
19
+ isTransient: true,
20
+ });
21
+ });
22
+
23
+ test("cancelled non-session failures are labeled as unit aborts (not session-creation failures)", () => {
24
+ const cancelled = _buildCancelledUnitStopReason("execute-task", "M001-S001-T001", {
25
+ category: "aborted",
26
+ message: "tool invocation cancelled",
27
+ });
28
+
29
+ assert.match(cancelled.notifyMessage, /aborted after dispatch/);
30
+ assert.equal(cancelled.stopReason, "Unit aborted: tool invocation cancelled");
31
+ assert.equal(cancelled.loopReason, "unit-aborted");
32
+ });
33
+
34
+ test("provider user-abort errors are recognized as cancellations, not provider outages", () => {
35
+ assert.equal(isUserInitiatedAbortMessage("Claude Code process aborted by user"), true);
36
+ assert.equal(isUserInitiatedAbortMessage("Request aborted by user"), true);
37
+ assert.equal(isUserInitiatedAbortMessage("HTTP 503 Service Unavailable"), false);
38
+ });
@@ -13,6 +13,9 @@ import {
13
13
  formatWidgetTokens,
14
14
  estimateTimeRemaining,
15
15
  extractUatSliceId,
16
+ updateProgressWidget,
17
+ getRoadmapSlicesSync,
18
+ clearSliceProgressCache,
16
19
  getWidgetMode,
17
20
  cycleWidgetMode,
18
21
  _resetWidgetModeForTests,
@@ -20,7 +23,16 @@ import {
20
23
  _refreshLastCommitForTests,
21
24
  _getLastCommitForTests,
22
25
  _getLastCommitFetchedAtForTests,
26
+ formatRuntimeHealthSignal,
27
+ shouldRenderRoadmapProgress,
23
28
  } from "../auto-dashboard.ts";
29
+ import {
30
+ openDatabase,
31
+ closeDatabase,
32
+ insertMilestone,
33
+ insertSlice,
34
+ insertTask,
35
+ } from "../gsd-db.ts";
24
36
 
25
37
  const autoSource = readFileSync(join(process.cwd(), "src", "resources", "extensions", "gsd", "auto.ts"), "utf-8");
26
38
  const dashboardSource = readFileSync(join(process.cwd(), "src", "resources", "extensions", "gsd", "auto-dashboard.ts"), "utf-8");
@@ -183,6 +195,37 @@ test("formatWidgetTokens formats millions with M", () => {
183
195
  assert.equal(formatWidgetTokens(25_000_000), "25M");
184
196
  });
185
197
 
198
+ test("formatRuntimeHealthSignal surfaces idle recovery instead of generic progress", () => {
199
+ const signal = formatRuntimeHealthSignal({
200
+ version: 1,
201
+ unitType: "research-milestone",
202
+ unitId: "M001",
203
+ startedAt: 1_000,
204
+ updatedAt: 600_000,
205
+ phase: "recovered",
206
+ wrapupWarningSent: false,
207
+ continueHereFired: false,
208
+ timeoutAt: null,
209
+ lastProgressAt: 1_000,
210
+ progressCount: 1,
211
+ lastProgressKind: "idle-recovery-retry",
212
+ recoveryAttempts: 1,
213
+ lastRecoveryReason: "idle",
214
+ }, 600_000);
215
+
216
+ assert.deepEqual(signal, {
217
+ level: "yellow",
218
+ summary: "Recovering",
219
+ detail: "retry 1 after idle stall",
220
+ });
221
+ });
222
+
223
+ test("shouldRenderRoadmapProgress hides pre-roadmap zero-slice progress", () => {
224
+ assert.equal(shouldRenderRoadmapProgress(null), false);
225
+ assert.equal(shouldRenderRoadmapProgress({ done: 0, total: 0, activeSliceTasks: null } as any), false);
226
+ assert.equal(shouldRenderRoadmapProgress({ done: 0, total: 1, activeSliceTasks: null } as any), true);
227
+ });
228
+
186
229
  // ─── estimateTimeRemaining ──────────────────────────────────────────────
187
230
 
188
231
  test("estimateTimeRemaining returns null when no ledger data", () => {
@@ -220,6 +263,61 @@ test("auto progress widget renders RTK savings under the footer stats line", ()
220
263
  assert.match(dashboardSource, /lines\.push\(rightAlign\("", theme\.fg\("dim", cachedRtkLabel\), width\)\);/);
221
264
  });
222
265
 
266
+ test("updateProgressWidget refreshes slice progress cache immediately", (t) => {
267
+ const dir = makeTempDir("progress-cache");
268
+ mkdirSync(join(dir, ".gsd"), { recursive: true });
269
+
270
+ t.after(() => {
271
+ closeDatabase();
272
+ clearSliceProgressCache();
273
+ cleanup(dir);
274
+ });
275
+
276
+ openDatabase(join(dir, ".gsd", "gsd.db"));
277
+ insertMilestone({ id: "M001", title: "Milestone", status: "active" });
278
+ insertSlice({ milestoneId: "M001", id: "S01", title: "Done", status: "complete", sequence: 1 });
279
+ insertSlice({ milestoneId: "M001", id: "S02", title: "Active", status: "pending", sequence: 2 });
280
+ insertSlice({ milestoneId: "M001", id: "S03", title: "Pending", status: "pending", sequence: 3 });
281
+ insertTask({ milestoneId: "M001", sliceId: "S02", id: "T01", title: "Task", status: "complete" });
282
+
283
+ clearSliceProgressCache();
284
+ updateProgressWidget(
285
+ {
286
+ hasUI: true,
287
+ ui: { setWidget() {} },
288
+ } as any,
289
+ "complete-slice",
290
+ "M001/S02",
291
+ {
292
+ phase: "summarizing",
293
+ activeMilestone: { id: "M001", title: "Milestone" },
294
+ activeSlice: { id: "S02", title: "Active" },
295
+ activeTask: null,
296
+ } as any,
297
+ {
298
+ getAutoStartTime: () => 0,
299
+ isStepMode: () => false,
300
+ getCmdCtx: () => null,
301
+ getBasePath: () => dir,
302
+ isVerbose: () => false,
303
+ isSessionSwitching: () => false,
304
+ getCurrentDispatchedModelId: () => null,
305
+ },
306
+ );
307
+
308
+ const progress = getRoadmapSlicesSync();
309
+ assert.ok(progress, "progress cache should be populated immediately after updateProgressWidget");
310
+ assert.deepEqual({
311
+ done: progress.done,
312
+ total: progress.total,
313
+ activeSliceTasks: progress.activeSliceTasks,
314
+ }, {
315
+ done: 1,
316
+ total: 3,
317
+ activeSliceTasks: { done: 1, total: 1 },
318
+ });
319
+ });
320
+
223
321
  test("last commit refresh backs off cleanly when base path is not a git repo", (t) => {
224
322
  const dir = makeTempDir("non-git");
225
323
  mkdirSync(dir, { recursive: true });
@@ -879,6 +879,123 @@ test("autoLoop passes structured session-lock failure details to the handler", a
879
879
  );
880
880
  });
881
881
 
882
+ // Regression for #5308: the iteration prelude must dequeue sidecar items
883
+ // (popping the queue and emitting the `sidecar-dequeue` journal event) BEFORE
884
+ // validateSessionLock + break-on-invalid. Inverting that order silently drops
885
+ // queued sidecar work on lock-loss. Covers first-iteration and mid-session.
886
+ test("autoLoop dequeues sidecar item before session-lock break (first iteration, #5308)", async () => {
887
+ _resetPendingResolve();
888
+
889
+ const ctx = makeMockCtx();
890
+ ctx.ui.setStatus = () => {};
891
+ const pi = makeMockPi();
892
+ const s = makeLoopSession();
893
+ s.sidecarQueue.push({
894
+ kind: "hook" as const,
895
+ unitType: "hook/review",
896
+ unitId: "M001/S01/T01/review",
897
+ prompt: "review the code",
898
+ });
899
+
900
+ const journalEvents: string[] = [];
901
+ const deps = makeMockDeps({
902
+ validateSessionLock: () =>
903
+ ({
904
+ valid: false,
905
+ failureReason: "compromised",
906
+ expectedPid: process.pid,
907
+ }) as SessionLockStatus,
908
+ handleLostSessionLock: () => {
909
+ deps.callLog.push("handleLostSessionLock");
910
+ },
911
+ emitJournalEvent: (entry) => {
912
+ journalEvents.push(entry.eventType);
913
+ },
914
+ });
915
+
916
+ await autoLoop(ctx, pi, s, deps);
917
+
918
+ assert.equal(
919
+ s.sidecarQueue.length,
920
+ 0,
921
+ "sidecar item must be popped on lock-loss iteration (pre-#5308 ordering)",
922
+ );
923
+ assert.ok(
924
+ journalEvents.includes("sidecar-dequeue"),
925
+ "sidecar-dequeue journal event must be emitted before session-lock break",
926
+ );
927
+ assert.ok(
928
+ deps.callLog.includes("handleLostSessionLock"),
929
+ "session lock handler must still fire after sidecar dequeue",
930
+ );
931
+ assert.ok(!deps.callLog.includes("deriveState"), "lock loss should stop before deriving state");
932
+ });
933
+
934
+ test("autoLoop dequeues sidecar item before session-lock break (mid-session, #5308)", async () => {
935
+ _resetPendingResolve();
936
+
937
+ const ctx = makeMockCtx();
938
+ ctx.ui.setStatus = () => {};
939
+ const pi = makeMockPi();
940
+ const s = makeLoopSession();
941
+
942
+ const journalEvents: string[] = [];
943
+ let lockCheckCount = 0;
944
+ const deps = makeMockDeps({
945
+ // First iteration: lock valid; second iteration: lock invalidates.
946
+ validateSessionLock: () => {
947
+ lockCheckCount += 1;
948
+ if (lockCheckCount === 1) {
949
+ return { valid: true } as SessionLockStatus;
950
+ }
951
+ return {
952
+ valid: false,
953
+ failureReason: "compromised",
954
+ expectedPid: process.pid,
955
+ } as SessionLockStatus;
956
+ },
957
+ handleLostSessionLock: () => {
958
+ deps.callLog.push("handleLostSessionLock");
959
+ },
960
+ emitJournalEvent: (entry) => {
961
+ journalEvents.push(entry.eventType);
962
+ },
963
+ // Enqueue a sidecar item at the end of iteration 1, so iteration 2 begins
964
+ // with a non-empty queue and an invalid lock.
965
+ postUnitPostVerification: async () => {
966
+ deps.callLog.push("postUnitPostVerification");
967
+ s.sidecarQueue.push({
968
+ kind: "hook" as const,
969
+ unitType: "hook/review",
970
+ unitId: "M001/S01/T01/review",
971
+ prompt: "review the code",
972
+ });
973
+ return "continue" as const;
974
+ },
975
+ });
976
+
977
+ const loopPromise = autoLoop(ctx, pi, s, deps);
978
+ // Allow the loop to reach runUnit's await on iteration 1.
979
+ await new Promise((r) => setTimeout(r, 50));
980
+ resolveAgentEnd(makeEvent());
981
+ await loopPromise;
982
+
983
+ assert.ok(lockCheckCount >= 2, "lock validator must run on iteration 2");
984
+ assert.equal(
985
+ s.sidecarQueue.length,
986
+ 0,
987
+ "queued sidecar item must be popped on the lock-loss iteration",
988
+ );
989
+ assert.ok(
990
+ journalEvents.includes("sidecar-dequeue"),
991
+ "sidecar-dequeue journal event must be emitted before session-lock break",
992
+ );
993
+ assert.ok(
994
+ deps.callLog.includes("handleLostSessionLock"),
995
+ "lock-loss handler must still fire on iteration 2",
996
+ );
997
+ });
998
+
882
999
  test("autoLoop exits on terminal blocked state", async (t) => {
883
1000
  _resetPendingResolve();
884
1001