gsd-pi 2.75.0-dev.063e5a3 → 2.75.0-dev.96d4bb599

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 (760) hide show
  1. package/README.md +186 -149
  2. package/dist/claude-cli-check.d.ts +10 -0
  3. package/dist/claude-cli-check.js +13 -3
  4. package/dist/headless-events.d.ts +1 -1
  5. package/dist/headless-events.js +5 -2
  6. package/dist/headless.js +5 -6
  7. package/dist/loader.js +0 -0
  8. package/dist/onboarding.d.ts +20 -1
  9. package/dist/onboarding.js +99 -39
  10. package/dist/resources/extensions/ask-user-questions.js +17 -5
  11. package/dist/resources/extensions/claude-code-cli/models.js +9 -0
  12. package/dist/resources/extensions/claude-code-cli/readiness.js +12 -2
  13. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +76 -4
  14. package/dist/resources/extensions/gsd/auto/detect-stuck.js +9 -0
  15. package/dist/resources/extensions/gsd/auto/loop.js +67 -4
  16. package/dist/resources/extensions/gsd/auto/phases.js +70 -47
  17. package/dist/resources/extensions/gsd/auto/resolve.js +1 -1
  18. package/dist/resources/extensions/gsd/auto/run-unit.js +10 -1
  19. package/dist/resources/extensions/gsd/auto/session.js +5 -0
  20. package/dist/resources/extensions/gsd/auto-artifact-paths.js +20 -0
  21. package/dist/resources/extensions/gsd/auto-dashboard.js +15 -7
  22. package/dist/resources/extensions/gsd/auto-dispatch.js +112 -6
  23. package/dist/resources/extensions/gsd/auto-loop.js +1 -1
  24. package/dist/resources/extensions/gsd/auto-model-selection.js +11 -3
  25. package/dist/resources/extensions/gsd/auto-post-unit.js +10 -8
  26. package/dist/resources/extensions/gsd/auto-prompts.js +173 -39
  27. package/dist/resources/extensions/gsd/auto-recovery.js +57 -0
  28. package/dist/resources/extensions/gsd/auto-start.js +5 -3
  29. package/dist/resources/extensions/gsd/auto-verification.js +3 -3
  30. package/dist/resources/extensions/gsd/auto-worktree.js +55 -1
  31. package/dist/resources/extensions/gsd/auto.js +57 -25
  32. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +8 -21
  33. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +45 -23
  34. package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +128 -0
  35. package/dist/resources/extensions/gsd/bootstrap/query-tools.js +29 -0
  36. package/dist/resources/extensions/gsd/bootstrap/register-extension.js +2 -0
  37. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +22 -0
  38. package/dist/resources/extensions/gsd/bootstrap/system-context.js +17 -4
  39. package/dist/resources/extensions/gsd/commands/catalog.js +81 -9
  40. package/dist/resources/extensions/gsd/commands/handlers/core.js +64 -24
  41. package/dist/resources/extensions/gsd/commands/handlers/escalate.js +171 -0
  42. package/dist/resources/extensions/gsd/commands/handlers/onboarding.js +159 -0
  43. package/dist/resources/extensions/gsd/commands/handlers/ops.js +21 -0
  44. package/dist/resources/extensions/gsd/commands/handlers/workflow.js +228 -29
  45. package/dist/resources/extensions/gsd/commands-cmux.js +5 -2
  46. package/dist/resources/extensions/gsd/commands-config.js +5 -0
  47. package/dist/resources/extensions/gsd/commands-debug.js +388 -0
  48. package/dist/resources/extensions/gsd/commands-do.js +1 -0
  49. package/dist/resources/extensions/gsd/commands-extract-learnings.js +233 -75
  50. package/dist/resources/extensions/gsd/commands-handlers.js +21 -2
  51. package/dist/resources/extensions/gsd/commands-memory.js +462 -0
  52. package/dist/resources/extensions/gsd/commands-prefs-wizard.js +40 -12
  53. package/dist/resources/extensions/gsd/commands-scan.js +94 -0
  54. package/dist/resources/extensions/gsd/commands-workflow-templates.js +101 -2
  55. package/dist/resources/extensions/gsd/custom-workflow-engine.js +74 -54
  56. package/dist/resources/extensions/gsd/db-writer.js +1 -0
  57. package/dist/resources/extensions/gsd/debug-session-store.js +238 -0
  58. package/dist/resources/extensions/gsd/definition-loader.js +7 -0
  59. package/dist/resources/extensions/gsd/docs/preferences-reference.md +9 -9
  60. package/dist/resources/extensions/gsd/doctor-environment.js +2 -1
  61. package/dist/resources/extensions/gsd/doctor-git-checks.js +5 -1
  62. package/dist/resources/extensions/gsd/doctor-proactive.js +4 -1
  63. package/dist/resources/extensions/gsd/doctor-providers.js +48 -20
  64. package/dist/resources/extensions/gsd/doctor-runtime-checks.js +22 -4
  65. package/dist/resources/extensions/gsd/doctor.js +7 -1
  66. package/dist/resources/extensions/gsd/error-classifier.js +6 -3
  67. package/dist/resources/extensions/gsd/escalation.js +321 -0
  68. package/dist/resources/extensions/gsd/forensics.js +26 -29
  69. package/dist/resources/extensions/gsd/git-service.js +0 -1
  70. package/dist/resources/extensions/gsd/graph.js +26 -2
  71. package/dist/resources/extensions/gsd/gsd-db.js +490 -32
  72. package/dist/resources/extensions/gsd/health-widget-core.js +42 -14
  73. package/dist/resources/extensions/gsd/health-widget.js +7 -4
  74. package/dist/resources/extensions/gsd/init-wizard.js +86 -45
  75. package/dist/resources/extensions/gsd/markdown-renderer.js +5 -5
  76. package/dist/resources/extensions/gsd/memory-embeddings.js +219 -0
  77. package/dist/resources/extensions/gsd/memory-extractor.js +78 -27
  78. package/dist/resources/extensions/gsd/memory-ingest.js +218 -0
  79. package/dist/resources/extensions/gsd/memory-relations.js +189 -0
  80. package/dist/resources/extensions/gsd/memory-source-store.js +113 -0
  81. package/dist/resources/extensions/gsd/memory-store.js +299 -6
  82. package/dist/resources/extensions/gsd/metrics.js +1 -0
  83. package/dist/resources/extensions/gsd/model-cost-table.js +3 -1
  84. package/dist/resources/extensions/gsd/model-router.js +16 -6
  85. package/dist/resources/extensions/gsd/native-git-bridge.js +137 -5
  86. package/dist/resources/extensions/gsd/notification-overlay.js +7 -22
  87. package/dist/resources/extensions/gsd/notification-widget.js +24 -39
  88. package/dist/resources/extensions/gsd/notifications.js +4 -0
  89. package/dist/resources/extensions/gsd/onboarding-state.js +133 -0
  90. package/dist/resources/extensions/gsd/post-execution-checks.js +27 -11
  91. package/dist/resources/extensions/gsd/pre-execution-checks.js +97 -4
  92. package/dist/resources/extensions/gsd/preferences-models.js +1 -0
  93. package/dist/resources/extensions/gsd/preferences-types.js +2 -1
  94. package/dist/resources/extensions/gsd/preferences-validation.js +42 -8
  95. package/dist/resources/extensions/gsd/preferences.js +10 -10
  96. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +4 -1
  97. package/dist/resources/extensions/gsd/prompts/debug-diagnose.md +25 -0
  98. package/dist/resources/extensions/gsd/prompts/debug-session-manager.md +80 -0
  99. package/dist/resources/extensions/gsd/prompts/execute-task.md +12 -0
  100. package/dist/resources/extensions/gsd/prompts/plan-milestone.md +12 -0
  101. package/dist/resources/extensions/gsd/prompts/refine-slice.md +69 -0
  102. package/dist/resources/extensions/gsd/prompts/scan.md +79 -0
  103. package/dist/resources/extensions/gsd/prompts/workflow-oneshot.md +26 -0
  104. package/dist/resources/extensions/gsd/python-resolver.js +70 -0
  105. package/dist/resources/extensions/gsd/run-manager.js +37 -17
  106. package/dist/resources/extensions/gsd/setup-catalog.js +75 -0
  107. package/dist/resources/extensions/gsd/state.js +47 -3
  108. package/dist/resources/extensions/gsd/templates/PREFERENCES.md +7 -7
  109. package/dist/resources/extensions/gsd/tools/complete-task.js +80 -0
  110. package/dist/resources/extensions/gsd/tools/memory-tools.js +306 -0
  111. package/dist/resources/extensions/gsd/tools/plan-milestone.js +37 -12
  112. package/dist/resources/extensions/gsd/tools/plan-slice.js +5 -2
  113. package/dist/resources/extensions/gsd/tools/skip-slice.js +78 -0
  114. package/dist/resources/extensions/gsd/uok/flags.js +7 -7
  115. package/dist/resources/extensions/gsd/uok/kernel.js +8 -3
  116. package/dist/resources/extensions/gsd/verification-gate.js +2 -1
  117. package/dist/resources/extensions/gsd/workflow-dispatch.js +64 -0
  118. package/dist/resources/extensions/gsd/workflow-install.js +327 -0
  119. package/dist/resources/extensions/gsd/workflow-manifest.js +8 -0
  120. package/dist/resources/extensions/gsd/workflow-mcp.js +1 -6
  121. package/dist/resources/extensions/gsd/workflow-plugins.js +346 -0
  122. package/dist/resources/extensions/gsd/workflow-projections.js +17 -15
  123. package/dist/resources/extensions/gsd/workflow-templates/accessibility-audit.md +88 -0
  124. package/dist/resources/extensions/gsd/workflow-templates/api-breaking-change.md +117 -0
  125. package/dist/resources/extensions/gsd/workflow-templates/bugfix.md +1 -0
  126. package/dist/resources/extensions/gsd/workflow-templates/changelog-gen.md +82 -0
  127. package/dist/resources/extensions/gsd/workflow-templates/ci-bootstrap.md +144 -0
  128. package/dist/resources/extensions/gsd/workflow-templates/dead-code.md +81 -0
  129. package/dist/resources/extensions/gsd/workflow-templates/dep-upgrade.md +1 -0
  130. package/dist/resources/extensions/gsd/workflow-templates/docs-sync.yaml +76 -0
  131. package/dist/resources/extensions/gsd/workflow-templates/env-audit.yaml +88 -0
  132. package/dist/resources/extensions/gsd/workflow-templates/full-project.md +1 -0
  133. package/dist/resources/extensions/gsd/workflow-templates/hotfix.md +1 -0
  134. package/dist/resources/extensions/gsd/workflow-templates/issue-triage.md +84 -0
  135. package/dist/resources/extensions/gsd/workflow-templates/observability-setup.md +133 -0
  136. package/dist/resources/extensions/gsd/workflow-templates/onboarding-check.md +74 -0
  137. package/dist/resources/extensions/gsd/workflow-templates/performance-audit.md +125 -0
  138. package/dist/resources/extensions/gsd/workflow-templates/pr-review.md +67 -0
  139. package/dist/resources/extensions/gsd/workflow-templates/pr-triage.md +83 -0
  140. package/dist/resources/extensions/gsd/workflow-templates/refactor.md +1 -0
  141. package/dist/resources/extensions/gsd/workflow-templates/registry.json +184 -0
  142. package/dist/resources/extensions/gsd/workflow-templates/release.md +118 -0
  143. package/dist/resources/extensions/gsd/workflow-templates/rename-symbol.yaml +99 -0
  144. package/dist/resources/extensions/gsd/workflow-templates/security-audit.md +1 -0
  145. package/dist/resources/extensions/gsd/workflow-templates/small-feature.md +1 -0
  146. package/dist/resources/extensions/gsd/workflow-templates/spike.md +1 -0
  147. package/dist/resources/extensions/gsd/workflow-templates/test-backfill.yaml +73 -0
  148. package/dist/resources/extensions/gsd/worktree-resolver.js +42 -1
  149. package/dist/resources/extensions/remote-questions/commands.js +380 -0
  150. package/dist/resources/extensions/remote-questions/manager.js +39 -5
  151. package/dist/resources/extensions/remote-questions/telegram-adapter.js +79 -4
  152. package/dist/resources/extensions/shared/interview-ui.js +189 -1
  153. package/dist/resources/extensions/shared/layout-utils.js +17 -0
  154. package/dist/resources/extensions/shared/rtk-shared.js +47 -0
  155. package/dist/resources/extensions/shared/rtk.js +3 -46
  156. package/dist/resources/skills/create-workflow/SKILL.md +33 -6
  157. package/dist/rtk-shared.d.ts +10 -0
  158. package/dist/rtk-shared.js +47 -0
  159. package/dist/rtk.d.ts +2 -6
  160. package/dist/rtk.js +3 -48
  161. package/dist/shared/workspace-types.d.ts +52 -0
  162. package/dist/shared/workspace-types.js +1 -0
  163. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  164. package/dist/update-check.d.ts +10 -0
  165. package/dist/update-check.js +24 -3
  166. package/dist/web/standalone/.next/BUILD_ID +1 -1
  167. package/dist/web/standalone/.next/app-path-routes-manifest.json +5 -5
  168. package/dist/web/standalone/.next/build-manifest.json +3 -3
  169. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  170. package/dist/web/standalone/.next/react-loadable-manifest.json +2 -2
  171. package/dist/web/standalone/.next/required-server-files.json +1 -1
  172. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  173. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  174. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  175. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  176. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  177. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  178. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  179. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  180. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  181. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  182. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  183. package/dist/web/standalone/.next/server/app/_not-found.rsc +2 -2
  184. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  185. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  186. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  187. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  188. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  189. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  190. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  191. package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +1 -1
  192. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  193. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
  194. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  195. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
  196. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  197. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
  198. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  199. package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +1 -1
  200. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  201. package/dist/web/standalone/.next/server/app/api/cleanup/route.js.nft.json +1 -1
  202. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  203. package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +1 -1
  204. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  205. package/dist/web/standalone/.next/server/app/api/export-data/route.js.nft.json +1 -1
  206. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  207. package/dist/web/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
  208. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  209. package/dist/web/standalone/.next/server/app/api/forensics/route.js.nft.json +1 -1
  210. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  211. package/dist/web/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  212. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  213. package/dist/web/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
  214. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  215. package/dist/web/standalone/.next/server/app/api/hooks/route.js.nft.json +1 -1
  216. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  217. package/dist/web/standalone/.next/server/app/api/inspect/route.js.nft.json +1 -1
  218. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  219. package/dist/web/standalone/.next/server/app/api/knowledge/route.js.nft.json +1 -1
  220. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  221. package/dist/web/standalone/.next/server/app/api/live-state/route.js.nft.json +1 -1
  222. package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
  223. package/dist/web/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
  224. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  225. package/dist/web/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -1
  226. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  227. package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  228. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  229. package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
  230. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  231. package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
  232. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  233. package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
  234. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  235. package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
  236. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  237. package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
  238. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  239. package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
  240. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  241. package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
  242. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  243. package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
  244. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  245. package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
  246. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
  247. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
  248. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +2 -2
  249. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
  250. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  251. package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
  252. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  253. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  254. package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +1 -1
  255. package/dist/web/standalone/.next/server/app/index.html +1 -1
  256. package/dist/web/standalone/.next/server/app/index.rsc +3 -3
  257. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  258. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
  259. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  260. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
  261. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  262. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  263. package/dist/web/standalone/.next/server/app-paths-manifest.json +5 -5
  264. package/dist/web/standalone/.next/server/chunks/6897.js +2 -2
  265. package/dist/web/standalone/.next/server/chunks/7461.js +1 -0
  266. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  267. package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
  268. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  269. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  270. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  271. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  272. package/dist/web/standalone/.next/static/chunks/2826.e59e8578e2e28639.js +9 -0
  273. package/dist/web/standalone/.next/static/chunks/{2008.71ee9230ad78df21.js → 3621.fc7480022c972438.js} +2 -2
  274. package/dist/web/standalone/.next/static/chunks/app/{page-f1e30ab6bb269149.js → page-5b113fd32bc2a1c3.js} +1 -1
  275. package/dist/web/standalone/.next/static/chunks/{webpack-b868033a5834586d.js → webpack-5fc74f13a25fa1bb.js} +1 -1
  276. package/dist/web/standalone/.next/static/css/632cd626b1731d88.css +1 -0
  277. package/dist/web/standalone/server.js +1 -1
  278. package/dist/welcome-screen.js +48 -24
  279. package/dist/wizard.js +2 -2
  280. package/dist/worktree-cli.d.ts +6 -5
  281. package/dist/worktree-cli.js +23 -7
  282. package/package.json +3 -3
  283. package/packages/mcp-server/dist/server.d.ts.map +1 -1
  284. package/packages/mcp-server/dist/server.js +12 -10
  285. package/packages/mcp-server/dist/server.js.map +1 -1
  286. package/packages/mcp-server/dist/session-manager.d.ts.map +1 -1
  287. package/packages/mcp-server/dist/session-manager.js +8 -1
  288. package/packages/mcp-server/dist/session-manager.js.map +1 -1
  289. package/packages/mcp-server/dist/workflow-tools.d.ts +1 -0
  290. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  291. package/packages/mcp-server/dist/workflow-tools.js +113 -14
  292. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  293. package/packages/mcp-server/src/mcp-server.test.ts +40 -4
  294. package/packages/mcp-server/src/server.ts +12 -10
  295. package/packages/mcp-server/src/session-manager.ts +10 -3
  296. package/packages/mcp-server/src/workflow-tools.test.ts +91 -1
  297. package/packages/mcp-server/src/workflow-tools.ts +128 -18
  298. package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
  299. package/packages/native/tsconfig.tsbuildinfo +1 -1
  300. package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
  301. package/packages/pi-ai/dist/models/capability-patches.d.ts.map +1 -1
  302. package/packages/pi-ai/dist/models/capability-patches.js +3 -2
  303. package/packages/pi-ai/dist/models/capability-patches.js.map +1 -1
  304. package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts +68 -0
  305. package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts.map +1 -1
  306. package/packages/pi-ai/dist/models/generated/amazon-bedrock.js +68 -0
  307. package/packages/pi-ai/dist/models/generated/amazon-bedrock.js.map +1 -1
  308. package/packages/pi-ai/dist/models/generated/anthropic.d.ts +17 -0
  309. package/packages/pi-ai/dist/models/generated/anthropic.d.ts.map +1 -1
  310. package/packages/pi-ai/dist/models/generated/anthropic.js +17 -0
  311. package/packages/pi-ai/dist/models/generated/anthropic.js.map +1 -1
  312. package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts +17 -0
  313. package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts.map +1 -1
  314. package/packages/pi-ai/dist/models/generated/google-antigravity.js +17 -0
  315. package/packages/pi-ai/dist/models/generated/google-antigravity.js.map +1 -1
  316. package/packages/pi-ai/dist/models/generated/groq.d.ts +0 -153
  317. package/packages/pi-ai/dist/models/generated/groq.d.ts.map +1 -1
  318. package/packages/pi-ai/dist/models/generated/groq.js +0 -153
  319. package/packages/pi-ai/dist/models/generated/groq.js.map +1 -1
  320. package/packages/pi-ai/dist/models/generated/index.d.ts +136 -153
  321. package/packages/pi-ai/dist/models/generated/index.d.ts.map +1 -1
  322. package/packages/pi-ai/dist/models/generated/openai-codex.d.ts +17 -0
  323. package/packages/pi-ai/dist/models/generated/openai-codex.d.ts.map +1 -1
  324. package/packages/pi-ai/dist/models/generated/openai-codex.js +17 -0
  325. package/packages/pi-ai/dist/models/generated/openai-codex.js.map +1 -1
  326. package/packages/pi-ai/dist/models/generated/openrouter.d.ts +17 -0
  327. package/packages/pi-ai/dist/models/generated/openrouter.d.ts.map +1 -1
  328. package/packages/pi-ai/dist/models/generated/openrouter.js +17 -0
  329. package/packages/pi-ai/dist/models/generated/openrouter.js.map +1 -1
  330. package/packages/pi-ai/dist/models.generated.test.js +17 -0
  331. package/packages/pi-ai/dist/models.generated.test.js.map +1 -1
  332. package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts +22 -1
  333. package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
  334. package/packages/pi-ai/dist/providers/amazon-bedrock.js +40 -6
  335. package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
  336. package/packages/pi-ai/dist/providers/amazon-bedrock.test.d.ts +2 -0
  337. package/packages/pi-ai/dist/providers/amazon-bedrock.test.d.ts.map +1 -0
  338. package/packages/pi-ai/dist/providers/amazon-bedrock.test.js +106 -0
  339. package/packages/pi-ai/dist/providers/amazon-bedrock.test.js.map +1 -0
  340. package/packages/pi-ai/dist/providers/anthropic-auth.test.js +42 -1
  341. package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
  342. package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +20 -1
  343. package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
  344. package/packages/pi-ai/dist/providers/anthropic-shared.js +32 -2
  345. package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
  346. package/packages/pi-ai/dist/providers/anthropic-shared.test.js +12 -1
  347. package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -1
  348. package/packages/pi-ai/dist/providers/anthropic.d.ts +11 -0
  349. package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  350. package/packages/pi-ai/dist/providers/anthropic.js +18 -1
  351. package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
  352. package/packages/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -1
  353. package/packages/pi-ai/dist/utils/oauth/openai-codex.js +12 -0
  354. package/packages/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -1
  355. package/packages/pi-ai/package.json +1 -1
  356. package/packages/pi-ai/scripts/generate-models.ts +50 -0
  357. package/packages/pi-ai/src/models/capability-patches.ts +5 -2
  358. package/packages/pi-ai/src/models/generated/amazon-bedrock.ts +68 -0
  359. package/packages/pi-ai/src/models/generated/anthropic.ts +17 -0
  360. package/packages/pi-ai/src/models/generated/google-antigravity.ts +17 -0
  361. package/packages/pi-ai/src/models/generated/groq.ts +0 -153
  362. package/packages/pi-ai/src/models/generated/openai-codex.ts +17 -0
  363. package/packages/pi-ai/src/models/generated/openrouter.ts +17 -0
  364. package/packages/pi-ai/src/models.generated.test.ts +17 -0
  365. package/packages/pi-ai/src/providers/amazon-bedrock.test.ts +164 -0
  366. package/packages/pi-ai/src/providers/amazon-bedrock.ts +41 -7
  367. package/packages/pi-ai/src/providers/anthropic-auth.test.ts +47 -1
  368. package/packages/pi-ai/src/providers/anthropic-shared.test.ts +15 -1
  369. package/packages/pi-ai/src/providers/anthropic-shared.ts +36 -3
  370. package/packages/pi-ai/src/providers/anthropic.ts +19 -1
  371. package/packages/pi-ai/src/utils/oauth/openai-codex.ts +15 -0
  372. package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
  373. package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.d.ts +2 -0
  374. package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.d.ts.map +1 -0
  375. package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +38 -0
  376. package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -0
  377. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +14 -0
  378. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  379. package/packages/pi-coding-agent/dist/core/auth-storage.js +34 -0
  380. package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  381. package/packages/pi-coding-agent/dist/core/auth-storage.test.js +74 -0
  382. package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
  383. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +4 -1
  384. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
  385. package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +32 -0
  386. package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -1
  387. package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  388. package/packages/pi-coding-agent/dist/core/sdk.js +32 -0
  389. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
  390. package/packages/pi-coding-agent/dist/core/skill-tool.test.js +2 -2
  391. package/packages/pi-coding-agent/dist/core/skill-tool.test.js.map +1 -1
  392. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
  393. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +17 -7
  394. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
  395. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
  396. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +48 -34
  397. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
  398. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts +4 -0
  399. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  400. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +83 -33
  401. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  402. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +70 -0
  403. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
  404. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +77 -0
  405. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -0
  406. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +1 -66
  407. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  408. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +1 -75
  409. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  410. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts +1 -1
  411. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  412. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +192 -24
  413. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
  414. package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +56 -0
  415. package/packages/pi-coding-agent/src/core/auth-storage.test.ts +83 -0
  416. package/packages/pi-coding-agent/src/core/auth-storage.ts +35 -0
  417. package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +4 -1
  418. package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +37 -1
  419. package/packages/pi-coding-agent/src/core/sdk.ts +41 -0
  420. package/packages/pi-coding-agent/src/core/skill-tool.test.ts +2 -2
  421. package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +19 -7
  422. package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +53 -31
  423. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +88 -36
  424. package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.ts +83 -0
  425. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +2 -83
  426. package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +208 -27
  427. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
  428. package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
  429. package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
  430. package/pkg/dist/modes/interactive/theme/theme-schema.d.ts +70 -0
  431. package/pkg/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
  432. package/pkg/dist/modes/interactive/theme/theme-schema.js +77 -0
  433. package/pkg/dist/modes/interactive/theme/theme-schema.js.map +1 -0
  434. package/pkg/dist/modes/interactive/theme/theme.d.ts +1 -66
  435. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  436. package/pkg/dist/modes/interactive/theme/theme.js +1 -75
  437. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  438. package/pkg/dist/modes/interactive/theme/themes.d.ts +1 -1
  439. package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  440. package/pkg/dist/modes/interactive/theme/themes.js +192 -24
  441. package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
  442. package/src/resources/extensions/ask-user-questions.ts +24 -6
  443. package/src/resources/extensions/claude-code-cli/models.ts +9 -0
  444. package/src/resources/extensions/claude-code-cli/readiness.ts +13 -2
  445. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +94 -4
  446. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +84 -0
  447. package/src/resources/extensions/gsd/auto/detect-stuck.ts +10 -0
  448. package/src/resources/extensions/gsd/auto/loop-deps.ts +1 -0
  449. package/src/resources/extensions/gsd/auto/loop.ts +109 -3
  450. package/src/resources/extensions/gsd/auto/phases.ts +94 -60
  451. package/src/resources/extensions/gsd/auto/resolve.ts +1 -1
  452. package/src/resources/extensions/gsd/auto/run-unit.ts +11 -1
  453. package/src/resources/extensions/gsd/auto/session.ts +7 -0
  454. package/src/resources/extensions/gsd/auto-artifact-paths.ts +20 -0
  455. package/src/resources/extensions/gsd/auto-dashboard.ts +21 -4
  456. package/src/resources/extensions/gsd/auto-dispatch.ts +123 -5
  457. package/src/resources/extensions/gsd/auto-loop.ts +1 -1
  458. package/src/resources/extensions/gsd/auto-model-selection.ts +14 -3
  459. package/src/resources/extensions/gsd/auto-post-unit.ts +10 -8
  460. package/src/resources/extensions/gsd/auto-prompts.ts +201 -40
  461. package/src/resources/extensions/gsd/auto-recovery.ts +63 -1
  462. package/src/resources/extensions/gsd/auto-start.ts +8 -6
  463. package/src/resources/extensions/gsd/auto-verification.ts +3 -3
  464. package/src/resources/extensions/gsd/auto-worktree.ts +65 -0
  465. package/src/resources/extensions/gsd/auto.ts +61 -28
  466. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +8 -21
  467. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +46 -24
  468. package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +158 -0
  469. package/src/resources/extensions/gsd/bootstrap/query-tools.ts +31 -0
  470. package/src/resources/extensions/gsd/bootstrap/register-extension.ts +2 -0
  471. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +22 -0
  472. package/src/resources/extensions/gsd/bootstrap/system-context.ts +20 -4
  473. package/src/resources/extensions/gsd/commands/catalog.ts +74 -9
  474. package/src/resources/extensions/gsd/commands/handlers/core.ts +69 -27
  475. package/src/resources/extensions/gsd/commands/handlers/escalate.ts +216 -0
  476. package/src/resources/extensions/gsd/commands/handlers/onboarding.ts +196 -0
  477. package/src/resources/extensions/gsd/commands/handlers/ops.ts +21 -0
  478. package/src/resources/extensions/gsd/commands/handlers/workflow.ts +279 -29
  479. package/src/resources/extensions/gsd/commands-cmux.ts +6 -2
  480. package/src/resources/extensions/gsd/commands-config.ts +10 -0
  481. package/src/resources/extensions/gsd/commands-debug.ts +484 -0
  482. package/src/resources/extensions/gsd/commands-do.ts +1 -0
  483. package/src/resources/extensions/gsd/commands-extract-learnings.ts +295 -76
  484. package/src/resources/extensions/gsd/commands-handlers.ts +19 -2
  485. package/src/resources/extensions/gsd/commands-memory.ts +551 -0
  486. package/src/resources/extensions/gsd/commands-prefs-wizard.ts +49 -12
  487. package/src/resources/extensions/gsd/commands-scan.ts +125 -0
  488. package/src/resources/extensions/gsd/commands-workflow-templates.ts +129 -2
  489. package/src/resources/extensions/gsd/custom-workflow-engine.ts +85 -60
  490. package/src/resources/extensions/gsd/db-writer.ts +3 -0
  491. package/src/resources/extensions/gsd/debug-session-store.ts +377 -0
  492. package/src/resources/extensions/gsd/definition-loader.ts +7 -0
  493. package/src/resources/extensions/gsd/docs/preferences-reference.md +9 -9
  494. package/src/resources/extensions/gsd/doctor-environment.ts +2 -1
  495. package/src/resources/extensions/gsd/doctor-git-checks.ts +5 -1
  496. package/src/resources/extensions/gsd/doctor-proactive.ts +4 -1
  497. package/src/resources/extensions/gsd/doctor-providers.ts +52 -22
  498. package/src/resources/extensions/gsd/doctor-runtime-checks.ts +23 -4
  499. package/src/resources/extensions/gsd/doctor-types.ts +1 -0
  500. package/src/resources/extensions/gsd/doctor.ts +7 -1
  501. package/src/resources/extensions/gsd/error-classifier.ts +6 -3
  502. package/src/resources/extensions/gsd/escalation.ts +367 -0
  503. package/src/resources/extensions/gsd/forensics.ts +25 -29
  504. package/src/resources/extensions/gsd/git-service.ts +0 -1
  505. package/src/resources/extensions/gsd/graph.ts +33 -3
  506. package/src/resources/extensions/gsd/gsd-db.ts +578 -32
  507. package/src/resources/extensions/gsd/health-widget-core.ts +43 -14
  508. package/src/resources/extensions/gsd/health-widget.ts +7 -3
  509. package/src/resources/extensions/gsd/init-wizard.ts +87 -54
  510. package/src/resources/extensions/gsd/markdown-renderer.ts +5 -5
  511. package/src/resources/extensions/gsd/memory-embeddings.ts +235 -0
  512. package/src/resources/extensions/gsd/memory-extractor.ts +100 -34
  513. package/src/resources/extensions/gsd/memory-ingest.ts +286 -0
  514. package/src/resources/extensions/gsd/memory-relations.ts +240 -0
  515. package/src/resources/extensions/gsd/memory-source-store.ts +138 -0
  516. package/src/resources/extensions/gsd/memory-store.ts +351 -7
  517. package/src/resources/extensions/gsd/metrics.ts +1 -0
  518. package/src/resources/extensions/gsd/model-cost-table.ts +3 -1
  519. package/src/resources/extensions/gsd/model-router.ts +25 -6
  520. package/src/resources/extensions/gsd/native-git-bridge.ts +134 -6
  521. package/src/resources/extensions/gsd/notification-overlay.ts +9 -19
  522. package/src/resources/extensions/gsd/notification-widget.ts +25 -43
  523. package/src/resources/extensions/gsd/notifications.ts +6 -0
  524. package/src/resources/extensions/gsd/onboarding-state.ts +146 -0
  525. package/src/resources/extensions/gsd/post-execution-checks.ts +37 -14
  526. package/src/resources/extensions/gsd/pre-execution-checks.ts +98 -8
  527. package/src/resources/extensions/gsd/preferences-models.ts +1 -0
  528. package/src/resources/extensions/gsd/preferences-types.ts +10 -2
  529. package/src/resources/extensions/gsd/preferences-validation.ts +33 -7
  530. package/src/resources/extensions/gsd/preferences.ts +10 -10
  531. package/src/resources/extensions/gsd/prompts/complete-milestone.md +4 -1
  532. package/src/resources/extensions/gsd/prompts/debug-diagnose.md +25 -0
  533. package/src/resources/extensions/gsd/prompts/debug-session-manager.md +80 -0
  534. package/src/resources/extensions/gsd/prompts/execute-task.md +12 -0
  535. package/src/resources/extensions/gsd/prompts/plan-milestone.md +12 -0
  536. package/src/resources/extensions/gsd/prompts/refine-slice.md +69 -0
  537. package/src/resources/extensions/gsd/prompts/scan.md +79 -0
  538. package/src/resources/extensions/gsd/prompts/workflow-oneshot.md +26 -0
  539. package/src/resources/extensions/gsd/python-resolver.ts +76 -0
  540. package/src/resources/extensions/gsd/run-manager.ts +53 -19
  541. package/src/resources/extensions/gsd/setup-catalog.ts +105 -0
  542. package/src/resources/extensions/gsd/state.ts +50 -2
  543. package/src/resources/extensions/gsd/templates/PREFERENCES.md +7 -7
  544. package/src/resources/extensions/gsd/tests/agent-end-retry.test.ts +1 -34
  545. package/src/resources/extensions/gsd/tests/artifact-corruption-2630.test.ts +7 -0
  546. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +45 -31
  547. package/src/resources/extensions/gsd/tests/auto-migrating-recovery.test.ts +63 -0
  548. package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +12 -0
  549. package/src/resources/extensions/gsd/tests/auto-prompts-fallback.test.ts +35 -0
  550. package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +123 -1
  551. package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +39 -0
  552. package/src/resources/extensions/gsd/tests/autocomplete-regressions-1675.test.ts +39 -0
  553. package/src/resources/extensions/gsd/tests/commands-do.test.ts +48 -0
  554. package/src/resources/extensions/gsd/tests/commands-extract-learnings.test.ts +333 -21
  555. package/src/resources/extensions/gsd/tests/commands-scan.test.ts +351 -0
  556. package/src/resources/extensions/gsd/tests/commands-workflow-custom.test.ts +8 -6
  557. package/src/resources/extensions/gsd/tests/complete-slice.test.ts +6 -8
  558. package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
  559. package/src/resources/extensions/gsd/tests/custom-workflow-engine.test.ts +63 -0
  560. package/src/resources/extensions/gsd/tests/debug-command-handler.test.ts +905 -0
  561. package/src/resources/extensions/gsd/tests/debug-command-lifecycle.integration.test.ts +1229 -0
  562. package/src/resources/extensions/gsd/tests/debug-session-store.test.ts +565 -0
  563. package/src/resources/extensions/gsd/tests/discuss-milestone-structured-questions.test.ts +64 -0
  564. package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +67 -0
  565. package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +62 -18
  566. package/src/resources/extensions/gsd/tests/enhanced-verification-integration.test.ts +5 -0
  567. package/src/resources/extensions/gsd/tests/escalation.test.ts +818 -0
  568. package/src/resources/extensions/gsd/tests/finalize-timeout-guard.test.ts +29 -12
  569. package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +106 -0
  570. package/src/resources/extensions/gsd/tests/forensics-hook-key-parse.test.ts +74 -0
  571. package/src/resources/extensions/gsd/tests/graph-operations.test.ts +0 -4
  572. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +44 -1
  573. package/src/resources/extensions/gsd/tests/health-widget.test.ts +8 -2
  574. package/src/resources/extensions/gsd/tests/init-prefs-routing.test.ts +190 -0
  575. package/src/resources/extensions/gsd/tests/integration/doctor-git.test.ts +39 -0
  576. package/src/resources/extensions/gsd/tests/integration/doctor-proactive.test.ts +44 -0
  577. package/src/resources/extensions/gsd/tests/integration/doctor-runtime.test.ts +68 -1
  578. package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +109 -11
  579. package/src/resources/extensions/gsd/tests/integration/idle-recovery.test.ts +51 -0
  580. package/src/resources/extensions/gsd/tests/integration/integration-proof.test.ts +2 -2
  581. package/src/resources/extensions/gsd/tests/integration/test-isolation.ts +53 -0
  582. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +171 -1
  583. package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
  584. package/src/resources/extensions/gsd/tests/memory-embeddings.test.ts +213 -0
  585. package/src/resources/extensions/gsd/tests/memory-ingest.test.ts +153 -0
  586. package/src/resources/extensions/gsd/tests/memory-maintenance.test.ts +107 -0
  587. package/src/resources/extensions/gsd/tests/memory-relations.test.ts +175 -0
  588. package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
  589. package/src/resources/extensions/gsd/tests/memory-tools.test.ts +295 -0
  590. package/src/resources/extensions/gsd/tests/milestone-status-tool.test.ts +3 -2
  591. package/src/resources/extensions/gsd/tests/model-cost-table.test.ts +2 -2
  592. package/src/resources/extensions/gsd/tests/model-router.test.ts +51 -1
  593. package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +59 -0
  594. package/src/resources/extensions/gsd/tests/notification-overlay.test.ts +56 -37
  595. package/src/resources/extensions/gsd/tests/notification-widget.test.ts +1 -1
  596. package/src/resources/extensions/gsd/tests/onboarding-state.test.ts +105 -0
  597. package/src/resources/extensions/gsd/tests/plan-milestone-boundary-map-preservation.test.ts +114 -0
  598. package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +4 -5
  599. package/src/resources/extensions/gsd/tests/plan-slice.test.ts +17 -0
  600. package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +105 -1
  601. package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +275 -6
  602. package/src/resources/extensions/gsd/tests/preferences.test.ts +69 -1
  603. package/src/resources/extensions/gsd/tests/progressive-planning.test.ts +539 -0
  604. package/src/resources/extensions/gsd/tests/projection-no-plan-overwrite.test.ts +11 -2
  605. package/src/resources/extensions/gsd/tests/projection-regression.test.ts +7 -0
  606. package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +27 -0
  607. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +24 -0
  608. package/src/resources/extensions/gsd/tests/prompt-db.test.ts +1 -1
  609. package/src/resources/extensions/gsd/tests/provider-errors.test.ts +33 -0
  610. package/src/resources/extensions/gsd/tests/python-resolver.test.ts +131 -0
  611. package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +67 -0
  612. package/src/resources/extensions/gsd/tests/remote-notification-from-desktop.test.ts +107 -0
  613. package/src/resources/extensions/gsd/tests/requirements.test.ts +9 -0
  614. package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +153 -0
  615. package/src/resources/extensions/gsd/tests/skip-slice-cascades-tasks.test.ts +125 -0
  616. package/src/resources/extensions/gsd/tests/slice-context-injection.test.ts +16 -4
  617. package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +3 -0
  618. package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +15 -0
  619. package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +5 -0
  620. package/src/resources/extensions/gsd/tests/uok-contracts.test.ts +2 -1
  621. package/src/resources/extensions/gsd/tests/uok-flags.test.ts +31 -1
  622. package/src/resources/extensions/gsd/tests/uok-kernel-path.test.ts +166 -0
  623. package/src/resources/extensions/gsd/tests/verification-gate.test.ts +35 -0
  624. package/src/resources/extensions/gsd/tests/workflow-install.test.ts +113 -0
  625. package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +15 -6
  626. package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +2 -2
  627. package/src/resources/extensions/gsd/tests/workflow-plugins.test.ts +310 -0
  628. package/src/resources/extensions/gsd/tests/workflow-projections.test.ts +7 -0
  629. package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +8 -2
  630. package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +2 -1
  631. package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +77 -2
  632. package/src/resources/extensions/gsd/tools/complete-task.ts +87 -0
  633. package/src/resources/extensions/gsd/tools/memory-tools.ts +380 -0
  634. package/src/resources/extensions/gsd/tools/plan-milestone.ts +42 -8
  635. package/src/resources/extensions/gsd/tools/plan-slice.ts +6 -1
  636. package/src/resources/extensions/gsd/tools/skip-slice.ts +133 -0
  637. package/src/resources/extensions/gsd/types.ts +62 -0
  638. package/src/resources/extensions/gsd/unit-runtime.ts +1 -0
  639. package/src/resources/extensions/gsd/uok/contracts.ts +2 -1
  640. package/src/resources/extensions/gsd/uok/flags.ts +7 -7
  641. package/src/resources/extensions/gsd/uok/kernel.ts +16 -4
  642. package/src/resources/extensions/gsd/verification-gate.ts +2 -1
  643. package/src/resources/extensions/gsd/workflow-dispatch.ts +106 -0
  644. package/src/resources/extensions/gsd/workflow-install.ts +423 -0
  645. package/src/resources/extensions/gsd/workflow-logger.ts +3 -1
  646. package/src/resources/extensions/gsd/workflow-manifest.ts +8 -0
  647. package/src/resources/extensions/gsd/workflow-mcp.ts +1 -6
  648. package/src/resources/extensions/gsd/workflow-plugins.ts +403 -0
  649. package/src/resources/extensions/gsd/workflow-projections.ts +18 -16
  650. package/src/resources/extensions/gsd/workflow-templates/accessibility-audit.md +88 -0
  651. package/src/resources/extensions/gsd/workflow-templates/api-breaking-change.md +117 -0
  652. package/src/resources/extensions/gsd/workflow-templates/bugfix.md +1 -0
  653. package/src/resources/extensions/gsd/workflow-templates/changelog-gen.md +82 -0
  654. package/src/resources/extensions/gsd/workflow-templates/ci-bootstrap.md +144 -0
  655. package/src/resources/extensions/gsd/workflow-templates/dead-code.md +81 -0
  656. package/src/resources/extensions/gsd/workflow-templates/dep-upgrade.md +1 -0
  657. package/src/resources/extensions/gsd/workflow-templates/docs-sync.yaml +76 -0
  658. package/src/resources/extensions/gsd/workflow-templates/env-audit.yaml +88 -0
  659. package/src/resources/extensions/gsd/workflow-templates/full-project.md +1 -0
  660. package/src/resources/extensions/gsd/workflow-templates/hotfix.md +1 -0
  661. package/src/resources/extensions/gsd/workflow-templates/issue-triage.md +84 -0
  662. package/src/resources/extensions/gsd/workflow-templates/observability-setup.md +133 -0
  663. package/src/resources/extensions/gsd/workflow-templates/onboarding-check.md +74 -0
  664. package/src/resources/extensions/gsd/workflow-templates/performance-audit.md +125 -0
  665. package/src/resources/extensions/gsd/workflow-templates/pr-review.md +67 -0
  666. package/src/resources/extensions/gsd/workflow-templates/pr-triage.md +83 -0
  667. package/src/resources/extensions/gsd/workflow-templates/refactor.md +1 -0
  668. package/src/resources/extensions/gsd/workflow-templates/registry.json +184 -0
  669. package/src/resources/extensions/gsd/workflow-templates/release.md +118 -0
  670. package/src/resources/extensions/gsd/workflow-templates/rename-symbol.yaml +99 -0
  671. package/src/resources/extensions/gsd/workflow-templates/security-audit.md +1 -0
  672. package/src/resources/extensions/gsd/workflow-templates/small-feature.md +1 -0
  673. package/src/resources/extensions/gsd/workflow-templates/spike.md +1 -0
  674. package/src/resources/extensions/gsd/workflow-templates/test-backfill.yaml +73 -0
  675. package/src/resources/extensions/gsd/workflow-templates.ts +7 -0
  676. package/src/resources/extensions/gsd/workspace-index.ts +9 -4
  677. package/src/resources/extensions/gsd/worktree-resolver.ts +47 -1
  678. package/src/resources/extensions/remote-questions/commands.ts +480 -0
  679. package/src/resources/extensions/remote-questions/manager.ts +49 -4
  680. package/src/resources/extensions/remote-questions/telegram-adapter.ts +86 -4
  681. package/src/resources/extensions/remote-questions/tests/command-polling.test.ts +246 -0
  682. package/src/resources/extensions/remote-questions/tests/remote-answer-normalization.test.ts +92 -0
  683. package/src/resources/extensions/remote-questions/tests/telegram-commands.test.ts +267 -0
  684. package/src/resources/extensions/shared/interview-ui.ts +195 -1
  685. package/src/resources/extensions/shared/layout-utils.ts +26 -0
  686. package/src/resources/extensions/shared/rtk-shared.ts +58 -0
  687. package/src/resources/extensions/shared/rtk.ts +12 -52
  688. package/src/resources/extensions/shared/tests/interview-preview.test.ts +177 -0
  689. package/src/resources/extensions/shared/tests/preview-layout.test.ts +120 -0
  690. package/src/resources/skills/create-workflow/SKILL.md +33 -6
  691. package/dist/web/standalone/.next/static/chunks/2826.dd3dc8bbd3025fa5.js +0 -9
  692. package/dist/web/standalone/.next/static/css/f6e8833d46e738d8.css +0 -1
  693. package/packages/native/dist/ps/types.d.ts +0 -5
  694. package/packages/native/dist/ps/types.js +0 -2
  695. package/packages/native/src/ps/types.ts +0 -5
  696. package/packages/pi-ai/node_modules/@smithy/node-http-handler/LICENSE +0 -201
  697. package/packages/pi-ai/node_modules/@smithy/node-http-handler/README.md +0 -9
  698. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-cjs/index.js +0 -762
  699. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +0 -19
  700. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/constants.js +0 -1
  701. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +0 -9
  702. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/index.js +0 -3
  703. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +0 -230
  704. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +0 -87
  705. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +0 -32
  706. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +0 -169
  707. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +0 -21
  708. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/server.mock.js +0 -88
  709. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +0 -36
  710. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +0 -21
  711. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +0 -22
  712. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +0 -23
  713. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +0 -8
  714. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +0 -41
  715. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +0 -21
  716. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/timing.js +0 -4
  717. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +0 -63
  718. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +0 -10
  719. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +0 -5
  720. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +0 -4
  721. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +0 -3
  722. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +0 -46
  723. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +0 -24
  724. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +0 -12
  725. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +0 -63
  726. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +0 -13
  727. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/server.mock.d.ts +0 -12
  728. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +0 -2
  729. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +0 -6
  730. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +0 -6
  731. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +0 -2
  732. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +0 -5
  733. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +0 -6
  734. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +0 -13
  735. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +0 -8
  736. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +0 -10
  737. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +0 -5
  738. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +0 -4
  739. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +0 -3
  740. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +0 -46
  741. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +0 -24
  742. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +0 -12
  743. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +0 -63
  744. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +0 -13
  745. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/server.mock.d.ts +0 -12
  746. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +0 -2
  747. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +0 -6
  748. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +0 -6
  749. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +0 -2
  750. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +0 -5
  751. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts +0 -6
  752. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +0 -13
  753. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +0 -8
  754. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +0 -12
  755. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +0 -12
  756. package/packages/pi-ai/node_modules/@smithy/node-http-handler/package.json +0 -68
  757. package/packages/pi-ai/oauth.d.ts +0 -1
  758. package/packages/pi-ai/oauth.js +0 -1
  759. /package/dist/web/standalone/.next/static/{j7IBD35UgrL2b298GLK3V → o61X3klsB6C0UE0X1x3PA}/_buildManifest.js +0 -0
  760. /package/dist/web/standalone/.next/static/{j7IBD35UgrL2b298GLK3V → o61X3klsB6C0UE0X1x3PA}/_ssgManifest.js +0 -0
@@ -32,6 +32,19 @@ test("classifyError detects rate limit from message", () => {
32
32
  assert.equal(result.kind, "rate-limit");
33
33
  });
34
34
 
35
+ test("classifyError treats Anthropic quota-window phrasing as transient rate-limit (#4373)", () => {
36
+ const result = classifyError("You've hit your limit · resets soon");
37
+ assert.ok(isTransient(result));
38
+ assert.equal(result.kind, "rate-limit");
39
+ assert.ok("retryAfterMs" in result && result.retryAfterMs === 60_000);
40
+ });
41
+
42
+ test("classifyError treats usage-limit phrasing as transient rate-limit (#4373)", () => {
43
+ const result = classifyError("usage limit reached for this workspace");
44
+ assert.ok(isTransient(result));
45
+ assert.equal(result.kind, "rate-limit");
46
+ });
47
+
35
48
  test("classifyError treats OpenRouter affordability errors as transient rate-limit class", () => {
36
49
  const result = classifyError(
37
50
  "402 This request requires more credits, or fewer max_tokens. You requested up to 32000 tokens, but can only afford 329.",
@@ -202,6 +215,10 @@ test("isTransientNetworkError detects DNS errors", () => {
202
215
  assert.ok(isTransientNetworkError("dns resolution failed"));
203
216
  });
204
217
 
218
+ test("isTransientNetworkError detects unexpected EOF", () => {
219
+ assert.ok(isTransientNetworkError("unexpected EOF"));
220
+ });
221
+
205
222
  test("isTransientNetworkError rejects auth errors", () => {
206
223
  assert.ok(!isTransientNetworkError("unauthorized: invalid API key"));
207
224
  });
@@ -455,6 +472,22 @@ test("agent-end-recovery.ts resumes transient provider pauses through startAuto
455
472
  );
456
473
  });
457
474
 
475
+ test("agent-end-recovery.ts does not defer rate-limit errors to core retry handler before fallback (#4373)", () => {
476
+ const src = readFileSync(join(__dirname, "..", "bootstrap", "agent-end-recovery.ts"), "utf-8");
477
+ assert.ok(
478
+ src.includes('if (isTransient(cls) && cls.kind !== "rate-limit")'),
479
+ "rate-limit errors must bypass transient core-retry deferral so fallback can execute (#4373)",
480
+ );
481
+ });
482
+
483
+ test("agent-end-recovery.ts updates dashboard dispatched model after fallback switch", () => {
484
+ const src = readFileSync(join(__dirname, "..", "bootstrap", "agent-end-recovery.ts"), "utf-8");
485
+ assert.ok(
486
+ src.includes("setCurrentDispatchedModelId"),
487
+ "agent-end-recovery.ts should update currentDispatchedModelId when recovery switches model",
488
+ );
489
+ });
490
+
458
491
  // ── Codex error extraction (#1166) ──────────────────────────────────────────
459
492
 
460
493
  test("openai-codex-responses.ts extracts nested error fields", () => {
@@ -0,0 +1,131 @@
1
+ import { describe, test } from "node:test";
2
+ import assert from "node:assert/strict";
3
+
4
+ // Regression tests for #4416: python invocation normalization for Windows.
5
+ // These tests import from python-resolver.ts which is created as part of the fix.
6
+ import { normalizePythonCommand, detectPythonExecutable } from "../python-resolver.ts";
7
+
8
+ describe("normalizePythonCommand", () => {
9
+ test("passes through command that does not start with python", () => {
10
+ assert.equal(normalizePythonCommand("npm run test"), "npm run test");
11
+ });
12
+
13
+ test("passes through empty string", () => {
14
+ assert.equal(normalizePythonCommand(""), "");
15
+ });
16
+
17
+ test("passes through non-python shell commands unchanged", () => {
18
+ assert.equal(normalizePythonCommand("node index.js"), "node index.js");
19
+ assert.equal(normalizePythonCommand("npx tsc --noEmit"), "npx tsc --noEmit");
20
+ });
21
+
22
+ test("passes through command unchanged when no python is detected", () => {
23
+ // We cannot fully mock detectPythonExecutable here without a mock framework,
24
+ // but we can verify that a command without python tokens is always preserved.
25
+ const cmd = "cargo test";
26
+ assert.equal(normalizePythonCommand(cmd), cmd);
27
+ });
28
+
29
+ test("rewrites leading python3 token when interpreter is detected", () => {
30
+ const input = "python3 -m pytest";
31
+ const result = normalizePythonCommand(input);
32
+ const detected = detectPythonExecutable();
33
+ if (detected === null) {
34
+ assert.equal(result, input, "expected passthrough when no interpreter is detected");
35
+ return;
36
+ }
37
+ assert.ok(
38
+ result.startsWith(`${detected} `),
39
+ `Expected rewritten prefix '${detected} ' in: ${result}`,
40
+ );
41
+ assert.ok(result.includes("-m pytest"), `Expected arguments preserved in: ${result}`);
42
+ });
43
+
44
+ test("rewrites leading python token when interpreter is detected", () => {
45
+ const input = "python manage.py migrate";
46
+ const result = normalizePythonCommand(input);
47
+ const detected = detectPythonExecutable();
48
+ if (detected === null) {
49
+ assert.equal(result, input, "expected passthrough when no interpreter is detected");
50
+ return;
51
+ }
52
+ assert.ok(
53
+ result.startsWith(`${detected} `),
54
+ `Expected rewritten prefix '${detected} ' in: ${result}`,
55
+ );
56
+ assert.ok(result.includes("manage.py migrate"), `Expected arguments preserved in: ${result}`);
57
+ });
58
+
59
+ test("rewrites python token after && compound separator", () => {
60
+ const input = "echo ok && python3 -m pytest --tb=short";
61
+ const result = normalizePythonCommand(input);
62
+ const detected = detectPythonExecutable();
63
+ if (detected === null) {
64
+ assert.equal(result, input, "expected passthrough when no interpreter is detected");
65
+ return;
66
+ }
67
+ assert.ok(
68
+ result.includes(`&& ${detected} `),
69
+ `Expected '&& ${detected} ' segment in: ${result}`,
70
+ );
71
+ assert.ok(
72
+ result.includes("-m pytest --tb=short"),
73
+ `Expected arguments preserved in: ${result}`,
74
+ );
75
+ });
76
+
77
+ test("rewrites leading python token when command has leading whitespace", () => {
78
+ const input = " python3 -m pytest";
79
+ const result = normalizePythonCommand(input);
80
+ const detected = detectPythonExecutable();
81
+ if (detected === null) {
82
+ assert.equal(result, input, "expected passthrough when no interpreter is detected");
83
+ return;
84
+ }
85
+ assert.equal(
86
+ result,
87
+ ` ${detected} -m pytest`,
88
+ `Expected leading whitespace preserved and python3 rewritten in: ${result}`,
89
+ );
90
+ });
91
+
92
+ test("does not duplicate '-3' when rewriting existing 'py -3' token", () => {
93
+ const input = "py -3 -m pytest";
94
+ const result = normalizePythonCommand(input);
95
+ const detected = detectPythonExecutable();
96
+ if (detected === null) {
97
+ assert.equal(result, input, "expected passthrough when no interpreter is detected");
98
+ return;
99
+ }
100
+ assert.equal(
101
+ result,
102
+ `${detected} -m pytest`,
103
+ `Expected clean rewrite without duplicated '-3' in: ${result}`,
104
+ );
105
+ });
106
+ });
107
+
108
+ describe("detectPythonExecutable", () => {
109
+ test("returns a string or null — never throws", () => {
110
+ let result: string | null | undefined;
111
+ assert.doesNotThrow(() => {
112
+ result = detectPythonExecutable();
113
+ });
114
+ assert.ok(result === null || typeof result === "string");
115
+ });
116
+
117
+ test("return value is a known python invocation form or null", () => {
118
+ const result = detectPythonExecutable();
119
+ const valid = [null, "python3", "python", "py -3"];
120
+ assert.ok(
121
+ valid.includes(result as string | null),
122
+ `Expected one of ${valid.join(", ")}, got: ${String(result)}`,
123
+ );
124
+ });
125
+
126
+ test("returns the same value on repeated calls (cached)", () => {
127
+ const first = detectPythonExecutable();
128
+ const second = detectPythonExecutable();
129
+ assert.equal(first, second, "detectPythonExecutable must return consistent cached result");
130
+ });
131
+ });
@@ -10,6 +10,7 @@ import {
10
10
  resetWriteGateState,
11
11
  shouldBlockContextArtifactSave,
12
12
  } from "../bootstrap/write-gate.ts";
13
+ import { toRoundResultResponse } from "../../remote-questions/manager.ts";
13
14
 
14
15
  function makeTempDir(prefix: string): string {
15
16
  const dir = join(
@@ -95,3 +96,69 @@ test("register-hooks unlocks milestone depth verification from question id witho
95
96
  "question-id milestone inference should unlock the matching milestone context write",
96
97
  );
97
98
  });
99
+
100
+ test("register-hooks clears depth gate when remote (Telegram/Slack/Discord) answer is normalized (#4406)", async (t) => {
101
+ const dir = makeTempDir("remote");
102
+ const originalCwd = process.cwd();
103
+ process.chdir(dir);
104
+ resetWriteGateState();
105
+
106
+ t.after(() => {
107
+ resetWriteGateState();
108
+ process.chdir(originalCwd);
109
+ rmSync(dir, { recursive: true, force: true });
110
+ });
111
+
112
+ const handlers = new Map<string, Array<(event: any, ctx?: any) => Promise<void> | void>>();
113
+ const pi = {
114
+ on(event: string, handler: (event: any, ctx?: any) => Promise<void> | void) {
115
+ const existing = handlers.get(event) ?? [];
116
+ existing.push(handler);
117
+ handlers.set(event, existing);
118
+ },
119
+ } as any;
120
+
121
+ registerHooks(pi, []);
122
+
123
+ const questionId = "depth_verification_M002_confirm";
124
+ const questions = [
125
+ {
126
+ id: questionId,
127
+ question: "Do you agree?",
128
+ options: [
129
+ { label: "Yes, you got it (Recommended)" },
130
+ { label: "Needs adjustment" },
131
+ ],
132
+ },
133
+ ];
134
+
135
+ for (const handler of handlers.get("tool_call") ?? []) {
136
+ await handler({ toolName: "ask_user_questions", input: { questions } });
137
+ }
138
+ assert.equal(getPendingGate(), questionId);
139
+
140
+ // Simulate the normalized response the remote manager now emits:
141
+ // a Telegram button press returns a RemoteAnswer that is fed through
142
+ // toRoundResultResponse before reaching details.response.
143
+ const remoteAnswer = {
144
+ answers: {
145
+ [questionId]: { answers: ["Yes, you got it (Recommended)"] },
146
+ },
147
+ };
148
+ const normalized = toRoundResultResponse(remoteAnswer);
149
+
150
+ for (const handler of handlers.get("tool_result") ?? []) {
151
+ await handler({
152
+ toolName: "ask_user_questions",
153
+ input: { questions },
154
+ details: { response: normalized },
155
+ });
156
+ }
157
+
158
+ assert.equal(getPendingGate(), null, "normalized remote answer must clear the gate");
159
+ assert.equal(
160
+ shouldBlockContextArtifactSave("CONTEXT", "M002").block,
161
+ false,
162
+ "remote confirmation must unlock the matching milestone context write",
163
+ );
164
+ });
@@ -0,0 +1,107 @@
1
+ /**
2
+ * remote-notification-from-desktop.test.ts
3
+ *
4
+ * Regression guard: sendDesktopNotification must fire sendRemoteNotification
5
+ * as a fire-and-forget side-effect so that Telegram/Slack/Discord channels
6
+ * receive the same events as native desktop notifications.
7
+ *
8
+ * Testing strategy (structural analysis):
9
+ * node:test does not support mock.module without --experimental-test-module-mocks,
10
+ * so we use the same source-code structural approach established in this codebase
11
+ * (see session-start-footer.test.ts). We read notifications.ts and assert that:
12
+ * 1. It imports sendRemoteNotification from the remote-questions/notify module.
13
+ * 2. The sendDesktopNotification function body calls sendRemoteNotification
14
+ * with title and message as arguments.
15
+ * 3. The call uses the void fire-and-forget pattern with a .catch(() => {})
16
+ * suppressor so that async failures never break the synchronous caller.
17
+ *
18
+ * Relates to #4341.
19
+ */
20
+
21
+ import test from "node:test";
22
+ import assert from "node:assert/strict";
23
+ import { readFileSync } from "node:fs";
24
+ import { join, dirname } from "node:path";
25
+ import { fileURLToPath } from "node:url";
26
+
27
+ const __dirname = dirname(fileURLToPath(import.meta.url));
28
+ const SOURCE = readFileSync(join(__dirname, "..", "notifications.ts"), "utf-8");
29
+
30
+ test("notifications.ts imports sendRemoteNotification from remote-questions/notify", () => {
31
+ const hasImport =
32
+ SOURCE.includes('from "../remote-questions/notify.js"') ||
33
+ SOURCE.includes("from '../remote-questions/notify.js'");
34
+ assert.ok(
35
+ hasImport,
36
+ "notifications.ts must import from '../remote-questions/notify.js'",
37
+ );
38
+
39
+ const importLine = SOURCE.split("\n").find(
40
+ (line) =>
41
+ line.includes("sendRemoteNotification") &&
42
+ (line.includes("remote-questions/notify") || line.includes("remote-questions/notify.js")),
43
+ );
44
+ assert.ok(
45
+ importLine,
46
+ "The import statement must include sendRemoteNotification from the remote-questions/notify module",
47
+ );
48
+ });
49
+
50
+ test("sendDesktopNotification calls sendRemoteNotification(title, message)", () => {
51
+ // Extract the body of sendDesktopNotification — from its opening brace to the
52
+ // closing brace at the same indentation level.
53
+ const fnStart = SOURCE.indexOf("export function sendDesktopNotification(");
54
+ assert.ok(fnStart > -1, "sendDesktopNotification must be present in notifications.ts");
55
+
56
+ // Find the next exported function/const after sendDesktopNotification to bound the search.
57
+ const nextExportIdx = SOURCE.indexOf("\nexport ", fnStart + 1);
58
+ const fnBody = nextExportIdx > -1 ? SOURCE.slice(fnStart, nextExportIdx) : SOURCE.slice(fnStart);
59
+
60
+ assert.ok(
61
+ fnBody.includes("sendRemoteNotification"),
62
+ "sendDesktopNotification must call sendRemoteNotification",
63
+ );
64
+
65
+ assert.ok(
66
+ fnBody.includes("sendRemoteNotification(title") || fnBody.includes("sendRemoteNotification(title,"),
67
+ "sendRemoteNotification must be called with title as first argument",
68
+ );
69
+ });
70
+
71
+ test("sendRemoteNotification is invoked as void fire-and-forget with .catch(() => {})", () => {
72
+ const fnStart = SOURCE.indexOf("export function sendDesktopNotification(");
73
+ const nextExportIdx = SOURCE.indexOf("\nexport ", fnStart + 1);
74
+ const fnBody = nextExportIdx > -1 ? SOURCE.slice(fnStart, nextExportIdx) : SOURCE.slice(fnStart);
75
+
76
+ assert.ok(
77
+ fnBody.includes("void sendRemoteNotification("),
78
+ "sendRemoteNotification must be called with void (fire-and-forget)",
79
+ );
80
+
81
+ assert.ok(
82
+ fnBody.includes(".catch("),
83
+ "sendRemoteNotification call must be followed by .catch() to suppress unhandled-rejection warnings",
84
+ );
85
+ });
86
+
87
+ test("sendRemoteNotification call appears before shouldSendDesktopNotification guard", () => {
88
+ // Regression guard for the HIGH-severity bug where remote notifications were
89
+ // gated behind the desktop-notification preference check. Users who disable
90
+ // desktop notifications must still receive Telegram/Slack/Discord messages.
91
+ const fnStart = SOURCE.indexOf("export function sendDesktopNotification(");
92
+ assert.ok(fnStart > -1, "sendDesktopNotification must be present in notifications.ts");
93
+
94
+ const nextExportIdx = SOURCE.indexOf("\nexport ", fnStart + 1);
95
+ const fnBody = nextExportIdx > -1 ? SOURCE.slice(fnStart, nextExportIdx) : SOURCE.slice(fnStart);
96
+
97
+ const remoteCallIdx = fnBody.indexOf("sendRemoteNotification(");
98
+ const guardIdx = fnBody.indexOf("shouldSendDesktopNotification(");
99
+
100
+ assert.ok(remoteCallIdx > -1, "sendRemoteNotification must be called inside sendDesktopNotification");
101
+ assert.ok(guardIdx > -1, "shouldSendDesktopNotification guard must be present inside sendDesktopNotification");
102
+
103
+ assert.ok(
104
+ remoteCallIdx < guardIdx,
105
+ `sendRemoteNotification (pos ${remoteCallIdx}) must appear BEFORE the shouldSendDesktopNotification guard (pos ${guardIdx}) so that remote channels fire even when desktop notifications are disabled`,
106
+ );
107
+ });
@@ -95,6 +95,15 @@ describe('requirements', () => {
95
95
  assert.ok(report.issues.some(issue => issue.code === "active_requirement_missing_owner"), "doctor flags missing owner");
96
96
  });
97
97
 
98
+ // #4414: active_requirement_missing_owner is a planning-hygiene signal,
99
+ // not a correctness blocker — severity must be warning, not error.
100
+ test('#4414: active_requirement_missing_owner is a warning, not an error', async () => {
101
+ const report = await runGSDDoctor(base);
102
+ const issue = report.issues.find(i => i.code === "active_requirement_missing_owner");
103
+ assert.ok(issue, "issue is present");
104
+ assert.equal(issue!.severity, "warning", "severity downgraded so doctor report.ok is not flipped to false");
105
+ });
106
+
98
107
  after(() => {
99
108
  rmSync(base, { recursive: true, force: true });
100
109
  });
@@ -0,0 +1,153 @@
1
+ /**
2
+ * session-start-footer.test.ts
3
+ *
4
+ * Verifies that register-hooks.ts suppresses the built-in footer by calling
5
+ * ctx.ui.setFooter(hideFooter) in both session_start and session_switch when
6
+ * isAutoActive() is true.
7
+ *
8
+ * Testing strategy:
9
+ * Two layers:
10
+ * 1. Source-code regression guard: ensures the guard and setFooter call are
11
+ * structurally present in register-hooks.ts for both event handlers.
12
+ * (node:test does not support mock.module without --experimental-test-module-mocks,
13
+ * so structural analysis is the correct approach here.)
14
+ * 2. Behavioral integration test: fires the live session_start handler with a
15
+ * fake ctx when isAutoActive() is false (its default at test time) and
16
+ * confirms setFooter is NOT called — verifying the guard is conditional.
17
+ *
18
+ * Relates to #4314.
19
+ */
20
+
21
+ import test from "node:test";
22
+ import assert from "node:assert/strict";
23
+ import { mkdirSync, readFileSync, rmSync } from "node:fs";
24
+ import { join, dirname } from "node:path";
25
+ import { tmpdir } from "node:os";
26
+ import { fileURLToPath } from "node:url";
27
+
28
+ import { registerHooks } from "../bootstrap/register-hooks.ts";
29
+
30
+ const __dirname = dirname(fileURLToPath(import.meta.url));
31
+ const HOOKS_SOURCE = readFileSync(
32
+ join(__dirname, "..", "bootstrap", "register-hooks.ts"),
33
+ "utf-8",
34
+ );
35
+
36
+ // ─── Source-code regression guards ──────────────────────────────────────────
37
+
38
+ test("register-hooks.ts imports hideFooter from auto-dashboard", () => {
39
+ assert.ok(
40
+ HOOKS_SOURCE.includes('import { hideFooter } from "../auto-dashboard.js"') ||
41
+ HOOKS_SOURCE.includes("import { hideFooter } from '../auto-dashboard.js'"),
42
+ "register-hooks.ts must import hideFooter from auto-dashboard.js",
43
+ );
44
+ });
45
+
46
+ test("session_start handler calls ctx.ui.setFooter(hideFooter) when isAutoActive()", () => {
47
+ // Locate the session_start handler body (up to the next pi.on call)
48
+ const sessionStartIdx = HOOKS_SOURCE.indexOf('"session_start"');
49
+ assert.ok(sessionStartIdx > -1, "session_start handler must exist");
50
+
51
+ const sessionSwitchIdx = HOOKS_SOURCE.indexOf('"session_switch"');
52
+ assert.ok(sessionSwitchIdx > sessionStartIdx, "session_switch handler must follow session_start");
53
+
54
+ const sessionStartBody = HOOKS_SOURCE.slice(sessionStartIdx, sessionSwitchIdx);
55
+
56
+ assert.ok(
57
+ sessionStartBody.includes("isAutoActive()"),
58
+ "session_start handler must call isAutoActive()",
59
+ );
60
+ assert.ok(
61
+ sessionStartBody.includes("ctx.ui.setFooter(hideFooter)"),
62
+ "session_start handler must call ctx.ui.setFooter(hideFooter)",
63
+ );
64
+
65
+ // Guard must wrap the setFooter call
66
+ const guardIdx = sessionStartBody.indexOf("isAutoActive()");
67
+ const setFooterIdx = sessionStartBody.indexOf("ctx.ui.setFooter(hideFooter)");
68
+ assert.ok(
69
+ guardIdx < setFooterIdx,
70
+ "isAutoActive() guard must appear before ctx.ui.setFooter(hideFooter) in session_start",
71
+ );
72
+ });
73
+
74
+ test("session_switch handler calls ctx.ui.setFooter(hideFooter) when isAutoActive()", () => {
75
+ const sessionSwitchIdx = HOOKS_SOURCE.indexOf('"session_switch"');
76
+ assert.ok(sessionSwitchIdx > -1, "session_switch handler must exist");
77
+
78
+ const beforeAgentStartIdx = HOOKS_SOURCE.indexOf('"before_agent_start"');
79
+ assert.ok(beforeAgentStartIdx > sessionSwitchIdx, "before_agent_start handler must follow session_switch");
80
+
81
+ const sessionSwitchBody = HOOKS_SOURCE.slice(sessionSwitchIdx, beforeAgentStartIdx);
82
+
83
+ assert.ok(
84
+ sessionSwitchBody.includes("isAutoActive()"),
85
+ "session_switch handler must call isAutoActive()",
86
+ );
87
+ assert.ok(
88
+ sessionSwitchBody.includes("ctx.ui.setFooter(hideFooter)"),
89
+ "session_switch handler must call ctx.ui.setFooter(hideFooter)",
90
+ );
91
+
92
+ const guardIdx = sessionSwitchBody.indexOf("isAutoActive()");
93
+ const setFooterIdx = sessionSwitchBody.indexOf("ctx.ui.setFooter(hideFooter)");
94
+ assert.ok(
95
+ guardIdx < setFooterIdx,
96
+ "isAutoActive() guard must appear before ctx.ui.setFooter(hideFooter) in session_switch",
97
+ );
98
+ });
99
+
100
+ // ─── Behavioral test: setFooter NOT called when auto-mode is inactive ────────
101
+
102
+ test("session_start does NOT call setFooter when isAutoActive() is false (default)", async (t) => {
103
+ const dir = join(
104
+ tmpdir(),
105
+ `gsd-footer-test-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
106
+ );
107
+ mkdirSync(dir, { recursive: true });
108
+
109
+ const originalCwd = process.cwd();
110
+ process.chdir(dir);
111
+ t.after(() => {
112
+ process.chdir(originalCwd);
113
+ try { rmSync(dir, { recursive: true, force: true }); } catch { /* best-effort */ }
114
+ });
115
+
116
+ let setFooterCallCount = 0;
117
+
118
+ const handlers = new Map<string, (event: unknown, ctx: any) => Promise<void> | void>();
119
+ const pi = {
120
+ on(event: string, handler: (event: unknown, ctx: any) => Promise<void> | void) {
121
+ handlers.set(event, handler);
122
+ },
123
+ } as any;
124
+
125
+ registerHooks(pi, []);
126
+
127
+ const sessionStart = handlers.get("session_start");
128
+ assert.ok(sessionStart, "session_start handler must be registered");
129
+
130
+ await sessionStart!({}, {
131
+ hasUI: true,
132
+ ui: {
133
+ notify: () => {},
134
+ setStatus: () => {},
135
+ setFooter: (_footer: unknown) => {
136
+ setFooterCallCount++;
137
+ },
138
+ setWorkingMessage: () => {},
139
+ onTerminalInput: () => () => {},
140
+ setWidget: () => {},
141
+ },
142
+ sessionManager: { getSessionId: () => null },
143
+ model: null,
144
+ } as any);
145
+
146
+ // isAutoActive() is false at test time (no auto session started),
147
+ // so setFooter must not be called.
148
+ assert.equal(
149
+ setFooterCallCount,
150
+ 0,
151
+ "setFooter must NOT be called when isAutoActive() returns false",
152
+ );
153
+ });
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Regression test for #4375: gsd_skip_slice must cascade "skipped" status to
3
+ * all non-closed tasks in the slice.
4
+ *
5
+ * Without the cascade, executeCompleteMilestone's deep-task check finds
6
+ * pending tasks inside a skipped slice and refuses to complete the milestone,
7
+ * causing auto-mode to loop on complete-milestone until stuck-recovery aborts.
8
+ */
9
+
10
+ import { describe, test, beforeEach, afterEach } from "node:test";
11
+ import assert from "node:assert/strict";
12
+ import { mkdtempSync, rmSync } from "node:fs";
13
+ import { join } from "node:path";
14
+ import { tmpdir } from "node:os";
15
+
16
+ import {
17
+ openDatabase,
18
+ closeDatabase,
19
+ insertMilestone,
20
+ insertSlice,
21
+ insertTask,
22
+ getSlice,
23
+ getSliceTasks,
24
+ updateSliceStatus,
25
+ updateTaskStatus,
26
+ } from "../gsd-db.ts";
27
+ import { handleSkipSlice } from "../tools/skip-slice.ts";
28
+
29
+ describe("handleSkipSlice cascades skip to tasks (#4375)", () => {
30
+ let dir: string;
31
+ let dbPath: string;
32
+
33
+ beforeEach(() => {
34
+ dir = mkdtempSync(join(tmpdir(), "gsd-skip-cascade-"));
35
+ dbPath = join(dir, "test.db");
36
+ openDatabase(dbPath);
37
+ insertMilestone({ id: "M001", title: "Test", status: "active" });
38
+ insertSlice({ milestoneId: "M001", id: "S03", title: "Deferred", status: "pending", sequence: 3 });
39
+ insertTask({ milestoneId: "M001", sliceId: "S03", id: "T01", title: "task 1", status: "pending", sequence: 1 });
40
+ insertTask({ milestoneId: "M001", sliceId: "S03", id: "T02", title: "task 2", status: "active", sequence: 2 });
41
+ insertTask({ milestoneId: "M001", sliceId: "S03", id: "T03", title: "task 3", status: "pending", sequence: 3 });
42
+ });
43
+
44
+ afterEach(() => {
45
+ closeDatabase();
46
+ rmSync(dir, { recursive: true, force: true });
47
+ });
48
+
49
+ test("sets slice to skipped and cascades pending/active tasks to skipped", () => {
50
+ const result = handleSkipSlice({ milestoneId: "M001", sliceId: "S03", reason: "deferred" });
51
+
52
+ assert.equal(result.error, undefined, `expected success, got error: ${result.error ?? ""}`);
53
+ assert.equal(result.sliceId, "S03");
54
+ assert.equal(result.milestoneId, "M001");
55
+ assert.equal(result.tasksSkipped, 3, "all three non-closed tasks should be cascaded");
56
+
57
+ const slice = getSlice("M001", "S03");
58
+ assert.equal(slice?.status, "skipped", "slice status must be skipped");
59
+
60
+ const tasks = getSliceTasks("M001", "S03");
61
+ for (const t of tasks) {
62
+ assert.equal(t.status, "skipped", `task ${t.id} must be skipped after cascade`);
63
+ }
64
+ });
65
+
66
+ test("does not downgrade already-closed tasks", () => {
67
+ updateTaskStatus("M001", "S03", "T01", "complete", new Date().toISOString());
68
+
69
+ const result = handleSkipSlice({ milestoneId: "M001", sliceId: "S03" });
70
+
71
+ assert.equal(result.error, undefined);
72
+ assert.equal(result.tasksSkipped, 2, "only the two non-closed tasks should be cascaded");
73
+
74
+ const tasks = getSliceTasks("M001", "S03");
75
+ const byId = new Map(tasks.map((t) => [t.id, t.status]));
76
+ assert.equal(byId.get("T01"), "complete", "completed task must not be downgraded");
77
+ assert.equal(byId.get("T02"), "skipped");
78
+ assert.equal(byId.get("T03"), "skipped");
79
+ });
80
+
81
+ test("re-running skip on an already-skipped slice heals leftover pending tasks (#4375 recovery)", () => {
82
+ const first = handleSkipSlice({ milestoneId: "M001", sliceId: "S03" });
83
+ assert.equal(first.error, undefined);
84
+ assert.equal(first.tasksSkipped, 3);
85
+
86
+ // Simulate historical inconsistent state: slice skipped but a task was
87
+ // later recreated or reset to pending by some migration/bug path.
88
+ updateTaskStatus("M001", "S03", "T01", "pending");
89
+
90
+ const second = handleSkipSlice({ milestoneId: "M001", sliceId: "S03" });
91
+ assert.equal(second.error, undefined, "re-running must succeed (no 'already skipped' hard error)");
92
+ assert.equal(second.tasksSkipped, 1, "only the leftover pending task should be cascaded");
93
+ assert.equal(second.wasAlreadySkipped, true);
94
+
95
+ const tasks = getSliceTasks("M001", "S03");
96
+ for (const t of tasks) {
97
+ assert.equal(t.status, "skipped", `task ${t.id} must be skipped after recovery`);
98
+ }
99
+ });
100
+
101
+ test("refuses to skip an already-complete slice", () => {
102
+ updateSliceStatus("M001", "S03", "complete");
103
+
104
+ const result = handleSkipSlice({ milestoneId: "M001", sliceId: "S03" });
105
+ assert.ok(result.error, "expected error when slice is already complete");
106
+ assert.match(result.error!, /already complete/i);
107
+ assert.equal(result.errorCode, "already_complete");
108
+ });
109
+
110
+ test("refuses to skip a slice in the legacy 'done' status", () => {
111
+ updateSliceStatus("M001", "S03", "done");
112
+
113
+ const result = handleSkipSlice({ milestoneId: "M001", sliceId: "S03" });
114
+ assert.ok(result.error, "expected error when slice is already done");
115
+ assert.match(result.error!, /already complete/i);
116
+ assert.equal(result.errorCode, "already_complete");
117
+ });
118
+
119
+ test("returns error for unknown slice", () => {
120
+ const result = handleSkipSlice({ milestoneId: "M001", sliceId: "S99" });
121
+ assert.ok(result.error);
122
+ assert.match(result.error!, /not found/i);
123
+ assert.equal(result.errorCode, "slice_not_found");
124
+ });
125
+ });