gsd-pi 2.71.0 → 2.72.0-dev.8f83716

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 (465) hide show
  1. package/README.md +57 -17
  2. package/dist/cli.js +29 -3
  3. package/dist/headless-events.d.ts +2 -0
  4. package/dist/headless-events.js +7 -0
  5. package/dist/headless.js +16 -3
  6. package/dist/mcp-server.js +40 -17
  7. package/dist/provider-migrations.d.ts +10 -0
  8. package/dist/provider-migrations.js +12 -0
  9. package/dist/resource-loader.js +139 -13
  10. package/dist/resources/GSD-WORKFLOW.md +1 -1
  11. package/dist/resources/agents/debugger.md +58 -0
  12. package/dist/resources/agents/doc-writer.md +43 -0
  13. package/dist/resources/agents/git-ops.md +56 -0
  14. package/dist/resources/agents/javascript-pro.md +46 -271
  15. package/dist/resources/agents/planner.md +55 -0
  16. package/dist/resources/agents/refactorer.md +47 -0
  17. package/dist/resources/agents/reviewer.md +48 -0
  18. package/dist/resources/agents/security.md +59 -0
  19. package/dist/resources/agents/tester.md +50 -0
  20. package/dist/resources/agents/typescript-pro.md +41 -235
  21. package/dist/resources/extensions/claude-code-cli/partial-builder.js +40 -12
  22. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +133 -14
  23. package/dist/resources/extensions/gsd/auto/infra-errors.js +34 -0
  24. package/dist/resources/extensions/gsd/auto/loop.js +32 -1
  25. package/dist/resources/extensions/gsd/auto/phases.js +5 -1
  26. package/dist/resources/extensions/gsd/auto/session.js +11 -0
  27. package/dist/resources/extensions/gsd/auto-dashboard.js +22 -16
  28. package/dist/resources/extensions/gsd/auto-model-selection.js +10 -2
  29. package/dist/resources/extensions/gsd/auto-prompts.js +88 -33
  30. package/dist/resources/extensions/gsd/auto-start.js +34 -7
  31. package/dist/resources/extensions/gsd/auto-tool-tracking.js +1 -1
  32. package/dist/resources/extensions/gsd/auto-worktree.js +1 -1
  33. package/dist/resources/extensions/gsd/auto.js +56 -0
  34. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +3 -3
  35. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +2 -0
  36. package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +63 -51
  37. package/dist/resources/extensions/gsd/bootstrap/system-context.js +6 -0
  38. package/dist/resources/extensions/gsd/commands/context.js +15 -6
  39. package/dist/resources/extensions/gsd/commands/dispatcher.js +12 -2
  40. package/dist/resources/extensions/gsd/commands/handlers/auto.js +10 -33
  41. package/dist/resources/extensions/gsd/commands/handlers/core.js +56 -11
  42. package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +15 -6
  43. package/dist/resources/extensions/gsd/commands/handlers/workflow.js +4 -10
  44. package/dist/resources/extensions/gsd/dashboard-overlay.js +8 -3
  45. package/dist/resources/extensions/gsd/dispatch-guard.js +18 -1
  46. package/dist/resources/extensions/gsd/doctor-providers.js +23 -0
  47. package/dist/resources/extensions/gsd/error-classifier.js +5 -2
  48. package/dist/resources/extensions/gsd/forensics.js +19 -6
  49. package/dist/resources/extensions/gsd/gate-registry.js +208 -0
  50. package/dist/resources/extensions/gsd/gsd-db.js +41 -0
  51. package/dist/resources/extensions/gsd/guided-flow.js +5 -10
  52. package/dist/resources/extensions/gsd/metrics.js +1 -0
  53. package/dist/resources/extensions/gsd/milestone-actions.js +10 -4
  54. package/dist/resources/extensions/gsd/milestone-validation-gates.js +11 -12
  55. package/dist/resources/extensions/gsd/notification-overlay.js +42 -13
  56. package/dist/resources/extensions/gsd/notification-store.js +56 -5
  57. package/dist/resources/extensions/gsd/notification-widget.js +5 -13
  58. package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +8 -3
  59. package/dist/resources/extensions/gsd/pre-execution-checks.js +35 -2
  60. package/dist/resources/extensions/gsd/prompt-validation.js +126 -0
  61. package/dist/resources/extensions/gsd/prompts/complete-slice.md +5 -3
  62. package/dist/resources/extensions/gsd/prompts/discuss.md +2 -0
  63. package/dist/resources/extensions/gsd/prompts/execute-task.md +22 -19
  64. package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
  65. package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
  66. package/dist/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
  67. package/dist/resources/extensions/gsd/prompts/queue.md +3 -2
  68. package/dist/resources/extensions/gsd/prompts/system.md +1 -0
  69. package/dist/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
  70. package/dist/resources/extensions/gsd/session-model-override.js +25 -0
  71. package/dist/resources/extensions/gsd/shortcut-defs.js +40 -0
  72. package/dist/resources/extensions/gsd/state.js +9 -2
  73. package/dist/resources/extensions/gsd/tools/complete-slice.js +52 -1
  74. package/dist/resources/extensions/gsd/tools/complete-task.js +51 -1
  75. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +4 -1
  76. package/dist/resources/extensions/ollama/index.js +13 -5
  77. package/dist/resources/extensions/shared/gsd-phase-state.js +35 -0
  78. package/dist/resources/extensions/subagent/agents.js +8 -0
  79. package/dist/resources/extensions/subagent/index.js +17 -0
  80. package/dist/resources/skills/create-skill/SKILL.md +2 -0
  81. package/dist/startup-model-validation.d.ts +0 -1
  82. package/dist/startup-model-validation.js +6 -2
  83. package/dist/web/standalone/.next/BUILD_ID +1 -1
  84. package/dist/web/standalone/.next/app-path-routes-manifest.json +13 -13
  85. package/dist/web/standalone/.next/build-manifest.json +3 -3
  86. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  87. package/dist/web/standalone/.next/required-server-files.json +3 -3
  88. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  89. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  90. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  91. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  92. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  93. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  94. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  95. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  96. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  97. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  98. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  99. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  100. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  101. package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
  102. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  103. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  104. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  105. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  106. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  107. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  108. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  109. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  110. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  111. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  112. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  113. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  114. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  115. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  116. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  117. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  118. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  119. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  120. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  121. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  122. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  123. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  124. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  125. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  126. package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
  127. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  128. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  129. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  130. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  131. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  132. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  133. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  134. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  135. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  136. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  137. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  138. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  139. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  140. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  141. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  142. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  143. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  144. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  145. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  146. package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
  147. package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  148. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  149. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  150. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  151. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  152. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  153. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  154. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  155. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  156. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
  157. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  158. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  159. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  160. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  161. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  162. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  163. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  164. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  165. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  166. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  168. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  169. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  170. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  171. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  172. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  173. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  174. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  175. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  176. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  178. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  179. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  180. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
  181. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  182. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +2 -2
  183. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  184. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  185. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  186. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  187. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  188. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  189. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  190. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  191. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  192. package/dist/web/standalone/.next/server/app/index.html +1 -1
  193. package/dist/web/standalone/.next/server/app/index.rsc +4 -4
  194. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  195. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  196. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  197. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
  198. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  199. package/dist/web/standalone/.next/server/app/page.js +2 -2
  200. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  201. package/dist/web/standalone/.next/server/app-paths-manifest.json +13 -13
  202. package/dist/web/standalone/.next/server/chunks/63.js +3 -3
  203. package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
  204. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  205. package/dist/web/standalone/.next/server/middleware.js +2 -2
  206. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  207. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  208. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  209. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  210. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  211. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  212. package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
  213. package/dist/web/standalone/.next/static/chunks/app/page-f1e30ab6bb269149.js +1 -0
  214. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  215. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  216. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  217. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  218. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  219. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  220. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  221. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  222. package/dist/web/standalone/server.js +1 -1
  223. package/package.json +1 -1
  224. package/packages/mcp-server/dist/server.d.ts +12 -1
  225. package/packages/mcp-server/dist/server.d.ts.map +1 -1
  226. package/packages/mcp-server/dist/server.js +90 -42
  227. package/packages/mcp-server/dist/server.js.map +1 -1
  228. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  229. package/packages/mcp-server/dist/workflow-tools.js +22 -12
  230. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  231. package/packages/mcp-server/src/server.ts +110 -38
  232. package/packages/mcp-server/src/workflow-tools.test.ts +110 -0
  233. package/packages/mcp-server/src/workflow-tools.ts +32 -12
  234. package/packages/pi-ai/dist/providers/amazon-bedrock.js +11 -2
  235. package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
  236. package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts +2 -0
  237. package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts.map +1 -0
  238. package/packages/pi-ai/dist/providers/anthropic-auth.test.js +20 -0
  239. package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -0
  240. package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +4 -1
  241. package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
  242. package/packages/pi-ai/dist/providers/anthropic-shared.js +8 -3
  243. package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
  244. package/packages/pi-ai/dist/providers/anthropic-shared.test.js +44 -1
  245. package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -1
  246. package/packages/pi-ai/dist/providers/anthropic.d.ts +2 -1
  247. package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  248. package/packages/pi-ai/dist/providers/anthropic.js +7 -4
  249. package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
  250. package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
  251. package/packages/pi-ai/dist/providers/openai-completions.js +11 -0
  252. package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
  253. package/packages/pi-ai/src/providers/amazon-bedrock.ts +13 -1
  254. package/packages/pi-ai/src/providers/anthropic-auth.test.ts +32 -0
  255. package/packages/pi-ai/src/providers/anthropic-shared.test.ts +55 -1
  256. package/packages/pi-ai/src/providers/anthropic-shared.ts +14 -3
  257. package/packages/pi-ai/src/providers/anthropic.ts +8 -4
  258. package/packages/pi-ai/src/providers/openai-completions.ts +14 -0
  259. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts +2 -0
  260. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts.map +1 -0
  261. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js +61 -0
  262. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js.map +1 -0
  263. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  264. package/packages/pi-coding-agent/dist/core/agent-session.js +2 -1
  265. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  266. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +10 -0
  267. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  268. package/packages/pi-coding-agent/dist/core/auth-storage.js +27 -0
  269. package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  270. package/packages/pi-coding-agent/dist/core/auth-storage.test.js +85 -0
  271. package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
  272. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts +2 -0
  273. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts.map +1 -0
  274. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js +64 -0
  275. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js.map +1 -0
  276. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
  277. package/packages/pi-coding-agent/dist/core/model-resolver.js +22 -18
  278. package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  279. package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts +8 -0
  280. package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts.map +1 -0
  281. package/packages/pi-coding-agent/dist/core/model-resolver.test.js +75 -0
  282. package/packages/pi-coding-agent/dist/core/model-resolver.test.js.map +1 -0
  283. package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +5 -0
  284. package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
  285. package/packages/pi-coding-agent/dist/core/retry-handler.js +55 -1
  286. package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
  287. package/packages/pi-coding-agent/dist/core/retry-handler.test.js +57 -0
  288. package/packages/pi-coding-agent/dist/core/retry-handler.test.js.map +1 -1
  289. package/packages/pi-coding-agent/dist/core/sdk.d.ts +11 -0
  290. package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  291. package/packages/pi-coding-agent/dist/core/sdk.js +38 -5
  292. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
  293. package/packages/pi-coding-agent/dist/core/sdk.test.d.ts +2 -0
  294. package/packages/pi-coding-agent/dist/core/sdk.test.d.ts.map +1 -0
  295. package/packages/pi-coding-agent/dist/core/sdk.test.js +71 -0
  296. package/packages/pi-coding-agent/dist/core/sdk.test.js.map +1 -0
  297. package/packages/pi-coding-agent/dist/index.d.ts +1 -1
  298. package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
  299. package/packages/pi-coding-agent/dist/index.js +1 -1
  300. package/packages/pi-coding-agent/dist/index.js.map +1 -1
  301. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts +2 -0
  302. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts.map +1 -0
  303. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js +13 -0
  304. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js.map +1 -0
  305. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +36 -0
  306. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
  307. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +4 -0
  308. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  309. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +24 -2
  310. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
  311. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  312. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js +9 -2
  313. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
  314. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +4 -0
  315. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  316. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +130 -12
  317. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  318. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  319. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +7 -2
  320. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  321. package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.d.ts.map +1 -1
  322. package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js +6 -1
  323. package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js.map +1 -1
  324. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  325. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -3
  326. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  327. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +4 -2
  328. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
  329. package/packages/pi-coding-agent/package.json +1 -1
  330. package/packages/pi-coding-agent/src/core/agent-session-renderable-tools.test.ts +70 -0
  331. package/packages/pi-coding-agent/src/core/agent-session.ts +2 -1
  332. package/packages/pi-coding-agent/src/core/auth-storage.test.ts +108 -0
  333. package/packages/pi-coding-agent/src/core/auth-storage.ts +30 -0
  334. package/packages/pi-coding-agent/src/core/model-resolver-initial-model-auth.test.ts +78 -0
  335. package/packages/pi-coding-agent/src/core/model-resolver.test.ts +85 -0
  336. package/packages/pi-coding-agent/src/core/model-resolver.ts +22 -18
  337. package/packages/pi-coding-agent/src/core/retry-handler.test.ts +83 -0
  338. package/packages/pi-coding-agent/src/core/retry-handler.ts +60 -1
  339. package/packages/pi-coding-agent/src/core/sdk.test.ts +89 -0
  340. package/packages/pi-coding-agent/src/core/sdk.ts +45 -9
  341. package/packages/pi-coding-agent/src/index.ts +1 -0
  342. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/login-dialog.test.ts +24 -0
  343. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +72 -0
  344. package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +30 -2
  345. package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +15 -6
  346. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +131 -12
  347. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +7 -2
  348. package/packages/pi-coding-agent/src/modes/interactive/controllers/model-controller.ts +6 -1
  349. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +4 -3
  350. package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +4 -2
  351. package/pkg/package.json +1 -1
  352. package/src/resources/GSD-WORKFLOW.md +1 -1
  353. package/src/resources/agents/debugger.md +58 -0
  354. package/src/resources/agents/doc-writer.md +43 -0
  355. package/src/resources/agents/git-ops.md +56 -0
  356. package/src/resources/agents/javascript-pro.md +46 -271
  357. package/src/resources/agents/planner.md +55 -0
  358. package/src/resources/agents/refactorer.md +47 -0
  359. package/src/resources/agents/reviewer.md +48 -0
  360. package/src/resources/agents/security.md +59 -0
  361. package/src/resources/agents/tester.md +50 -0
  362. package/src/resources/agents/typescript-pro.md +41 -235
  363. package/src/resources/extensions/claude-code-cli/partial-builder.ts +45 -12
  364. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +143 -13
  365. package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +91 -2
  366. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +281 -6
  367. package/src/resources/extensions/gsd/auto/infra-errors.ts +38 -0
  368. package/src/resources/extensions/gsd/auto/loop-deps.ts +2 -0
  369. package/src/resources/extensions/gsd/auto/loop.ts +45 -1
  370. package/src/resources/extensions/gsd/auto/phases.ts +6 -0
  371. package/src/resources/extensions/gsd/auto/session.ts +11 -0
  372. package/src/resources/extensions/gsd/auto-dashboard.ts +29 -18
  373. package/src/resources/extensions/gsd/auto-model-selection.ts +9 -1
  374. package/src/resources/extensions/gsd/auto-prompts.ts +111 -33
  375. package/src/resources/extensions/gsd/auto-start.ts +41 -7
  376. package/src/resources/extensions/gsd/auto-tool-tracking.ts +1 -1
  377. package/src/resources/extensions/gsd/auto-worktree.ts +1 -1
  378. package/src/resources/extensions/gsd/auto.ts +72 -0
  379. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +3 -3
  380. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +2 -0
  381. package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +79 -60
  382. package/src/resources/extensions/gsd/bootstrap/system-context.ts +7 -0
  383. package/src/resources/extensions/gsd/commands/context.ts +16 -5
  384. package/src/resources/extensions/gsd/commands/dispatcher.ts +14 -2
  385. package/src/resources/extensions/gsd/commands/handlers/auto.ts +10 -36
  386. package/src/resources/extensions/gsd/commands/handlers/core.ts +58 -11
  387. package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +17 -7
  388. package/src/resources/extensions/gsd/commands/handlers/workflow.ts +4 -10
  389. package/src/resources/extensions/gsd/dashboard-overlay.ts +10 -3
  390. package/src/resources/extensions/gsd/dispatch-guard.ts +18 -1
  391. package/src/resources/extensions/gsd/doctor-providers.ts +24 -0
  392. package/src/resources/extensions/gsd/error-classifier.ts +5 -2
  393. package/src/resources/extensions/gsd/forensics.ts +23 -7
  394. package/src/resources/extensions/gsd/gate-registry.ts +251 -0
  395. package/src/resources/extensions/gsd/gsd-db.ts +51 -0
  396. package/src/resources/extensions/gsd/guided-flow.ts +5 -10
  397. package/src/resources/extensions/gsd/interrupted-session.ts +1 -0
  398. package/src/resources/extensions/gsd/metrics.ts +12 -1
  399. package/src/resources/extensions/gsd/milestone-actions.ts +10 -3
  400. package/src/resources/extensions/gsd/milestone-validation-gates.ts +11 -13
  401. package/src/resources/extensions/gsd/notification-overlay.ts +47 -14
  402. package/src/resources/extensions/gsd/notification-store.ts +54 -5
  403. package/src/resources/extensions/gsd/notification-widget.ts +5 -14
  404. package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +10 -3
  405. package/src/resources/extensions/gsd/pre-execution-checks.ts +39 -2
  406. package/src/resources/extensions/gsd/prompt-validation.ts +157 -0
  407. package/src/resources/extensions/gsd/prompts/complete-slice.md +5 -3
  408. package/src/resources/extensions/gsd/prompts/discuss.md +2 -0
  409. package/src/resources/extensions/gsd/prompts/execute-task.md +22 -19
  410. package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
  411. package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
  412. package/src/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
  413. package/src/resources/extensions/gsd/prompts/queue.md +3 -2
  414. package/src/resources/extensions/gsd/prompts/system.md +1 -0
  415. package/src/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
  416. package/src/resources/extensions/gsd/session-model-override.ts +36 -0
  417. package/src/resources/extensions/gsd/shortcut-defs.ts +56 -0
  418. package/src/resources/extensions/gsd/state.ts +13 -2
  419. package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +25 -9
  420. package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +28 -0
  421. package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +39 -0
  422. package/src/resources/extensions/gsd/tests/complete-slice-gate-closure.test.ts +167 -0
  423. package/src/resources/extensions/gsd/tests/complete-slice-prompt-task-summary-layout.test.ts +18 -0
  424. package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +27 -0
  425. package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +36 -0
  426. package/src/resources/extensions/gsd/tests/execute-task-prompt-existing-artifact-guard.test.ts +33 -0
  427. package/src/resources/extensions/gsd/tests/forensics-stuck-loops.test.ts +62 -0
  428. package/src/resources/extensions/gsd/tests/format-shortcut.test.ts +31 -0
  429. package/src/resources/extensions/gsd/tests/gate-dispatch.test.ts +27 -0
  430. package/src/resources/extensions/gsd/tests/gate-registry.test.ts +140 -0
  431. package/src/resources/extensions/gsd/tests/gsd-no-project-error.test.ts +73 -0
  432. package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +180 -0
  433. package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +66 -1
  434. package/src/resources/extensions/gsd/tests/model-isolation.test.ts +36 -51
  435. package/src/resources/extensions/gsd/tests/notification-store.test.ts +35 -0
  436. package/src/resources/extensions/gsd/tests/notification-widget.test.ts +26 -0
  437. package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +90 -0
  438. package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +1 -0
  439. package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +18 -0
  440. package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +49 -0
  441. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +19 -0
  442. package/src/resources/extensions/gsd/tests/prompt-system-gate-coverage.test.ts +208 -0
  443. package/src/resources/extensions/gsd/tests/provider-errors.test.ts +16 -0
  444. package/src/resources/extensions/gsd/tests/register-shortcuts.test.ts +63 -5
  445. package/src/resources/extensions/gsd/tests/session-model-override.test.ts +35 -0
  446. package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +90 -0
  447. package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +7 -0
  448. package/src/resources/extensions/gsd/tests/validate-milestone-prompt-verification-classes.test.ts +18 -0
  449. package/src/resources/extensions/gsd/tools/complete-slice.ts +63 -0
  450. package/src/resources/extensions/gsd/tools/complete-task.ts +63 -0
  451. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +4 -1
  452. package/src/resources/extensions/gsd/types.ts +26 -0
  453. package/src/resources/extensions/ollama/index.ts +13 -3
  454. package/src/resources/extensions/ollama/ollama-status-indicator.test.ts +28 -0
  455. package/src/resources/extensions/shared/gsd-phase-state.ts +42 -0
  456. package/src/resources/extensions/shared/tests/gsd-phase-state.test.ts +48 -0
  457. package/src/resources/extensions/subagent/agents.ts +10 -0
  458. package/src/resources/extensions/subagent/index.ts +18 -0
  459. package/src/resources/extensions/subagent/tests/agents-conflicts.test.ts +33 -0
  460. package/src/resources/skills/create-skill/SKILL.md +2 -0
  461. package/dist/web/standalone/.next/static/chunks/app/page-7115e62689b5fd84.js +0 -1
  462. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  463. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  464. /package/dist/web/standalone/.next/static/{nPky_WQC28aBD77eZsRAB → nCL1Ivw47iAAoKVgerXNi}/_buildManifest.js +0 -0
  465. /package/dist/web/standalone/.next/static/{nPky_WQC28aBD77eZsRAB → nCL1Ivw47iAAoKVgerXNi}/_ssgManifest.js +0 -0
@@ -22,6 +22,8 @@ A researcher explored the codebase and a planner decomposed the work — you are
22
22
 
23
23
  {{slicePlanExcerpt}}
24
24
 
25
+ {{gatesToClose}}
26
+
25
27
  ## Backing Source Artifacts
26
28
  - Slice plan: `{{planPath}}`
27
29
  - Task plan source: `{{taskPlanPath}}`
@@ -32,29 +34,30 @@ Then:
32
34
  0. Narrate step transitions, key implementation decisions, and verification outcomes as you work. Keep it terse — one line between tool-call clusters, not between every call — but write complete sentences in user-facing prose, not shorthand notes or scratchpad fragments.
33
35
  1. {{skillActivation}} Follow any activated skills before writing code. If no skills match this task, skip this step.
34
36
  2. Execute the steps in the inlined task plan, adapting minor local mismatches when the surrounding code differs from the planner's snapshot
35
- 3. Build the real thing. If the task plan says "create login endpoint", build an endpoint that actually authenticates against a real store, not one that returns a hardcoded success response. If the task plan says "create dashboard page", build a page that renders real data from the API, not a component with hardcoded props. Stubs and mocks are for tests, not for the shipped feature.
36
- 4. Write or update tests as part of execution tests are verification, not an afterthought. If the slice plan defines test files in its Verification section and this is the first task, create them (they should initially fail).
37
- 5. When implementing non-trivial runtime behavior (async flows, API boundaries, background processes, error paths), add or preserve agent-usable observability. Skip this for simple changes where it doesn't apply.
37
+ 3. Before any `Write` that creates an artifact or output file, check whether that path already exists. If it does, read it first and decide whether the work is already done, should be extended, or truly needs replacement. "Create" in the plan does **not** mean the file is missing a prior session may already have started it.
38
+ 4. Build the real thing. If the task plan says "create login endpoint", build an endpoint that actually authenticates against a real store, not one that returns a hardcoded success response. If the task plan says "create dashboard page", build a page that renders real data from the API, not a component with hardcoded props. Stubs and mocks are for tests, not for the shipped feature.
39
+ 5. Write or update tests as part of execution tests are verification, not an afterthought. If the slice plan defines test files in its Verification section and this is the first task, create them (they should initially fail).
40
+ 6. When implementing non-trivial runtime behavior (async flows, API boundaries, background processes, error paths), add or preserve agent-usable observability. Skip this for simple changes where it doesn't apply.
38
41
 
39
42
  **Background process rule:** Never use bare `command &` to run background processes. The shell's `&` operator leaves stdout/stderr attached to the parent, which causes the Bash tool to hang indefinitely waiting for those streams to close. Always redirect output before backgrounding:
40
43
  - Correct: `command > /dev/null 2>&1 &` or `nohup command > /dev/null 2>&1 &`
41
44
  - Example: `python -m http.server 8080 > /dev/null 2>&1 &` (NOT `python -m http.server 8080 &`)
42
45
  - Preferred: use the `bg_shell` tool if available — it manages process lifecycle correctly without stream-inheritance issues
43
- 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.
44
- 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.
45
- 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.
46
- 9. Verify must-haves are met by running concrete checks (tests, commands, observable behaviors)
47
- 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.
48
- 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.
49
- 12. If the task touches UI, browser flows, DOM behavior, or user-visible web state:
46
+ 7. 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.
47
+ 8. 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.
48
+ 9. 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.
49
+ 10. Verify must-haves are met by running concrete checks (tests, commands, observable behaviors)
50
+ 11. 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.
51
+ 12. 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.
52
+ 13. If the task touches UI, browser flows, DOM behavior, or user-visible web state:
50
53
  - exercise the real flow in the browser
51
54
  - prefer `browser_batch` when the next few actions are obvious and sequential
52
55
  - prefer `browser_assert` for explicit pass/fail verification of the intended outcome
53
56
  - use `browser_diff` when an action's effect is ambiguous
54
57
  - use console/network/dialog diagnostics when validating async, stateful, or failure-prone UI
55
58
  - record verification in terms of explicit checks passed/failed, not only prose interpretation
56
- 13. If the task plan includes an Observability Impact section, verify those signals directly. Skip this step if the task plan omits the section.
57
- 14. **If execution is running long or verification fails:**
59
+ 14. If the task plan includes an Observability Impact section, verify those signals directly. Skip this step if the task plan omits the section.
60
+ 15. **If execution is running long or verification fails:**
58
61
 
59
62
  **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.
60
63
 
@@ -65,13 +68,13 @@ Then:
65
68
  - Distinguish "I know" from "I assume." Observable facts (the error says X) are strong evidence. Assumptions (this library should work this way) need verification.
66
69
  - 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.
67
70
  - 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.
68
- 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.
69
- 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.
70
- 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.
71
- 18. Read the template at `~/.gsd/agent/extensions/gsd/templates/task-summary.md`
72
- 19. Use that template to prepare the completion content you will pass to `gsd_complete_task` using the camelCase fields `milestoneId`, `sliceId`, `taskId`, `oneLiner`, `narrative`, `verification`, and `verificationEvidence`. Do **not** manually write `{{taskSummaryPath}}` — the DB-backed tool is the canonical write path and renders the summary file for you.
73
- 20. Call `gsd_complete_task` with milestoneId, sliceId, taskId, and the completion fields derived from the template. This is your final required step — do NOT manually edit PLAN.md checkboxes. The tool marks the task complete, updates the DB, renders `{{taskSummaryPath}}`, and updates PLAN.md automatically.
74
- 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.
71
+ 16. **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.
72
+ 17. 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.
73
+ 18. 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.
74
+ 19. Read the template at `~/.gsd/agent/extensions/gsd/templates/task-summary.md`
75
+ 20. Use that template to prepare the completion content you will pass to `gsd_complete_task` using the camelCase fields `milestoneId`, `sliceId`, `taskId`, `oneLiner`, `narrative`, `verification`, and `verificationEvidence`. Do **not** manually write `{{taskSummaryPath}}` — the DB-backed tool is the canonical write path and renders the summary file for you.
76
+ 21. Call `gsd_complete_task` with milestoneId, sliceId, taskId, and the completion fields derived from the template. This is your final required step — do NOT manually edit PLAN.md checkboxes. The tool marks the task complete, updates the DB, renders `{{taskSummaryPath}}`, and updates PLAN.md automatically.
77
+ 22. 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.
75
78
 
76
79
  All work stays in your working directory: `{{workingDirectory}}`.
77
80
 
@@ -32,6 +32,8 @@ Ask **1–3 questions per round**. Keep each question focused on one of:
32
32
  - **The biggest technical unknowns / risks** — what could fail, what hasn't been proven
33
33
  - **What external systems/services this touches** — APIs, databases, third-party services
34
34
 
35
+ **Never fabricate or simulate user input.** Never generate fake transcript markers like `[User]`, `[Human]`, or `User:`. Ask one question round, then wait for the user's actual response before continuing.
36
+
35
37
  **If `{{structuredQuestionsAvailable}}` is `true`:** use `ask_user_questions` for each round. 1–3 questions per call, each as a separate question object. Keep option labels short (3–5 words). Always include a freeform "Other / let me explain" option. When the user picks that option or writes a long freeform answer, switch to plain text follow-up for that thread before resuming structured questions. **IMPORTANT: Call `ask_user_questions` exactly once per turn. Never make multiple calls with the same or overlapping questions — wait for the user's response before asking the next round.**
36
38
 
37
39
  **If `{{structuredQuestionsAvailable}}` is `false`:** ask questions in plain text. Keep each round to 1–3 focused questions. Wait for answers before asking the next round.
@@ -22,6 +22,8 @@ Do **not** go deep — just enough that your questions reflect what's actually t
22
22
 
23
23
  ### Question rounds
24
24
 
25
+ **Never fabricate or simulate user input.** Never generate fake transcript markers like `[User]`, `[Human]`, or `User:`. Ask one question round, then wait for the user's actual response before continuing.
26
+
25
27
  **If `{{structuredQuestionsAvailable}}` is `true`:** Ask **1–3 questions per round** using `ask_user_questions`. **Call `ask_user_questions` exactly once per turn — never make multiple calls with the same or overlapping questions. Wait for the user's response before asking the next round.**
26
28
  **If `{{structuredQuestionsAvailable}}` is `false`:** Ask **1–3 questions per round** in plain text. Number them and wait for the user's response before asking the next round.
27
29
  Keep each question focused on one of:
@@ -1 +1 @@
1
- Resume interrupted work. Find the continue file (`{{sliceId}}-CONTINUE.md` or `continue.md`) in slice {{sliceId}} of milestone {{milestoneId}}, read it, and use it as the recovery contract for where to pick up. Do **not** delete the continue file immediately. Keep it until the task is successfully completed or you have written a newer summary/continue artifact that clearly supersedes it. If the resumed attempt fails again, update or replace the continue file so no recovery context is lost. {{skillActivation}}
1
+ Resume interrupted work. Find the continue file (`{{sliceId}}-CONTINUE.md` or `continue.md`) in slice {{sliceId}} of milestone {{milestoneId}}, read it, and use it as the recovery contract for where to pick up. Before you create any expected artifact or output file, check whether it already exists and read it first — a prior session may already have started or completed that work. Do **not** delete the continue file immediately. Keep it until the task is successfully completed or you have written a newer summary/continue artifact that clearly supersedes it. If the resumed attempt fails again, update or replace the continue file so no recovery context is lost. {{skillActivation}}
@@ -18,6 +18,7 @@ Say exactly: "What do you want to add?" — nothing else. Wait for the user's an
18
18
  ## Discussion Phase
19
19
 
20
20
  After they describe it, your job is to understand the new work deeply enough to create context files that a future planning session can use.
21
+ Never fabricate or simulate user input during this discussion. Never generate fake transcript markers like `[User]`, `[Human]`, or `User:`. Ask one question round, then wait for the user's actual response before continuing.
21
22
 
22
23
  **If the user provides a file path or pastes a large document** (spec, design doc, product plan, chat export), read it fully before asking questions. Use it as the starting point — don't ask them to re-explain what's already in the document. Your questions should fill gaps and resolve ambiguities the document doesn't cover.
23
24
 
@@ -36,11 +37,11 @@ Don't go deep — just enough that your next question reflects what's actually t
36
37
  - How the new work relates to existing milestones — overlap, dependencies, prerequisites
37
38
  - If `.gsd/REQUIREMENTS.md` exists: which unmet Active or Deferred requirements this queued work advances
38
39
 
39
- **Then use ask_user_questions** to dig into gray areas — scope boundaries, proof expectations, integration choices, tech preferences when they materially matter, and what's in vs out. 1-3 questions per round.
40
+ **Then use ask_user_questions** to dig into gray areas — scope boundaries, proof expectations, integration choices, tech preferences when they materially matter, and what's in vs out. Ask 1-3 questions per round, then wait for the user's response before asking the next round.
40
41
 
41
42
  If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow during discuss/planning work, but do not let it override the required discuss flow or artifact requirements.
42
43
 
43
- **Self-regulate:** Do **not** ask a meta "ready to queue?" question after every round. Keep going until you have enough depth to write the context well, then use a single wrap-up prompt if needed. If the user clearly keeps adding detail instead of objecting, treat that as permission to continue.
44
+ **Self-regulate:** Do **not** ask a meta "ready to queue?" question after every round. Keep going until you have enough depth to write the context well, then use a single wrap-up prompt if needed. Do not infer permission to continue from silence or from partial prior answers each new round requires an actual user response.
44
45
 
45
46
  ## Existing Milestone Awareness
46
47
 
@@ -35,6 +35,7 @@ GSD ships with bundled skills. Load the relevant skill file with the `read` tool
35
35
  - Read before edit.
36
36
  - Reproduce before fix when possible.
37
37
  - Work is not done until the relevant verification has passed.
38
+ - **Never fabricate, simulate, or role-play user responses.** Never generate markers like `[User]`, `[Human]`, `User:`, or similar to represent user input inside your own output. Prior conversation context may be provided to you inside `<conversation_history>` with `<user_message>` / `<assistant_message>` XML tags — treat those as read-only context and never emit those tags in your response. Ask one question round (1-3 questions), then stop and wait for the user's actual response before continuing. If `ask_user_questions` is available, treat its returned response as the only valid structured user input for that round.
38
39
  - Never print, echo, log, or restate secrets or credentials. Report only key names and applied/skipped status.
39
40
  - Never ask the user to edit `.env` files or set secrets manually. Use `secure_env_collect`.
40
41
  - In enduring files, write current state only unless the file is explicitly historical.
@@ -18,6 +18,8 @@ All relevant context has been preloaded below — the roadmap, all slice summari
18
18
 
19
19
  {{inlinedContext}}
20
20
 
21
+ {{gatesToEvaluate}}
22
+
21
23
  ## Execution Protocol
22
24
 
23
25
  ### Step 1 — Dispatch Parallel Reviewers
@@ -31,7 +33,7 @@ Prompt: "Review milestone {{milestoneId}} requirements coverage. Working directo
31
33
  Prompt: "Review milestone {{milestoneId}} cross-slice integration. Working directory: {{workingDirectory}}. Read `{{roadmapPath}}` and find the boundary map (produces/consumes contracts). For each boundary, check that the producing slice's SUMMARY confirms it produced the artifact, and the consuming slice's SUMMARY confirms it consumed it. Output a markdown table: Boundary | Producer Summary | Consumer Summary | Status. End with a one-line verdict: PASS if all boundaries honored, NEEDS-ATTENTION if any gaps."
32
34
 
33
35
  **Reviewer C — Assessment & Acceptance Criteria**
34
- Prompt: "Review milestone {{milestoneId}} assessment evidence and acceptance criteria. Working directory: {{workingDirectory}}. Read `.gsd/{{milestoneId}}/CONTEXT.md` for acceptance criteria. Check for ASSESSMENT files in each slice directory. Verify each acceptance criterion maps to either a passing assessment result or clear SUMMARY evidence. Output a checklist: [ ] Criterion | Evidence. End with a one-line verdict: PASS if all criteria met, NEEDS-ATTENTION if gaps exist."
36
+ Prompt: "Review milestone {{milestoneId}} assessment evidence and acceptance criteria. Working directory: {{workingDirectory}}. Read `.gsd/{{milestoneId}}/CONTEXT.md` for acceptance criteria. Check for ASSESSMENT files in each slice directory. Verify each acceptance criterion maps to either a passing assessment result or clear SUMMARY evidence. Then review the inlined milestone verification classes from planning. For each non-empty planned class, output a markdown table: Class | Planned Check | Evidence | Verdict. Use the exact class names `Contract`, `Integration`, `Operational`, and `UAT` whenever those classes are present. If no verification classes were planned, say that explicitly. Output two sections: `Acceptance Criteria` with a checklist `[ ] Criterion | Evidence`, and `Verification Classes` with the table. End with a one-line verdict: PASS if all criteria and verification classes are covered, NEEDS-ATTENTION if gaps exist."
35
37
 
36
38
  ### Step 2 — Synthesize Findings
37
39
 
@@ -70,6 +72,7 @@ reviewers: 3
70
72
  ```
71
73
 
72
74
  Call `gsd_validate_milestone` with the camelCase fields `milestoneId`, `verdict`, `remediationRound`, `successCriteriaChecklist`, `sliceDeliveryAudit`, `crossSliceIntegration`, `requirementCoverage`, `verdictRationale`, and `remediationPlan` when needed. If you include verification-class analysis, pass it in `verificationClasses`.
75
+ Extract the `Verification Classes` subsection from Reviewer C and pass it verbatim in `verificationClasses` so the persisted validation output uses the canonical class names `Contract`, `Integration`, `Operational`, and `UAT`.
73
76
 
74
77
  **DB access safety:** Do NOT query `.gsd/gsd.db` directly via `sqlite3` or `node -e require('better-sqlite3')` — the engine owns the WAL connection. Use `gsd_milestone_status` to read milestone and slice state. All data you need is already inlined in the context above or accessible via the `gsd_*` tools. Direct DB access corrupts the WAL and bypasses tool-level validation.
75
78
 
@@ -0,0 +1,25 @@
1
+ const sessionOverrides = new Map();
2
+ function normalizeSessionId(sessionId) {
3
+ return typeof sessionId === "string" ? sessionId.trim() : "";
4
+ }
5
+ export function setSessionModelOverride(sessionId, override) {
6
+ const key = normalizeSessionId(sessionId);
7
+ if (!key)
8
+ return;
9
+ sessionOverrides.set(key, {
10
+ provider: override.provider,
11
+ id: override.id,
12
+ });
13
+ }
14
+ export function getSessionModelOverride(sessionId) {
15
+ const key = normalizeSessionId(sessionId);
16
+ if (!key)
17
+ return undefined;
18
+ return sessionOverrides.get(key);
19
+ }
20
+ export function clearSessionModelOverride(sessionId) {
21
+ const key = normalizeSessionId(sessionId);
22
+ if (!key)
23
+ return;
24
+ sessionOverrides.delete(key);
25
+ }
@@ -0,0 +1,40 @@
1
+ // Canonical GSD shortcut definitions used by registration, help text, and overlays.
2
+ import { formatShortcut } from "./files.js";
3
+ export const GSD_SHORTCUTS = {
4
+ dashboard: {
5
+ key: "g",
6
+ action: "Open GSD dashboard",
7
+ command: "/gsd status",
8
+ hasFallback: true,
9
+ },
10
+ notifications: {
11
+ key: "n",
12
+ action: "Open notification history",
13
+ command: "/gsd notifications",
14
+ hasFallback: true,
15
+ },
16
+ parallel: {
17
+ key: "p",
18
+ action: "Open parallel worker monitor",
19
+ command: "/gsd parallel watch",
20
+ hasFallback: false, // Ctrl+Shift+P conflicts with cycleModelBackward
21
+ },
22
+ };
23
+ function combo(prefix, key) {
24
+ return `${prefix}${key.toUpperCase()}`;
25
+ }
26
+ export function primaryShortcutCombo(id) {
27
+ return combo("Ctrl+Alt+", GSD_SHORTCUTS[id].key);
28
+ }
29
+ export function fallbackShortcutCombo(id) {
30
+ return combo("Ctrl+Shift+", GSD_SHORTCUTS[id].key);
31
+ }
32
+ export function shortcutPair(id, formatter = (combo) => combo) {
33
+ const primary = formatter(primaryShortcutCombo(id));
34
+ if (!GSD_SHORTCUTS[id].hasFallback)
35
+ return primary;
36
+ return `${primary} / ${formatter(fallbackShortcutCombo(id))}`;
37
+ }
38
+ export function formattedShortcutPair(id) {
39
+ return shortcutPair(id, formatShortcut);
40
+ }
@@ -13,7 +13,7 @@ import { existsSync, readdirSync, readFileSync } from 'node:fs';
13
13
  import { debugCount, debugTime } from './debug-logger.js';
14
14
  import { logWarning, logError } from './workflow-logger.js';
15
15
  import { extractVerdict } from './verdict-parser.js';
16
- import { isDbAvailable, wasDbOpenAttempted, getAllMilestones, getMilestone, getMilestoneSlices, getSliceTasks, getReplanHistory, getSlice, insertMilestone, insertSlice, insertTask, updateTaskStatus, getPendingSliceGateCount, } from './gsd-db.js';
16
+ import { isDbAvailable, wasDbOpenAttempted, getAllMilestones, getMilestone, getMilestoneSlices, getSliceTasks, getReplanHistory, getSlice, insertMilestone, insertSlice, insertTask, updateTaskStatus, getPendingGateCountForTurn, } from './gsd-db.js';
17
17
  /**
18
18
  * A "ghost" milestone directory contains only META.json (and no substantive
19
19
  * files like CONTEXT, CONTEXT-DRAFT, ROADMAP, or SUMMARY). These appear when
@@ -724,7 +724,14 @@ export async function deriveStateFromDb(basePath) {
724
724
  };
725
725
  }
726
726
  }
727
- const pendingGateCount = getPendingSliceGateCount(activeMilestone.id, activeSlice.id);
727
+ // ── Quality gate evaluation check ──────────────────────────────────
728
+ // Pause before execution only when gates owned by the `gate-evaluate`
729
+ // turn (Q3/Q4) are still pending. Q8 is also `scope:"slice"` but is
730
+ // owned by `complete-slice`, so it must NOT block the evaluating-gates
731
+ // phase — otherwise auto-loop stalls forever waiting for a gate that
732
+ // this turn never evaluates. See gate-registry.ts for the ownership map.
733
+ // Slices with zero gate rows (pre-feature or simple) skip straight through.
734
+ const pendingGateCount = getPendingGateCountForTurn(activeMilestone.id, activeSlice.id, "gate-evaluate");
728
735
  if (pendingGateCount > 0) {
729
736
  return {
730
737
  activeMilestone, activeSlice, activeTask: null,
@@ -9,7 +9,8 @@
9
9
  import { join } from "node:path";
10
10
  import { mkdirSync } from "node:fs";
11
11
  import { isClosedStatus } from "../status-guards.js";
12
- import { transaction, insertMilestone, insertSlice, getSlice, getSliceTasks, getMilestone, updateSliceStatus, setSliceSummaryMd, } from "../gsd-db.js";
12
+ import { transaction, insertMilestone, insertSlice, getSlice, getSliceTasks, getMilestone, updateSliceStatus, setSliceSummaryMd, saveGateResult, getPendingGatesForTurn, } from "../gsd-db.js";
13
+ import { getGatesForTurn } from "../gate-registry.js";
13
14
  import { resolveSlicePath, clearPathCache } from "../paths.js";
14
15
  import { checkOwnership, sliceUnitKey } from "../unit-ownership.js";
15
16
  import { saveFile, clearParseCache } from "../files.js";
@@ -19,6 +20,19 @@ import { renderAllProjections } from "../workflow-projections.js";
19
20
  import { writeManifest } from "../workflow-manifest.js";
20
21
  import { appendEvent } from "../workflow-events.js";
21
22
  import { logWarning, logError } from "../workflow-logger.js";
23
+ /**
24
+ * Map a complete-slice-owned gate id to the CompleteSliceParams field
25
+ * whose presence drives `pass` vs. `omitted`. Keep this in lockstep with
26
+ * the gates declared in gate-registry.ts under ownerTurn "complete-slice".
27
+ */
28
+ function sliceGateFieldForId(id, params) {
29
+ switch (id) {
30
+ case "Q8":
31
+ return params.operationalReadiness;
32
+ default:
33
+ return undefined;
34
+ }
35
+ }
22
36
  /**
23
37
  * Render slice summary markdown matching the template format.
24
38
  * YAML frontmatter uses snake_case keys for parseSummary() compatibility.
@@ -134,6 +148,10 @@ ${reqSurfaced}
134
148
 
135
149
  ${reqInvalidated}
136
150
 
151
+ ## Operational Readiness
152
+
153
+ ${params.operationalReadiness?.trim() || "None."}
154
+
137
155
  ## Deviations
138
156
 
139
157
  ${params.deviations || "None."}
@@ -271,6 +289,39 @@ export async function handleCompleteSlice(params, basePath) {
271
289
  }
272
290
  // Store rendered markdown in DB for D004 recovery
273
291
  setSliceSummaryMd(params.milestoneId, params.sliceId, summaryMd, uatMd);
292
+ // ── Close gates owned by complete-slice (Q8) ───────────────────────────
293
+ // Each owned gate maps to a specific summary section via the registry.
294
+ // If the caller populated the corresponding field, record `pass`; if the
295
+ // field is empty, record `omitted`. Without this loop, Q8 would stay
296
+ // pending forever and block future state derivation (see gate-registry).
297
+ try {
298
+ const pendingGates = getPendingGatesForTurn(params.milestoneId, params.sliceId, "complete-slice");
299
+ if (pendingGates.length > 0) {
300
+ const ownedDefs = new Map(getGatesForTurn("complete-slice").map((g) => [g.id, g]));
301
+ for (const row of pendingGates) {
302
+ const def = ownedDefs.get(row.gate_id);
303
+ if (!def)
304
+ continue;
305
+ // Map gate id → param field it maps to. Keep the map local so
306
+ // adding a new complete-slice gate is a single place change.
307
+ const field = sliceGateFieldForId(def.id, params);
308
+ const hasContent = typeof field === "string" && field.trim().length > 0;
309
+ saveGateResult({
310
+ milestoneId: params.milestoneId,
311
+ sliceId: params.sliceId,
312
+ gateId: def.id,
313
+ verdict: hasContent ? "pass" : "omitted",
314
+ rationale: hasContent
315
+ ? `${def.promptSection} section populated in slice summary`
316
+ : `${def.promptSection} section left empty — recorded as omitted`,
317
+ findings: hasContent ? field.trim() : "",
318
+ });
319
+ }
320
+ }
321
+ }
322
+ catch (gateErr) {
323
+ logWarning("tool", `complete-slice gate close warning for ${params.milestoneId}/${params.sliceId}: ${gateErr.message}`);
324
+ }
274
325
  // Invalidate all caches
275
326
  invalidateStateCache();
276
327
  clearPathCache();
@@ -9,7 +9,8 @@
9
9
  import { join } from "node:path";
10
10
  import { mkdirSync } from "node:fs";
11
11
  import { isClosedStatus } from "../status-guards.js";
12
- import { transaction, insertMilestone, insertSlice, insertTask, insertVerificationEvidence, getMilestone, getSlice, getTask, updateTaskStatus, setTaskSummaryMd, deleteVerificationEvidence, } from "../gsd-db.js";
12
+ import { transaction, insertMilestone, insertSlice, insertTask, insertVerificationEvidence, getMilestone, getSlice, getTask, updateTaskStatus, setTaskSummaryMd, deleteVerificationEvidence, saveGateResult, getPendingGatesForTurn, } from "../gsd-db.js";
13
+ import { getGatesForTurn } from "../gate-registry.js";
13
14
  import { resolveSliceFile, resolveTasksDir, clearPathCache } from "../paths.js";
14
15
  import { checkOwnership, taskUnitKey } from "../unit-ownership.js";
15
16
  import { saveFile, clearParseCache } from "../files.js";
@@ -19,6 +20,23 @@ import { renderAllProjections, renderSummaryContent } from "../workflow-projecti
19
20
  import { writeManifest } from "../workflow-manifest.js";
20
21
  import { appendEvent } from "../workflow-events.js";
21
22
  import { logWarning, logError } from "../workflow-logger.js";
23
+ /**
24
+ * Map an execute-task-owned gate id to the CompleteTaskParams field whose
25
+ * presence drives `pass` vs. `omitted`. Keep in lockstep with the gates
26
+ * declared in gate-registry.ts under ownerTurn "execute-task".
27
+ */
28
+ function taskGateFieldForId(id, params) {
29
+ switch (id) {
30
+ case "Q5":
31
+ return params.failureModes;
32
+ case "Q6":
33
+ return params.loadProfile;
34
+ case "Q7":
35
+ return params.negativeTests;
36
+ default:
37
+ return undefined;
38
+ }
39
+ }
22
40
  /**
23
41
  * Normalize a list parameter that may arrive as a string (newline-delimited
24
42
  * bullet list from the LLM) into a string array (#3361).
@@ -189,6 +207,38 @@ export async function handleCompleteTask(params, basePath) {
189
207
  }
190
208
  // Store rendered markdown in DB for D004 recovery
191
209
  setTaskSummaryMd(params.milestoneId, params.sliceId, params.taskId, summaryMd);
210
+ // ── Close gates owned by execute-task (Q5/Q6/Q7) for this task ────────
211
+ // Each gate id maps to a specific params field via taskGateFieldForId.
212
+ // When the model populates the field, record `pass`; when it's empty,
213
+ // record `omitted`. Task-scoped rows are filtered by taskId so a single
214
+ // task's completion doesn't touch sibling tasks' gate rows.
215
+ try {
216
+ const pendingGates = getPendingGatesForTurn(params.milestoneId, params.sliceId, "execute-task", params.taskId);
217
+ if (pendingGates.length > 0) {
218
+ const ownedDefs = new Map(getGatesForTurn("execute-task").map((g) => [g.id, g]));
219
+ for (const row of pendingGates) {
220
+ const def = ownedDefs.get(row.gate_id);
221
+ if (!def)
222
+ continue;
223
+ const field = taskGateFieldForId(def.id, params);
224
+ const hasContent = typeof field === "string" && field.trim().length > 0;
225
+ saveGateResult({
226
+ milestoneId: params.milestoneId,
227
+ sliceId: params.sliceId,
228
+ taskId: params.taskId,
229
+ gateId: def.id,
230
+ verdict: hasContent ? "pass" : "omitted",
231
+ rationale: hasContent
232
+ ? `${def.promptSection} section populated in task summary`
233
+ : `${def.promptSection} section left empty — recorded as omitted`,
234
+ findings: hasContent ? field.trim() : "",
235
+ });
236
+ }
237
+ }
238
+ }
239
+ catch (gateErr) {
240
+ logWarning("tool", `complete-task gate close warning for ${params.milestoneId}/${params.sliceId}/${params.taskId}: ${gateErr.message}`);
241
+ }
192
242
  // Invalidate all caches
193
243
  invalidateStateCache();
194
244
  clearPathCache();
@@ -2,6 +2,7 @@ import { ensureDbOpen } from "../bootstrap/dynamic-tools.js";
2
2
  import { sanitizeCompleteMilestoneParams } from "../bootstrap/sanitize-complete-milestone.js";
3
3
  import { loadWriteGateSnapshot, shouldBlockContextArtifactSaveInSnapshot } from "../bootstrap/write-gate.js";
4
4
  import { getMilestone, getSliceStatusSummary, getSliceTaskCounts, _getAdapter, saveGateResult, } from "../gsd-db.js";
5
+ import { GATE_REGISTRY } from "../gate-registry.js";
5
6
  import { saveArtifactToDb } from "../db-writer.js";
6
7
  import { handleCompleteMilestone } from "./complete-milestone.js";
7
8
  import { handleCompleteTask } from "./complete-task.js";
@@ -323,7 +324,9 @@ export async function executeSaveGateResult(params, basePath = process.cwd()) {
323
324
  isError: true,
324
325
  };
325
326
  }
326
- const validGates = ["Q3", "Q4", "Q5", "Q6", "Q7", "Q8"];
327
+ // Source of truth: gate-registry.ts. Every declared GateId is accepted,
328
+ // so adding a new gate in one place automatically flows through here.
329
+ const validGates = Object.keys(GATE_REGISTRY);
327
330
  if (!validGates.includes(params.gateId)) {
328
331
  return {
329
332
  content: [{ type: "text", text: `Error: Invalid gateId "${params.gateId}". Must be one of: ${validGates.join(", ")}` }],
@@ -49,8 +49,15 @@ async function probeAndRegister(pi) {
49
49
  return false;
50
50
  }
51
51
  const models = await discoverModels();
52
- if (models.length === 0)
53
- return true; // Running but no models pulled
52
+ if (models.length === 0) {
53
+ // No local models means there's nothing usable to register in GSD.
54
+ // Keep the footer/status clean instead of advertising Ollama availability.
55
+ if (providerRegistered) {
56
+ pi.unregisterProvider("ollama");
57
+ providerRegistered = false;
58
+ }
59
+ return false;
60
+ }
54
61
  const baseUrl = client.getOllamaHost();
55
62
  // Use authMode "apiKey" with a dummy key (#3440).
56
63
  // authMode "none" requires a custom streamSimple handler, but Ollama uses
@@ -102,10 +109,11 @@ export default function ollama(pi) {
102
109
  else {
103
110
  probeAndRegister(pi)
104
111
  .then((found) => {
105
- if (found)
106
- ctx.ui.setStatus("ollama", "Ollama");
112
+ ctx.ui.setStatus("ollama", found ? "Ollama" : undefined);
107
113
  })
108
- .catch(() => { });
114
+ .catch(() => {
115
+ ctx.ui.setStatus("ollama", undefined);
116
+ });
109
117
  }
110
118
  });
111
119
  pi.on("session_shutdown", async () => {
@@ -0,0 +1,35 @@
1
+ /**
2
+ * GSD Phase State — cross-extension coordination
3
+ * Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>
4
+ *
5
+ * Lightweight module-level state that GSD auto-mode writes to and the
6
+ * subagent tool reads from. Both extensions run in the same process so
7
+ * a module variable is sufficient — no file I/O needed.
8
+ */
9
+ let _active = false;
10
+ let _currentPhase = null;
11
+ /** Mark GSD auto-mode as active. */
12
+ export function activateGSD() {
13
+ _active = true;
14
+ }
15
+ /** Mark GSD auto-mode as inactive and clear the current phase. */
16
+ export function deactivateGSD() {
17
+ _active = false;
18
+ _currentPhase = null;
19
+ }
20
+ /** Set the currently dispatched GSD phase (e.g. "plan-milestone"). */
21
+ export function setCurrentPhase(phase) {
22
+ _currentPhase = phase;
23
+ }
24
+ /** Clear the current phase (unit completed or aborted). */
25
+ export function clearCurrentPhase() {
26
+ _currentPhase = null;
27
+ }
28
+ /** Returns true if GSD auto-mode is currently active. */
29
+ export function isGSDActive() {
30
+ return _active;
31
+ }
32
+ /** Returns the current GSD phase, or null if none is active. */
33
+ export function getCurrentPhase() {
34
+ return _active ? _currentPhase : null;
35
+ }
@@ -5,6 +5,12 @@ import * as fs from "node:fs";
5
5
  import * as path from "node:path";
6
6
  import { getAgentDir, parseFrontmatter } from "@gsd/pi-coding-agent";
7
7
  const PROJECT_AGENT_DIR_CANDIDATES = [".gsd", ".pi"];
8
+ export function parseConflictsWith(value) {
9
+ if (typeof value !== "string")
10
+ return undefined;
11
+ const conflicts = value.split(",").map((s) => s.trim()).filter(Boolean);
12
+ return conflicts.length > 0 ? conflicts : undefined;
13
+ }
8
14
  function parseAgentTools(value) {
9
15
  if (typeof value === "string") {
10
16
  const tools = value
@@ -52,11 +58,13 @@ function loadAgentsFromDir(dir, source) {
52
58
  continue;
53
59
  }
54
60
  const tools = parseAgentTools(frontmatter.tools);
61
+ const conflictsWith = parseConflictsWith(frontmatter.conflicts_with);
55
62
  agents.push({
56
63
  name: frontmatter.name,
57
64
  description: frontmatter.description,
58
65
  tools: tools && tools.length > 0 ? tools : undefined,
59
66
  model: frontmatter.model,
67
+ conflictsWith,
60
68
  systemPrompt: body,
61
69
  source,
62
70
  filePath,
@@ -21,6 +21,7 @@ import { getMarkdownTheme } from "@gsd/pi-coding-agent";
21
21
  import { Container, Markdown, Spacer, Text } from "@gsd/pi-tui";
22
22
  import { Type } from "@sinclair/typebox";
23
23
  import { formatTokenCount } from "../shared/mod.js";
24
+ import { getCurrentPhase } from "../shared/gsd-phase-state.js";
24
25
  import { discoverAgents } from "./agents.js";
25
26
  import { createIsolation, mergeDeltaPatches, readIsolationMode, } from "./isolation.js";
26
27
  import { registerWorker, updateWorker } from "./worker-registry.js";
@@ -268,6 +269,22 @@ async function runSingleAgent(defaultCwd, agents, agentName, task, cwd, step, si
268
269
  step,
269
270
  };
270
271
  }
272
+ // GSD phase guard: block agents that conflict with the active GSD phase
273
+ if (agent.conflictsWith && agent.conflictsWith.length > 0) {
274
+ const activePhase = getCurrentPhase();
275
+ if (activePhase && agent.conflictsWith.includes(activePhase)) {
276
+ return {
277
+ agent: agentName,
278
+ agentSource: agent.source,
279
+ task,
280
+ exitCode: 1,
281
+ messages: [],
282
+ stderr: `Agent "${agentName}" is blocked: it conflicts with the active GSD phase "${activePhase}". Use the built-in GSD workflow instead.`,
283
+ usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, cost: 0, contextTokens: 0, turns: 0 },
284
+ step,
285
+ };
286
+ }
287
+ }
271
288
  let tmpPromptDir = null;
272
289
  let tmpPromptPath = null;
273
290
  const currentResult = {
@@ -78,6 +78,8 @@ Based on the user's message, route directly to the appropriate workflow:
78
78
  **If user intent is unclear, ask minimal clarifying questions:**
79
79
  - "Create a MIDI skill" → "Task-execution skill (does MIDI tasks) or domain expertise (complete MIDI knowledge base)?"
80
80
  - "Work on my skill" → "Which skill? What do you want to do with it?"
81
+ - Ask one clarifying question round at a time, then wait for the user's actual response before asking another.
82
+ - Never fabricate or simulate user responses while clarifying (for example, fake `[User]` markers or imagined answers).
81
83
 
82
84
  Then proceed directly to the workflow.
83
85
  </routing>
@@ -13,7 +13,6 @@ interface MinimalModel {
13
13
  id: string;
14
14
  }
15
15
  interface MinimalModelRegistry {
16
- getAll(): MinimalModel[];
17
16
  getAvailable(): MinimalModel[];
18
17
  }
19
18
  type ThinkingLevel = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
@@ -23,10 +23,14 @@ import { getPiDefaultModelAndProvider } from './pi-migration.js';
23
23
  export function validateConfiguredModel(modelRegistry, settingsManager) {
24
24
  const configuredProvider = settingsManager.getDefaultProvider();
25
25
  const configuredModel = settingsManager.getDefaultModel();
26
- const allModels = modelRegistry.getAll();
27
26
  const availableModels = modelRegistry.getAvailable();
27
+ // Check against availableModels (configured + auth'd) rather than getAll()
28
+ // so a stale default pointing at an unconfigured provider triggers the
29
+ // fallback. Previously a model present in the registry but missing API
30
+ // key / OAuth would satisfy configuredExists and survive startup, ending
31
+ // up as ctx.model even though it couldn't actually be used.
28
32
  const configuredExists = configuredProvider && configuredModel &&
29
- allModels.some((m) => m.provider === configuredProvider && m.id === configuredModel);
33
+ availableModels.some((m) => m.provider === configuredProvider && m.id === configuredModel);
30
34
  if (!configuredModel || !configuredExists) {
31
35
  // Model not configured at all, or removed from registry — pick a fallback.
32
36
  // Only fires when the model is genuinely unknown (not just temporarily unavailable).
@@ -1 +1 @@
1
- nPky_WQC28aBD77eZsRAB
1
+ nCL1Ivw47iAAoKVgerXNi