gsd-pi 2.49.0 → 2.50.0-dev.d210a87

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 (679) hide show
  1. package/README.md +2 -0
  2. package/dist/cli.js +26 -0
  3. package/dist/headless-ui.js +12 -2
  4. package/dist/headless.js +29 -13
  5. package/dist/loader.js +4 -0
  6. package/dist/resource-loader.d.ts +4 -1
  7. package/dist/resource-loader.js +138 -3
  8. package/dist/resources/extensions/async-jobs/async-bash-tool.js +3 -1
  9. package/dist/resources/extensions/bg-shell/interaction.js +3 -1
  10. package/dist/resources/extensions/bg-shell/process-manager.js +4 -1
  11. package/dist/resources/extensions/claude-code-cli/partial-builder.js +5 -0
  12. package/dist/resources/extensions/gsd/auto/infra-errors.js +1 -0
  13. package/dist/resources/extensions/gsd/auto/phases.js +27 -12
  14. package/dist/resources/extensions/gsd/auto/resolve.js +2 -2
  15. package/dist/resources/extensions/gsd/auto/run-unit.js +2 -2
  16. package/dist/resources/extensions/gsd/auto/session.js +9 -0
  17. package/dist/resources/extensions/gsd/auto-artifact-paths.js +8 -10
  18. package/dist/resources/extensions/gsd/auto-dashboard.js +28 -6
  19. package/dist/resources/extensions/gsd/auto-dispatch.js +113 -74
  20. package/dist/resources/extensions/gsd/auto-observability.js +54 -0
  21. package/dist/resources/extensions/gsd/auto-post-unit.js +53 -99
  22. package/dist/resources/extensions/gsd/auto-prompts.js +155 -17
  23. package/dist/resources/extensions/gsd/auto-recovery.js +79 -205
  24. package/dist/resources/extensions/gsd/auto-start.js +4 -31
  25. package/dist/resources/extensions/gsd/auto-timers.js +2 -2
  26. package/dist/resources/extensions/gsd/auto-utils.js +20 -0
  27. package/dist/resources/extensions/gsd/auto-verification.js +4 -7
  28. package/dist/resources/extensions/gsd/auto-worktree.js +257 -113
  29. package/dist/resources/extensions/gsd/auto.js +22 -10
  30. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +89 -0
  31. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +24 -1
  32. package/dist/resources/extensions/gsd/branch-patterns.js +13 -0
  33. package/dist/resources/extensions/gsd/crash-recovery.js +6 -2
  34. package/dist/resources/extensions/gsd/custom-execution-policy.js +3 -2
  35. package/dist/resources/extensions/gsd/custom-verification.js +3 -1
  36. package/dist/resources/extensions/gsd/custom-workflow-engine.js +3 -2
  37. package/dist/resources/extensions/gsd/dashboard-overlay.js +4 -0
  38. package/dist/resources/extensions/gsd/detection.js +589 -3
  39. package/dist/resources/extensions/gsd/dispatch-guard.js +2 -1
  40. package/dist/resources/extensions/gsd/docs/preferences-reference.md +15 -0
  41. package/dist/resources/extensions/gsd/doctor-checks.js +5 -1234
  42. package/dist/resources/extensions/gsd/doctor-engine-checks.js +168 -0
  43. package/dist/resources/extensions/gsd/doctor-environment.js +28 -7
  44. package/dist/resources/extensions/gsd/doctor-git-checks.js +405 -0
  45. package/dist/resources/extensions/gsd/doctor-global-checks.js +74 -0
  46. package/dist/resources/extensions/gsd/doctor-runtime-checks.js +600 -0
  47. package/dist/resources/extensions/gsd/doctor.js +9 -1
  48. package/dist/resources/extensions/gsd/extension-manifest.json +1 -1
  49. package/dist/resources/extensions/gsd/files.js +5 -1
  50. package/dist/resources/extensions/gsd/git-service.js +9 -10
  51. package/dist/resources/extensions/gsd/gsd-db.js +124 -1
  52. package/dist/resources/extensions/gsd/guided-flow-queue.js +10 -11
  53. package/dist/resources/extensions/gsd/guided-flow.js +10 -0
  54. package/dist/resources/extensions/gsd/init-wizard.js +9 -1
  55. package/dist/resources/extensions/gsd/markdown-renderer.js +33 -5
  56. package/dist/resources/extensions/gsd/model-router.js +25 -0
  57. package/dist/resources/extensions/gsd/notifications.js +23 -0
  58. package/dist/resources/extensions/gsd/observability-validator.js +422 -0
  59. package/dist/resources/extensions/gsd/preferences-skills.js +11 -5
  60. package/dist/resources/extensions/gsd/preferences-types.js +3 -1
  61. package/dist/resources/extensions/gsd/preferences-validation.js +64 -0
  62. package/dist/resources/extensions/gsd/preferences.js +3 -0
  63. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +27 -8
  64. package/dist/resources/extensions/gsd/prompts/complete-slice.md +9 -8
  65. package/dist/resources/extensions/gsd/prompts/execute-task.md +16 -13
  66. package/dist/resources/extensions/gsd/prompts/forensics.md +19 -8
  67. package/dist/resources/extensions/gsd/prompts/gate-evaluate.md +32 -0
  68. package/dist/resources/extensions/gsd/prompts/guided-complete-slice.md +1 -1
  69. package/dist/resources/extensions/gsd/prompts/guided-execute-task.md +1 -1
  70. package/dist/resources/extensions/gsd/prompts/guided-plan-milestone.md +1 -1
  71. package/dist/resources/extensions/gsd/prompts/guided-plan-slice.md +1 -1
  72. package/dist/resources/extensions/gsd/prompts/plan-milestone.md +1 -1
  73. package/dist/resources/extensions/gsd/prompts/plan-slice.md +8 -3
  74. package/dist/resources/extensions/gsd/prompts/reassess-roadmap.md +3 -0
  75. package/dist/resources/extensions/gsd/prompts/replan-slice.md +1 -1
  76. package/dist/resources/extensions/gsd/prompts/validate-milestone.md +6 -1
  77. package/dist/resources/extensions/gsd/provider-error-pause.js +8 -0
  78. package/dist/resources/extensions/gsd/repo-identity.js +29 -0
  79. package/dist/resources/extensions/gsd/roadmap-mutations.js +110 -0
  80. package/dist/resources/extensions/gsd/roadmap-slices.js +2 -2
  81. package/dist/resources/extensions/gsd/rtk-status.js +43 -0
  82. package/dist/resources/extensions/gsd/rule-registry.js +10 -11
  83. package/dist/resources/extensions/gsd/session-forensics.js +13 -14
  84. package/dist/resources/extensions/gsd/session-lock.js +67 -56
  85. package/dist/resources/extensions/gsd/skill-catalog.js +1026 -0
  86. package/dist/resources/extensions/gsd/skill-discovery.js +3 -2
  87. package/dist/resources/extensions/gsd/skill-health.js +2 -2
  88. package/dist/resources/extensions/gsd/skill-telemetry.js +15 -5
  89. package/dist/resources/extensions/gsd/state.js +51 -12
  90. package/dist/resources/extensions/gsd/templates/milestone-summary.md +8 -0
  91. package/dist/resources/extensions/gsd/templates/milestone-validation.md +12 -0
  92. package/dist/resources/extensions/gsd/templates/plan.md +16 -0
  93. package/dist/resources/extensions/gsd/templates/preferences.md +2 -0
  94. package/dist/resources/extensions/gsd/templates/roadmap.md +13 -0
  95. package/dist/resources/extensions/gsd/templates/slice-summary.md +9 -0
  96. package/dist/resources/extensions/gsd/templates/task-plan.md +24 -0
  97. package/dist/resources/extensions/gsd/tests/dist-redirect.mjs +28 -9
  98. package/dist/resources/extensions/gsd/tools/plan-slice.js +14 -1
  99. package/dist/resources/extensions/gsd/tools/validate-milestone.js +3 -3
  100. package/dist/resources/extensions/gsd/undo.js +8 -7
  101. package/dist/resources/extensions/gsd/unit-runtime.js +2 -1
  102. package/dist/resources/extensions/gsd/verdict-parser.js +84 -0
  103. package/dist/resources/extensions/gsd/verification-gate.js +3 -1
  104. package/dist/resources/extensions/gsd/worktree-resolver.js +24 -0
  105. package/dist/resources/extensions/gsd/worktree.js +3 -2
  106. package/dist/resources/extensions/remote-questions/config.js +3 -5
  107. package/dist/resources/extensions/search-the-web/native-search.js +8 -3
  108. package/dist/resources/extensions/search-the-web/tool-search.js +19 -2
  109. package/dist/resources/extensions/shared/rtk-session-stats.js +189 -0
  110. package/dist/resources/extensions/shared/rtk.js +100 -0
  111. package/dist/resources/skills/github-workflows/references/gh/SKILL.md +22 -1
  112. package/dist/rtk.d.ts +52 -0
  113. package/dist/rtk.js +332 -0
  114. package/dist/web/standalone/.next/BUILD_ID +1 -1
  115. package/dist/web/standalone/.next/app-path-routes-manifest.json +20 -19
  116. package/dist/web/standalone/.next/build-manifest.json +4 -4
  117. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  118. package/dist/web/standalone/.next/react-loadable-manifest.json +2 -2
  119. package/dist/web/standalone/.next/required-server-files.json +3 -3
  120. package/dist/web/standalone/.next/routes-manifest.json +6 -0
  121. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  122. package/dist/web/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  123. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  124. package/dist/web/standalone/.next/server/app/_global-error.html +2 -2
  125. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  126. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  127. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  128. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  129. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  130. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  131. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  132. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  133. package/dist/web/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  134. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  135. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  136. package/dist/web/standalone/.next/server/app/_not-found.rsc +4 -4
  137. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  138. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  139. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  140. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  141. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  142. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  143. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  144. package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +1 -1
  145. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  146. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  147. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
  148. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  149. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  150. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
  151. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  152. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  153. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
  154. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  155. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  156. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js.nft.json +1 -1
  157. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  158. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  159. package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +1 -1
  160. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  161. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  162. package/dist/web/standalone/.next/server/app/api/cleanup/route.js.nft.json +1 -1
  163. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  164. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  165. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js.nft.json +1 -1
  166. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  168. package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +1 -1
  169. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  170. package/dist/web/standalone/.next/server/app/api/experimental/route.js +3 -0
  171. package/dist/web/standalone/.next/server/app/api/experimental/route.js.nft.json +1 -0
  172. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -0
  173. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  174. package/dist/web/standalone/.next/server/app/api/export-data/route.js.nft.json +1 -1
  175. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  176. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
  178. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  179. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  180. package/dist/web/standalone/.next/server/app/api/forensics/route.js.nft.json +1 -1
  181. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  182. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  183. package/dist/web/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  184. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  185. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  186. package/dist/web/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
  187. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  188. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  189. package/dist/web/standalone/.next/server/app/api/hooks/route.js.nft.json +1 -1
  190. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  191. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  192. package/dist/web/standalone/.next/server/app/api/inspect/route.js.nft.json +1 -1
  193. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  194. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  195. package/dist/web/standalone/.next/server/app/api/knowledge/route.js.nft.json +1 -1
  196. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  197. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  198. package/dist/web/standalone/.next/server/app/api/live-state/route.js.nft.json +1 -1
  199. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  200. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  201. package/dist/web/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -1
  202. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  203. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  204. package/dist/web/standalone/.next/server/app/api/preferences/route.js.nft.json +1 -1
  205. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  206. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  207. package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  208. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  209. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  210. package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
  211. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  212. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -26
  213. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js.nft.json +1 -1
  214. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  215. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  216. package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
  217. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  218. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  219. package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
  220. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  221. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  222. package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
  223. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  224. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  225. package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
  226. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  227. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  228. package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
  229. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  230. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  231. package/dist/web/standalone/.next/server/app/api/shutdown/route.js.nft.json +1 -1
  232. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  233. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  234. package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
  235. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  236. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  237. package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
  238. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  239. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  240. package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
  241. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  242. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
  243. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js.nft.json +1 -1
  244. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  245. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  246. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js.nft.json +1 -1
  247. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  248. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
  249. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
  250. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  251. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
  252. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
  253. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  254. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  255. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js.nft.json +1 -1
  256. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  257. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  258. package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
  259. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  260. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  261. package/dist/web/standalone/.next/server/app/api/update/route.js.nft.json +1 -1
  262. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  263. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  264. package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +1 -1
  265. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  266. package/dist/web/standalone/.next/server/app/index.html +1 -1
  267. package/dist/web/standalone/.next/server/app/index.rsc +5 -5
  268. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  269. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +5 -5
  270. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  271. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +4 -4
  272. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  273. package/dist/web/standalone/.next/server/app/page.js +2 -2
  274. package/dist/web/standalone/.next/server/app/page.js.nft.json +1 -1
  275. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  276. package/dist/web/standalone/.next/server/app-paths-manifest.json +20 -19
  277. package/dist/web/standalone/.next/server/chunks/2229.js +12 -0
  278. package/dist/web/standalone/.next/server/chunks/2331.js +25 -0
  279. package/dist/web/standalone/.next/server/chunks/{741.js → 4741.js} +1 -1
  280. package/dist/web/standalone/.next/server/chunks/5822.js +2 -0
  281. package/dist/web/standalone/.next/server/chunks/7471.js +13 -0
  282. package/dist/web/standalone/.next/server/functions-config-manifest.json +1 -0
  283. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  284. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  285. package/dist/web/standalone/.next/server/middleware.js +3 -3
  286. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  287. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  288. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  289. package/dist/web/standalone/.next/server/pages/500.html +2 -2
  290. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  291. package/dist/web/standalone/.next/server/webpack-runtime.js +1 -1
  292. package/dist/web/standalone/.next/static/chunks/{485.243af25f0cdf50d6.js → 2008.817d0885545aaea9.js} +6 -6
  293. package/dist/web/standalone/.next/static/chunks/4024.9ad5def014d90ce4.js +9 -0
  294. package/dist/web/standalone/.next/static/chunks/app/_global-error/page-c4cc189e7b117ea2.js +1 -0
  295. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  296. package/dist/web/standalone/.next/static/chunks/app/api/boot/route-c4cc189e7b117ea2.js +1 -0
  297. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/input/route-c4cc189e7b117ea2.js +1 -0
  298. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/resize/route-c4cc189e7b117ea2.js +1 -0
  299. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/stream/route-c4cc189e7b117ea2.js +1 -0
  300. package/dist/web/standalone/.next/static/chunks/app/api/browse-directories/route-c4cc189e7b117ea2.js +1 -0
  301. package/dist/web/standalone/.next/static/chunks/app/api/captures/route-c4cc189e7b117ea2.js +1 -0
  302. package/dist/web/standalone/.next/static/chunks/app/api/cleanup/route-c4cc189e7b117ea2.js +1 -0
  303. package/dist/web/standalone/.next/static/chunks/app/api/dev-mode/route-c4cc189e7b117ea2.js +1 -0
  304. package/dist/web/standalone/.next/static/chunks/app/api/doctor/route-c4cc189e7b117ea2.js +1 -0
  305. package/dist/web/standalone/.next/static/chunks/app/api/experimental/route-c4cc189e7b117ea2.js +1 -0
  306. package/dist/web/standalone/.next/static/chunks/app/api/export-data/route-c4cc189e7b117ea2.js +1 -0
  307. package/dist/web/standalone/.next/static/chunks/app/api/files/route-c4cc189e7b117ea2.js +1 -0
  308. package/dist/web/standalone/.next/static/chunks/app/api/forensics/route-c4cc189e7b117ea2.js +1 -0
  309. package/dist/web/standalone/.next/static/chunks/app/api/git/route-c4cc189e7b117ea2.js +1 -0
  310. package/dist/web/standalone/.next/static/chunks/app/api/history/route-c4cc189e7b117ea2.js +1 -0
  311. package/dist/web/standalone/.next/static/chunks/app/api/hooks/route-c4cc189e7b117ea2.js +1 -0
  312. package/dist/web/standalone/.next/static/chunks/app/api/inspect/route-c4cc189e7b117ea2.js +1 -0
  313. package/dist/web/standalone/.next/static/chunks/app/api/knowledge/route-c4cc189e7b117ea2.js +1 -0
  314. package/dist/web/standalone/.next/static/chunks/app/api/live-state/route-c4cc189e7b117ea2.js +1 -0
  315. package/dist/web/standalone/.next/static/chunks/app/api/onboarding/route-c4cc189e7b117ea2.js +1 -0
  316. package/dist/web/standalone/.next/static/chunks/app/api/preferences/route-c4cc189e7b117ea2.js +1 -0
  317. package/dist/web/standalone/.next/static/chunks/app/api/projects/route-c4cc189e7b117ea2.js +1 -0
  318. package/dist/web/standalone/.next/static/chunks/app/api/recovery/route-c4cc189e7b117ea2.js +1 -0
  319. package/dist/web/standalone/.next/static/chunks/app/api/remote-questions/route-c4cc189e7b117ea2.js +1 -0
  320. package/dist/web/standalone/.next/static/chunks/app/api/session/browser/route-c4cc189e7b117ea2.js +1 -0
  321. package/dist/web/standalone/.next/static/chunks/app/api/session/command/route-c4cc189e7b117ea2.js +1 -0
  322. package/dist/web/standalone/.next/static/chunks/app/api/session/events/route-c4cc189e7b117ea2.js +1 -0
  323. package/dist/web/standalone/.next/static/chunks/app/api/session/manage/route-c4cc189e7b117ea2.js +1 -0
  324. package/dist/web/standalone/.next/static/chunks/app/api/settings-data/route-c4cc189e7b117ea2.js +1 -0
  325. package/dist/web/standalone/.next/static/chunks/app/api/shutdown/route-c4cc189e7b117ea2.js +1 -0
  326. package/dist/web/standalone/.next/static/chunks/app/api/skill-health/route-c4cc189e7b117ea2.js +1 -0
  327. package/dist/web/standalone/.next/static/chunks/app/api/steer/route-c4cc189e7b117ea2.js +1 -0
  328. package/dist/web/standalone/.next/static/chunks/app/api/switch-root/route-c4cc189e7b117ea2.js +1 -0
  329. package/dist/web/standalone/.next/static/chunks/app/api/terminal/input/route-c4cc189e7b117ea2.js +1 -0
  330. package/dist/web/standalone/.next/static/chunks/app/api/terminal/resize/route-c4cc189e7b117ea2.js +1 -0
  331. package/dist/web/standalone/.next/static/chunks/app/api/terminal/sessions/route-c4cc189e7b117ea2.js +1 -0
  332. package/dist/web/standalone/.next/static/chunks/app/api/terminal/stream/route-c4cc189e7b117ea2.js +1 -0
  333. package/dist/web/standalone/.next/static/chunks/app/api/terminal/upload/route-c4cc189e7b117ea2.js +1 -0
  334. package/dist/web/standalone/.next/static/chunks/app/api/undo/route-c4cc189e7b117ea2.js +1 -0
  335. package/dist/web/standalone/.next/static/chunks/app/api/update/route-c4cc189e7b117ea2.js +1 -0
  336. package/dist/web/standalone/.next/static/chunks/app/api/visualizer/route-c4cc189e7b117ea2.js +1 -0
  337. package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
  338. package/dist/web/standalone/.next/static/chunks/app/page-b950e4e384cc62b3.js +1 -0
  339. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  340. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-c4cc189e7b117ea2.js +1 -0
  341. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-c4cc189e7b117ea2.js +1 -0
  342. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  343. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-c4cc189e7b117ea2.js +1 -0
  344. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-c4cc189e7b117ea2.js +1 -0
  345. package/dist/web/standalone/.next/static/chunks/webpack-cfc9a116e6450a6b.js +1 -0
  346. package/dist/web/standalone/.next/static/css/de141508b083f922.css +1 -0
  347. package/dist/web/standalone/.next/static/yJIyd5cXPNpmXTv18ZlyC/_buildManifest.js +1 -0
  348. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  349. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  350. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  351. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  352. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  353. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  354. package/dist/web/standalone/server.js +1 -1
  355. package/package.json +1 -1
  356. package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  357. package/packages/pi-agent-core/dist/agent-loop.js +4 -1
  358. package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
  359. package/packages/pi-agent-core/src/agent-loop.ts +4 -1
  360. package/packages/pi-ai/dist/providers/openai-codex-responses.js +39 -10
  361. package/packages/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
  362. package/packages/pi-ai/dist/types.d.ts +1 -0
  363. package/packages/pi-ai/dist/types.d.ts.map +1 -1
  364. package/packages/pi-ai/dist/types.js.map +1 -1
  365. package/packages/pi-ai/src/providers/openai-codex-responses.ts +39 -8
  366. package/packages/pi-ai/src/types.ts +1 -1
  367. package/packages/pi-coding-agent/dist/core/agent-session.d.ts +1 -0
  368. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  369. package/packages/pi-coding-agent/dist/core/agent-session.js +1 -0
  370. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  371. package/packages/pi-coding-agent/dist/core/bash-executor.d.ts +3 -1
  372. package/packages/pi-coding-agent/dist/core/bash-executor.d.ts.map +1 -1
  373. package/packages/pi-coding-agent/dist/core/bash-executor.js +10 -1
  374. package/packages/pi-coding-agent/dist/core/bash-executor.js.map +1 -1
  375. package/packages/pi-coding-agent/dist/core/blob-store.d.ts.map +1 -1
  376. package/packages/pi-coding-agent/dist/core/blob-store.js +8 -3
  377. package/packages/pi-coding-agent/dist/core/blob-store.js.map +1 -1
  378. package/packages/pi-coding-agent/dist/core/discovery-cache.d.ts.map +1 -1
  379. package/packages/pi-coding-agent/dist/core/discovery-cache.js +9 -2
  380. package/packages/pi-coding-agent/dist/core/discovery-cache.js.map +1 -1
  381. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
  382. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
  383. package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
  384. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +1 -0
  385. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  386. package/packages/pi-coding-agent/dist/core/extensions/runner.js +13 -0
  387. package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  388. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +19 -1
  389. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  390. package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  391. package/packages/pi-coding-agent/dist/core/extensions/wrapper.d.ts.map +1 -1
  392. package/packages/pi-coding-agent/dist/core/extensions/wrapper.js +8 -0
  393. package/packages/pi-coding-agent/dist/core/extensions/wrapper.js.map +1 -1
  394. package/packages/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
  395. package/packages/pi-coding-agent/dist/core/package-manager.js +8 -1
  396. package/packages/pi-coding-agent/dist/core/package-manager.js.map +1 -1
  397. package/packages/pi-coding-agent/dist/core/retry-handler.js +1 -1
  398. package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
  399. package/packages/pi-coding-agent/dist/core/skills.d.ts +11 -1
  400. package/packages/pi-coding-agent/dist/core/skills.d.ts.map +1 -1
  401. package/packages/pi-coding-agent/dist/core/skills.js +30 -8
  402. package/packages/pi-coding-agent/dist/core/skills.js.map +1 -1
  403. package/packages/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
  404. package/packages/pi-coding-agent/dist/core/slash-commands.js +1 -0
  405. package/packages/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
  406. package/packages/pi-coding-agent/dist/index.d.ts +2 -2
  407. package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
  408. package/packages/pi-coding-agent/dist/index.js +1 -1
  409. package/packages/pi-coding-agent/dist/index.js.map +1 -1
  410. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
  411. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +3 -2
  412. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
  413. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  414. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +13 -36
  415. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  416. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts +5 -0
  417. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -1
  418. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +12 -0
  419. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
  420. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  421. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +2 -1
  422. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
  423. package/packages/pi-coding-agent/dist/modes/rpc/jsonl.d.ts.map +1 -1
  424. package/packages/pi-coding-agent/dist/modes/rpc/jsonl.js +5 -0
  425. package/packages/pi-coding-agent/dist/modes/rpc/jsonl.js.map +1 -1
  426. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  427. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.js +0 -1
  428. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.js.map +1 -1
  429. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js +1 -1
  430. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
  431. package/packages/pi-coding-agent/package.json +1 -1
  432. package/packages/pi-coding-agent/src/core/agent-session.ts +2 -1
  433. package/packages/pi-coding-agent/src/core/bash-executor.ts +10 -2
  434. package/packages/pi-coding-agent/src/core/blob-store.ts +6 -3
  435. package/packages/pi-coding-agent/src/core/discovery-cache.ts +9 -2
  436. package/packages/pi-coding-agent/src/core/extensions/index.ts +2 -0
  437. package/packages/pi-coding-agent/src/core/extensions/runner.ts +18 -0
  438. package/packages/pi-coding-agent/src/core/extensions/types.ts +21 -0
  439. package/packages/pi-coding-agent/src/core/extensions/wrapper.ts +9 -0
  440. package/packages/pi-coding-agent/src/core/package-manager.ts +10 -1
  441. package/packages/pi-coding-agent/src/core/retry-handler.ts +1 -1
  442. package/packages/pi-coding-agent/src/core/skills.ts +35 -10
  443. package/packages/pi-coding-agent/src/core/slash-commands.ts +1 -0
  444. package/packages/pi-coding-agent/src/index.ts +4 -0
  445. package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +3 -2
  446. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +13 -36
  447. package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +15 -0
  448. package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +2 -1
  449. package/packages/pi-coding-agent/src/modes/rpc/jsonl.ts +6 -0
  450. package/packages/pi-coding-agent/src/modes/rpc/rpc-client.ts +0 -2
  451. package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +2 -2
  452. package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  453. package/pkg/dist/modes/interactive/theme/themes.js +2 -1
  454. package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
  455. package/pkg/package.json +1 -1
  456. package/scripts/postinstall.js +163 -6
  457. package/src/resources/extensions/async-jobs/async-bash-tool.ts +3 -1
  458. package/src/resources/extensions/bg-shell/interaction.ts +3 -1
  459. package/src/resources/extensions/bg-shell/process-manager.ts +4 -1
  460. package/src/resources/extensions/claude-code-cli/partial-builder.ts +5 -0
  461. package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +105 -0
  462. package/src/resources/extensions/gsd/auto/infra-errors.ts +1 -0
  463. package/src/resources/extensions/gsd/auto/phases.ts +25 -12
  464. package/src/resources/extensions/gsd/auto/resolve.ts +3 -3
  465. package/src/resources/extensions/gsd/auto/run-unit.ts +2 -2
  466. package/src/resources/extensions/gsd/auto/session.ts +11 -0
  467. package/src/resources/extensions/gsd/auto/types.ts +13 -0
  468. package/src/resources/extensions/gsd/auto-artifact-paths.ts +19 -21
  469. package/src/resources/extensions/gsd/auto-dashboard.ts +36 -5
  470. package/src/resources/extensions/gsd/auto-dispatch.ts +122 -71
  471. package/src/resources/extensions/gsd/auto-loop.ts +1 -1
  472. package/src/resources/extensions/gsd/auto-observability.ts +72 -0
  473. package/src/resources/extensions/gsd/auto-post-unit.ts +73 -110
  474. package/src/resources/extensions/gsd/auto-prompts.ts +159 -17
  475. package/src/resources/extensions/gsd/auto-recovery.ts +80 -221
  476. package/src/resources/extensions/gsd/auto-start.ts +7 -27
  477. package/src/resources/extensions/gsd/auto-timers.ts +2 -2
  478. package/src/resources/extensions/gsd/auto-utils.ts +25 -0
  479. package/src/resources/extensions/gsd/auto-verification.ts +4 -7
  480. package/src/resources/extensions/gsd/auto-worktree.ts +305 -108
  481. package/src/resources/extensions/gsd/auto.ts +26 -15
  482. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +93 -0
  483. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +25 -0
  484. package/src/resources/extensions/gsd/branch-patterns.ts +16 -0
  485. package/src/resources/extensions/gsd/crash-recovery.ts +6 -2
  486. package/src/resources/extensions/gsd/custom-execution-policy.ts +3 -2
  487. package/src/resources/extensions/gsd/custom-verification.ts +3 -1
  488. package/src/resources/extensions/gsd/custom-workflow-engine.ts +3 -2
  489. package/src/resources/extensions/gsd/dashboard-overlay.ts +7 -0
  490. package/src/resources/extensions/gsd/detection.ts +662 -3
  491. package/src/resources/extensions/gsd/dispatch-guard.ts +2 -1
  492. package/src/resources/extensions/gsd/docs/preferences-reference.md +15 -0
  493. package/src/resources/extensions/gsd/doctor-checks.ts +5 -1291
  494. package/src/resources/extensions/gsd/doctor-engine-checks.ts +182 -0
  495. package/src/resources/extensions/gsd/doctor-environment.ts +30 -7
  496. package/src/resources/extensions/gsd/doctor-git-checks.ts +415 -0
  497. package/src/resources/extensions/gsd/doctor-global-checks.ts +84 -0
  498. package/src/resources/extensions/gsd/doctor-runtime-checks.ts +626 -0
  499. package/src/resources/extensions/gsd/doctor.ts +9 -1
  500. package/src/resources/extensions/gsd/extension-manifest.json +1 -1
  501. package/src/resources/extensions/gsd/files.ts +6 -1
  502. package/src/resources/extensions/gsd/git-service.ts +7 -15
  503. package/src/resources/extensions/gsd/gsd-db.ts +150 -2
  504. package/src/resources/extensions/gsd/guided-flow-queue.ts +11 -12
  505. package/src/resources/extensions/gsd/guided-flow.ts +11 -0
  506. package/src/resources/extensions/gsd/init-wizard.ts +9 -1
  507. package/src/resources/extensions/gsd/markdown-renderer.ts +37 -4
  508. package/src/resources/extensions/gsd/model-router.ts +25 -0
  509. package/src/resources/extensions/gsd/notifications.ts +23 -0
  510. package/src/resources/extensions/gsd/observability-validator.ts +456 -0
  511. package/src/resources/extensions/gsd/preferences-skills.ts +11 -5
  512. package/src/resources/extensions/gsd/preferences-types.ts +25 -1
  513. package/src/resources/extensions/gsd/preferences-validation.ts +63 -0
  514. package/src/resources/extensions/gsd/preferences.ts +3 -0
  515. package/src/resources/extensions/gsd/prompts/complete-milestone.md +27 -8
  516. package/src/resources/extensions/gsd/prompts/complete-slice.md +9 -8
  517. package/src/resources/extensions/gsd/prompts/execute-task.md +16 -13
  518. package/src/resources/extensions/gsd/prompts/forensics.md +19 -8
  519. package/src/resources/extensions/gsd/prompts/gate-evaluate.md +32 -0
  520. package/src/resources/extensions/gsd/prompts/guided-complete-slice.md +1 -1
  521. package/src/resources/extensions/gsd/prompts/guided-execute-task.md +1 -1
  522. package/src/resources/extensions/gsd/prompts/guided-plan-milestone.md +1 -1
  523. package/src/resources/extensions/gsd/prompts/guided-plan-slice.md +1 -1
  524. package/src/resources/extensions/gsd/prompts/plan-milestone.md +1 -1
  525. package/src/resources/extensions/gsd/prompts/plan-slice.md +8 -3
  526. package/src/resources/extensions/gsd/prompts/reassess-roadmap.md +3 -0
  527. package/src/resources/extensions/gsd/prompts/replan-slice.md +1 -1
  528. package/src/resources/extensions/gsd/prompts/validate-milestone.md +6 -1
  529. package/src/resources/extensions/gsd/provider-error-pause.ts +9 -0
  530. package/src/resources/extensions/gsd/repo-identity.ts +28 -0
  531. package/src/resources/extensions/gsd/roadmap-mutations.ts +134 -0
  532. package/src/resources/extensions/gsd/roadmap-slices.ts +2 -2
  533. package/src/resources/extensions/gsd/rtk-status.ts +53 -0
  534. package/src/resources/extensions/gsd/rule-registry.ts +10 -11
  535. package/src/resources/extensions/gsd/session-forensics.ts +13 -14
  536. package/src/resources/extensions/gsd/session-lock.ts +92 -64
  537. package/src/resources/extensions/gsd/skill-catalog.ts +1085 -0
  538. package/src/resources/extensions/gsd/skill-discovery.ts +3 -2
  539. package/src/resources/extensions/gsd/skill-health.ts +2 -2
  540. package/src/resources/extensions/gsd/skill-telemetry.ts +15 -5
  541. package/src/resources/extensions/gsd/state.ts +54 -10
  542. package/src/resources/extensions/gsd/templates/milestone-summary.md +8 -0
  543. package/src/resources/extensions/gsd/templates/milestone-validation.md +12 -0
  544. package/src/resources/extensions/gsd/templates/plan.md +16 -0
  545. package/src/resources/extensions/gsd/templates/preferences.md +2 -0
  546. package/src/resources/extensions/gsd/templates/roadmap.md +13 -0
  547. package/src/resources/extensions/gsd/templates/slice-summary.md +9 -0
  548. package/src/resources/extensions/gsd/templates/task-plan.md +24 -0
  549. package/src/resources/extensions/gsd/tests/agent-end-retry.test.ts +2 -2
  550. package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +16 -0
  551. package/src/resources/extensions/gsd/tests/auto-lock-creation.test.ts +2 -2
  552. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +103 -0
  553. package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +1 -81
  554. package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +2 -2
  555. package/src/resources/extensions/gsd/tests/complete-slice.test.ts +2 -2
  556. package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
  557. package/src/resources/extensions/gsd/tests/completed-units-metrics-sync.test.ts +9 -12
  558. package/src/resources/extensions/gsd/tests/crash-recovery.test.ts +5 -3
  559. package/src/resources/extensions/gsd/tests/custom-verification.test.ts +33 -0
  560. package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +4 -3
  561. package/src/resources/extensions/gsd/tests/detection.test.ts +838 -0
  562. package/src/resources/extensions/gsd/tests/dist-redirect.mjs +28 -9
  563. package/src/resources/extensions/gsd/tests/doctor-environment.test.ts +115 -1
  564. package/src/resources/extensions/gsd/tests/doctor-fixlevel.test.ts +65 -1
  565. package/src/resources/extensions/gsd/tests/doctor-git.test.ts +50 -0
  566. package/src/resources/extensions/gsd/tests/double-merge-guard.test.ts +97 -0
  567. package/src/resources/extensions/gsd/tests/gate-dispatch.test.ts +189 -0
  568. package/src/resources/extensions/gsd/tests/gate-storage.test.ts +156 -0
  569. package/src/resources/extensions/gsd/tests/git-service.test.ts +49 -0
  570. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +1 -1
  571. package/src/resources/extensions/gsd/tests/idle-recovery.test.ts +63 -0
  572. package/src/resources/extensions/gsd/tests/infra-error.test.ts +12 -2
  573. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +39 -0
  574. package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
  575. package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
  576. package/src/resources/extensions/gsd/tests/model-router.test.ts +40 -0
  577. package/src/resources/extensions/gsd/tests/notifications.test.ts +28 -6
  578. package/src/resources/extensions/gsd/tests/plan-quality-validator.test.ts +474 -0
  579. package/src/resources/extensions/gsd/tests/preferences.test.ts +50 -0
  580. package/src/resources/extensions/gsd/tests/quality-gates.test.ts +347 -0
  581. package/src/resources/extensions/gsd/tests/queue-completed-milestone-perf.test.ts +155 -0
  582. package/src/resources/extensions/gsd/tests/queue-reorder-e2e.test.ts +40 -0
  583. package/src/resources/extensions/gsd/tests/reactive-executor.test.ts +6 -6
  584. package/src/resources/extensions/gsd/tests/replan-slice.test.ts +2 -1
  585. package/src/resources/extensions/gsd/tests/repo-identity-worktree.test.ts +32 -0
  586. package/src/resources/extensions/gsd/tests/retry-diagnostic-reasoning.test.ts +161 -0
  587. package/src/resources/extensions/gsd/tests/retry-state-reset.test.ts +4 -5
  588. package/src/resources/extensions/gsd/tests/rewrite-count-persist.test.ts +82 -0
  589. package/src/resources/extensions/gsd/tests/roadmap-slices.test.ts +26 -0
  590. package/src/resources/extensions/gsd/tests/run-uat.test.ts +166 -16
  591. package/src/resources/extensions/gsd/tests/session-lock-transient-read.test.ts +223 -0
  592. package/src/resources/extensions/gsd/tests/sidecar-queue.test.ts +12 -12
  593. package/src/resources/extensions/gsd/tests/skill-activation.test.ts +44 -4
  594. package/src/resources/extensions/gsd/tests/skill-catalog.test.ts +193 -0
  595. package/src/resources/extensions/gsd/tests/terminated-transient.test.ts +24 -0
  596. package/src/resources/extensions/gsd/tests/tool-naming.test.ts +1 -1
  597. package/src/resources/extensions/gsd/tests/triage-dispatch.test.ts +2 -2
  598. package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +2 -1
  599. package/src/resources/extensions/gsd/tests/verification-gate.test.ts +0 -16
  600. package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +67 -0
  601. package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +1 -1
  602. package/src/resources/extensions/gsd/tests/worktree-sync-overwrite-loop.test.ts +204 -0
  603. package/src/resources/extensions/gsd/tools/plan-slice.ts +16 -0
  604. package/src/resources/extensions/gsd/tools/validate-milestone.ts +3 -3
  605. package/src/resources/extensions/gsd/types.ts +32 -0
  606. package/src/resources/extensions/gsd/undo.ts +8 -7
  607. package/src/resources/extensions/gsd/unit-runtime.ts +2 -1
  608. package/src/resources/extensions/gsd/verdict-parser.ts +95 -0
  609. package/src/resources/extensions/gsd/verification-gate.ts +3 -3
  610. package/src/resources/extensions/gsd/worktree-resolver.ts +31 -0
  611. package/src/resources/extensions/gsd/worktree.ts +3 -2
  612. package/src/resources/extensions/remote-questions/config.ts +3 -5
  613. package/src/resources/extensions/search-the-web/native-search.ts +8 -3
  614. package/src/resources/extensions/search-the-web/tool-search.ts +22 -2
  615. package/src/resources/extensions/shared/rtk-session-stats.ts +249 -0
  616. package/src/resources/extensions/shared/rtk.ts +120 -0
  617. package/src/resources/skills/github-workflows/references/gh/SKILL.md +22 -1
  618. package/dist/resources/extensions/gsd/auto-worktree-sync.js +0 -191
  619. package/dist/resources/extensions/gsd/resource-version.js +0 -97
  620. package/dist/web/standalone/.next/server/chunks/229.js +0 -12
  621. package/dist/web/standalone/.next/server/chunks/441.js +0 -2
  622. package/dist/web/standalone/.next/server/chunks/471.js +0 -13
  623. package/dist/web/standalone/.next/static/chunks/4024.11ca5c01938e5948.js +0 -9
  624. package/dist/web/standalone/.next/static/chunks/app/_global-error/page-d83ba70a25a85472.js +0 -1
  625. package/dist/web/standalone/.next/static/chunks/app/api/boot/route-d83ba70a25a85472.js +0 -1
  626. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/input/route-d83ba70a25a85472.js +0 -1
  627. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/resize/route-d83ba70a25a85472.js +0 -1
  628. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/stream/route-d83ba70a25a85472.js +0 -1
  629. package/dist/web/standalone/.next/static/chunks/app/api/browse-directories/route-d83ba70a25a85472.js +0 -1
  630. package/dist/web/standalone/.next/static/chunks/app/api/captures/route-d83ba70a25a85472.js +0 -1
  631. package/dist/web/standalone/.next/static/chunks/app/api/cleanup/route-d83ba70a25a85472.js +0 -1
  632. package/dist/web/standalone/.next/static/chunks/app/api/dev-mode/route-d83ba70a25a85472.js +0 -1
  633. package/dist/web/standalone/.next/static/chunks/app/api/doctor/route-d83ba70a25a85472.js +0 -1
  634. package/dist/web/standalone/.next/static/chunks/app/api/export-data/route-d83ba70a25a85472.js +0 -1
  635. package/dist/web/standalone/.next/static/chunks/app/api/files/route-d83ba70a25a85472.js +0 -1
  636. package/dist/web/standalone/.next/static/chunks/app/api/forensics/route-d83ba70a25a85472.js +0 -1
  637. package/dist/web/standalone/.next/static/chunks/app/api/git/route-d83ba70a25a85472.js +0 -1
  638. package/dist/web/standalone/.next/static/chunks/app/api/history/route-d83ba70a25a85472.js +0 -1
  639. package/dist/web/standalone/.next/static/chunks/app/api/hooks/route-d83ba70a25a85472.js +0 -1
  640. package/dist/web/standalone/.next/static/chunks/app/api/inspect/route-d83ba70a25a85472.js +0 -1
  641. package/dist/web/standalone/.next/static/chunks/app/api/knowledge/route-d83ba70a25a85472.js +0 -1
  642. package/dist/web/standalone/.next/static/chunks/app/api/live-state/route-d83ba70a25a85472.js +0 -1
  643. package/dist/web/standalone/.next/static/chunks/app/api/onboarding/route-d83ba70a25a85472.js +0 -1
  644. package/dist/web/standalone/.next/static/chunks/app/api/preferences/route-d83ba70a25a85472.js +0 -1
  645. package/dist/web/standalone/.next/static/chunks/app/api/projects/route-d83ba70a25a85472.js +0 -1
  646. package/dist/web/standalone/.next/static/chunks/app/api/recovery/route-d83ba70a25a85472.js +0 -1
  647. package/dist/web/standalone/.next/static/chunks/app/api/remote-questions/route-d83ba70a25a85472.js +0 -1
  648. package/dist/web/standalone/.next/static/chunks/app/api/session/browser/route-d83ba70a25a85472.js +0 -1
  649. package/dist/web/standalone/.next/static/chunks/app/api/session/command/route-d83ba70a25a85472.js +0 -1
  650. package/dist/web/standalone/.next/static/chunks/app/api/session/events/route-d83ba70a25a85472.js +0 -1
  651. package/dist/web/standalone/.next/static/chunks/app/api/session/manage/route-d83ba70a25a85472.js +0 -1
  652. package/dist/web/standalone/.next/static/chunks/app/api/settings-data/route-d83ba70a25a85472.js +0 -1
  653. package/dist/web/standalone/.next/static/chunks/app/api/shutdown/route-d83ba70a25a85472.js +0 -1
  654. package/dist/web/standalone/.next/static/chunks/app/api/skill-health/route-d83ba70a25a85472.js +0 -1
  655. package/dist/web/standalone/.next/static/chunks/app/api/steer/route-d83ba70a25a85472.js +0 -1
  656. package/dist/web/standalone/.next/static/chunks/app/api/switch-root/route-d83ba70a25a85472.js +0 -1
  657. package/dist/web/standalone/.next/static/chunks/app/api/terminal/input/route-d83ba70a25a85472.js +0 -1
  658. package/dist/web/standalone/.next/static/chunks/app/api/terminal/resize/route-d83ba70a25a85472.js +0 -1
  659. package/dist/web/standalone/.next/static/chunks/app/api/terminal/sessions/route-d83ba70a25a85472.js +0 -1
  660. package/dist/web/standalone/.next/static/chunks/app/api/terminal/stream/route-d83ba70a25a85472.js +0 -1
  661. package/dist/web/standalone/.next/static/chunks/app/api/terminal/upload/route-d83ba70a25a85472.js +0 -1
  662. package/dist/web/standalone/.next/static/chunks/app/api/undo/route-d83ba70a25a85472.js +0 -1
  663. package/dist/web/standalone/.next/static/chunks/app/api/update/route-d83ba70a25a85472.js +0 -1
  664. package/dist/web/standalone/.next/static/chunks/app/api/visualizer/route-d83ba70a25a85472.js +0 -1
  665. package/dist/web/standalone/.next/static/chunks/app/page-12dd5ece0df4badc.js +0 -1
  666. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  667. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-d83ba70a25a85472.js +0 -1
  668. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-d83ba70a25a85472.js +0 -1
  669. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  670. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-d83ba70a25a85472.js +0 -1
  671. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-d83ba70a25a85472.js +0 -1
  672. package/dist/web/standalone/.next/static/chunks/webpack-0a4cd455ec4197d2.js +0 -1
  673. package/dist/web/standalone/.next/static/css/dd4ae3f58ac9b600.css +0 -1
  674. package/dist/web/standalone/.next/static/gj-y5hikmhS--NT8Web6M/_buildManifest.js +0 -1
  675. package/packages/pi-ai/pnpm-lock.yaml +0 -2022
  676. package/packages/pi-coding-agent/pnpm-lock.yaml +0 -454
  677. package/src/resources/extensions/gsd/auto-worktree-sync.ts +0 -234
  678. package/src/resources/extensions/gsd/resource-version.ts +0 -101
  679. /package/dist/web/standalone/.next/static/{gj-y5hikmhS--NT8Web6M → yJIyd5cXPNpmXTv18ZlyC}/_ssgManifest.js +0 -0
@@ -38,18 +38,21 @@ Then:
38
38
  - Correct: `command > /dev/null 2>&1 &` or `nohup command > /dev/null 2>&1 &`
39
39
  - Example: `python -m http.server 8080 > /dev/null 2>&1 &` (NOT `python -m http.server 8080 &`)
40
40
  - Preferred: use the `bg_shell` tool if available — it manages process lifecycle correctly without stream-inheritance issues
41
- 6. Verify must-haves are met by running concrete checks (tests, commands, observable behaviors)
42
- 7. Run the slice-level verification checks defined in the slice plan's Verification section. Track which pass. On the final task of the slice, all must pass before marking done. On intermediate tasks, partial passes are expected — note which ones pass in the summary.
43
- 8. After the verification gate runs (you'll see gate results in stderr/notify output), populate the `## Verification Evidence` table in your task summary with the check results. Use the `formatEvidenceTable` format: one row per check with command, exit code, verdict (✅ pass / ❌ fail), and duration. If no verification commands were discovered, note that in the section.
44
- 9. If the task touches UI, browser flows, DOM behavior, or user-visible web state:
41
+ 6. If the task plan includes a **Failure Modes** section (Q5), implement the error/timeout/malformed handling specified. Verify each dependency's failure path is handled. Skip if the section is absent.
42
+ 7. If the task plan includes a **Load Profile** section (Q6), implement protections for the identified 10x breakpoint (connection pooling, rate limiting, pagination, etc.). Skip if absent.
43
+ 8. If the task plan includes a **Negative Tests** section (Q7), write the specified negative test cases alongside the happy-path tests malformed inputs, error paths, and boundary conditions. Skip if absent.
44
+ 9. Verify must-haves are met by running concrete checks (tests, commands, observable behaviors)
45
+ 10. Run the slice-level verification checks defined in the slice plan's Verification section. Track which pass. On the final task of the slice, all must pass before marking done. On intermediate tasks, partial passes are expected — note which ones pass in the summary.
46
+ 11. After the verification gate runs (you'll see gate results in stderr/notify output), populate the `## Verification Evidence` table in your task summary with the check results. Use the `formatEvidenceTable` format: one row per check with command, exit code, verdict (✅ pass / ❌ fail), and duration. If no verification commands were discovered, note that in the section.
47
+ 12. If the task touches UI, browser flows, DOM behavior, or user-visible web state:
45
48
  - exercise the real flow in the browser
46
49
  - prefer `browser_batch` when the next few actions are obvious and sequential
47
50
  - prefer `browser_assert` for explicit pass/fail verification of the intended outcome
48
51
  - use `browser_diff` when an action's effect is ambiguous
49
52
  - use console/network/dialog diagnostics when validating async, stateful, or failure-prone UI
50
53
  - record verification in terms of explicit checks passed/failed, not only prose interpretation
51
- 10. If the task plan includes an Observability Impact section, verify those signals directly. Skip this step if the task plan omits the section.
52
- 11. **If execution is running long or verification fails:**
54
+ 13. If the task plan includes an Observability Impact section, verify those signals directly. Skip this step if the task plan omits the section.
55
+ 14. **If execution is running long or verification fails:**
53
56
 
54
57
  **Context budget:** You have approximately **{{verificationBudget}}** reserved for verification context. If you've used most of your context and haven't finished all steps, stop implementing and prioritize writing the task summary with clear notes on what's done and what remains. A partial summary that enables clean resumption is more valuable than one more half-finished step with no documentation. Never sacrifice summary quality for one more implementation step.
55
58
 
@@ -60,13 +63,13 @@ Then:
60
63
  - Distinguish "I know" from "I assume." Observable facts (the error says X) are strong evidence. Assumptions (this library should work this way) need verification.
61
64
  - Know when to stop. If you've tried 3+ fixes without progress, your mental model is probably wrong. Stop. List what you know for certain. List what you've ruled out. Form fresh hypotheses from there.
62
65
  - Don't fix symptoms. Understand *why* something fails before changing code. A test that passes after a change you don't understand is luck, not a fix.
63
- 11. **Blocker discovery:** If execution reveals that the remaining slice plan is fundamentally invalid — not just a bug or minor deviation, but a plan-invalidating finding like a wrong API, missing capability, or architectural mismatch — set `blocker_discovered: true` in the task summary frontmatter and describe the blocker clearly in the summary narrative. Do NOT set `blocker_discovered: true` for ordinary debugging, minor deviations, or issues that can be fixed within the current task or the remaining plan. This flag triggers an automatic replan of the slice.
64
- 12. If you made an architectural, pattern, library, or observability decision during this task that downstream work should know about, append it to `.gsd/DECISIONS.md` (read the template at `~/.gsd/agent/extensions/gsd/templates/decisions.md` if the file doesn't exist yet). Not every task produces decisions — only append when a meaningful choice was made.
65
- 13. If you discover a non-obvious rule, recurring gotcha, or useful pattern during execution, append it to `.gsd/KNOWLEDGE.md`. Only add entries that would save future agents from repeating your investigation. Don't add obvious things.
66
- 14. Read the template at `~/.gsd/agent/extensions/gsd/templates/task-summary.md`
67
- 15. Write `{{taskSummaryPath}}`
68
- 16. Call `gsd_complete_task` with milestone_id, slice_id, task_id, and a summary of what was accomplished. This is your final required step — do NOT manually edit PLAN.md checkboxes. The tool marks the task complete, updates the DB, and renders PLAN.md automatically.
69
- 17. Do not run git commands — the system reads your task summary after completion and creates a meaningful commit from it (type inferred from title, message from your one-liner, key files from frontmatter). Write a clear, specific one-liner in the summary — it becomes the commit message.
66
+ 15. **Blocker discovery:** If execution reveals that the remaining slice plan is fundamentally invalid — not just a bug or minor deviation, but a plan-invalidating finding like a wrong API, missing capability, or architectural mismatch — set `blocker_discovered: true` in the task summary frontmatter and describe the blocker clearly in the summary narrative. Do NOT set `blocker_discovered: true` for ordinary debugging, minor deviations, or issues that can be fixed within the current task or the remaining plan. This flag triggers an automatic replan of the slice.
67
+ 16. If you made an architectural, pattern, library, or observability decision during this task that downstream work should know about, append it to `.gsd/DECISIONS.md` (read the template at `~/.gsd/agent/extensions/gsd/templates/decisions.md` if the file doesn't exist yet). Not every task produces decisions — only append when a meaningful choice was made.
68
+ 17. If you discover a non-obvious rule, recurring gotcha, or useful pattern during execution, append it to `.gsd/KNOWLEDGE.md`. Only add entries that would save future agents from repeating your investigation. Don't add obvious things.
69
+ 18. Read the template at `~/.gsd/agent/extensions/gsd/templates/task-summary.md`
70
+ 19. Write `{{taskSummaryPath}}`
71
+ 20. Call `gsd_complete_task` with milestone_id, slice_id, task_id, and a summary of what was accomplished. This is your final required step — do NOT manually edit PLAN.md checkboxes. The tool marks the task complete, updates the DB, and renders PLAN.md automatically.
72
+ 21. Do not run git commands — the system reads your task summary after completion and creates a meaningful commit from it (type inferred from title, message from your one-liner, key files from frontmatter). Write a clear, specific one-liner in the summary — it becomes the commit message.
70
73
 
71
74
  All work stays in your working directory: `{{workingDirectory}}`.
72
75
 
@@ -16,7 +16,7 @@ GSD extension source code is at: `{{gsdSourceDir}}`
16
16
 
17
17
  | Domain | Files |
18
18
  |--------|-------|
19
- | **Auto-mode engine** | `auto.ts` `auto-loop.ts` `auto-dispatch.ts` `auto-start.ts` `auto-supervisor.ts` `auto-timers.ts` `auto-timeout-recovery.ts` `auto-unit-closeout.ts` `auto-post-unit.ts` `auto-verification.ts` `auto-recovery.ts` `auto-worktree.ts` `auto-worktree-sync.ts` `auto-model-selection.ts` `auto-budget.ts` `dispatch-guard.ts` |
19
+ | **Auto-mode engine** | `auto.ts` `auto-loop.ts` `auto-dispatch.ts` `auto-start.ts` `auto-supervisor.ts` `auto-timers.ts` `auto-timeout-recovery.ts` `auto-unit-closeout.ts` `auto-post-unit.ts` `auto-verification.ts` `auto-recovery.ts` `auto-worktree.ts` `auto-model-selection.ts` `auto-budget.ts` `dispatch-guard.ts` |
20
20
  | **State & persistence** | `state.ts` `types.ts` `files.ts` `paths.ts` `json-persistence.ts` `atomic-write.ts` |
21
21
  | **Forensics & recovery** | `forensics.ts` `session-forensics.ts` `crash-recovery.ts` `session-lock.ts` |
22
22
  | **Metrics & telemetry** | `metrics.ts` `skill-telemetry.ts` `token-counter.ts` |
@@ -46,7 +46,7 @@ GSD extension source code is at: `{{gsdSourceDir}}`
46
46
  ├── milestones/{ID}/ — milestone artifacts
47
47
  │ ├── {ID}-ROADMAP.md, {ID}-RESEARCH.md, {ID}-CONTEXT.md, {ID}-SUMMARY.md
48
48
  │ └── slices/{SID}/ — slice artifacts
49
- │ ├── {SID}-PLAN.md, {SID}-RESEARCH.md, {SID}-UAT-RESULT.md, {SID}-SUMMARY.md
49
+ │ ├── {SID}-PLAN.md, {SID}-RESEARCH.md, {SID}-UAT.md, {SID}-SUMMARY.md
50
50
  │ └── tasks/{TID}-PLAN.md, {TID}-SUMMARY.md
51
51
  └── worktrees/{milestoneId}/ — per-milestone worktree with replicated .gsd/
52
52
  ```
@@ -142,10 +142,10 @@ Then **offer GitHub issue creation**: "Would you like me to create a GitHub issu
142
142
  If yes, create using the `bash` tool:
143
143
 
144
144
  ```bash
145
- gh issue create --repo gsd-build/gsd-2 \
146
- --title "..." \
147
- --label "bug" --label "auto-generated" \
148
- --body "$(cat <<'EOF'
145
+ # Step 1: Write issue body to a temp file to avoid escaping/truncation issues.
146
+ # Using --body-file bypasses shell quoting entirely — backticks, quotes, and
147
+ # content containing "EOF" all render correctly. (#2465)
148
+ cat > /tmp/gsd-forensic-issue.md << 'GSD_ISSUE_BODY'
149
149
  ## Problem
150
150
  [1-2 sentence summary]
151
151
 
@@ -168,8 +168,19 @@ gh issue create --repo gsd-build/gsd-2 \
168
168
 
169
169
  ---
170
170
  *Auto-generated by `/gsd forensics`*
171
- EOF
172
- )"
171
+ GSD_ISSUE_BODY
172
+
173
+ ISSUE_URL=$(gh issue create --repo gsd-build/gsd-2 \
174
+ --title "..." \
175
+ --label "auto-generated" \
176
+ --body-file /tmp/gsd-forensic-issue.md)
177
+ rm -f /tmp/gsd-forensic-issue.md
178
+
179
+ # Step 2: Set issue type via GraphQL (gh issue create has no --type flag)
180
+ ISSUE_NUM=$(echo "$ISSUE_URL" | grep -oE '[0-9]+$')
181
+ ISSUE_ID=$(gh api graphql -f query='{ repository(owner:"gsd-build",name:"gsd-2") { issue(number:'"$ISSUE_NUM"') { id } } }' --jq '.data.repository.issue.id')
182
+ TYPE_ID=$(gh api graphql -f query='{ repository(owner:"gsd-build",name:"gsd-2") { issueTypes(first:20) { nodes { id name } } } }' --jq '.data.repository.issueTypes.nodes[] | select(.name=="Bug") | .id')
183
+ gh api graphql -f query='mutation { updateIssue(input:{id:"'"$ISSUE_ID"'",issueTypeId:"'"$TYPE_ID"'"}) { issue { number } } }'
173
184
  ```
174
185
 
175
186
  ### Redaction Rules (CRITICAL)
@@ -0,0 +1,32 @@
1
+ # Quality Gate Evaluation — Parallel Dispatch
2
+
3
+ **Working directory:** `{{workingDirectory}}`
4
+ **Milestone:** {{milestoneId}} — {{milestoneTitle}}
5
+ **Slice:** {{sliceId}} — {{sliceTitle}}
6
+
7
+ ## Mission
8
+
9
+ You are evaluating **quality gates in parallel** for this slice. Each gate is an independent question that must be answered before task execution begins. Use the `subagent` tool to dispatch all gate evaluations simultaneously.
10
+
11
+ ## Slice Plan Context
12
+
13
+ {{slicePlanContent}}
14
+
15
+ ## Gates to Evaluate
16
+
17
+ {{gateCount}} gates require evaluation:
18
+
19
+ {{gateList}}
20
+
21
+ ## Execution Protocol
22
+
23
+ 1. **Dispatch all gates** using `subagent` in parallel mode. Each subagent prompt is provided below.
24
+ 2. **Wait for all subagents** to complete.
25
+ 3. **Verify each gate wrote its result** by checking that `gsd_save_gate_result` was called for each gate ID.
26
+ 4. **Report the batch outcome** — which gates passed, which flagged concerns, and which were omitted as not applicable.
27
+
28
+ Gate agents may return `verdict: "omitted"` if the gate question is not applicable to this slice (e.g., no auth surface for Q3, no existing requirements touched for Q4). This is expected for simple slices.
29
+
30
+ ## Subagent Prompts
31
+
32
+ {{subagentPrompts}}
@@ -1,3 +1,3 @@
1
- Complete slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Your working directory is `{{workingDirectory}}` — all file operations must use this path. All tasks are done. Your slice summary is the primary record of what was built — downstream agents (reassess-roadmap, future slice researchers) read it to understand what this slice delivered and what to watch out for. Use the **Slice Summary** and **UAT** output templates below to understand the expected structure. {{skillActivation}} Call `gsd_slice_complete` to record completion — the tool writes `{{sliceId}}-SUMMARY.md`, `{{sliceId}}-UAT.md`, and toggles the roadmap checkbox atomically. Fill the `UAT Type` plus `Not Proven By This UAT` sections explicitly in `uatContent` so the artifact states what class of acceptance it covers and what still remains unproven. Review task summaries for `key_decisions` and ensure any significant ones are in `.gsd/DECISIONS.md`. Do not commit or merge manually — the system handles this after the unit completes.
1
+ Complete slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Your working directory is `{{workingDirectory}}` — all file operations must use this path. All tasks are done. Your slice summary is the primary record of what was built — downstream agents (reassess-roadmap, future slice researchers) read it to understand what this slice delivered and what to watch out for. Use the **Slice Summary** and **UAT** output templates below to understand the expected structure. {{skillActivation}} Call `gsd_slice_complete` to record completion — the tool writes `{{sliceId}}-SUMMARY.md`, `{{sliceId}}-UAT.md`, and toggles the roadmap checkbox atomically. Fill the `UAT Type` plus `Not Proven By This UAT` sections explicitly in `uatContent` so the artifact states what class of acceptance it covers and what still remains unproven. Review task summaries for `key_decisions` and ensure any significant ones are in `.gsd/DECISIONS.md`. If the slice involved runtime behavior, fill the Operational Readiness section (Q8) in the summary: health signal, failure signal, recovery procedure, and monitoring gaps. Omit for simple slices. Do not commit or merge manually — the system handles this after the unit completes.
2
2
 
3
3
  {{inlinedTemplates}}
@@ -1,3 +1,3 @@
1
- Execute the next task: {{taskId}} ("{{taskTitle}}") in slice {{sliceId}} of milestone {{milestoneId}}. Read the task plan (`{{taskId}}-PLAN.md`), load relevant summaries from prior tasks, and execute each step. Verify must-haves when done. If the task touches UI, browser flows, DOM behavior, or user-visible web state, exercise the real flow in the browser, prefer `browser_batch` for obvious sequences, prefer `browser_assert` for explicit pass/fail verification, use `browser_diff` when an action's effect is ambiguous, and use browser diagnostics when validating async or failure-prone UI. If you made an architectural, pattern, or library decision, append it to `.gsd/DECISIONS.md`. Use the **Task Summary** output template below. Call `gsd_task_complete` to record completion (it writes the summary, toggles the checkbox, and persists to DB atomically). {{skillActivation}} If running long and not all steps are finished, stop implementing and prioritize writing a clean partial summary over attempting one more step — a recoverable handoff is more valuable than a half-finished step with no documentation. If verification fails, debug methodically: form a hypothesis and test that specific theory before changing anything, change one variable at a time, read entire functions not just the suspect line, distinguish observable facts from assumptions, and if 3+ fixes fail without progress stop and reassess your mental model — list what you know for certain, what you've ruled out, and form fresh hypotheses. Don't fix symptoms — understand why something fails before changing code.
1
+ Execute the next task: {{taskId}} ("{{taskTitle}}") in slice {{sliceId}} of milestone {{milestoneId}}. Read the task plan (`{{taskId}}-PLAN.md`), load relevant summaries from prior tasks, and execute each step. Verify must-haves when done. If the task touches UI, browser flows, DOM behavior, or user-visible web state, exercise the real flow in the browser, prefer `browser_batch` for obvious sequences, prefer `browser_assert` for explicit pass/fail verification, use `browser_diff` when an action's effect is ambiguous, and use browser diagnostics when validating async or failure-prone UI. If you made an architectural, pattern, or library decision, append it to `.gsd/DECISIONS.md`. Use the **Task Summary** output template below. Call `gsd_task_complete` to record completion (it writes the summary, toggles the checkbox, and persists to DB atomically). {{skillActivation}} If running long and not all steps are finished, stop implementing and prioritize writing a clean partial summary over attempting one more step — a recoverable handoff is more valuable than a half-finished step with no documentation. If verification fails, debug methodically: form a hypothesis and test that specific theory before changing anything, change one variable at a time, read entire functions not just the suspect line, distinguish observable facts from assumptions, and if 3+ fixes fail without progress stop and reassess your mental model — list what you know for certain, what you've ruled out, and form fresh hypotheses. Don't fix symptoms — understand why something fails before changing code. If the task plan includes Failure Modes, Load Profile, or Negative Tests sections, implement and verify them: handle each dependency's error/timeout/malformed paths (Q5), protect against identified 10x breakpoints (Q6), and write specified negative test cases (Q7).
2
2
 
3
3
  {{inlinedTemplates}}
@@ -1,4 +1,4 @@
1
- Plan milestone {{milestoneId}} ("{{milestoneTitle}}"). Read `.gsd/DECISIONS.md` if it exists — respect existing decisions. Read `.gsd/REQUIREMENTS.md` if it exists and treat Active requirements as the capability contract. If `REQUIREMENTS.md` is missing, continue in legacy compatibility mode but explicitly note missing requirement coverage. Use the **Roadmap** output template below to shape the milestone planning payload you send to `gsd_plan_milestone`. Call `gsd_plan_milestone` to persist the milestone planning fields and render `{{milestoneId}}-ROADMAP.md` from DB state. Do **not** write `{{milestoneId}}-ROADMAP.md`, `ROADMAP.md`, or other planning artifacts manually. If planning produces structural decisions, append them to `.gsd/DECISIONS.md`. {{skillActivation}}
1
+ Plan milestone {{milestoneId}} ("{{milestoneTitle}}"). Read `.gsd/DECISIONS.md` if it exists — respect existing decisions. Read `.gsd/REQUIREMENTS.md` if it exists and treat Active requirements as the capability contract. If `REQUIREMENTS.md` is missing, continue in legacy compatibility mode but explicitly note missing requirement coverage. Use the **Roadmap** output template below to shape the milestone planning payload you send to `gsd_plan_milestone`. Call `gsd_plan_milestone` to persist the milestone planning fields and render `{{milestoneId}}-ROADMAP.md` from DB state. Do **not** write `{{milestoneId}}-ROADMAP.md`, `ROADMAP.md`, or other planning artifacts manually. If planning produces structural decisions, append them to `.gsd/DECISIONS.md`. {{skillActivation}} Fill the Horizontal Checklist section with cross-cutting concerns considered during planning (requirements re-read, decisions re-evaluated, graceful shutdown, revenue paths, auth boundary, shared resources, reconnection). Omit for trivial milestones.
2
2
 
3
3
  ## Requirement Rules
4
4
 
@@ -1,3 +1,3 @@
1
- Plan slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.gsd/DECISIONS.md` if it exists — respect existing decisions. Read `.gsd/REQUIREMENTS.md` if it exists — identify which Active requirements the roadmap says this slice owns or supports, and ensure the plan delivers them. Read the roadmap boundary map, any existing context/research files, and dependency summaries. Use the **Slice Plan** and **Task Plan** output templates below. Decompose into tasks with must-haves. Fill the `Proof Level` and `Integration Closure` sections truthfully so the plan says what class of proof this slice really delivers and what end-to-end wiring still remains. Call `gsd_plan_slice` to persist the slice plan — the tool writes `{{sliceId}}-PLAN.md` and individual `T##-PLAN.md` files to disk and persists to DB. Do **not** write plan files manually — use the DB-backed tool so state stays consistent. If planning produces structural decisions, call `gsd_decision_save` for each — the tool auto-assigns IDs and regenerates `.gsd/DECISIONS.md` automatically. {{skillActivation}} Before finishing, self-audit the plan: every must-have maps to at least one task, every task has complete sections (steps, must-haves, verification, observability impact, inputs, and expected output), task ordering is consistent with no circular references, every pair of artifacts that must connect has an explicit wiring step, task scope targets 2–5 steps and 3–8 files (6–8 steps or 8–10 files — consider splitting; 10+ steps or 12+ files — must split), the plan honors locked decisions from context/research/decisions artifacts, the proof-level wording does not overclaim live integration if only fixture/contract proof is planned, every Active requirement this slice owns has at least one task with verification that proves it is met, and every task produces real user-facing progress — if the slice has a UI surface at least one task builds the real UI, if it has an API at least one task connects it to a real data source, and showing the completed result to a non-technical stakeholder would demonstrate real product progress rather than developer artifacts.
1
+ Plan slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.gsd/DECISIONS.md` if it exists — respect existing decisions. Read `.gsd/REQUIREMENTS.md` if it exists — identify which Active requirements the roadmap says this slice owns or supports, and ensure the plan delivers them. Read the roadmap boundary map, any existing context/research files, and dependency summaries. Use the **Slice Plan** and **Task Plan** output templates below. Decompose into tasks with must-haves. Fill the `Proof Level` and `Integration Closure` sections truthfully so the plan says what class of proof this slice really delivers and what end-to-end wiring still remains. Call `gsd_plan_slice` to persist the slice plan — the tool writes `{{sliceId}}-PLAN.md` and individual `T##-PLAN.md` files to disk and persists to DB. Do **not** write plan files manually — use the DB-backed tool so state stays consistent. If planning produces structural decisions, call `gsd_decision_save` for each — the tool auto-assigns IDs and regenerates `.gsd/DECISIONS.md` automatically. {{skillActivation}} Before finishing, self-audit the plan: every must-have maps to at least one task, every task has complete sections (steps, must-haves, verification, observability impact, inputs, and expected output), task ordering is consistent with no circular references, every pair of artifacts that must connect has an explicit wiring step, task scope targets 2–5 steps and 3–8 files (6–8 steps or 8–10 files — consider splitting; 10+ steps or 12+ files — must split), the plan honors locked decisions from context/research/decisions artifacts, the proof-level wording does not overclaim live integration if only fixture/contract proof is planned, every Active requirement this slice owns has at least one task with verification that proves it is met, and every task produces real user-facing progress — if the slice has a UI surface at least one task builds the real UI, if it has an API at least one task connects it to a real data source, and showing the completed result to a non-technical stakeholder would demonstrate real product progress rather than developer artifacts, and quality gate coverage — for non-trivial slices, Threat Surface (Q3: abuse, data exposure, input trust) and Requirement Impact (Q4: requirements touched, re-verify, decisions revisited) sections are present. For non-trivial tasks, Failure Modes (Q5), Load Profile (Q6), and Negative Tests (Q7) are filled in task plans.
2
2
 
3
3
  {{inlinedTemplates}}
@@ -47,7 +47,7 @@ Then:
47
47
  2. {{skillActivation}}
48
48
  3. Create the roadmap: decompose into demoable vertical slices — as many as the work genuinely needs, no more. A simple feature might be 1 slice. Don't decompose for decomposition's sake.
49
49
  4. Order by risk (high-risk first)
50
- 5. Call `gsd_plan_milestone` to persist the milestone planning fields and slice rows in the DB-backed planning path. Do **not** write `{{outputPath}}`, `ROADMAP.md`, or other planning artifacts manually — the planning tool owns roadmap rendering and persistence.
50
+ 5. Call `gsd_plan_milestone` to persist the milestone planning fields, slice rows, and **horizontal checklist** in the DB-backed planning path. Do **not** write `{{outputPath}}`, `ROADMAP.md`, or other planning artifacts manually — the planning tool owns roadmap rendering and persistence.
51
51
  6. If planning produced structural decisions (e.g. slice ordering rationale, technology choices, scope exclusions), call `gsd_decision_save` for each decision — the tool auto-assigns IDs and regenerates `.gsd/DECISIONS.md` automatically.
52
52
 
53
53
  ## Requirement Mapping Rules
@@ -57,14 +57,18 @@ Then:
57
57
  - Include `Observability / Diagnostics` for backend, integration, async, stateful, or UI slices where failure diagnosis matters.
58
58
  - Fill `Proof Level` and `Integration Closure` when the slice crosses runtime boundaries or has meaningful integration concerns.
59
59
  - **Omit these sections entirely for simple slices** where they would all be "none" or trivially obvious.
60
- 5. Decompose the slice into tasks, each fitting one context window. Each task needs:
60
+ 5. **Quality gates** for non-trivial slices, fill the Threat Surface (Q3) and Requirement Impact (Q4) sections in the slice plan:
61
+ - **Threat Surface:** Identify abuse scenarios, data exposure risks, and input trust boundaries. Required when the slice handles user input, authentication, authorization, or sensitive data. Omit entirely for internal refactoring or simple changes.
62
+ - **Requirement Impact:** List which existing requirements this slice touches, what must be re-verified after shipping, and which prior decisions should be reconsidered. Omit entirely if no existing requirements are affected.
63
+ - For each task in a non-trivial slice, fill Failure Modes (Q5), Load Profile (Q6), and Negative Tests (Q7) in the task plan when the task has external dependencies, shared resources, or non-trivial input handling. Omit for simple tasks.
64
+ 6. Decompose the slice into tasks, each fitting one context window. Each task needs:
61
65
  - a concrete, action-oriented title
62
66
  - the inline task entry fields defined in the plan.md template (Why / Files / Do / Verify / Done when)
63
67
  - a matching task plan file with description, steps, must-haves, verification, inputs, and expected output
64
68
  - **Inputs and Expected Output must list concrete backtick-wrapped file paths** (e.g. `` `src/types.ts` ``). These are machine-parsed to derive task dependencies — vague prose without paths breaks parallel execution. Every task must have at least one output file path.
65
69
  - Observability Impact section **only if the task touches runtime boundaries, async flows, or error paths** — omit it otherwise
66
- 6. **Persist planning state through `gsd_plan_slice`.** Call it with the full slice planning payload (goal, demo, must-haves, verification, tasks, and metadata). The tool inserts all tasks in the same transaction, writes to the DB, and renders `{{outputPath}}` and `{{slicePath}}/tasks/T##-PLAN.md` files automatically. Do **not** call `gsd_plan_task` separately — `gsd_plan_slice` handles task persistence. Do **not** rely on direct `PLAN.md` writes as the source of truth; the DB-backed tool is the canonical write path for slice and task planning state.
67
- 7. **Self-audit the plan.** Walk through each check — if any fail, fix the plan files before moving on:
70
+ 7. **Persist planning state through `gsd_plan_slice`.** Call it with the full slice planning payload (goal, demo, must-haves, verification, tasks, and metadata). The tool inserts all tasks in the same transaction, writes to the DB, and renders `{{outputPath}}` and `{{slicePath}}/tasks/T##-PLAN.md` files automatically. Do **not** call `gsd_plan_task` separately — `gsd_plan_slice` handles task persistence. Do **not** rely on direct `PLAN.md` writes as the source of truth; the DB-backed tool is the canonical write path for slice and task planning state.
71
+ 8. **Self-audit the plan.** Walk through each check — if any fail, fix the plan files before moving on:
68
72
  - **Completion semantics:** If every task were completed exactly as written, the slice goal/demo should actually be true.
69
73
  - **Requirement coverage:** Every must-have in the slice maps to at least one task. No must-have is orphaned. If `REQUIREMENTS.md` exists, every Active requirement this slice owns maps to at least one task.
70
74
  - **Task completeness:** Every task has steps, must-haves, verification, inputs, and expected output — none are blank or vague. Inputs and Expected Output list backtick-wrapped file paths, not prose descriptions.
@@ -72,6 +76,7 @@ Then:
72
76
  - **Key links planned:** For every pair of artifacts that must connect, there is an explicit step that wires them.
73
77
  - **Scope sanity:** Target 2–5 steps and 3–8 files per task. 10+ steps or 12+ files — must split. Each task must be completable in a single fresh context window.
74
78
  - **Feature completeness:** Every task produces real, user-facing progress — not just internal scaffolding.
79
+ - **Quality gate coverage:** For non-trivial slices, Threat Surface and Requirement Impact sections are present and specific (not placeholder text). For non-trivial tasks, Failure Modes, Load Profile, and Negative Tests are addressed in the task plan.
75
80
  10. If planning produced structural decisions, append them to `.gsd/DECISIONS.md`
76
81
  11. {{commitInstruction}}
77
82
 
@@ -36,6 +36,9 @@ Ask yourself:
36
36
  - Did assumptions in remaining slice descriptions turn out wrong?
37
37
  - If `.gsd/REQUIREMENTS.md` exists: did this slice validate, invalidate, defer, block, or newly surface requirements?
38
38
  - If `.gsd/REQUIREMENTS.md` exists: does the remaining roadmap still provide credible coverage for Active requirements, including launchability, primary user loop, continuity, and failure visibility where relevant?
39
+ - Are the Threat Surface and Requirement Impact sections in completed slice plans still accurate for remaining slices?
40
+ - Did this slice's Operational Readiness reveal monitoring gaps that remaining slices should address?
41
+ - Should any Horizontal Checklist items be updated based on what was actually built?
39
42
 
40
43
  ### Success-Criterion Coverage Check
41
44
 
@@ -32,7 +32,7 @@ Consider these captures when rewriting the remaining tasks — they represent th
32
32
 
33
33
  1. Read the blocker task summary carefully. Understand exactly what was discovered and why it blocks the current plan.
34
34
  2. Analyze the remaining `[ ]` tasks in the slice plan. Determine which are still valid, which need modification, and which should be replaced.
35
- 3. **Persist replan state through `gsd_replan_slice`.** Call it with: `milestoneId`, `sliceId`, `blockerTaskId`, `blockerDescription`, `whatChanged`, `updatedTasks` (array of task objects with taskId, title, description, estimate, files, verify, inputs, expectedOutput), `removedTaskIds` (array of task ID strings). The tool structurally enforces preservation of completed tasks, writes replan history to the DB, re-renders `{{planPath}}`, and renders `{{replanPath}}`.
35
+ 3. **Persist replan state through `gsd_replan_slice`.** Call it with: `milestoneId`, `sliceId`, `blockerTaskId`, `blockerDescription`, `whatChanged`, `updatedTasks` (array of task objects with taskId, title, description, estimate, files, verify, inputs, expectedOutput), `removedTaskIds` (array of task ID strings). The tool structurally enforces preservation of completed tasks, writes replan history to the DB, re-renders `{{planPath}}`, and renders `{{replanPath}}`. Preserve or update the Threat Surface and Requirement Impact sections if the replan changes the slice's security posture or requirement coverage.
36
36
  4. If any incomplete task had a `T0x-PLAN.md`, remove or rewrite it to match the new task description.
37
37
  5. Do not commit manually — the system auto-commits your changes after this unit completes.
38
38
 
@@ -24,7 +24,12 @@ All relevant context has been preloaded below — the roadmap, all slice summari
24
24
  2. For each **slice** in the roadmap, verify its demo/deliverable claim against its summary. Flag any slice whose summary does not substantiate its claimed output.
25
25
  3. Check **cross-slice integration points** — do boundary map entries (produces/consumes) align with what was actually built?
26
26
  4. Check **requirement coverage** — are all active requirements addressed by at least one slice?
27
- 5. Determine a verdict:
27
+ 5. If **Verification Classes** are provided in the inlined context above, check each non-empty class:
28
+ - For each verification class (Contract, Integration, Operational, UAT), determine whether slice summaries, UAT results, or observable behavior provide evidence that this verification tier was addressed.
29
+ - Document the compliance status of each class in your verdict rationale.
30
+ - If `Operational` verification is non-empty and no evidence of operational verification exists, flag this explicitly — it means planned operational checks (migrations, deployments, runtime verification) were not proven.
31
+ - A milestone with unaddressed verification classes may still pass if the gaps are minor, but the gaps MUST be documented in the Deferred Work Inventory.
32
+ 6. Determine a verdict:
28
33
  - `pass` — all criteria met, all slices delivered, no gaps
29
34
  - `needs-attention` — minor gaps that do not block completion (document them)
30
35
  - `needs-remediation` — material gaps found; remediation slices must be added to the roadmap
@@ -31,6 +31,14 @@ export function classifyProviderError(errorMsg) {
31
31
  if (isConnectionError) {
32
32
  return { isTransient: true, isRateLimit: false, suggestedDelayMs: 15_000 }; // 15s for connection errors
33
33
  }
34
+ // Stream-truncation JSON parse errors — transient (#2572).
35
+ // When the API stream is cut mid-chunk, pi tries to reassemble the partial
36
+ // tool-call JSON and gets a SyntaxError. This is the downstream symptom of
37
+ // a connection drop — same root cause as ECONNRESET, one layer up.
38
+ const isMalformedStream = /Unexpected end of JSON|Unexpected token.*JSON|Expected double-quoted property name|SyntaxError.*JSON/i.test(errorMsg);
39
+ if (isMalformedStream) {
40
+ return { isTransient: true, isRateLimit: false, suggestedDelayMs: 15_000 }; // 15s, same as connection errors
41
+ }
34
42
  // Unknown error — treat as permanent (user reviews)
35
43
  return { isTransient: false, isRateLimit: false, suggestedDelayMs: 0 };
36
44
  }
@@ -349,6 +349,35 @@ export function ensureGsdSymlink(projectPath) {
349
349
  if (localGsdNormalized === gsdHomePath) {
350
350
  return localGsd;
351
351
  }
352
+ // Guard: If projectPath is a plain subdirectory (not a worktree) of a git
353
+ // repo that already has a .gsd at the git root, do not create a duplicate
354
+ // symlink in the subdirectory — that causes `.gsd 2` collision variants on
355
+ // macOS (#2380). Worktrees are excluded because they legitimately need their
356
+ // own .gsd symlink pointing at the shared external state dir.
357
+ if (!inWorktree) {
358
+ try {
359
+ const gitRoot = resolveGitRoot(projectPath);
360
+ const normalizedProject = canonicalizeExistingPath(projectPath);
361
+ const normalizedRoot = canonicalizeExistingPath(gitRoot);
362
+ if (normalizedProject !== normalizedRoot) {
363
+ const rootGsd = join(gitRoot, ".gsd");
364
+ if (existsSync(rootGsd)) {
365
+ try {
366
+ const rootStat = lstatSync(rootGsd);
367
+ if (rootStat.isSymbolicLink() || rootStat.isDirectory()) {
368
+ return rootStat.isSymbolicLink() ? realpathSync(rootGsd) : rootGsd;
369
+ }
370
+ }
371
+ catch {
372
+ // Fall through to normal logic if we can't stat root .gsd
373
+ }
374
+ }
375
+ }
376
+ }
377
+ catch {
378
+ // If git root detection fails, fall through to normal logic
379
+ }
380
+ }
352
381
  // Clean up macOS numbered collision variants (.gsd 2, .gsd 3, etc.) before
353
382
  // any existence checks — otherwise they accumulate and confuse state (#2205).
354
383
  cleanNumberedGsdVariants(projectPath);
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Roadmap Mutations — shared utilities for modifying roadmap checkbox state.
3
+ *
4
+ * Extracts the duplicated "flip slice checkbox" pattern that existed in
5
+ * doctor.ts, mechanical-completion.ts, and auto-recovery.ts.
6
+ */
7
+ import { readFileSync } from "node:fs";
8
+ import { atomicWriteSync } from "./atomic-write.js";
9
+ import { resolveMilestoneFile } from "./paths.js";
10
+ import { clearParseCache } from "./files.js";
11
+ /**
12
+ * Mark a slice as done ([x]) in the milestone roadmap.
13
+ * Idempotent — no-op if already checked or if the slice isn't found.
14
+ *
15
+ * @returns true if the roadmap was modified, false if no change was needed
16
+ */
17
+ export function markSliceDoneInRoadmap(basePath, mid, sid) {
18
+ const roadmapFile = resolveMilestoneFile(basePath, mid, "ROADMAP");
19
+ if (!roadmapFile)
20
+ return false;
21
+ let content;
22
+ try {
23
+ content = readFileSync(roadmapFile, "utf-8");
24
+ }
25
+ catch {
26
+ return false;
27
+ }
28
+ // Try checkbox format first: "- [ ] **S01: Title**"
29
+ let updated = content.replace(new RegExp(`^(\\s*-\\s+)\\[ \\]\\s+\\*\\*${sid}:`, "m"), `$1[x] **${sid}:`);
30
+ // If checkbox format didn't match, try prose format: "## S01: Title" -> "## S01: \u2713 Title"
31
+ if (updated === content) {
32
+ updated = content.replace(new RegExp(`^(#{1,4}\\s+(?:\\*{0,2})(?:Slice\\s+)?${sid}\\*{0,2}[:\\s.\\u2014\\u2013-]+\\s*)(.+)`, "m"), (match, prefix, title) => {
33
+ // Already marked done — no-op
34
+ if (/^\u2713/.test(title) || /\(Complete\)\s*$/i.test(title))
35
+ return match;
36
+ return `${prefix}\u2713 ${title}`;
37
+ });
38
+ }
39
+ if (updated === content)
40
+ return false;
41
+ atomicWriteSync(roadmapFile, updated);
42
+ clearParseCache();
43
+ return true;
44
+ }
45
+ /**
46
+ * Mark a slice as not done ([ ]) in the milestone roadmap.
47
+ * Idempotent — no-op if already unchecked or if the slice isn't found.
48
+ *
49
+ * @returns true if the roadmap was modified, false if no change was needed
50
+ */
51
+ export function markSliceUndoneInRoadmap(basePath, mid, sid) {
52
+ const roadmapFile = resolveMilestoneFile(basePath, mid, "ROADMAP");
53
+ if (!roadmapFile)
54
+ return false;
55
+ let content;
56
+ try {
57
+ content = readFileSync(roadmapFile, "utf-8");
58
+ }
59
+ catch {
60
+ return false;
61
+ }
62
+ const updated = content.replace(new RegExp(`^(\\s*-\\s+)\\[x\\]\\s+\\*\\*${sid}:`, "m"), `$1[ ] **${sid}:`);
63
+ if (updated === content)
64
+ return false;
65
+ atomicWriteSync(roadmapFile, updated);
66
+ clearParseCache();
67
+ return true;
68
+ }
69
+ /**
70
+ * Mark a task as done ([x]) in the slice plan.
71
+ * Idempotent — no-op if already checked or if the task isn't found.
72
+ *
73
+ * @returns true if the plan was modified, false if no change was needed
74
+ */
75
+ export function markTaskDoneInPlan(basePath, planPath, tid) {
76
+ let content;
77
+ try {
78
+ content = readFileSync(planPath, "utf-8");
79
+ }
80
+ catch {
81
+ return false;
82
+ }
83
+ const updated = content.replace(new RegExp(`^(\\s*-\\s+)\\[ \\]\\s+\\*\\*${tid}:`, "m"), `$1[x] **${tid}:`);
84
+ if (updated === content)
85
+ return false;
86
+ atomicWriteSync(planPath, updated);
87
+ clearParseCache();
88
+ return true;
89
+ }
90
+ /**
91
+ * Mark a task as not done ([ ]) in the slice plan.
92
+ * Idempotent — no-op if already unchecked or if the task isn't found.
93
+ *
94
+ * @returns true if the plan was modified, false if no change was needed
95
+ */
96
+ export function markTaskUndoneInPlan(basePath, planPath, tid) {
97
+ let content;
98
+ try {
99
+ content = readFileSync(planPath, "utf-8");
100
+ }
101
+ catch {
102
+ return false;
103
+ }
104
+ const updated = content.replace(new RegExp(`^(\\s*-\\s+)\\[x\\]\\s+\\*\\*${tid}:`, "mi"), `$1[ ] **${tid}:`);
105
+ if (updated === content)
106
+ return false;
107
+ atomicWriteSync(planPath, updated);
108
+ clearParseCache();
109
+ return true;
110
+ }
@@ -36,8 +36,8 @@ export function expandDependencies(deps) {
36
36
  return result;
37
37
  }
38
38
  function extractSlicesSection(content) {
39
- // Match "## Slices", "## Slice Overview", "## Slice Table", etc.
40
- const headingMatch = /^## Slice(?:s| Overview| Table| Summary| Status)\b.*$/m.exec(content);
39
+ // Match "## Slices", "## Slice Overview", "## Slice Table", "## Slice Roadmap", etc.
40
+ const headingMatch = /^## Slice(?:s| Overview| Table| Summary| Status| Roadmap)\b.*$/m.exec(content);
41
41
  if (!headingMatch || headingMatch.index == null)
42
42
  return "";
43
43
  const start = headingMatch.index + headingMatch[0].length;
@@ -0,0 +1,43 @@
1
+ import { ensureRtkSessionBaseline, formatRtkSavingsLabel, getRtkSessionSavings, } from "../shared/rtk-session-stats.js";
2
+ import { loadEffectiveGSDPreferences } from "./preferences.js";
3
+ const STATUS_KEY = "gsd-rtk";
4
+ const REFRESH_INTERVAL_MS = 30_000;
5
+ let refreshTimer = null;
6
+ function clearTimer() {
7
+ if (refreshTimer) {
8
+ clearInterval(refreshTimer);
9
+ refreshTimer = null;
10
+ }
11
+ }
12
+ function isRtkEnabledInPrefs() {
13
+ return loadEffectiveGSDPreferences()?.preferences.experimental?.rtk === true;
14
+ }
15
+ function updateStatus(ctx) {
16
+ if (!ctx.hasUI)
17
+ return;
18
+ if (!isRtkEnabledInPrefs())
19
+ return;
20
+ const basePath = ctx.cwd;
21
+ const sessionId = ctx.sessionManager.getSessionId();
22
+ ensureRtkSessionBaseline(basePath, sessionId);
23
+ const savings = getRtkSessionSavings(basePath, sessionId);
24
+ ctx.ui.setStatus(STATUS_KEY, formatRtkSavingsLabel(savings) ?? undefined);
25
+ }
26
+ export function startRtkStatusUpdates(ctx) {
27
+ clearTimer();
28
+ if (!isRtkEnabledInPrefs()) {
29
+ // Ensure any previously set status is cleared (e.g. preference was toggled off)
30
+ ctx.ui.setStatus(STATUS_KEY, undefined);
31
+ return;
32
+ }
33
+ updateStatus(ctx);
34
+ if (!ctx.hasUI)
35
+ return;
36
+ refreshTimer = setInterval(() => {
37
+ updateStatus(ctx);
38
+ }, REFRESH_INTERVAL_MS);
39
+ }
40
+ export function stopRtkStatusUpdates(ctx) {
41
+ clearTimer();
42
+ ctx?.ui.setStatus(STATUS_KEY, undefined);
43
+ }
@@ -8,18 +8,17 @@
8
8
  import { resolvePostUnitHooks, resolvePreDispatchHooks } from "./preferences.js";
9
9
  import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
10
10
  import { join } from "node:path";
11
+ import { parseUnitId } from "./unit-id.js";
11
12
  // ─── Artifact Path Resolution ──────────────────────────────────────────────
12
13
  export function resolveHookArtifactPath(basePath, unitId, artifactName) {
13
- const parts = unitId.split("/");
14
- if (parts.length === 3) {
15
- const [mid, sid, tid] = parts;
16
- return join(basePath, ".gsd", "milestones", mid, "slices", sid, "tasks", `${tid}-${artifactName}`);
14
+ const { milestone, slice, task } = parseUnitId(unitId);
15
+ if (task !== undefined && slice !== undefined) {
16
+ return join(basePath, ".gsd", "milestones", milestone, "slices", slice, "tasks", `${task}-${artifactName}`);
17
17
  }
18
- if (parts.length === 2) {
19
- const [mid, sid] = parts;
20
- return join(basePath, ".gsd", "milestones", mid, "slices", sid, artifactName);
18
+ if (slice !== undefined) {
19
+ return join(basePath, ".gsd", "milestones", milestone, "slices", slice, artifactName);
21
20
  }
22
- return join(basePath, ".gsd", "milestones", parts[0], artifactName);
21
+ return join(basePath, ".gsd", "milestones", milestone, artifactName);
23
22
  }
24
23
  // ─── Dispatch Rule Conversion ──────────────────────────────────────────────
25
24
  /**
@@ -163,7 +162,7 @@ export class RuleRegistry {
163
162
  pendingRetry: false,
164
163
  };
165
164
  // Build prompt with variable substitution
166
- const [mid, sid, tid] = triggerUnitId.split("/");
165
+ const { milestone: mid, slice: sid, task: tid } = parseUnitId(triggerUnitId);
167
166
  let prompt = config.prompt
168
167
  .replace(/\{milestoneId\}/g, mid ?? "")
169
168
  .replace(/\{sliceId\}/g, sid ?? "")
@@ -224,7 +223,7 @@ export class RuleRegistry {
224
223
  if (hooks.length === 0) {
225
224
  return { action: "proceed", prompt, firedHooks: [] };
226
225
  }
227
- const [mid, sid, tid] = unitId.split("/");
226
+ const { milestone: mid, slice: sid, task: tid } = parseUnitId(unitId);
228
227
  const substitute = (text) => text
229
228
  .replace(/\{milestoneId\}/g, mid ?? "")
230
229
  .replace(/\{sliceId\}/g, sid ?? "")
@@ -410,7 +409,7 @@ export class RuleRegistry {
410
409
  const currentCycle = (this.cycleCounts.get(cycleKey) ?? 0) + 1;
411
410
  this.cycleCounts.set(cycleKey, currentCycle);
412
411
  this.activeHook.cycle = currentCycle;
413
- const [mid, sid, tid] = unitId.split("/");
412
+ const { milestone: mid, slice: sid, task: tid } = parseUnitId(unitId);
414
413
  const prompt = hook.prompt
415
414
  .replace(/\{milestoneId\}/g, mid ?? "")
416
415
  .replace(/\{sliceId\}/g, sid ?? "")
@@ -24,7 +24,6 @@ import { truncateWithEllipsis } from "../shared/format-utils.js";
24
24
  import { nativeParseJsonlTail } from "./native-parser-bridge.js";
25
25
  import { MAX_JSONL_BYTES, parseJSONL } from "./jsonl-utils.js";
26
26
  import { nativeWorkingTreeStatus, nativeDiffStat } from "./native-git-bridge.js";
27
- import { getAutoWorktreePath } from "./auto-worktree.js";
28
27
  // ─── JSONL Parsing ────────────────────────────────────────────────────────────
29
28
  // MAX_JSONL_BYTES and parseJSONL are imported from ./jsonl-utils.js
30
29
  /**
@@ -235,17 +234,13 @@ export function synthesizeCrashRecovery(basePath, unitType, unitId, sessionFile,
235
234
  * Deep diagnostic from any JSONL source (activity log or session file).
236
235
  * Replaces the old shallow getLastActivityDiagnostic().
237
236
  */
238
- export function getDeepDiagnostic(basePath) {
239
- // Try worktree activity logs first if an auto-worktree is active
237
+ export function getDeepDiagnostic(basePath, worktreePath) {
238
+ // Try worktree activity logs first if a worktree path is provided
240
239
  let trace = null;
241
240
  try {
242
- const mid = readActiveMilestoneId(basePath);
243
- if (mid) {
244
- const wtPath = getAutoWorktreePath(basePath, mid);
245
- if (wtPath) {
246
- const wtActivityDir = join(gsdRoot(wtPath), "activity");
247
- trace = readLastActivityLog(wtActivityDir);
248
- }
241
+ if (worktreePath) {
242
+ const wtActivityDir = join(gsdRoot(worktreePath), "activity");
243
+ trace = readLastActivityLog(wtActivityDir);
249
244
  }
250
245
  }
251
246
  catch { /* non-fatal — fall through to root */ }
@@ -262,7 +257,7 @@ export function getDeepDiagnostic(basePath) {
262
257
  * Read the active milestone ID directly from STATE.md without async deriveState().
263
258
  * Looks for `**Active Milestone:** M001` pattern.
264
259
  */
265
- function readActiveMilestoneId(basePath) {
260
+ export function readActiveMilestoneId(basePath) {
266
261
  try {
267
262
  const statePath = join(gsdRoot(basePath), "STATE.md");
268
263
  if (!existsSync(statePath))
@@ -368,9 +363,13 @@ function formatTraceSummary(trace) {
368
363
  if (trace.errors.length > 0) {
369
364
  parts.push(`Errors: ${trace.errors.slice(-3).join("; ")}`);
370
365
  }
371
- if (trace.lastReasoning) {
372
- parts.push(`Last reasoning: "${trace.lastReasoning}"`);
373
- }
366
+ // NOTE: lastReasoning is intentionally excluded from the retry diagnostic.
367
+ // This summary is injected into retry prompts via getDeepDiagnostic()
368
+ // phases.ts. Including prior assistant free-text causes hallucination loops
369
+ // when the previous turn was truncated or malformed. Crash recovery has its
370
+ // own path (formatCrashRecoveryBriefing) that handles lastReasoning safely
371
+ // with explicit "Last Agent Reasoning Before Interruption" framing.
372
+ // See: https://github.com/gsd-build/gsd-2/issues/2195
374
373
  return parts.join("\n");
375
374
  }
376
375
  // ─── Helpers ──────────────────────────────────────────────────────────────────