gsd-pi 2.58.0-dev.778d6ac → 2.58.0-dev.d63175c

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 (628) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +35 -49
  3. package/dist/headless-ui.d.ts +0 -17
  4. package/dist/headless-ui.js +3 -97
  5. package/dist/headless.js +6 -67
  6. package/dist/help-text.js +0 -1
  7. package/dist/onboarding.js +0 -44
  8. package/dist/resource-loader.js +1 -16
  9. package/dist/resources/agents/researcher.md +1 -1
  10. package/dist/resources/extensions/ask-user-questions.js +3 -16
  11. package/dist/resources/extensions/async-jobs/extension-manifest.json +1 -1
  12. package/dist/resources/extensions/bg-shell/extension-manifest.json +1 -1
  13. package/dist/resources/extensions/browser-tools/extension-manifest.json +1 -1
  14. package/dist/resources/extensions/claude-code-cli/partial-builder.js +6 -14
  15. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +36 -59
  16. package/dist/resources/extensions/context7/extension-manifest.json +1 -1
  17. package/dist/resources/extensions/get-secrets-from-user.js +5 -8
  18. package/dist/resources/extensions/google-search/extension-manifest.json +1 -1
  19. package/dist/resources/extensions/google-search/index.js +1 -2
  20. package/dist/resources/extensions/gsd/auto/phases.js +21 -25
  21. package/dist/resources/extensions/gsd/auto-artifact-paths.js +2 -2
  22. package/dist/resources/extensions/gsd/auto-dashboard.js +20 -37
  23. package/dist/resources/extensions/gsd/auto-dispatch.js +2 -17
  24. package/dist/resources/extensions/gsd/auto-model-selection.js +3 -26
  25. package/dist/resources/extensions/gsd/auto-post-unit.js +4 -16
  26. package/dist/resources/extensions/gsd/auto-prompts.js +1 -1
  27. package/dist/resources/extensions/gsd/auto-recovery.js +5 -13
  28. package/dist/resources/extensions/gsd/auto-start.js +22 -35
  29. package/dist/resources/extensions/gsd/auto-worktree.js +12 -196
  30. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +0 -32
  31. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +8 -80
  32. package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +1 -32
  33. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +18 -33
  34. package/dist/resources/extensions/gsd/bootstrap/system-context.js +11 -44
  35. package/dist/resources/extensions/gsd/bootstrap/write-gate.js +0 -67
  36. package/dist/resources/extensions/gsd/captures.js +4 -56
  37. package/dist/resources/extensions/gsd/db-writer.js +8 -116
  38. package/dist/resources/extensions/gsd/doctor-git-checks.js +0 -28
  39. package/dist/resources/extensions/gsd/doctor-providers.js +1 -2
  40. package/dist/resources/extensions/gsd/doctor-runtime-checks.js +4 -5
  41. package/dist/resources/extensions/gsd/doctor.js +1 -3
  42. package/dist/resources/extensions/gsd/error-classifier.js +10 -13
  43. package/dist/resources/extensions/gsd/extension-manifest.json +1 -16
  44. package/dist/resources/extensions/gsd/forensics.js +20 -123
  45. package/dist/resources/extensions/gsd/git-service.js +1 -23
  46. package/dist/resources/extensions/gsd/gitignore.js +0 -33
  47. package/dist/resources/extensions/gsd/gsd-db.js +9 -36
  48. package/dist/resources/extensions/gsd/guided-flow.js +44 -106
  49. package/dist/resources/extensions/gsd/health-widget-core.js +0 -31
  50. package/dist/resources/extensions/gsd/health-widget.js +0 -17
  51. package/dist/resources/extensions/gsd/index.js +1 -1
  52. package/dist/resources/extensions/gsd/memory-extractor.js +0 -7
  53. package/dist/resources/extensions/gsd/migrate-external.js +1 -8
  54. package/dist/resources/extensions/gsd/model-cost-table.js +0 -18
  55. package/dist/resources/extensions/gsd/model-router.js +1 -35
  56. package/dist/resources/extensions/gsd/native-git-bridge.js +0 -17
  57. package/dist/resources/extensions/gsd/notifications.js +1 -16
  58. package/dist/resources/extensions/gsd/parallel-eligibility.js +2 -13
  59. package/dist/resources/extensions/gsd/parallel-merge.js +5 -78
  60. package/dist/resources/extensions/gsd/parsers-legacy.js +3 -20
  61. package/dist/resources/extensions/gsd/paths.js +0 -43
  62. package/dist/resources/extensions/gsd/preferences-models.js +1 -14
  63. package/dist/resources/extensions/gsd/preferences-types.js +1 -2
  64. package/dist/resources/extensions/gsd/preferences.js +16 -13
  65. package/dist/resources/extensions/gsd/prompt-loader.js +1 -4
  66. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
  67. package/dist/resources/extensions/gsd/prompts/complete-slice.md +2 -4
  68. package/dist/resources/extensions/gsd/prompts/discuss-headless.md +1 -1
  69. package/dist/resources/extensions/gsd/prompts/discuss.md +1 -1
  70. package/dist/resources/extensions/gsd/prompts/execute-task.md +1 -3
  71. package/dist/resources/extensions/gsd/prompts/forensics.md +2 -2
  72. package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +1 -1
  73. package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +1 -1
  74. package/dist/resources/extensions/gsd/prompts/plan-slice.md +0 -2
  75. package/dist/resources/extensions/gsd/prompts/rethink.md +1 -1
  76. package/dist/resources/extensions/gsd/prompts/triage-captures.md +0 -1
  77. package/dist/resources/extensions/gsd/repo-identity.js +11 -205
  78. package/dist/resources/extensions/gsd/rethink.js +0 -5
  79. package/dist/resources/extensions/gsd/roadmap-slices.js +4 -5
  80. package/dist/resources/extensions/gsd/state.js +27 -85
  81. package/dist/resources/extensions/gsd/tests/dist-redirect.mjs +1 -20
  82. package/dist/resources/extensions/gsd/tools/complete-task.js +71 -34
  83. package/dist/resources/extensions/gsd/tools/plan-milestone.js +2 -12
  84. package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +1 -29
  85. package/dist/resources/extensions/gsd/tools/validate-milestone.js +3 -14
  86. package/dist/resources/extensions/gsd/triage-resolution.js +7 -22
  87. package/dist/resources/extensions/gsd/undo.js +2 -2
  88. package/dist/resources/extensions/gsd/unit-ownership.js +33 -164
  89. package/dist/resources/extensions/gsd/verdict-parser.js +8 -20
  90. package/dist/resources/extensions/gsd/workflow-manifest.js +5 -24
  91. package/dist/resources/extensions/gsd/workflow-projections.js +63 -95
  92. package/dist/resources/extensions/gsd/workflow-reconcile.js +5 -35
  93. package/dist/resources/extensions/gsd/workspace-index.js +0 -24
  94. package/dist/resources/extensions/gsd/worktree-manager.js +1 -105
  95. package/dist/resources/extensions/gsd/worktree-resolver.js +3 -20
  96. package/dist/resources/extensions/mcp-client/index.js +7 -11
  97. package/dist/resources/extensions/search-the-web/extension-manifest.json +1 -1
  98. package/dist/resources/extensions/shared/interview-ui.js +1 -11
  99. package/dist/resources/skills/create-gsd-extension/SKILL.md +3 -5
  100. package/dist/resources/skills/create-gsd-extension/references/key-rules-gotchas.md +4 -5
  101. package/dist/resources/skills/create-gsd-extension/workflows/add-capability.md +2 -2
  102. package/dist/resources/skills/create-gsd-extension/workflows/create-extension.md +4 -4
  103. package/dist/resources/skills/create-gsd-extension/workflows/debug-extension.md +3 -5
  104. package/dist/web/standalone/.next/BUILD_ID +1 -1
  105. package/dist/web/standalone/.next/app-path-routes-manifest.json +17 -17
  106. package/dist/web/standalone/.next/build-manifest.json +3 -3
  107. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  108. package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
  109. package/dist/web/standalone/.next/required-server-files.json +1 -1
  110. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  111. package/dist/web/standalone/.next/server/app/_global-error.html +2 -2
  112. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  113. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  114. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  115. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  116. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  117. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  118. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  119. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  120. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  121. package/dist/web/standalone/.next/server/app/_not-found.rsc +2 -2
  122. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  123. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  124. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  125. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  126. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  127. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  128. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  129. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  130. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  131. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  132. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  133. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  134. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  135. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  136. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  137. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  138. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  139. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  140. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  141. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  142. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  143. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  144. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  145. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  146. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  147. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  148. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  149. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  150. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  151. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  152. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  153. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  154. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  155. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  156. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  157. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  158. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  159. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  160. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  161. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  162. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  163. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  164. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  165. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  166. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  168. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  169. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  170. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  171. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  172. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  173. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  174. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  175. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  176. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  178. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  179. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  180. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  181. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  182. package/dist/web/standalone/.next/server/app/index.html +1 -1
  183. package/dist/web/standalone/.next/server/app/index.rsc +2 -2
  184. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  185. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
  186. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  187. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
  188. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  189. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  190. package/dist/web/standalone/.next/server/app-paths-manifest.json +17 -17
  191. package/dist/web/standalone/.next/server/chunks/2229.js +2 -2
  192. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  193. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  194. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  195. package/dist/web/standalone/.next/server/pages/500.html +2 -2
  196. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  197. package/dist/web/standalone/.next/static/chunks/6502.8b732f67a11b11b4.js +9 -0
  198. package/dist/web/standalone/.next/static/chunks/{webpack-a1c1e452c6b32d04.js → webpack-61d3afac6d0f0ce7.js} +1 -1
  199. package/dist/web/standalone/.next/static/css/a58ef8a151aa0493.css +1 -0
  200. package/dist/web/standalone/server.js +1 -1
  201. package/dist/web-mode.js +1 -2
  202. package/package.json +2 -2
  203. package/packages/native/dist/ast/index.js +5 -9
  204. package/packages/native/dist/ast/types.js +1 -2
  205. package/packages/native/dist/clipboard/index.js +7 -12
  206. package/packages/native/dist/clipboard/types.js +1 -2
  207. package/packages/native/dist/diff/index.js +7 -12
  208. package/packages/native/dist/diff/types.js +1 -2
  209. package/packages/native/dist/fd/index.js +3 -6
  210. package/packages/native/dist/fd/types.js +1 -2
  211. package/packages/native/dist/glob/index.js +5 -9
  212. package/packages/native/dist/glob/types.js +1 -2
  213. package/packages/native/dist/grep/index.js +5 -9
  214. package/packages/native/dist/grep/types.js +1 -2
  215. package/packages/native/dist/gsd-parser/index.js +11 -18
  216. package/packages/native/dist/gsd-parser/types.js +1 -2
  217. package/packages/native/dist/highlight/index.js +7 -12
  218. package/packages/native/dist/highlight/types.js +1 -2
  219. package/packages/native/dist/html/index.js +3 -6
  220. package/packages/native/dist/html/types.js +1 -2
  221. package/packages/native/dist/image/index.js +5 -10
  222. package/packages/native/dist/image/types.js +4 -7
  223. package/packages/native/dist/index.js +17 -70
  224. package/packages/native/dist/json-parse/index.js +8 -13
  225. package/packages/native/dist/native.js +10 -47
  226. package/packages/native/dist/ps/index.js +9 -15
  227. package/packages/native/dist/ps/types.js +1 -2
  228. package/packages/native/dist/stream-process/index.js +7 -12
  229. package/packages/native/dist/text/index.js +14 -24
  230. package/packages/native/dist/text/types.js +2 -5
  231. package/packages/native/dist/truncate/index.js +7 -12
  232. package/packages/native/dist/ttsr/index.js +7 -12
  233. package/packages/native/dist/ttsr/types.js +1 -2
  234. package/packages/native/dist/xxhash/index.js +5 -9
  235. package/packages/native/package.json +19 -19
  236. package/packages/native/src/native.ts +8 -9
  237. package/packages/pi-agent-core/dist/agent-loop.js +2 -3
  238. package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
  239. package/packages/pi-agent-core/dist/proxy.d.ts +1 -1
  240. package/packages/pi-agent-core/dist/proxy.d.ts.map +1 -1
  241. package/packages/pi-agent-core/dist/proxy.js.map +1 -1
  242. package/packages/pi-agent-core/src/agent-loop.ts +2 -3
  243. package/packages/pi-agent-core/src/proxy.ts +1 -1
  244. package/packages/pi-ai/dist/env-api-keys.js +0 -1
  245. package/packages/pi-ai/dist/env-api-keys.js.map +1 -1
  246. package/packages/pi-ai/dist/index.d.ts +0 -1
  247. package/packages/pi-ai/dist/index.d.ts.map +1 -1
  248. package/packages/pi-ai/dist/index.js +0 -1
  249. package/packages/pi-ai/dist/index.js.map +1 -1
  250. package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
  251. package/packages/pi-ai/dist/providers/anthropic-shared.js +2 -19
  252. package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
  253. package/packages/pi-ai/dist/types.d.ts +3 -3
  254. package/packages/pi-ai/dist/types.d.ts.map +1 -1
  255. package/packages/pi-ai/dist/types.js.map +1 -1
  256. package/packages/pi-ai/dist/utils/json-parse.d.ts +0 -3
  257. package/packages/pi-ai/dist/utils/json-parse.d.ts.map +1 -1
  258. package/packages/pi-ai/dist/utils/json-parse.js +1 -24
  259. package/packages/pi-ai/dist/utils/json-parse.js.map +1 -1
  260. package/packages/pi-ai/src/env-api-keys.ts +0 -1
  261. package/packages/pi-ai/src/index.ts +0 -1
  262. package/packages/pi-ai/src/providers/anthropic-shared.ts +2 -17
  263. package/packages/pi-ai/src/types.ts +2 -3
  264. package/packages/pi-ai/src/utils/json-parse.ts +1 -28
  265. package/packages/pi-coding-agent/dist/core/agent-session.d.ts +0 -4
  266. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  267. package/packages/pi-coding-agent/dist/core/agent-session.js +0 -31
  268. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  269. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +1 -17
  270. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
  271. package/packages/pi-coding-agent/dist/core/compaction/compaction.js +2 -62
  272. package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
  273. package/packages/pi-coding-agent/dist/core/exec.d.ts.map +1 -1
  274. package/packages/pi-coding-agent/dist/core/exec.js +1 -3
  275. package/packages/pi-coding-agent/dist/core/exec.js.map +1 -1
  276. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +0 -4
  277. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
  278. package/packages/pi-coding-agent/dist/core/extensions/index.js +0 -2
  279. package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
  280. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +0 -5
  281. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
  282. package/packages/pi-coding-agent/dist/core/extensions/loader.js +0 -5
  283. package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
  284. package/packages/pi-coding-agent/dist/core/index.d.ts +1 -1
  285. package/packages/pi-coding-agent/dist/core/index.d.ts.map +1 -1
  286. package/packages/pi-coding-agent/dist/core/index.js +1 -1
  287. package/packages/pi-coding-agent/dist/core/index.js.map +1 -1
  288. package/packages/pi-coding-agent/dist/core/lsp/index.d.ts.map +1 -1
  289. package/packages/pi-coding-agent/dist/core/lsp/index.js +0 -3
  290. package/packages/pi-coding-agent/dist/core/lsp/index.js.map +1 -1
  291. package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts.map +1 -1
  292. package/packages/pi-coding-agent/dist/core/lsp/lspmux.js +0 -3
  293. package/packages/pi-coding-agent/dist/core/lsp/lspmux.js.map +1 -1
  294. package/packages/pi-coding-agent/dist/core/messages.d.ts.map +1 -1
  295. package/packages/pi-coding-agent/dist/core/messages.js +2 -31
  296. package/packages/pi-coding-agent/dist/core/messages.js.map +1 -1
  297. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
  298. package/packages/pi-coding-agent/dist/core/model-resolver.js +0 -1
  299. package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  300. package/packages/pi-coding-agent/dist/core/resource-loader.d.ts +0 -10
  301. package/packages/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
  302. package/packages/pi-coding-agent/dist/core/resource-loader.js +1 -12
  303. package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
  304. package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +0 -6
  305. package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
  306. package/packages/pi-coding-agent/dist/core/retry-handler.js +1 -48
  307. package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
  308. package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts.map +1 -1
  309. package/packages/pi-coding-agent/dist/core/tools/hashline-read.js +3 -10
  310. package/packages/pi-coding-agent/dist/core/tools/hashline-read.js.map +1 -1
  311. package/packages/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
  312. package/packages/pi-coding-agent/dist/core/tools/read.js +4 -13
  313. package/packages/pi-coding-agent/dist/core/tools/read.js.map +1 -1
  314. package/packages/pi-coding-agent/dist/index.d.ts +2 -2
  315. package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
  316. package/packages/pi-coding-agent/dist/index.js +1 -1
  317. package/packages/pi-coding-agent/dist/index.js.map +1 -1
  318. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  319. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +0 -4
  320. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  321. package/packages/pi-coding-agent/dist/modes/rpc/remote-terminal.d.ts +0 -1
  322. package/packages/pi-coding-agent/dist/modes/rpc/remote-terminal.d.ts.map +1 -1
  323. package/packages/pi-coding-agent/dist/modes/rpc/remote-terminal.js +0 -5
  324. package/packages/pi-coding-agent/dist/modes/rpc/remote-terminal.js.map +1 -1
  325. package/packages/pi-coding-agent/src/core/agent-session.ts +1 -38
  326. package/packages/pi-coding-agent/src/core/compaction/compaction.ts +1 -94
  327. package/packages/pi-coding-agent/src/core/exec.ts +1 -3
  328. package/packages/pi-coding-agent/src/core/extensions/index.ts +0 -4
  329. package/packages/pi-coding-agent/src/core/extensions/loader.ts +0 -5
  330. package/packages/pi-coding-agent/src/core/index.ts +0 -6
  331. package/packages/pi-coding-agent/src/core/lsp/index.ts +0 -3
  332. package/packages/pi-coding-agent/src/core/lsp/lspmux.ts +0 -3
  333. package/packages/pi-coding-agent/src/core/messages.ts +2 -29
  334. package/packages/pi-coding-agent/src/core/model-resolver.ts +0 -1
  335. package/packages/pi-coding-agent/src/core/resource-loader.ts +1 -20
  336. package/packages/pi-coding-agent/src/core/retry-handler.ts +1 -52
  337. package/packages/pi-coding-agent/src/core/tools/hashline-read.ts +3 -11
  338. package/packages/pi-coding-agent/src/core/tools/read.ts +4 -14
  339. package/packages/pi-coding-agent/src/index.ts +0 -6
  340. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +0 -7
  341. package/packages/pi-coding-agent/src/modes/rpc/remote-terminal.ts +0 -6
  342. package/packages/pi-tui/dist/terminal.d.ts +0 -2
  343. package/packages/pi-tui/dist/terminal.d.ts.map +1 -1
  344. package/packages/pi-tui/dist/terminal.js +0 -9
  345. package/packages/pi-tui/dist/terminal.js.map +1 -1
  346. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  347. package/packages/pi-tui/dist/tui.js +0 -9
  348. package/packages/pi-tui/dist/tui.js.map +1 -1
  349. package/packages/pi-tui/src/terminal.ts +0 -14
  350. package/packages/pi-tui/src/tui.ts +0 -8
  351. package/scripts/ensure-workspace-builds.cjs +14 -45
  352. package/src/resources/agents/researcher.md +1 -1
  353. package/src/resources/extensions/ask-user-questions.ts +3 -21
  354. package/src/resources/extensions/async-jobs/extension-manifest.json +1 -1
  355. package/src/resources/extensions/bg-shell/extension-manifest.json +1 -1
  356. package/src/resources/extensions/browser-tools/extension-manifest.json +1 -1
  357. package/src/resources/extensions/claude-code-cli/partial-builder.ts +6 -13
  358. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +35 -63
  359. package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +0 -28
  360. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +1 -108
  361. package/src/resources/extensions/context7/extension-manifest.json +1 -1
  362. package/src/resources/extensions/get-secrets-from-user.ts +5 -8
  363. package/src/resources/extensions/google-search/extension-manifest.json +1 -1
  364. package/src/resources/extensions/google-search/index.ts +1 -2
  365. package/src/resources/extensions/gsd/auto/loop-deps.ts +0 -1
  366. package/src/resources/extensions/gsd/auto/phases.ts +34 -43
  367. package/src/resources/extensions/gsd/auto-artifact-paths.ts +2 -2
  368. package/src/resources/extensions/gsd/auto-dashboard.ts +19 -37
  369. package/src/resources/extensions/gsd/auto-dispatch.ts +2 -18
  370. package/src/resources/extensions/gsd/auto-model-selection.ts +5 -26
  371. package/src/resources/extensions/gsd/auto-post-unit.ts +4 -18
  372. package/src/resources/extensions/gsd/auto-prompts.ts +1 -1
  373. package/src/resources/extensions/gsd/auto-recovery.ts +5 -12
  374. package/src/resources/extensions/gsd/auto-start.ts +26 -35
  375. package/src/resources/extensions/gsd/auto-worktree.ts +9 -190
  376. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +0 -31
  377. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +8 -85
  378. package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +1 -38
  379. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +19 -31
  380. package/src/resources/extensions/gsd/bootstrap/system-context.ts +11 -50
  381. package/src/resources/extensions/gsd/bootstrap/write-gate.ts +0 -75
  382. package/src/resources/extensions/gsd/captures.ts +3 -63
  383. package/src/resources/extensions/gsd/db-writer.ts +7 -140
  384. package/src/resources/extensions/gsd/doctor-git-checks.ts +0 -26
  385. package/src/resources/extensions/gsd/doctor-providers.ts +1 -2
  386. package/src/resources/extensions/gsd/doctor-runtime-checks.ts +4 -5
  387. package/src/resources/extensions/gsd/doctor.ts +1 -3
  388. package/src/resources/extensions/gsd/error-classifier.ts +11 -14
  389. package/src/resources/extensions/gsd/extension-manifest.json +1 -16
  390. package/src/resources/extensions/gsd/forensics.ts +20 -144
  391. package/src/resources/extensions/gsd/git-service.ts +3 -26
  392. package/src/resources/extensions/gsd/gitignore.ts +0 -33
  393. package/src/resources/extensions/gsd/gsd-db.ts +7 -43
  394. package/src/resources/extensions/gsd/guided-flow.ts +45 -114
  395. package/src/resources/extensions/gsd/health-widget-core.ts +0 -34
  396. package/src/resources/extensions/gsd/health-widget.ts +0 -17
  397. package/src/resources/extensions/gsd/index.ts +0 -1
  398. package/src/resources/extensions/gsd/memory-extractor.ts +0 -8
  399. package/src/resources/extensions/gsd/migrate-external.ts +1 -9
  400. package/src/resources/extensions/gsd/model-cost-table.ts +0 -19
  401. package/src/resources/extensions/gsd/model-router.ts +1 -35
  402. package/src/resources/extensions/gsd/native-git-bridge.ts +0 -17
  403. package/src/resources/extensions/gsd/notifications.ts +0 -16
  404. package/src/resources/extensions/gsd/parallel-eligibility.ts +2 -15
  405. package/src/resources/extensions/gsd/parallel-merge.ts +4 -87
  406. package/src/resources/extensions/gsd/parsers-legacy.ts +3 -22
  407. package/src/resources/extensions/gsd/paths.ts +0 -42
  408. package/src/resources/extensions/gsd/preferences-models.ts +1 -14
  409. package/src/resources/extensions/gsd/preferences-types.ts +1 -2
  410. package/src/resources/extensions/gsd/preferences.ts +15 -13
  411. package/src/resources/extensions/gsd/prompt-loader.ts +1 -4
  412. package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
  413. package/src/resources/extensions/gsd/prompts/complete-slice.md +2 -4
  414. package/src/resources/extensions/gsd/prompts/discuss-headless.md +1 -1
  415. package/src/resources/extensions/gsd/prompts/discuss.md +1 -1
  416. package/src/resources/extensions/gsd/prompts/execute-task.md +1 -3
  417. package/src/resources/extensions/gsd/prompts/forensics.md +2 -2
  418. package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +1 -1
  419. package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +1 -1
  420. package/src/resources/extensions/gsd/prompts/plan-slice.md +0 -2
  421. package/src/resources/extensions/gsd/prompts/rethink.md +1 -1
  422. package/src/resources/extensions/gsd/prompts/triage-captures.md +0 -1
  423. package/src/resources/extensions/gsd/repo-identity.ts +11 -186
  424. package/src/resources/extensions/gsd/rethink.ts +0 -6
  425. package/src/resources/extensions/gsd/roadmap-slices.ts +4 -5
  426. package/src/resources/extensions/gsd/state.ts +32 -84
  427. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +0 -29
  428. package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +1 -71
  429. package/src/resources/extensions/gsd/tests/captures.test.ts +0 -103
  430. package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +0 -27
  431. package/src/resources/extensions/gsd/tests/complete-slice.test.ts +0 -21
  432. package/src/resources/extensions/gsd/tests/db-writer.test.ts +12 -7
  433. package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +5 -78
  434. package/src/resources/extensions/gsd/tests/derive-state.test.ts +0 -29
  435. package/src/resources/extensions/gsd/tests/discuss-queued-milestones.test.ts +0 -40
  436. package/src/resources/extensions/gsd/tests/dist-redirect.mjs +1 -20
  437. package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +0 -117
  438. package/src/resources/extensions/gsd/tests/empty-db-reconciliation.test.ts +79 -0
  439. package/src/resources/extensions/gsd/tests/forensics-dedup.test.ts +0 -31
  440. package/src/resources/extensions/gsd/tests/gsd-tools.test.ts +12 -125
  441. package/src/resources/extensions/gsd/tests/health-widget.test.ts +0 -67
  442. package/src/resources/extensions/gsd/tests/integration/auto-recovery.test.ts +1 -111
  443. package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +0 -101
  444. package/src/resources/extensions/gsd/tests/integration/auto-worktree.test.ts +0 -59
  445. package/src/resources/extensions/gsd/tests/integration/parallel-merge.test.ts +0 -110
  446. package/src/resources/extensions/gsd/tests/integration/run-uat.test.ts +1 -1
  447. package/src/resources/extensions/gsd/tests/memory-extractor.test.ts +2 -85
  448. package/src/resources/extensions/gsd/tests/model-cost-table.test.ts +0 -34
  449. package/src/resources/extensions/gsd/tests/model-router.test.ts +3 -68
  450. package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +0 -28
  451. package/src/resources/extensions/gsd/tests/notifications.test.ts +0 -45
  452. package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +1 -33
  453. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +0 -29
  454. package/src/resources/extensions/gsd/tests/provider-errors.test.ts +0 -38
  455. package/src/resources/extensions/gsd/tests/reassess-handler.test.ts +0 -117
  456. package/src/resources/extensions/gsd/tests/roadmap-slices.test.ts +0 -97
  457. package/src/resources/extensions/gsd/tests/secure-env-collect.test.ts +0 -134
  458. package/src/resources/extensions/gsd/tests/tool-naming.test.ts +1 -2
  459. package/src/resources/extensions/gsd/tests/triage-resolution.test.ts +0 -8
  460. package/src/resources/extensions/gsd/tests/unit-ownership.test.ts +17 -100
  461. package/src/resources/extensions/gsd/tests/validate-milestone-write-order.test.ts +1 -4
  462. package/src/resources/extensions/gsd/tests/workflow-logger.test.ts +0 -48
  463. package/src/resources/extensions/gsd/tests/workflow-manifest.test.ts +0 -92
  464. package/src/resources/extensions/gsd/tests/workflow-projections.test.ts +2 -4
  465. package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +1 -48
  466. package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +5 -29
  467. package/src/resources/extensions/gsd/tools/complete-task.ts +74 -36
  468. package/src/resources/extensions/gsd/tools/plan-milestone.ts +1 -13
  469. package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +0 -36
  470. package/src/resources/extensions/gsd/tools/validate-milestone.ts +2 -20
  471. package/src/resources/extensions/gsd/triage-resolution.ts +6 -23
  472. package/src/resources/extensions/gsd/types.ts +2 -4
  473. package/src/resources/extensions/gsd/undo.ts +2 -2
  474. package/src/resources/extensions/gsd/unit-ownership.ts +35 -206
  475. package/src/resources/extensions/gsd/verdict-parser.ts +6 -21
  476. package/src/resources/extensions/gsd/workflow-logger.ts +1 -3
  477. package/src/resources/extensions/gsd/workflow-manifest.ts +5 -22
  478. package/src/resources/extensions/gsd/workflow-projections.ts +64 -97
  479. package/src/resources/extensions/gsd/workflow-reconcile.ts +10 -39
  480. package/src/resources/extensions/gsd/workspace-index.ts +0 -30
  481. package/src/resources/extensions/gsd/worktree-manager.ts +1 -120
  482. package/src/resources/extensions/gsd/worktree-resolver.ts +3 -22
  483. package/src/resources/extensions/mcp-client/index.ts +7 -13
  484. package/src/resources/extensions/search-the-web/extension-manifest.json +1 -1
  485. package/src/resources/extensions/shared/interview-ui.ts +1 -12
  486. package/src/resources/skills/create-gsd-extension/SKILL.md +3 -5
  487. package/src/resources/skills/create-gsd-extension/references/key-rules-gotchas.md +4 -5
  488. package/src/resources/skills/create-gsd-extension/workflows/add-capability.md +2 -2
  489. package/src/resources/skills/create-gsd-extension/workflows/create-extension.md +4 -4
  490. package/src/resources/skills/create-gsd-extension/workflows/debug-extension.md +3 -5
  491. package/dist/resources/extensions/gsd/milestone-validation-gates.js +0 -45
  492. package/dist/resources/extensions/ollama/index.js +0 -112
  493. package/dist/resources/extensions/ollama/model-capabilities.js +0 -115
  494. package/dist/resources/extensions/ollama/ollama-client.js +0 -168
  495. package/dist/resources/extensions/ollama/ollama-commands.js +0 -194
  496. package/dist/resources/extensions/ollama/ollama-discovery.js +0 -69
  497. package/dist/resources/extensions/ollama/ollama-tool.js +0 -184
  498. package/dist/resources/extensions/ollama/types.js +0 -2
  499. package/dist/startup-model-validation.d.ts +0 -39
  500. package/dist/startup-model-validation.js +0 -50
  501. package/dist/web/standalone/.next/static/chunks/6502.7593d7797a4b3999.js +0 -9
  502. package/dist/web/standalone/.next/static/css/f6e8833d46e738d8.css +0 -1
  503. package/packages/native/src/__tests__/module-compat.test.mjs +0 -91
  504. package/packages/pi-agent-core/src/agent-loop.test.ts +0 -45
  505. package/packages/pi-ai/dist/providers/anthropic-shared.test.d.ts +0 -2
  506. package/packages/pi-ai/dist/providers/anthropic-shared.test.d.ts.map +0 -1
  507. package/packages/pi-ai/dist/providers/anthropic-shared.test.js +0 -25
  508. package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +0 -1
  509. package/packages/pi-ai/dist/utils/repair-tool-json.d.ts +0 -37
  510. package/packages/pi-ai/dist/utils/repair-tool-json.d.ts.map +0 -1
  511. package/packages/pi-ai/dist/utils/repair-tool-json.js +0 -75
  512. package/packages/pi-ai/dist/utils/repair-tool-json.js.map +0 -1
  513. package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.d.ts +0 -2
  514. package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.d.ts.map +0 -1
  515. package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.js +0 -73
  516. package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.js.map +0 -1
  517. package/packages/pi-ai/src/providers/anthropic-shared.test.ts +0 -29
  518. package/packages/pi-ai/src/utils/repair-tool-json.ts +0 -88
  519. package/packages/pi-ai/src/utils/tests/repair-tool-json.test.ts +0 -102
  520. package/packages/pi-coding-agent/dist/core/compaction/compaction.test.d.ts +0 -6
  521. package/packages/pi-coding-agent/dist/core/compaction/compaction.test.d.ts.map +0 -1
  522. package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js +0 -176
  523. package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js.map +0 -1
  524. package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.d.ts +0 -28
  525. package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.d.ts.map +0 -1
  526. package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.js +0 -37
  527. package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.js.map +0 -1
  528. package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.test.d.ts +0 -2
  529. package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.test.d.ts.map +0 -1
  530. package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.test.js +0 -63
  531. package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.test.js.map +0 -1
  532. package/packages/pi-coding-agent/dist/core/extensions/extension-sort.d.ts +0 -19
  533. package/packages/pi-coding-agent/dist/core/extensions/extension-sort.d.ts.map +0 -1
  534. package/packages/pi-coding-agent/dist/core/extensions/extension-sort.js +0 -115
  535. package/packages/pi-coding-agent/dist/core/extensions/extension-sort.js.map +0 -1
  536. package/packages/pi-coding-agent/dist/core/extensions/extension-sort.test.d.ts +0 -2
  537. package/packages/pi-coding-agent/dist/core/extensions/extension-sort.test.d.ts.map +0 -1
  538. package/packages/pi-coding-agent/dist/core/extensions/extension-sort.test.js +0 -109
  539. package/packages/pi-coding-agent/dist/core/extensions/extension-sort.test.js.map +0 -1
  540. package/packages/pi-coding-agent/dist/core/image-overflow-recovery.d.ts +0 -44
  541. package/packages/pi-coding-agent/dist/core/image-overflow-recovery.d.ts.map +0 -1
  542. package/packages/pi-coding-agent/dist/core/image-overflow-recovery.js +0 -97
  543. package/packages/pi-coding-agent/dist/core/image-overflow-recovery.js.map +0 -1
  544. package/packages/pi-coding-agent/dist/core/image-overflow-recovery.test.d.ts +0 -2
  545. package/packages/pi-coding-agent/dist/core/image-overflow-recovery.test.d.ts.map +0 -1
  546. package/packages/pi-coding-agent/dist/core/image-overflow-recovery.test.js +0 -181
  547. package/packages/pi-coding-agent/dist/core/image-overflow-recovery.test.js.map +0 -1
  548. package/packages/pi-coding-agent/dist/core/messages.test.d.ts +0 -9
  549. package/packages/pi-coding-agent/dist/core/messages.test.d.ts.map +0 -1
  550. package/packages/pi-coding-agent/dist/core/messages.test.js +0 -86
  551. package/packages/pi-coding-agent/dist/core/messages.test.js.map +0 -1
  552. package/packages/pi-coding-agent/dist/core/retry-handler.test.d.ts +0 -9
  553. package/packages/pi-coding-agent/dist/core/retry-handler.test.d.ts.map +0 -1
  554. package/packages/pi-coding-agent/dist/core/retry-handler.test.js +0 -193
  555. package/packages/pi-coding-agent/dist/core/retry-handler.test.js.map +0 -1
  556. package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.d.ts +0 -16
  557. package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.d.ts.map +0 -1
  558. package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js +0 -80
  559. package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js.map +0 -1
  560. package/packages/pi-coding-agent/src/core/compaction/compaction.test.ts +0 -236
  561. package/packages/pi-coding-agent/src/core/extensions/extension-manifest.test.ts +0 -77
  562. package/packages/pi-coding-agent/src/core/extensions/extension-manifest.ts +0 -62
  563. package/packages/pi-coding-agent/src/core/extensions/extension-sort.test.ts +0 -134
  564. package/packages/pi-coding-agent/src/core/extensions/extension-sort.ts +0 -137
  565. package/packages/pi-coding-agent/src/core/image-overflow-recovery.test.ts +0 -228
  566. package/packages/pi-coding-agent/src/core/image-overflow-recovery.ts +0 -118
  567. package/packages/pi-coding-agent/src/core/messages.test.ts +0 -114
  568. package/packages/pi-coding-agent/src/core/retry-handler.test.ts +0 -255
  569. package/packages/pi-coding-agent/src/core/tools/spawn-shell-windows.test.ts +0 -92
  570. package/src/resources/extensions/gsd/milestone-validation-gates.ts +0 -56
  571. package/src/resources/extensions/gsd/tests/auto-mode-interactive-guard.test.ts +0 -71
  572. package/src/resources/extensions/gsd/tests/cli-provider-rate-limit.test.ts +0 -47
  573. package/src/resources/extensions/gsd/tests/completion-hierarchy-guards.test.ts +0 -192
  574. package/src/resources/extensions/gsd/tests/db-path-worktree-symlink.test.ts +0 -131
  575. package/src/resources/extensions/gsd/tests/discord-invite-links.test.ts +0 -47
  576. package/src/resources/extensions/gsd/tests/discuss-empty-db-fallback.test.ts +0 -127
  577. package/src/resources/extensions/gsd/tests/dynamic-routing-default.test.ts +0 -20
  578. package/src/resources/extensions/gsd/tests/empty-content-abort-loop.test.ts +0 -74
  579. package/src/resources/extensions/gsd/tests/event-replay-idempotency.test.ts +0 -140
  580. package/src/resources/extensions/gsd/tests/forensics-context-persist.test.ts +0 -129
  581. package/src/resources/extensions/gsd/tests/forensics-db-completion.test.ts +0 -96
  582. package/src/resources/extensions/gsd/tests/gsdroot-worktree-detection.test.ts +0 -164
  583. package/src/resources/extensions/gsd/tests/guided-flow-dynamic-routing.test.ts +0 -135
  584. package/src/resources/extensions/gsd/tests/guided-flow-session-isolation.test.ts +0 -97
  585. package/src/resources/extensions/gsd/tests/hook-key-parsing.test.ts +0 -107
  586. package/src/resources/extensions/gsd/tests/integration/doctor-false-positives.test.ts +0 -243
  587. package/src/resources/extensions/gsd/tests/integration/gitignore-staging-2570.test.ts +0 -150
  588. package/src/resources/extensions/gsd/tests/integration/state-machine-live-validation.test.ts +0 -959
  589. package/src/resources/extensions/gsd/tests/migrate-external-worktree.test.ts +0 -105
  590. package/src/resources/extensions/gsd/tests/milestone-status-authoritative.test.ts +0 -116
  591. package/src/resources/extensions/gsd/tests/parallel-commit-scope.test.ts +0 -159
  592. package/src/resources/extensions/gsd/tests/parallel-eligibility-ghost.test.ts +0 -150
  593. package/src/resources/extensions/gsd/tests/plan-milestone-title.test.ts +0 -70
  594. package/src/resources/extensions/gsd/tests/project-relocation-recovery.test.ts +0 -297
  595. package/src/resources/extensions/gsd/tests/prompt-loader-replacement.test.ts +0 -178
  596. package/src/resources/extensions/gsd/tests/prompt-tool-names.test.ts +0 -69
  597. package/src/resources/extensions/gsd/tests/queue-execution-guard.test.ts +0 -157
  598. package/src/resources/extensions/gsd/tests/quick-turn-end-cleanup.test.ts +0 -90
  599. package/src/resources/extensions/gsd/tests/reconciliation-edge-cases.test.ts +0 -162
  600. package/src/resources/extensions/gsd/tests/slice-disk-reconcile.test.ts +0 -233
  601. package/src/resources/extensions/gsd/tests/stash-queued-context-files.test.ts +0 -305
  602. package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +0 -405
  603. package/src/resources/extensions/gsd/tests/state-derivation-parity.test.ts +0 -257
  604. package/src/resources/extensions/gsd/tests/state-machine-full-walkthrough.test.ts +0 -1628
  605. package/src/resources/extensions/gsd/tests/stop-auto-race-null-unit.test.ts +0 -106
  606. package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +0 -174
  607. package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +0 -221
  608. package/src/resources/extensions/gsd/tests/uat-stuck-loop-orphaned-worktree.test.ts +0 -289
  609. package/src/resources/extensions/gsd/tests/vacuum-recovery.test.ts +0 -154
  610. package/src/resources/extensions/gsd/tests/verdict-parser.test.ts +0 -156
  611. package/src/resources/extensions/gsd/tests/verification-operational-gate.test.ts +0 -82
  612. package/src/resources/extensions/gsd/tests/worktree-db-respawn-truncation.test.ts +0 -140
  613. package/src/resources/extensions/gsd/tests/worktree-nested-git-safety.test.ts +0 -101
  614. package/src/resources/extensions/gsd/tests/zombie-gsd-state.test.ts +0 -95
  615. package/src/resources/extensions/mcp-client/tests/server-name-spaces.test.ts +0 -55
  616. package/src/resources/extensions/ollama/index.ts +0 -130
  617. package/src/resources/extensions/ollama/model-capabilities.ts +0 -145
  618. package/src/resources/extensions/ollama/ollama-client.ts +0 -196
  619. package/src/resources/extensions/ollama/ollama-commands.ts +0 -248
  620. package/src/resources/extensions/ollama/ollama-discovery.ts +0 -106
  621. package/src/resources/extensions/ollama/ollama-tool.ts +0 -218
  622. package/src/resources/extensions/ollama/tests/model-capabilities.test.ts +0 -162
  623. package/src/resources/extensions/ollama/tests/ollama-client.test.ts +0 -38
  624. package/src/resources/extensions/ollama/tests/ollama-discovery.test.ts +0 -28
  625. package/src/resources/extensions/ollama/types.ts +0 -130
  626. package/src/resources/extensions/shared/tests/ask-user-freetext.test.ts +0 -156
  627. /package/dist/web/standalone/.next/static/{R0D4xaIPl5kg93edN7Oo0 → 5DLsjFHdSB6_a1EDQVjr7}/_buildManifest.js +0 -0
  628. /package/dist/web/standalone/.next/static/{R0D4xaIPl5kg93edN7Oo0 → 5DLsjFHdSB6_a1EDQVjr7}/_ssgManifest.js +0 -0
@@ -11,7 +11,6 @@
11
11
  * Extracted from handleAgentEnd() in auto.ts.
12
12
  */
13
13
  import { deriveState } from "./state.js";
14
- import { logWarning, logError } from "./workflow-logger.js";
15
14
  import { loadFile, parseSummary, resolveAllOverrides } from "./files.js";
16
15
  import { loadPrompt } from "./prompt-loader.js";
17
16
  import { resolveSliceFile, resolveTaskFile, resolveMilestoneFile, resolveTasksDir, buildTaskFileName, } from "./paths.js";
@@ -320,18 +319,18 @@ export async function postUnitPreVerification(pctx, opts) {
320
319
  ctx.ui.notify(`Triage: ${triageResult.quickTasks.length} quick-task${triageResult.quickTasks.length === 1 ? "" : "s"} queued for execution.`, "info");
321
320
  }
322
321
  for (const action of triageResult.actions) {
323
- logWarning("engine", `triage resolution: ${action}`);
322
+ process.stderr.write(`gsd-triage: ${action}\n`);
324
323
  }
325
324
  }
326
325
  catch (err) {
327
- logError("engine", "triage resolution failed", { error: err.message });
326
+ process.stderr.write(`gsd-triage: resolution execution failed: ${err.message}\n`);
328
327
  }
329
328
  }
330
329
  // Rogue file detection — safety net for LLM bypassing completion tools (D003)
331
330
  try {
332
331
  const rogueFiles = detectRogueFileWrites(s.currentUnit.type, s.currentUnit.id, s.basePath);
333
332
  for (const rogue of rogueFiles) {
334
- logWarning("engine", "rogue file write detected", { path: rogue.path, unitId: rogue.unitId });
333
+ process.stderr.write(`gsd-rogue: detected rogue file write: ${rogue.path} (unit: ${rogue.unitId})\n`);
335
334
  ctx.ui.notify(`Rogue file write detected: ${rogue.path}`, "warning");
336
335
  }
337
336
  }
@@ -373,18 +372,7 @@ export async function postUnitPreVerification(pctx, opts) {
373
372
  // When artifact verification fails for a unit type that has a known expected
374
373
  // artifact, return "retry" so the caller re-dispatches with failure context
375
374
  // instead of blindly re-dispatching the same unit (#1571).
376
- //
377
- // HOWEVER, if the DB is unavailable (db_unavailable), the artifact was never
378
- // written because the completion tool failed at the infra level. Retrying
379
- // can never succeed and produces a costly re-dispatch loop (#2517).
380
- if (!triggerArtifactVerified && !isDbAvailable()) {
381
- // DB infra failure — do NOT retry; the completion tool returned
382
- // db_unavailable so the artifact was never written. Retrying would
383
- // produce an infinite re-dispatch loop (#2517).
384
- debugLog("postUnit", { phase: "artifact-verify-skip-db-unavailable", unitType: s.currentUnit.type, unitId: s.currentUnit.id });
385
- ctx.ui.notify(`Artifact missing for ${s.currentUnit.type} ${s.currentUnit.id} but DB is unavailable — skipping retry to avoid loop (#2517)`, "error");
386
- }
387
- else if (!triggerArtifactVerified) {
375
+ if (!triggerArtifactVerified) {
388
376
  const hasExpectedArtifact = resolveExpectedArtifactPath(s.currentUnit.type, s.currentUnit.id, s.basePath) !== null;
389
377
  if (hasExpectedArtifact) {
390
378
  const retryKey = `${s.currentUnit.type}:${s.currentUnit.id}`;
@@ -1403,7 +1403,7 @@ export async function buildRunUatPrompt(mid, sliceId, uatPath, uatContent, base)
1403
1403
  if (projectInline)
1404
1404
  inlined.push(projectInline);
1405
1405
  const inlinedContext = capPreamble(`## Inlined Context (preloaded — do not re-read these files)\n\n${inlined.join("\n\n---\n\n")}`);
1406
- const uatResultPath = join(base, relSliceFile(base, mid, sliceId, "ASSESSMENT"));
1406
+ const uatResultPath = join(base, relSliceFile(base, mid, sliceId, "UAT"));
1407
1407
  const uatType = getUatType(uatContent);
1408
1408
  return loadPrompt("run-uat", {
1409
1409
  workingDirectory: base,
@@ -11,7 +11,6 @@ import { clearParseCache } from "./files.js";
11
11
  import { parseRoadmap as parseLegacyRoadmap, parsePlan as parseLegacyPlan } from "./parsers-legacy.js";
12
12
  import { isDbAvailable, getTask, getSlice, getSliceTasks, updateTaskStatus } from "./gsd-db.js";
13
13
  import { isValidationTerminal } from "./state.js";
14
- import { getErrorMessage } from "./error-utils.js";
15
14
  import { nativeConflictFiles, nativeCommit, nativeCheckoutTheirs, nativeAddPaths, nativeMergeAbort, nativeResetHard, } from "./native-git-bridge.js";
16
15
  import { resolveSlicePath, resolveSliceFile, resolveTasksDir, resolveTaskFiles, relMilestoneFile, relSliceFile, buildSliceFileName, resolveMilestoneFile, clearPathCache, resolveGsdRootFile, } from "./paths.js";
17
16
  import { existsSync, mkdirSync, readFileSync, writeFileSync, unlinkSync, } from "node:fs";
@@ -426,19 +425,12 @@ export function reconcileMergeState(basePath, ctx) {
426
425
  if (conflictedFiles.length === 0) {
427
426
  // All conflicts resolved — finalize the merge/squash commit
428
427
  try {
429
- const commitSha = nativeCommit(basePath, ""); // --no-edit equivalent: use empty message placeholder
430
- if (commitSha) {
431
- const mode = hasMergeHead ? "merge" : "squash commit";
432
- ctx.ui.notify(`Finalized leftover ${mode} from prior session.`, "info");
433
- }
434
- else {
435
- ctx.ui.notify("No new commit needed for leftover merge/squash state — already committed.", "info");
436
- }
428
+ nativeCommit(basePath, ""); // --no-edit equivalent: use empty message placeholder
429
+ const mode = hasMergeHead ? "merge" : "squash commit";
430
+ ctx.ui.notify(`Finalized leftover ${mode} from prior session.`, "info");
437
431
  }
438
- catch (err) {
439
- const errorMessage = getErrorMessage(err);
440
- ctx.ui.notify(`Failed to finalize leftover merge/squash commit: ${errorMessage}`, "error");
441
- return false;
432
+ catch {
433
+ // Commit may already exist; non-fatal
442
434
  }
443
435
  }
444
436
  else {
@@ -30,14 +30,15 @@ import { initRoutingHistory } from "./routing-history.js";
30
30
  import { restoreHookState, resetHookState } from "./post-unit-hooks.js";
31
31
  import { resetProactiveHealing, setLevelChangeCallback } from "./doctor-proactive.js";
32
32
  import { snapshotSkills } from "./skill-discovery.js";
33
- import { isDbAvailable, getMilestone } from "./gsd-db.js";
33
+ import { isDbAvailable, getMilestone, openDatabase } from "./gsd-db.js";
34
34
  import { hideFooter } from "./auto-dashboard.js";
35
+ import { resolveProjectRootDbPath } from "./bootstrap/dynamic-tools.js";
35
36
  import { debugLog, enableDebug, isDebugEnabled, getDebugLogPath, } from "./debug-logger.js";
36
37
  import { parseUnitId } from "./unit-id.js";
38
+ import { setLogBasePath } from "./workflow-logger.js";
37
39
  import { existsSync, mkdirSync, readdirSync, statSync, unlinkSync, } from "node:fs";
38
40
  import { join } from "node:path";
39
41
  import { sep as pathSep } from "node:path";
40
- import { resolveProjectRootDbPath } from "./bootstrap/dynamic-tools.js";
41
42
  /**
42
43
  * Bootstrap a fresh auto-mode session. Handles everything from git init
43
44
  * through secrets collection, returning when ready for the first
@@ -46,33 +47,23 @@ import { resolveProjectRootDbPath } from "./bootstrap/dynamic-tools.js";
46
47
  * Returns false if the bootstrap aborted (e.g., guided flow returned,
47
48
  * concurrent session detected). Returns true when ready to dispatch.
48
49
  */
49
- /**
50
- * Open the project-root DB before the first deriveState call (#2841).
51
- * When auto-mode starts cold (no prior DB handle), state derivation that
52
- * touches DB-backed helpers (queue-order, task status) silently falls back
53
- * to markdown-only data, producing stale or incomplete state. Opening the
54
- * DB first ensures deriveState sees the full picture on its very first run.
55
- */
50
+ /** Guard: tracks consecutive bootstrap attempts that found phase === "complete".
51
+ * Prevents the recursive dialog loop described in #1348 where
52
+ * bootstrapAutoSession showSmartEntry checkAutoStartAfterDiscuss startAuto
53
+ * cycles indefinitely when the discuss workflow doesn't produce a milestone. */
54
+ let _consecutiveCompleteBootstraps = 0;
55
+ const MAX_CONSECUTIVE_COMPLETE_BOOTSTRAPS = 2;
56
56
  async function openProjectDbIfPresent(basePath) {
57
57
  const gsdDbPath = resolveProjectRootDbPath(basePath);
58
- if (!existsSync(gsdDbPath))
59
- return;
60
- if (isDbAvailable())
58
+ if (!existsSync(gsdDbPath) || isDbAvailable())
61
59
  return;
62
60
  try {
63
- const { openDatabase } = await import("./gsd-db.js");
64
61
  openDatabase(gsdDbPath);
65
62
  }
66
- catch {
67
- /* non-fatal DB lifecycle block below will retry */
63
+ catch (err) {
64
+ process.stderr.write(`gsd-db: failed to open existing database: ${err.message}\n`);
68
65
  }
69
66
  }
70
- /** Guard: tracks consecutive bootstrap attempts that found phase === "complete".
71
- * Prevents the recursive dialog loop described in #1348 where
72
- * bootstrapAutoSession → showSmartEntry → checkAutoStartAfterDiscuss → startAuto
73
- * cycles indefinitely when the discuss workflow doesn't produce a milestone. */
74
- let _consecutiveCompleteBootstraps = 0;
75
- const MAX_CONSECUTIVE_COMPLETE_BOOTSTRAPS = 2;
76
67
  export async function bootstrapAutoSession(s, ctx, pi, base, verboseMode, requestedStepMode, deps) {
77
68
  const { shouldUseWorktreeIsolation, registerSigtermHandler, lockBase, buildResolver, } = deps;
78
69
  const lockResult = acquireSessionLock(base);
@@ -129,13 +120,10 @@ export async function bootstrapAutoSession(s, ctx, pi, base, verboseMode, reques
129
120
  ensureGitignore(base, { manageGitignore });
130
121
  if (manageGitignore !== false)
131
122
  untrackRuntimeFiles(base);
132
- // Bootstrap milestones/ if it doesn't exist.
133
- // Check milestones/ directly — ensureGsdSymlink above already created .gsd/,
134
- // so checking .gsd/ existence would be dead code (#2942).
123
+ // Bootstrap .gsd/ if it doesn't exist
135
124
  const gsdDir = join(base, ".gsd");
136
- const milestonesPath = join(gsdDir, "milestones");
137
- if (!existsSync(milestonesPath)) {
138
- mkdirSync(milestonesPath, { recursive: true });
125
+ if (!existsSync(gsdDir)) {
126
+ mkdirSync(join(gsdDir, "milestones"), { recursive: true });
139
127
  try {
140
128
  nativeAddAll(base);
141
129
  nativeCommit(base, "chore: init gsd");
@@ -190,13 +178,13 @@ export async function bootstrapAutoSession(s, ctx, pi, base, verboseMode, reques
190
178
  });
191
179
  ctx.ui.notify(`Debug logging enabled → ${getDebugLogPath()}`, "info");
192
180
  }
181
+ // Open the project DB before the first derive so resume uses DB truth
182
+ // immediately on cold starts instead of falling back to markdown (#2841).
183
+ await openProjectDbIfPresent(base);
193
184
  // Invalidate caches before initial state derivation
194
185
  invalidateAllCaches();
195
186
  // Clean stale runtime unit files for completed milestones (#887)
196
187
  cleanStaleRuntimeUnits(gsdRoot(base), (mid) => !!resolveMilestoneFile(base, mid, "SUMMARY"));
197
- // Open the project-root DB before deriveState so DB-backed state
198
- // derivation (queue-order, task status) works on a cold start (#2841).
199
- await openProjectDbIfPresent(base);
200
188
  let state = await deriveState(base);
201
189
  // Stale worktree state recovery (#654)
202
190
  if (state.activeMilestone &&
@@ -348,6 +336,7 @@ export async function bootstrapAutoSession(s, ctx, pi, base, verboseMode, reques
348
336
  s.verbose = verboseMode;
349
337
  s.cmdCtx = ctx;
350
338
  s.basePath = base;
339
+ setLogBasePath(base);
351
340
  s.unitDispatchCount.clear();
352
341
  s.unitRecoveryCount.clear();
353
342
  s.lastBudgetAlertLevel = 0;
@@ -403,15 +392,14 @@ export async function bootstrapAutoSession(s, ctx, pi, base, verboseMode, reques
403
392
  }
404
393
  }
405
394
  // ── DB lifecycle ──
406
- const gsdDbPath = join(s.basePath, ".gsd", "gsd.db");
395
+ const gsdDbPath = resolveProjectRootDbPath(s.basePath);
407
396
  const gsdDirPath = join(s.basePath, ".gsd");
408
397
  if (existsSync(gsdDirPath) && !existsSync(gsdDbPath)) {
409
398
  const hasDecisions = existsSync(join(gsdDirPath, "DECISIONS.md"));
410
399
  const hasRequirements = existsSync(join(gsdDirPath, "REQUIREMENTS.md"));
411
400
  const hasMilestones = existsSync(join(gsdDirPath, "milestones"));
412
401
  try {
413
- const { openDatabase: openDb } = await import("./gsd-db.js");
414
- openDb(gsdDbPath);
402
+ openDatabase(gsdDbPath);
415
403
  if (hasDecisions || hasRequirements || hasMilestones) {
416
404
  const { migrateFromMarkdown } = await import("./md-importer.js");
417
405
  migrateFromMarkdown(s.basePath);
@@ -423,8 +411,7 @@ export async function bootstrapAutoSession(s, ctx, pi, base, verboseMode, reques
423
411
  }
424
412
  if (existsSync(gsdDbPath) && !isDbAvailable()) {
425
413
  try {
426
- const { openDatabase: openDb } = await import("./gsd-db.js");
427
- openDb(gsdDbPath);
414
+ openDatabase(gsdDbPath);
428
415
  }
429
416
  catch (err) {
430
417
  process.stderr.write(`gsd-db: failed to open existing database: ${err.message}\n`);
@@ -5,7 +5,7 @@
5
5
  * manual `/worktree` which uses `worktree/<name>` branches). This module
6
6
  * manages create, enter, detect, and teardown for auto-mode worktrees.
7
7
  */
8
- import { existsSync, cpSync, readFileSync, readdirSync, mkdirSync, realpathSync, rmSync, unlinkSync, statSync, lstatSync as lstatSyncFn, } from "node:fs";
8
+ import { existsSync, cpSync, readFileSync, readdirSync, mkdirSync, realpathSync, rmSync, unlinkSync, lstatSync as lstatSyncFn, } from "node:fs";
9
9
  import { isAbsolute, join, sep as pathSep } from "node:path";
10
10
  import { homedir } from "node:os";
11
11
  import { GSDError, GSD_IO_ERROR, GSD_GIT_ERROR } from "./errors.js";
@@ -20,7 +20,7 @@ import { MergeConflictError, readIntegrationBranch, RUNTIME_EXCLUSION_PATHS } fr
20
20
  import { debugLog } from "./debug-logger.js";
21
21
  import { logWarning } from "./workflow-logger.js";
22
22
  import { loadEffectiveGSDPreferences } from "./preferences.js";
23
- import { nativeGetCurrentBranch, nativeDetectMainBranch, nativeWorkingTreeStatus, nativeAddAllWithExclusions, nativeCommit, nativeCheckoutBranch, nativeMergeSquash, nativeConflictFiles, nativeCheckoutTheirs, nativeAddPaths, nativeRmForce, nativeBranchDelete, nativeBranchExists, nativeDiffNumstat, nativeUpdateRef, nativeIsAncestor, nativeMergeAbort, } from "./native-git-bridge.js";
23
+ import { nativeGetCurrentBranch, nativeDetectMainBranch, nativeWorkingTreeStatus, nativeAddAllWithExclusions, nativeCommit, nativeCheckoutBranch, nativeMergeSquash, nativeConflictFiles, nativeCheckoutTheirs, nativeAddPaths, nativeRmForce, nativeBranchDelete, nativeBranchExists, nativeDiffNumstat, nativeUpdateRef, nativeIsAncestor, } from "./native-git-bridge.js";
24
24
  const gsdHome = process.env.GSD_HOME || join(homedir(), ".gsd");
25
25
  const PROJECT_PREFERENCES_FILE = "PREFERENCES.md";
26
26
  const LEGACY_PROJECT_PREFERENCES_FILE = "preferences.md";
@@ -39,7 +39,6 @@ const ROOT_STATE_FILES = [
39
39
  "QUEUE.md",
40
40
  "completed-units.json",
41
41
  "metrics.json",
42
- "mcp.json",
43
42
  // NOTE: project preferences are intentionally NOT in ROOT_STATE_FILES.
44
43
  // Forward-sync (main → worktree) is handled explicitly in syncGsdStateToWorktree().
45
44
  // Back-sync (worktree → main) must NEVER overwrite the project root's copy
@@ -57,65 +56,6 @@ function isSamePath(a, b) {
57
56
  return false;
58
57
  }
59
58
  }
60
- // ─── ASSESSMENT Force-Sync Helper (#2821) ─────────────────────────────────
61
- /** Regex matching YAML frontmatter `verdict:` field. */
62
- const VERDICT_RE = /verdict:\s*[\w-]+/i;
63
- /**
64
- * Walk a milestone directory and force-overwrite ASSESSMENT files in the
65
- * destination when the source copy contains a `verdict:` field.
66
- *
67
- * This is the targeted fix for the UAT stuck-loop (#2821): the main
68
- * safeCopyRecursive uses force:false to protect worktree-authoritative
69
- * files (#1886), but ASSESSMENT files written by run-uat must be
70
- * forward-synced when the project root has a verdict. Without this,
71
- * the worktree retains a stale FAIL or missing ASSESSMENT and
72
- * checkNeedsRunUat re-dispatches run-uat indefinitely.
73
- *
74
- * Only overwrites when the source has a verdict — never clobbers a
75
- * worktree ASSESSMENT with a verdictless project-root copy.
76
- */
77
- function forceOverwriteAssessmentsWithVerdict(srcMilestoneDir, dstMilestoneDir) {
78
- if (!existsSync(srcMilestoneDir))
79
- return;
80
- // Walk slices/<SID>/ looking for *-ASSESSMENT.md files
81
- const slicesDir = join(srcMilestoneDir, "slices");
82
- if (!existsSync(slicesDir))
83
- return;
84
- try {
85
- for (const sliceEntry of readdirSync(slicesDir, { withFileTypes: true })) {
86
- if (!sliceEntry.isDirectory())
87
- continue;
88
- const srcSliceDir = join(slicesDir, sliceEntry.name);
89
- const dstSliceDir = join(dstMilestoneDir, "slices", sliceEntry.name);
90
- try {
91
- for (const fileEntry of readdirSync(srcSliceDir, { withFileTypes: true })) {
92
- if (!fileEntry.isFile())
93
- continue;
94
- if (!fileEntry.name.endsWith("-ASSESSMENT.md"))
95
- continue;
96
- const srcFile = join(srcSliceDir, fileEntry.name);
97
- try {
98
- const srcContent = readFileSync(srcFile, "utf-8");
99
- if (!VERDICT_RE.test(srcContent))
100
- continue; // no verdict in source — skip
101
- // Source has a verdict — force-copy into worktree
102
- mkdirSync(dstSliceDir, { recursive: true });
103
- safeCopy(srcFile, join(dstSliceDir, fileEntry.name), { force: true });
104
- }
105
- catch {
106
- /* non-fatal per file */
107
- }
108
- }
109
- }
110
- catch {
111
- /* non-fatal per slice */
112
- }
113
- }
114
- }
115
- catch {
116
- /* non-fatal */
117
- }
118
- }
119
59
  // ─── Module State ──────────────────────────────────────────────────────────
120
60
  /** Original project root before chdir into auto-worktree. */
121
61
  let originalBase = null;
@@ -207,31 +147,16 @@ export function syncProjectRootToWorktree(projectRoot, worktreePath_, milestoneI
207
147
  // by validate-milestone) get clobbered by stale project root copies,
208
148
  // causing an infinite re-validation loop (#1886).
209
149
  safeCopyRecursive(join(prGsd, "milestones", milestoneId), join(wtGsd, "milestones", milestoneId), { force: false });
210
- // Force-sync ASSESSMENT files that have a verdict from project root (#2821).
211
- // The additive-only copy above preserves worktree-authoritative files, but
212
- // ASSESSMENT files are special: after run-uat writes a verdict and post-unit
213
- // syncs it to the project root, the worktree may retain a stale copy (e.g.
214
- // verdict:fail while the project root has verdict:pass from a retry). On
215
- // session resume the DB is rebuilt from disk, and if the stale ASSESSMENT
216
- // persists, checkNeedsRunUat finds no passing verdict → re-dispatches
217
- // run-uat indefinitely (stuck-loop ×9).
218
- forceOverwriteAssessmentsWithVerdict(join(prGsd, "milestones", milestoneId), join(wtGsd, "milestones", milestoneId));
219
150
  // Forward-sync completed-units.json from project root to worktree.
220
151
  // Project root is authoritative for completion state after crash recovery;
221
152
  // without this, the worktree re-dispatches already-completed units (#1886).
222
153
  safeCopy(join(prGsd, "completed-units.json"), join(wtGsd, "completed-units.json"), { force: true });
223
- // Delete worktree gsd.db ONLY if it is empty (0 bytes).
224
- // An empty DB is stale/corrupt and should be rebuilt (#853).
225
- // A non-empty DB was populated by gsd-migrate on respawn and must be
226
- // preserved — deleting it truncates the file to 0 bytes when
227
- // openDatabase re-creates it, causing "no such table" failures (#2815).
154
+ // Delete worktree gsd.db so it rebuilds from the freshly synced files.
155
+ // Stale DB rows are the root cause of the infinite skip loop (#853).
228
156
  try {
229
157
  const wtDb = join(wtGsd, "gsd.db");
230
158
  if (existsSync(wtDb)) {
231
- const size = statSync(wtDb).size;
232
- if (size === 0) {
233
- unlinkSync(wtDb);
234
- }
159
+ unlinkSync(wtDb);
235
160
  }
236
161
  }
237
162
  catch {
@@ -930,7 +855,6 @@ function copyPlanningArtifacts(srcBase, wtPath) {
930
855
  "STATE.md",
931
856
  "KNOWLEDGE.md",
932
857
  "OVERRIDES.md",
933
- "mcp.json",
934
858
  ]) {
935
859
  safeCopy(join(srcGsd, file), join(dstGsd, file), { force: true });
936
860
  }
@@ -1271,17 +1195,7 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1271
1195
  encoding: "utf-8",
1272
1196
  }).trim();
1273
1197
  if (status) {
1274
- // Use --include-untracked to stash untracked files that would block
1275
- // the squash merge, but EXCLUDE .gsd/milestones/ (#2505).
1276
- // --include-untracked without exclusion sweeps queued milestone
1277
- // CONTEXT files into the stash. If stash pop later fails, those files
1278
- // are permanently trapped in the stash entry and lost on the next
1279
- // stash push or drop.
1280
- execFileSync("git", [
1281
- "stash", "push", "--include-untracked",
1282
- "-m", `gsd: pre-merge stash for ${milestoneId}`,
1283
- "--", ":(exclude).gsd/milestones",
1284
- ], { cwd: originalBasePath_, stdio: ["ignore", "pipe", "pipe"], encoding: "utf-8" });
1198
+ execFileSync("git", ["stash", "push", "--include-untracked", "-m", `gsd: pre-merge stash for ${milestoneId}`], { cwd: originalBasePath_, stdio: ["ignore", "pipe", "pipe"], encoding: "utf-8" });
1285
1199
  stashed = true;
1286
1200
  }
1287
1201
  }
@@ -1289,69 +1203,6 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1289
1203
  // Stash failure is non-fatal — proceed without stash and let the merge
1290
1204
  // report the dirty tree if it fails.
1291
1205
  }
1292
- // 7a. Shelter queued milestone directories before the squash merge (#2505).
1293
- // The milestone branch may contain copies of queued milestone dirs (via
1294
- // copyPlanningArtifacts), so `git merge --squash` rejects when those same
1295
- // files exist as untracked in the working tree. Temporarily move them to
1296
- // a backup location, then restore after the merge+commit.
1297
- const milestonesDir = join(gsdRoot(originalBasePath_), "milestones");
1298
- const shelterDir = join(gsdRoot(originalBasePath_), ".milestone-shelter");
1299
- const shelteredDirs = [];
1300
- // Helper: restore sheltered milestone directories (#2505).
1301
- // Called on both success and error paths to ensure queued CONTEXT files
1302
- // are never permanently lost.
1303
- const restoreShelter = () => {
1304
- if (shelteredDirs.length === 0)
1305
- return;
1306
- for (const dirName of shelteredDirs) {
1307
- try {
1308
- mkdirSync(milestonesDir, { recursive: true });
1309
- cpSync(join(shelterDir, dirName), join(milestonesDir, dirName), { recursive: true, force: true });
1310
- }
1311
- catch { /* best-effort */ }
1312
- }
1313
- try {
1314
- rmSync(shelterDir, { recursive: true, force: true });
1315
- }
1316
- catch { /* best-effort */ }
1317
- };
1318
- try {
1319
- if (existsSync(milestonesDir)) {
1320
- const entries = readdirSync(milestonesDir, { withFileTypes: true });
1321
- for (const entry of entries) {
1322
- if (!entry.isDirectory())
1323
- continue;
1324
- // Only shelter directories that do NOT belong to the milestone being merged
1325
- if (entry.name === milestoneId)
1326
- continue;
1327
- const srcDir = join(milestonesDir, entry.name);
1328
- const dstDir = join(shelterDir, entry.name);
1329
- try {
1330
- mkdirSync(shelterDir, { recursive: true });
1331
- cpSync(srcDir, dstDir, { recursive: true, force: true });
1332
- rmSync(srcDir, { recursive: true, force: true });
1333
- shelteredDirs.push(entry.name);
1334
- }
1335
- catch {
1336
- // Non-fatal — if shelter fails, the merge may still succeed
1337
- }
1338
- }
1339
- }
1340
- }
1341
- catch {
1342
- // Non-fatal — proceed with merge; untracked files may block it
1343
- }
1344
- // 7c. Clean stale MERGE_HEAD before the squash merge (#2912).
1345
- // The native (libgit2) merge path or a prior interrupted merge may leave
1346
- // MERGE_HEAD in the git dir. `git merge --squash` refuses to run when
1347
- // MERGE_HEAD exists, so remove it preemptively.
1348
- try {
1349
- const gitDirPre = resolveGitDir(originalBasePath_);
1350
- const mergeHeadPre = join(gitDirPre, "MERGE_HEAD");
1351
- if (existsSync(mergeHeadPre))
1352
- unlinkSync(mergeHeadPre);
1353
- }
1354
- catch { /* best-effort */ }
1355
1206
  // 8. Squash merge — auto-resolve .gsd/ state file conflicts (#530)
1356
1207
  const mergeResult = nativeMergeSquash(originalBasePath_, milestoneBranch);
1357
1208
  if (!mergeResult.success) {
@@ -1359,17 +1210,6 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1359
1210
  // untracked .gsd/ files left by syncStateToProjectRoot). Preserve the
1360
1211
  // milestone branch so commits are not lost.
1361
1212
  if (mergeResult.conflicts.includes("__dirty_working_tree__")) {
1362
- // Defensively clean merge state — the native path may leave MERGE_HEAD
1363
- // even when the merge is rejected (#2912).
1364
- try {
1365
- const gitDir_ = resolveGitDir(originalBasePath_);
1366
- for (const f of ["SQUASH_MSG", "MERGE_MSG", "MERGE_HEAD"]) {
1367
- const p = join(gitDir_, f);
1368
- if (existsSync(p))
1369
- unlinkSync(p);
1370
- }
1371
- }
1372
- catch { /* best-effort */ }
1373
1213
  // Pop stash before throwing so local work is not lost.
1374
1214
  if (stashed) {
1375
1215
  try {
@@ -1381,7 +1221,6 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1381
1221
  }
1382
1222
  catch { /* stash pop conflict is non-fatal */ }
1383
1223
  }
1384
- restoreShelter();
1385
1224
  // Restore cwd so the caller is not stranded on the integration branch
1386
1225
  process.chdir(previousCwd);
1387
1226
  // Surface the actual dirty filenames from git stderr instead of
@@ -1419,22 +1258,6 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1419
1258
  }
1420
1259
  // If there are still real code conflicts, escalate
1421
1260
  if (codeConflicts.length > 0) {
1422
- // Abort merge state so MERGE_HEAD is not left on disk (#2912).
1423
- // libgit2's merge creates MERGE_HEAD even for squash merges; if left
1424
- // dangling, subsequent merges fail and doctor reports corrupt state.
1425
- try {
1426
- nativeMergeAbort(originalBasePath_);
1427
- }
1428
- catch { /* best-effort */ }
1429
- try {
1430
- const gitDir_ = resolveGitDir(originalBasePath_);
1431
- for (const f of ["SQUASH_MSG", "MERGE_MSG", "MERGE_HEAD"]) {
1432
- const p = join(gitDir_, f);
1433
- if (existsSync(p))
1434
- unlinkSync(p);
1435
- }
1436
- }
1437
- catch { /* best-effort */ }
1438
1261
  // Pop stash before throwing so local work is not lost (#2151).
1439
1262
  if (stashed) {
1440
1263
  try {
@@ -1446,7 +1269,6 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1446
1269
  }
1447
1270
  catch { /* stash pop conflict is non-fatal */ }
1448
1271
  }
1449
- restoreShelter();
1450
1272
  throw new MergeConflictError(codeConflicts, "squash", milestoneBranch, mainBranch);
1451
1273
  }
1452
1274
  }
@@ -1455,19 +1277,15 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1455
1277
  // 9. Commit (handle nothing-to-commit gracefully)
1456
1278
  const commitResult = nativeCommit(originalBasePath_, commitMessage);
1457
1279
  const nothingToCommit = commitResult === null;
1458
- // 9a. Clean up merge state files left by git merge --squash (#1853, #2912).
1280
+ // 9a. Clean up SQUASH_MSG left by git merge --squash (#1853).
1459
1281
  // git only removes SQUASH_MSG when the commit reads it directly (plain
1460
1282
  // `git commit`). nativeCommit uses `-F -` (stdin) or libgit2, neither
1461
- // of which trigger git's SQUASH_MSG cleanup. MERGE_HEAD is created by
1462
- // libgit2's merge even in squash mode and is not removed by nativeCommit.
1463
- // If left on disk, doctor reports `corrupt_merge_state` on every subsequent run.
1283
+ // of which trigger git's SQUASH_MSG cleanup. If left on disk, doctor
1284
+ // reports `corrupt_merge_state` on every subsequent run.
1464
1285
  try {
1465
- const gitDir_ = resolveGitDir(originalBasePath_);
1466
- for (const f of ["SQUASH_MSG", "MERGE_MSG", "MERGE_HEAD"]) {
1467
- const p = join(gitDir_, f);
1468
- if (existsSync(p))
1469
- unlinkSync(p);
1470
- }
1286
+ const squashMsgPath = join(resolveGitDir(originalBasePath_), "SQUASH_MSG");
1287
+ if (existsSync(squashMsgPath))
1288
+ unlinkSync(squashMsgPath);
1471
1289
  }
1472
1290
  catch { /* best-effort */ }
1473
1291
  // 9a-ii. Restore stashed files now that the merge+commit is complete (#2151).
@@ -1527,8 +1345,6 @@ export function mergeMilestoneToMain(originalBasePath_, milestoneId, roadmapCont
1527
1345
  }
1528
1346
  }
1529
1347
  }
1530
- // 9a-iii. Restore sheltered queued milestone directories (#2505).
1531
- restoreShelter();
1532
1348
  // 9b. Safety check (#1792): if nothing was committed, verify the milestone
1533
1349
  // work is already on the integration branch before allowing teardown.
1534
1350
  // Compare only non-.gsd/ paths — .gsd/ state files diverge normally and
@@ -48,30 +48,6 @@ export async function handleAgentEnd(pi, event, ctx) {
48
48
  return;
49
49
  const lastMsg = event.messages[event.messages.length - 1];
50
50
  if (lastMsg && "stopReason" in lastMsg && lastMsg.stopReason === "aborted") {
51
- // Empty content with aborted stopReason is a non-fatal agent stop (the LLM
52
- // chose to end without producing output). Only pause on genuine fatal aborts
53
- // that carry error context — e.g. errorMessage field or non-empty content
54
- // indicating a mid-stream failure. (#2695)
55
- const content = "content" in lastMsg ? lastMsg.content : undefined;
56
- const hasEmptyContent = Array.isArray(content) && content.length === 0;
57
- const hasErrorMessage = "errorMessage" in lastMsg && !!lastMsg.errorMessage;
58
- if (hasEmptyContent && !hasErrorMessage) {
59
- // Non-fatal: treat as a normal agent end so the loop can continue
60
- // instead of entering a stuck re-dispatch cycle.
61
- try {
62
- resetRetryState(retryState);
63
- resolveAgentEnd(event);
64
- }
65
- catch (err) {
66
- const message = err instanceof Error ? err.message : String(err);
67
- ctx.ui.notify(`Auto-mode error after empty-content abort: ${message}. Stopping auto-mode.`, "error");
68
- try {
69
- await pauseAuto(ctx, pi);
70
- }
71
- catch { /* best-effort */ }
72
- }
73
- return;
74
- }
75
51
  await pauseAuto(ctx, pi);
76
52
  return;
77
53
  }
@@ -81,14 +57,6 @@ export async function handleAgentEnd(pi, event, ctx) {
81
57
  const explicitRetryAfterMs = ("retryAfterMs" in lastMsg && typeof lastMsg.retryAfterMs === "number") ? lastMsg.retryAfterMs : undefined;
82
58
  // ── 1. Classify ──────────────────────────────────────────────────────
83
59
  const cls = classifyError(errorMsg, explicitRetryAfterMs);
84
- // Cap rate-limit backoff for CLI-style providers (openai-codex, google-gemini-cli)
85
- // which use per-user quotas with shorter windows (#2922).
86
- if (cls.kind === "rate-limit") {
87
- const currentProvider = ctx.model?.provider;
88
- if (currentProvider === "openai-codex" || currentProvider === "google-gemini-cli") {
89
- cls.retryAfterMs = Math.min(cls.retryAfterMs, 30_000);
90
- }
91
- }
92
60
  // ── 2. Decide & Act ──────────────────────────────────────────────────
93
61
  // --- Network errors: same-model retry with backoff ---
94
62
  if (cls.kind === "network") {