prizmkit 1.1.100 → 1.1.102

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 (317) hide show
  1. package/bin/create-prizmkit.js +4 -4
  2. package/bundled/VERSION.json +3 -3
  3. package/bundled/dev-pipeline/.env.example +3 -3
  4. package/bundled/dev-pipeline/README.md +110 -90
  5. package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +1 -1
  6. package/bundled/dev-pipeline/cli.py +27 -0
  7. package/bundled/dev-pipeline/prizmkit_runtime/__init__.py +13 -0
  8. package/bundled/dev-pipeline/prizmkit_runtime/__main__.py +9 -0
  9. package/bundled/dev-pipeline/prizmkit_runtime/cli.py +193 -0
  10. package/bundled/dev-pipeline/prizmkit_runtime/commands.py +313 -0
  11. package/bundled/dev-pipeline/prizmkit_runtime/compat.py +32 -0
  12. package/bundled/dev-pipeline/prizmkit_runtime/config.py +410 -0
  13. package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +478 -0
  14. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +734 -0
  15. package/bundled/dev-pipeline/prizmkit_runtime/heartbeat.py +256 -0
  16. package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +109 -0
  17. package/bundled/dev-pipeline/prizmkit_runtime/paths.py +110 -0
  18. package/bundled/dev-pipeline/prizmkit_runtime/processes.py +373 -0
  19. package/bundled/dev-pipeline/prizmkit_runtime/reset.py +389 -0
  20. package/bundled/dev-pipeline/prizmkit_runtime/runner_bookkeeping.py +51 -0
  21. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +179 -0
  22. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +355 -0
  23. package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +118 -0
  24. package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +187 -0
  25. package/bundled/dev-pipeline/prizmkit_runtime/runner_status.py +153 -0
  26. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +425 -0
  27. package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +560 -0
  28. package/bundled/dev-pipeline/prizmkit_runtime/status.py +71 -0
  29. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +51 -36
  30. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +20 -5
  31. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +2 -2
  32. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +39 -0
  33. package/bundled/dev-pipeline/templates/agent-prompts/dev-implement.md +8 -2
  34. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +1 -1
  35. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +6 -2
  36. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +14 -6
  37. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +14 -4
  38. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +14 -4
  39. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +2 -0
  40. package/bundled/dev-pipeline/templates/sections/log-size-awareness.md +9 -30
  41. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +15 -7
  42. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +42 -29
  43. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +41 -39
  44. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +8 -17
  45. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +2 -2
  46. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +1 -3
  47. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +1 -3
  48. package/bundled/dev-pipeline/templates/sections/phase0-test-baseline.md +3 -8
  49. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +6 -2
  50. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +5 -1
  51. package/bundled/dev-pipeline/tests/test_auto_skip.py +436 -14
  52. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +115 -7
  53. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +40 -0
  54. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +1226 -0
  55. package/bundled/dev-pipeline/tests/test_unified_cli.py +1045 -0
  56. package/bundled/skills/_metadata.json +1 -1
  57. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +29 -34
  58. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +6 -5
  59. package/bundled/skills/feature-pipeline-launcher/SKILL.md +29 -35
  60. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +7 -6
  61. package/bundled/skills/feature-workflow/SKILL.md +3 -6
  62. package/bundled/skills/recovery-workflow/SKILL.md +23 -32
  63. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +29 -35
  64. package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +7 -6
  65. package/bundled/skills/refactor-workflow/SKILL.md +3 -6
  66. package/bundled/templates/hooks/commit-intent.json +2 -2
  67. package/bundled/templates/hooks/diff-prizm-docs.py +226 -0
  68. package/bundled/templates/hooks/prizm-pre-commit.py +45 -0
  69. package/bundled/templates/hooks/validate-prizm-docs.py +240 -0
  70. package/package.json +1 -1
  71. package/src/config.js +42 -19
  72. package/src/external-skills.js +14 -14
  73. package/src/index.js +3 -6
  74. package/src/manifest.js +11 -5
  75. package/src/metadata.js +7 -18
  76. package/src/platforms.js +25 -0
  77. package/src/prompts.js +0 -12
  78. package/src/runtimes.js +18 -11
  79. package/src/scaffold.js +144 -122
  80. package/src/upgrade.js +12 -3
  81. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +0 -500
  82. package/bundled/dev-pipeline/launch-feature-daemon.sh +0 -657
  83. package/bundled/dev-pipeline/launch-refactor-daemon.sh +0 -502
  84. package/bundled/dev-pipeline/lib/branch.sh +0 -326
  85. package/bundled/dev-pipeline/lib/common.sh +0 -1476
  86. package/bundled/dev-pipeline/lib/heartbeat.sh +0 -469
  87. package/bundled/dev-pipeline/reset-bug.sh +0 -425
  88. package/bundled/dev-pipeline/reset-feature.sh +0 -436
  89. package/bundled/dev-pipeline/reset-refactor.sh +0 -423
  90. package/bundled/dev-pipeline/run-bugfix.sh +0 -1430
  91. package/bundled/dev-pipeline/run-feature.sh +0 -1718
  92. package/bundled/dev-pipeline/run-recovery.sh +0 -648
  93. package/bundled/dev-pipeline/run-refactor.sh +0 -1463
  94. package/bundled/dev-pipeline/tests/test-path-resolution.sh +0 -100
  95. package/bundled/dev-pipeline-windows/.env.example +0 -36
  96. package/bundled/dev-pipeline-windows/README.md +0 -30
  97. package/bundled/dev-pipeline-windows/SCHEMA_ANALYSIS.md +0 -533
  98. package/bundled/dev-pipeline-windows/assets/feature-list-example.json +0 -146
  99. package/bundled/dev-pipeline-windows/assets/prizm-dev-team-integration.md +0 -137
  100. package/bundled/dev-pipeline-windows/launch-bugfix-daemon.ps1 +0 -9
  101. package/bundled/dev-pipeline-windows/launch-feature-daemon.ps1 +0 -9
  102. package/bundled/dev-pipeline-windows/launch-refactor-daemon.ps1 +0 -9
  103. package/bundled/dev-pipeline-windows/lib/branch.ps1 +0 -235
  104. package/bundled/dev-pipeline-windows/lib/common.ps1 +0 -991
  105. package/bundled/dev-pipeline-windows/lib/daemon.ps1 +0 -140
  106. package/bundled/dev-pipeline-windows/lib/pipeline.ps1 +0 -1051
  107. package/bundled/dev-pipeline-windows/lib/reset.ps1 +0 -121
  108. package/bundled/dev-pipeline-windows/reset-bug.ps1 +0 -10
  109. package/bundled/dev-pipeline-windows/reset-feature.ps1 +0 -10
  110. package/bundled/dev-pipeline-windows/reset-refactor.ps1 +0 -10
  111. package/bundled/dev-pipeline-windows/run-bugfix.ps1 +0 -9
  112. package/bundled/dev-pipeline-windows/run-feature.ps1 +0 -9
  113. package/bundled/dev-pipeline-windows/run-recovery.ps1 +0 -179
  114. package/bundled/dev-pipeline-windows/run-refactor.ps1 +0 -9
  115. package/bundled/dev-pipeline-windows/scripts/check-session-status.py +0 -301
  116. package/bundled/dev-pipeline-windows/scripts/continuation.py +0 -374
  117. package/bundled/dev-pipeline-windows/scripts/detect-stuck.py +0 -530
  118. package/bundled/dev-pipeline-windows/scripts/generate-bootstrap-prompt.py +0 -2279
  119. package/bundled/dev-pipeline-windows/scripts/generate-bugfix-prompt.py +0 -763
  120. package/bundled/dev-pipeline-windows/scripts/generate-recovery-prompt.py +0 -805
  121. package/bundled/dev-pipeline-windows/scripts/generate-refactor-prompt.py +0 -841
  122. package/bundled/dev-pipeline-windows/scripts/init-bugfix-pipeline.py +0 -316
  123. package/bundled/dev-pipeline-windows/scripts/init-dev-team.py +0 -134
  124. package/bundled/dev-pipeline-windows/scripts/init-pipeline.py +0 -382
  125. package/bundled/dev-pipeline-windows/scripts/init-refactor-pipeline.py +0 -399
  126. package/bundled/dev-pipeline-windows/scripts/parse-stream-progress.py +0 -1362
  127. package/bundled/dev-pipeline-windows/scripts/patch-completion-notes.py +0 -191
  128. package/bundled/dev-pipeline-windows/scripts/prizmkit-test-gate.py +0 -446
  129. package/bundled/dev-pipeline-windows/scripts/update-bug-status.py +0 -1121
  130. package/bundled/dev-pipeline-windows/scripts/update-checkpoint.py +0 -173
  131. package/bundled/dev-pipeline-windows/scripts/update-feature-status.py +0 -1789
  132. package/bundled/dev-pipeline-windows/scripts/update-refactor-status.py +0 -1327
  133. package/bundled/dev-pipeline-windows/scripts/utils.py +0 -542
  134. package/bundled/dev-pipeline-windows/templates/agent-prompts/critic-plan-challenge.md +0 -7
  135. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-fix.md +0 -7
  136. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-implement.md +0 -65
  137. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-resume.md +0 -5
  138. package/bundled/dev-pipeline-windows/templates/agent-prompts/reviewer-review.md +0 -7
  139. package/bundled/dev-pipeline-windows/templates/bootstrap-prompt.md +0 -73
  140. package/bundled/dev-pipeline-windows/templates/bootstrap-tier1.md +0 -589
  141. package/bundled/dev-pipeline-windows/templates/bootstrap-tier2.md +0 -710
  142. package/bundled/dev-pipeline-windows/templates/bootstrap-tier3.md +0 -791
  143. package/bundled/dev-pipeline-windows/templates/bug-fix-list-schema.json +0 -263
  144. package/bundled/dev-pipeline-windows/templates/bugfix-bootstrap-prompt.md +0 -326
  145. package/bundled/dev-pipeline-windows/templates/feature-list-schema.json +0 -237
  146. package/bundled/dev-pipeline-windows/templates/refactor-bootstrap-prompt.md +0 -340
  147. package/bundled/dev-pipeline-windows/templates/refactor-list-schema.json +0 -270
  148. package/bundled/dev-pipeline-windows/templates/sections/ac-verification-checklist.md +0 -7
  149. package/bundled/dev-pipeline-windows/templates/sections/checkpoint-system.md +0 -91
  150. package/bundled/dev-pipeline-windows/templates/sections/context-budget-rules.md +0 -34
  151. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-agent.md +0 -10
  152. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-full.md +0 -12
  153. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-lite.md +0 -7
  154. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-agent.md +0 -8
  155. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-full.md +0 -9
  156. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-lite.md +0 -6
  157. package/bundled/dev-pipeline-windows/templates/sections/failure-capture.md +0 -21
  158. package/bundled/dev-pipeline-windows/templates/sections/feature-context.md +0 -21
  159. package/bundled/dev-pipeline-windows/templates/sections/log-size-awareness.md +0 -41
  160. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-auto.md +0 -283
  161. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-opencli.md +0 -112
  162. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification.md +0 -168
  163. package/bundled/dev-pipeline-windows/templates/sections/phase-commit-full.md +0 -82
  164. package/bundled/dev-pipeline-windows/templates/sections/phase-commit.md +0 -75
  165. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-agent-suffix.md +0 -23
  166. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-base.md +0 -14
  167. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-lite-suffix.md +0 -19
  168. package/bundled/dev-pipeline-windows/templates/sections/phase-critic-plan-full.md +0 -63
  169. package/bundled/dev-pipeline-windows/templates/sections/phase-critic-plan.md +0 -42
  170. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-agent.md +0 -44
  171. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-full.md +0 -59
  172. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-lite.md +0 -39
  173. package/bundled/dev-pipeline-windows/templates/sections/phase-plan-agent.md +0 -27
  174. package/bundled/dev-pipeline-windows/templates/sections/phase-plan-lite.md +0 -27
  175. package/bundled/dev-pipeline-windows/templates/sections/phase-prizmkit-test.md +0 -39
  176. package/bundled/dev-pipeline-windows/templates/sections/phase-review-agent.md +0 -35
  177. package/bundled/dev-pipeline-windows/templates/sections/phase-review-full.md +0 -35
  178. package/bundled/dev-pipeline-windows/templates/sections/phase-specify-plan-full.md +0 -73
  179. package/bundled/dev-pipeline-windows/templates/sections/phase0-init.md +0 -13
  180. package/bundled/dev-pipeline-windows/templates/sections/phase0-test-baseline.md +0 -21
  181. package/bundled/dev-pipeline-windows/templates/sections/session-context.md +0 -5
  182. package/bundled/dev-pipeline-windows/templates/sections/subagent-timeout-recovery.md +0 -6
  183. package/bundled/dev-pipeline-windows/templates/sections/task-contract.md +0 -34
  184. package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-agent.md +0 -48
  185. package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-lite.md +0 -48
  186. package/bundled/dev-pipeline-windows/templates/session-status-schema.json +0 -83
  187. package/bundled/skills-windows/app-planner/SKILL.md +0 -296
  188. package/bundled/skills-windows/app-planner/assets/app-design-guide.md +0 -101
  189. package/bundled/skills-windows/app-planner/references/architecture-decisions.md +0 -52
  190. package/bundled/skills-windows/app-planner/references/brainstorm-guide.md +0 -101
  191. package/bundled/skills-windows/app-planner/references/frontend-design-guide.md +0 -71
  192. package/bundled/skills-windows/app-planner/references/infrastructure-convention-discovery.md +0 -108
  193. package/bundled/skills-windows/app-planner/references/project-brief-guide.md +0 -82
  194. package/bundled/skills-windows/app-planner/references/project-conventions-discovery.md +0 -59
  195. package/bundled/skills-windows/app-planner/references/project-state-detection.md +0 -90
  196. package/bundled/skills-windows/app-planner/references/red-team-checklist.md +0 -40
  197. package/bundled/skills-windows/app-planner/references/rules/backend/derivation-rules.md +0 -619
  198. package/bundled/skills-windows/app-planner/references/rules/backend/fixed-rules.md +0 -285
  199. package/bundled/skills-windows/app-planner/references/rules/backend/question-bank.md +0 -249
  200. package/bundled/skills-windows/app-planner/references/rules/backend/question-manifest.json +0 -46
  201. package/bundled/skills-windows/app-planner/references/rules/backend/template.md +0 -173
  202. package/bundled/skills-windows/app-planner/references/rules/database/derivation-rules.md +0 -382
  203. package/bundled/skills-windows/app-planner/references/rules/database/fixed-rules.md +0 -211
  204. package/bundled/skills-windows/app-planner/references/rules/database/question-bank.md +0 -184
  205. package/bundled/skills-windows/app-planner/references/rules/database/question-manifest.json +0 -39
  206. package/bundled/skills-windows/app-planner/references/rules/database/template.md +0 -158
  207. package/bundled/skills-windows/app-planner/references/rules/frontend/derivation-rules.md +0 -820
  208. package/bundled/skills-windows/app-planner/references/rules/frontend/fixed-rules.md +0 -188
  209. package/bundled/skills-windows/app-planner/references/rules/frontend/question-bank.md +0 -319
  210. package/bundled/skills-windows/app-planner/references/rules/frontend/question-manifest.json +0 -51
  211. package/bundled/skills-windows/app-planner/references/rules/frontend/template.md +0 -339
  212. package/bundled/skills-windows/app-planner/references/rules/mobile/derivation-rules.md +0 -649
  213. package/bundled/skills-windows/app-planner/references/rules/mobile/fixed-rules.md +0 -290
  214. package/bundled/skills-windows/app-planner/references/rules/mobile/question-bank.md +0 -232
  215. package/bundled/skills-windows/app-planner/references/rules/mobile/question-manifest.json +0 -47
  216. package/bundled/skills-windows/app-planner/references/rules/mobile/template.md +0 -175
  217. package/bundled/skills-windows/app-planner/references/rules-configuration.md +0 -46
  218. package/bundled/skills-windows/bug-fix-workflow/SKILL.md +0 -379
  219. package/bundled/skills-windows/bug-fix-workflow/references/bug-diagnosis.md +0 -41
  220. package/bundled/skills-windows/bug-planner/SKILL.md +0 -402
  221. package/bundled/skills-windows/bug-planner/assets/bug-confirmation-template.md +0 -43
  222. package/bundled/skills-windows/bug-planner/references/critic-and-verification.md +0 -44
  223. package/bundled/skills-windows/bug-planner/references/error-recovery.md +0 -73
  224. package/bundled/skills-windows/bug-planner/references/input-formats.md +0 -53
  225. package/bundled/skills-windows/bug-planner/references/schema-validation.md +0 -25
  226. package/bundled/skills-windows/bug-planner/references/severity-rules.md +0 -16
  227. package/bundled/skills-windows/bug-planner/scripts/validate-bug-list.py +0 -322
  228. package/bundled/skills-windows/bugfix-pipeline-launcher/SKILL.md +0 -304
  229. package/bundled/skills-windows/bugfix-pipeline-launcher/references/configuration.md +0 -84
  230. package/bundled/skills-windows/feature-pipeline-launcher/SKILL.md +0 -381
  231. package/bundled/skills-windows/feature-pipeline-launcher/references/configuration.md +0 -67
  232. package/bundled/skills-windows/feature-pipeline-launcher/scripts/preflight-check.py +0 -462
  233. package/bundled/skills-windows/feature-planner/SKILL.md +0 -397
  234. package/bundled/skills-windows/feature-planner/assets/evaluation-guide.md +0 -64
  235. package/bundled/skills-windows/feature-planner/assets/planning-guide.md +0 -214
  236. package/bundled/skills-windows/feature-planner/references/browser-interaction.md +0 -59
  237. package/bundled/skills-windows/feature-planner/references/completeness-review.md +0 -57
  238. package/bundled/skills-windows/feature-planner/references/decomposition-patterns.md +0 -75
  239. package/bundled/skills-windows/feature-planner/references/error-recovery.md +0 -90
  240. package/bundled/skills-windows/feature-planner/references/incremental-feature-planning.md +0 -112
  241. package/bundled/skills-windows/feature-planner/references/new-project-planning.md +0 -85
  242. package/bundled/skills-windows/feature-planner/scripts/validate-and-generate.py +0 -1020
  243. package/bundled/skills-windows/feature-workflow/SKILL.md +0 -374
  244. package/bundled/skills-windows/feature-workflow/references/brainstorm-guide.md +0 -137
  245. package/bundled/skills-windows/prizm-kit/SKILL.md +0 -93
  246. package/bundled/skills-windows/prizmkit-code-review/SKILL.md +0 -161
  247. package/bundled/skills-windows/prizmkit-code-review/references/dev-agent-prompt.md +0 -30
  248. package/bundled/skills-windows/prizmkit-code-review/references/review-report-template.md +0 -31
  249. package/bundled/skills-windows/prizmkit-code-review/references/reviewer-agent-prompt.md +0 -66
  250. package/bundled/skills-windows/prizmkit-code-review/scripts/check_loop.py +0 -186
  251. package/bundled/skills-windows/prizmkit-committer/SKILL.md +0 -89
  252. package/bundled/skills-windows/prizmkit-deploy/SKILL.md +0 -444
  253. package/bundled/skills-windows/prizmkit-deploy/references/ci-cd-workflows.md +0 -115
  254. package/bundled/skills-windows/prizmkit-deploy/references/cloud-platform-deploy.md +0 -93
  255. package/bundled/skills-windows/prizmkit-deploy/references/data-safety-examples.md +0 -120
  256. package/bundled/skills-windows/prizmkit-deploy/references/database-setup.md +0 -46
  257. package/bundled/skills-windows/prizmkit-deploy/references/deploy-config-schema.md +0 -148
  258. package/bundled/skills-windows/prizmkit-deploy/references/deploy-history-schema.md +0 -62
  259. package/bundled/skills-windows/prizmkit-deploy/references/deployment-modes.md +0 -50
  260. package/bundled/skills-windows/prizmkit-deploy/references/direct-upload.md +0 -26
  261. package/bundled/skills-windows/prizmkit-deploy/references/dns-setup.md +0 -42
  262. package/bundled/skills-windows/prizmkit-deploy/references/docker-deploy.md +0 -31
  263. package/bundled/skills-windows/prizmkit-deploy/references/firewall-setup.md +0 -37
  264. package/bundled/skills-windows/prizmkit-deploy/references/live-validation-notes.md +0 -21
  265. package/bundled/skills-windows/prizmkit-deploy/references/nginx-blue-green.md +0 -59
  266. package/bundled/skills-windows/prizmkit-deploy/references/ssh-bootstrap-flow.md +0 -49
  267. package/bundled/skills-windows/prizmkit-deploy/references/ssh-execution-flow.md +0 -41
  268. package/bundled/skills-windows/prizmkit-deploy/references/ssh-takeover.md +0 -20
  269. package/bundled/skills-windows/prizmkit-deploy/references/ssl-setup.md +0 -56
  270. package/bundled/skills-windows/prizmkit-implement/SKILL.md +0 -71
  271. package/bundled/skills-windows/prizmkit-init/SKILL.md +0 -356
  272. package/bundled/skills-windows/prizmkit-init/assets/project-brief-template.md +0 -82
  273. package/bundled/skills-windows/prizmkit-init/references/config-schema.md +0 -70
  274. package/bundled/skills-windows/prizmkit-init/references/rules/layer-detection.md +0 -41
  275. package/bundled/skills-windows/prizmkit-init/references/tech-stack-catalog.md +0 -13
  276. package/bundled/skills-windows/prizmkit-init/references/update-supplement.md +0 -9
  277. package/bundled/skills-windows/prizmkit-plan/SKILL.md +0 -102
  278. package/bundled/skills-windows/prizmkit-plan/assets/plan-template.md +0 -115
  279. package/bundled/skills-windows/prizmkit-plan/assets/spec-template.md +0 -73
  280. package/bundled/skills-windows/prizmkit-plan/references/clarify-guide.md +0 -67
  281. package/bundled/skills-windows/prizmkit-plan/references/examples.md +0 -85
  282. package/bundled/skills-windows/prizmkit-plan/references/verification-checklist.md +0 -60
  283. package/bundled/skills-windows/prizmkit-prizm-docs/SKILL.md +0 -129
  284. package/bundled/skills-windows/prizmkit-prizm-docs/assets/prizm-docs-format.md +0 -613
  285. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-init.md +0 -45
  286. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-rebuild.md +0 -15
  287. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-status.md +0 -14
  288. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-update.md +0 -19
  289. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-validate.md +0 -17
  290. package/bundled/skills-windows/prizmkit-retrospective/SKILL.md +0 -87
  291. package/bundled/skills-windows/prizmkit-retrospective/references/knowledge-injection-steps.md +0 -50
  292. package/bundled/skills-windows/prizmkit-retrospective/references/structural-sync-steps.md +0 -43
  293. package/bundled/skills-windows/prizmkit-test/SKILL.md +0 -227
  294. package/bundled/skills-windows/prizmkit-test/references/boundary-coverage-protocol.md +0 -220
  295. package/bundled/skills-windows/prizmkit-test/references/examples.md +0 -143
  296. package/bundled/skills-windows/prizmkit-test/references/service-boundary-test-catalog.md +0 -225
  297. package/bundled/skills-windows/prizmkit-test/references/test-generation-steps.md +0 -109
  298. package/bundled/skills-windows/prizmkit-test/references/test-report-template.md +0 -111
  299. package/bundled/skills-windows/prizmkit-test/scripts/validate_boundary_report.py +0 -347
  300. package/bundled/skills-windows/recovery-workflow/SKILL.md +0 -355
  301. package/bundled/skills-windows/recovery-workflow/evals/evals.json +0 -46
  302. package/bundled/skills-windows/recovery-workflow/references/detection.md +0 -58
  303. package/bundled/skills-windows/recovery-workflow/scripts/detect-recovery-state.py +0 -544
  304. package/bundled/skills-windows/refactor-pipeline-launcher/SKILL.md +0 -346
  305. package/bundled/skills-windows/refactor-pipeline-launcher/references/configuration.md +0 -72
  306. package/bundled/skills-windows/refactor-planner/SKILL.md +0 -398
  307. package/bundled/skills-windows/refactor-planner/assets/planning-guide.md +0 -292
  308. package/bundled/skills-windows/refactor-planner/references/behavior-preservation.md +0 -301
  309. package/bundled/skills-windows/refactor-planner/references/fast-path.md +0 -59
  310. package/bundled/skills-windows/refactor-planner/references/planning-phases.md +0 -135
  311. package/bundled/skills-windows/refactor-planner/references/refactor-scoping-guide.md +0 -221
  312. package/bundled/skills-windows/refactor-planner/scripts/validate-and-generate-refactor.py +0 -858
  313. package/bundled/skills-windows/refactor-workflow/SKILL.md +0 -343
  314. package/bundled/skills-windows/refactor-workflow/references/brainstorm-guide.md +0 -116
  315. package/bundled/templates/hooks/diff-prizm-docs.sh +0 -158
  316. package/bundled/templates/hooks/prizm-pre-commit.sh +0 -108
  317. package/bundled/templates/hooks/validate-prizm-docs.sh +0 -139
@@ -0,0 +1,153 @@
1
+ """Status updater subprocess bridge for Python foreground runners."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import subprocess
7
+ import sys
8
+ from dataclasses import dataclass
9
+ from pathlib import Path
10
+
11
+ from .runner_models import RunnerEnvironment, RunnerFamily, RunnerInvocation
12
+
13
+
14
+ @dataclass(frozen=True)
15
+ class StatusCommandResult:
16
+ """Captured output from a canonical status updater script."""
17
+
18
+ action: str
19
+ return_code: int
20
+ stdout: str
21
+ stderr: str
22
+ data: object | None = None
23
+
24
+ @property
25
+ def ok(self) -> bool:
26
+ return self.return_code == 0
27
+
28
+ @property
29
+ def text(self) -> str:
30
+ return self.stdout.strip() or self.stderr.strip()
31
+
32
+
33
+ def _resolved_max_retries(invocation: RunnerInvocation) -> int:
34
+ if invocation.max_retries is not None:
35
+ return max(0, invocation.max_retries)
36
+ return RunnerEnvironment.from_env().max_retries
37
+
38
+
39
+ def run_status_action(
40
+ family: RunnerFamily,
41
+ action: str,
42
+ invocation: RunnerInvocation,
43
+ *,
44
+ item_id: str = "",
45
+ session_status: str = "",
46
+ session_id: str = "",
47
+ max_retries: int | None = None,
48
+ active_dev_branch: str = "",
49
+ base_branch: str = "",
50
+ last_fatal_error_code: str = "",
51
+ continuation_summary_path: Path | None = None,
52
+ no_progress_count: int | None = None,
53
+ progress_fingerprint: object | None = None,
54
+ project_root: Path | None = None,
55
+ ) -> StatusCommandResult:
56
+ max_retries = _resolved_max_retries(invocation) if max_retries is None else max(0, max_retries)
57
+ command = [
58
+ sys.executable,
59
+ str(family.updater_script),
60
+ family.list_arg,
61
+ str(invocation.list_path),
62
+ "--state-dir",
63
+ str(family.state_dir),
64
+ "--action",
65
+ action,
66
+ "--max-retries",
67
+ str(max_retries),
68
+ "--max-infra-retries",
69
+ str(invocation.max_infra_retries),
70
+ ]
71
+ if item_id:
72
+ command.extend([family.item_id_arg, item_id])
73
+ if session_status:
74
+ command.extend(["--session-status", session_status])
75
+ if session_id:
76
+ command.extend(["--session-id", session_id])
77
+ if family.kind == "feature" and invocation.item_filter:
78
+ command.extend(["--features", invocation.item_filter])
79
+ if active_dev_branch:
80
+ command.extend(["--active-dev-branch", active_dev_branch])
81
+ if base_branch:
82
+ command.extend(["--base-branch", base_branch])
83
+ if last_fatal_error_code:
84
+ command.extend(["--last-fatal-error-code", last_fatal_error_code])
85
+ if continuation_summary_path is not None:
86
+ command.extend(["--continuation-summary-path", str(continuation_summary_path)])
87
+ if no_progress_count is not None:
88
+ command.extend(["--no-progress-count", str(no_progress_count)])
89
+ if progress_fingerprint is not None:
90
+ command.extend(["--progress-fingerprint", json.dumps(progress_fingerprint, sort_keys=True)])
91
+ if project_root is not None:
92
+ command.extend(["--project-root", str(project_root)])
93
+
94
+ completed = subprocess.run(
95
+ command,
96
+ cwd=str(project_root or family.plan_path.parent.parent.parent),
97
+ stdout=subprocess.PIPE,
98
+ stderr=subprocess.PIPE,
99
+ text=True,
100
+ check=False,
101
+ )
102
+ text = completed.stdout.strip()
103
+ data = None
104
+ if text and text not in {"PIPELINE_COMPLETE", "PIPELINE_BLOCKED"}:
105
+ try:
106
+ data = json.loads(text)
107
+ except json.JSONDecodeError:
108
+ data = None
109
+ return StatusCommandResult(
110
+ action=action,
111
+ return_code=completed.returncode,
112
+ stdout=completed.stdout,
113
+ stderr=completed.stderr,
114
+ data=data,
115
+ )
116
+
117
+
118
+ def get_next(family: RunnerFamily, invocation: RunnerInvocation, project_root: Path) -> StatusCommandResult:
119
+ return run_status_action(family, "get_next", invocation, project_root=project_root)
120
+
121
+
122
+ def start_item(family: RunnerFamily, invocation: RunnerInvocation, item_id: str, project_root: Path) -> StatusCommandResult:
123
+ return run_status_action(family, "start", invocation, item_id=item_id, project_root=project_root)
124
+
125
+
126
+ def update_item(
127
+ family: RunnerFamily,
128
+ invocation: RunnerInvocation,
129
+ item_id: str,
130
+ session_status: str,
131
+ session_id: str,
132
+ project_root: Path,
133
+ **metadata: object,
134
+ ) -> StatusCommandResult:
135
+ return run_status_action(
136
+ family,
137
+ "update",
138
+ invocation,
139
+ item_id=item_id,
140
+ session_status=session_status,
141
+ session_id=session_id,
142
+ project_root=project_root,
143
+ active_dev_branch=str(metadata.get("active_dev_branch") or ""),
144
+ base_branch=str(metadata.get("base_branch") or ""),
145
+ last_fatal_error_code=str(metadata.get("last_fatal_error_code") or ""),
146
+ continuation_summary_path=metadata.get("continuation_summary_path") if isinstance(metadata.get("continuation_summary_path"), Path) else None,
147
+ no_progress_count=metadata.get("no_progress_count") if isinstance(metadata.get("no_progress_count"), int) else None,
148
+ progress_fingerprint=metadata.get("progress_fingerprint"),
149
+ )
150
+
151
+
152
+ def status_text(family: RunnerFamily, invocation: RunnerInvocation, project_root: Path) -> StatusCommandResult:
153
+ return run_status_action(family, "status", invocation, project_root=project_root)
@@ -0,0 +1,425 @@
1
+ """Python foreground runner dispatch for feature, bugfix, refactor, and recovery."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import time
7
+ from pathlib import Path
8
+
9
+ from .commands import CommandResult # type: ignore # imported only at runtime by commands.py
10
+ from .config import load_runtime_config
11
+ from .gitops import (
12
+ BranchContext,
13
+ WorktreePolicy,
14
+ branch_create_plan,
15
+ branch_ensure_return,
16
+ branch_merge_plan,
17
+ current_branch,
18
+ ensure_linked_worktree,
19
+ guarded_worktree_remove,
20
+ materialize_worktree_support_assets,
21
+ merge_linked_worktree,
22
+ run_git_command,
23
+ run_git_plan,
24
+ worktree_runtime_context,
25
+ worktree_save_wip,
26
+ )
27
+ from .runner_bookkeeping import commit_final_bookkeeping, commit_pre_branch_bookkeeping
28
+ from .runner_classification import classify_session
29
+ from .runner_models import RunnerEnvironment, RunnerFamily, RunnerInvocation, SessionPaths, family_for, parse_invocation
30
+ from .runner_prompts import PromptGenerationResult, generate_prompt
31
+ from .runner_recovery import run_recovery, run_recovery_detect
32
+ from .runner_status import get_next, run_status_action, start_item, status_text, update_item
33
+ from .sessions import AISessionConfig, AISessionLauncher, detect_stream_json_support
34
+
35
+
36
+ def run_pipeline_command(kind: str, action: str, legacy_args: tuple[str, ...], paths) -> CommandResult:
37
+ """Dispatch a feature/bugfix/refactor Python foreground command."""
38
+ family = family_for(kind, paths)
39
+ invocation = parse_invocation(family, action, legacy_args)
40
+ invocation = _resolve_invocation_paths(invocation, paths.project_root)
41
+ if invocation.help_requested:
42
+ return CommandResult(0, f"Python {kind} runner", _help_text(family))
43
+ if action == "status":
44
+ status = status_text(family, invocation, paths.project_root)
45
+ return CommandResult(status.return_code, f"Python {kind} status", status.stdout.strip() or status.stderr.strip())
46
+ if action == "unskip":
47
+ status = run_status_action(
48
+ family,
49
+ "unskip",
50
+ invocation,
51
+ item_id=invocation.item_id,
52
+ project_root=paths.project_root,
53
+ )
54
+ return CommandResult(
55
+ status.return_code,
56
+ f"Python {kind} unskip",
57
+ status.stdout.strip() or status.stderr.strip(),
58
+ )
59
+ if action == "test-cli":
60
+ return _test_cli(kind, paths)
61
+ if action != "run":
62
+ return CommandResult(1, "Unsupported Python runner action", f"Unsupported action: {kind} {action}")
63
+ if not invocation.list_path.is_file():
64
+ return CommandResult(1, f"Python {kind} runner", f"Plan list not found: {invocation.list_path}")
65
+ try:
66
+ result = _run_pipeline(family, invocation, paths)
67
+ except Exception as exc: # keep CLI boundary traceback-free
68
+ return CommandResult(1, f"Python {kind} runner failed", str(exc))
69
+ details = result.details + ((f"last_status: {result.last_status}",) if result.last_status else ())
70
+ return CommandResult(
71
+ 0 if result.completed else 1,
72
+ f"Python {kind} runner",
73
+ f"processed={result.processed} completed={result.completed} stopped_reason={result.stopped_reason or 'none'}",
74
+ details=details,
75
+ )
76
+
77
+
78
+ def run_recovery_command(action: str, legacy_args: tuple[str, ...], paths) -> CommandResult:
79
+ """Dispatch a Python recovery command."""
80
+ if action == "detect":
81
+ code, stdout, stderr, _data = run_recovery_detect(paths)
82
+ return CommandResult(code, "Python recovery detect", stdout.strip() or stderr.strip())
83
+ if action == "run":
84
+ code, stdout, stderr = run_recovery(paths, legacy_args)
85
+ return CommandResult(code, "Python recovery run", stdout.strip() or stderr.strip())
86
+ return CommandResult(1, "Unsupported Python recovery action", f"Unsupported action: {action}")
87
+
88
+
89
+ def _run_pipeline(family: RunnerFamily, invocation: RunnerInvocation, paths) -> "PipelineRunResult":
90
+ from .runner_models import PipelineRunResult
91
+
92
+ processed = 0
93
+ details: list[str] = []
94
+ if invocation.item_id:
95
+ status = _process_item(family, invocation, invocation.item_id, paths, initial_metadata={})
96
+ return PipelineRunResult(status == "completed", 1, "single_item_done", status, tuple(details))
97
+
98
+ while True:
99
+ next_result = get_next(family, invocation, paths.project_root)
100
+ if not next_result.ok:
101
+ return PipelineRunResult(False, processed, "get_next_failed", details=(next_result.text,))
102
+ marker = next_result.stdout.strip()
103
+ if marker == "PIPELINE_COMPLETE":
104
+ return PipelineRunResult(True, processed, "pipeline_complete", details=tuple(details))
105
+ if marker == "PIPELINE_BLOCKED":
106
+ return PipelineRunResult(False, processed, "pipeline_blocked", details=tuple(details))
107
+ if not isinstance(next_result.data, dict):
108
+ return PipelineRunResult(False, processed, "invalid_get_next_output", details=(marker[:500],))
109
+ item_id = str(next_result.data.get(f"{family.kind}_id") or next_result.data.get("feature_id") or next_result.data.get("bug_id") or next_result.data.get("refactor_id") or "")
110
+ if not item_id:
111
+ return PipelineRunResult(False, processed, "missing_item_id", details=(marker[:500],))
112
+ final_status = _process_item(family, invocation, item_id, paths, initial_metadata=next_result.data)
113
+ processed += 1
114
+ details.append(f"{item_id}:{final_status}")
115
+ if final_status == "completed":
116
+ continue
117
+ if final_status == "pending":
118
+ continue
119
+ if RunnerEnvironment.from_env().stop_on_failure:
120
+ return PipelineRunResult(False, processed, "stop_on_failure", final_status, tuple(details))
121
+ if final_status in {"failed", "needs_info"}:
122
+ return PipelineRunResult(False, processed, "item_failed", final_status, tuple(details))
123
+
124
+
125
+ def _process_item(
126
+ family: RunnerFamily,
127
+ invocation: RunnerInvocation,
128
+ item_id: str,
129
+ paths,
130
+ *,
131
+ initial_metadata: dict[str, object],
132
+ ) -> str:
133
+ env = RunnerEnvironment.from_env()
134
+ config = load_runtime_config(paths)
135
+ if not config.ai_client.command:
136
+ raise RuntimeError("No supported AI CLI command was found")
137
+ start = start_item(family, invocation, item_id, paths.project_root)
138
+ if not start.ok:
139
+ raise RuntimeError(start.text)
140
+ commit_pre_branch_bookkeeping(paths.project_root, family, item_id)
141
+
142
+ base_branch = str(initial_metadata.get("base_branch") or current_branch(paths.project_root) or "main")
143
+ branch_name = str(initial_metadata.get("active_dev_branch") or env.dev_branch or _default_branch_name(family, item_id))
144
+ branch_context = BranchContext(base_branch, branch_name, paths.project_root)
145
+ worktree_runtime = None
146
+ use_worktree = _use_worktree_for_family(env, family)
147
+ execution_root = paths.project_root
148
+ if use_worktree:
149
+ worktree_runtime = worktree_runtime_context(
150
+ branch_context,
151
+ WorktreePolicy(
152
+ use_worktree=True,
153
+ cleanup_on_success=True,
154
+ preserve_on_failure=True,
155
+ worktree_root=paths.state_dir / "worktrees",
156
+ ),
157
+ )
158
+ setup = ensure_linked_worktree(worktree_runtime)
159
+ if not setup.ok:
160
+ status = update_item(family, invocation, item_id, "infra_error", "", paths.project_root)
161
+ return _status_from_update(status)
162
+ worktree_runtime = setup.runtime or worktree_runtime
163
+ support_assets = materialize_worktree_support_assets(worktree_runtime)
164
+ if not support_assets.ok:
165
+ status = update_item(family, invocation, item_id, "infra_error", "", paths.project_root)
166
+ return _status_from_update(status)
167
+ execution_root = worktree_runtime.worktree_path
168
+ else:
169
+ branch_result = run_git_plan(paths.project_root, branch_create_plan(branch_context))
170
+ if not branch_result.ok:
171
+ status = update_item(family, invocation, item_id, "infra_error", "", paths.project_root)
172
+ return _status_from_update(status)
173
+
174
+ previous_fingerprint = initial_metadata.get("last_progress_fingerprint")
175
+ previous_no_progress_count = int(initial_metadata.get("no_progress_count") or 0)
176
+ continuation_pending = bool(initial_metadata.get("continuation_pending"))
177
+ previous_session_id = str(initial_metadata.get("previous_session_id") or initial_metadata.get("last_context_overflow_session_id") or "")
178
+ continuation_count = int(initial_metadata.get("continuation_count") or 0)
179
+ context_overflow_count = int(initial_metadata.get("context_overflow_count") or 0)
180
+
181
+ while True:
182
+ session_id = _session_id(item_id)
183
+ session_paths = SessionPaths.for_item(family.state_dir, item_id, session_id)
184
+ continuation = None
185
+ if continuation_pending:
186
+ continuation = {
187
+ "previous_session_id": previous_session_id,
188
+ "continuation_count": continuation_count,
189
+ "context_overflow_count": context_overflow_count,
190
+ "task_type": family.task_type,
191
+ "active_dev_branch": branch_name,
192
+ "base_branch": base_branch,
193
+ "continuation_summary_path": _continuation_summary_path(paths.project_root, family, item_id, None),
194
+ }
195
+ prompt = generate_prompt(
196
+ family,
197
+ invocation,
198
+ item_id=item_id,
199
+ session_id=session_id,
200
+ run_id="run-python",
201
+ retry_count=0,
202
+ session_paths=session_paths,
203
+ project_root=paths.project_root,
204
+ execution_root=execution_root,
205
+ continuation=continuation,
206
+ )
207
+ if invocation.dry_run:
208
+ return "dry_run"
209
+ stream_json = detect_stream_json_support(config.ai_client.command, config.ai_client.platform).enabled
210
+ base_head = run_git_command(execution_root, ("rev-parse", "HEAD")).stdout.strip()
211
+ session_result = AISessionLauncher(
212
+ AISessionConfig(
213
+ cli_command=config.ai_client.command,
214
+ platform=config.ai_client.platform or "codebuddy",
215
+ model=prompt.model or config.model,
216
+ prompt_path=prompt.output_path,
217
+ cwd=execution_root,
218
+ log_path=session_paths.session_log,
219
+ progress_path=session_paths.progress_json,
220
+ heartbeat_path=session_paths.heartbeat_json,
221
+ effort=config.effort,
222
+ verbose=env.verbose,
223
+ use_stream_json=stream_json,
224
+ stale_kill_threshold_seconds=env.stale_kill_threshold_seconds,
225
+ )
226
+ ).run()
227
+ classification = classify_session(
228
+ session_result,
229
+ project_root=execution_root,
230
+ base_head=base_head,
231
+ prompt=prompt,
232
+ previous_fingerprint=previous_fingerprint,
233
+ previous_no_progress_count=previous_no_progress_count,
234
+ )
235
+ if classification.session_status == "context_overflow":
236
+ summary_path = _continuation_summary_path(paths.project_root, family, item_id, prompt)
237
+ update = update_item(
238
+ family,
239
+ invocation,
240
+ item_id,
241
+ "context_overflow",
242
+ session_id,
243
+ paths.project_root,
244
+ active_dev_branch=branch_name,
245
+ base_branch=base_branch,
246
+ last_fatal_error_code=classification.fatal_error_code or "context_overflow",
247
+ continuation_summary_path=summary_path,
248
+ no_progress_count=classification.no_progress_count,
249
+ progress_fingerprint=classification.progress_fingerprint,
250
+ )
251
+ if not update.ok:
252
+ raise RuntimeError(update.text)
253
+ previous_fingerprint = classification.progress_fingerprint
254
+ previous_no_progress_count = classification.no_progress_count
255
+ continuation_pending = True
256
+ previous_session_id = session_id
257
+ continuation_count += 1
258
+ context_overflow_count += 1
259
+ continue
260
+
261
+ final_session_status = classification.session_status
262
+ if use_worktree and worktree_runtime is not None:
263
+ if final_session_status == "success":
264
+ merge = merge_linked_worktree(worktree_runtime, auto_push=env.auto_push)
265
+ if merge.ok:
266
+ guarded_worktree_remove(worktree_runtime, delete_branch=True)
267
+ else:
268
+ final_session_status = "merge_conflict"
269
+ guarded_worktree_remove(worktree_runtime, delete_branch=False)
270
+ else:
271
+ worktree_save_wip(worktree_runtime)
272
+ guarded_worktree_remove(worktree_runtime, delete_branch=False)
273
+ else:
274
+ if final_session_status == "success":
275
+ merge = run_git_plan(paths.project_root, branch_merge_plan(branch_context, auto_push=env.auto_push))
276
+ if not merge.ok:
277
+ branch_ensure_return(paths.project_root, base_branch, branch_name)
278
+ final_session_status = "merge_conflict"
279
+ else:
280
+ branch_ensure_return(paths.project_root, base_branch, branch_name)
281
+
282
+ _write_session_status(
283
+ session_paths,
284
+ status=final_session_status,
285
+ session_id=session_id,
286
+ task_id=item_id,
287
+ task_type=family.task_type,
288
+ base_branch=base_branch,
289
+ active_dev_branch=branch_name,
290
+ worktree_path=worktree_runtime.worktree_path if worktree_runtime is not None else None,
291
+ reason=classification.reason,
292
+ fatal_error_code=classification.fatal_error_code,
293
+ )
294
+
295
+ update = update_item(
296
+ family,
297
+ invocation,
298
+ item_id,
299
+ final_session_status,
300
+ session_id,
301
+ paths.project_root,
302
+ active_dev_branch=branch_name,
303
+ base_branch=base_branch,
304
+ last_fatal_error_code=classification.fatal_error_code,
305
+ no_progress_count=classification.no_progress_count,
306
+ progress_fingerprint=classification.progress_fingerprint,
307
+ )
308
+ if not update.ok:
309
+ raise RuntimeError(update.text)
310
+ new_status = _status_from_update(update)
311
+ commit_final_bookkeeping(paths.project_root, family, item_id, new_status)
312
+ return new_status
313
+
314
+
315
+
316
+ def _test_cli(kind: str, paths) -> CommandResult:
317
+ """Report the AI CLI resolution used by Python runner commands."""
318
+ config = load_runtime_config(paths)
319
+ cli = config.ai_client.command or "(not found)"
320
+ platform = config.ai_client.platform or "unresolved"
321
+ details = [
322
+ f"detected_cli: {cli}",
323
+ f"platform: {platform}",
324
+ f"source: {config.ai_client.source}",
325
+ f"runtime_mode: {config.runtime_mode}",
326
+ ]
327
+ if config.model:
328
+ details.append(f"model: {config.model}")
329
+ details.extend(f"note: {note}" for note in config.ai_client.notes)
330
+ return CommandResult(
331
+ 0 if config.ai_client.command else 1,
332
+ f"Python {kind} AI CLI test",
333
+ "AI CLI resolution for the canonical Python runtime.",
334
+ tuple(details),
335
+ )
336
+
337
+
338
+ def _use_worktree_for_family(env: RunnerEnvironment, family: RunnerFamily) -> bool:
339
+ return env.use_worktree and family.kind in {"feature", "bugfix"}
340
+
341
+
342
+ def _write_session_status(
343
+ session_paths: SessionPaths,
344
+ *,
345
+ status: str,
346
+ session_id: str,
347
+ task_id: str,
348
+ task_type: str,
349
+ base_branch: str,
350
+ active_dev_branch: str,
351
+ worktree_path: Path | None = None,
352
+ reason: str = "",
353
+ fatal_error_code: str = "",
354
+ ) -> None:
355
+ payload = {
356
+ "status": status,
357
+ "session_id": session_id,
358
+ "task_id": task_id,
359
+ "task_type": task_type,
360
+ "base_branch": base_branch,
361
+ "active_dev_branch": active_dev_branch,
362
+ }
363
+ if worktree_path is not None:
364
+ payload["worktree_path"] = str(worktree_path)
365
+ if reason:
366
+ payload["reason"] = reason
367
+ if fatal_error_code:
368
+ payload["fatal_error_code"] = fatal_error_code
369
+ session_paths.session_status_json.parent.mkdir(parents=True, exist_ok=True)
370
+ session_paths.session_status_json.write_text(
371
+ json.dumps(payload, indent=2, sort_keys=True) + "\n",
372
+ encoding="utf-8",
373
+ )
374
+
375
+ def _status_from_update(update_result) -> str:
376
+ if isinstance(update_result.data, dict):
377
+ return str(update_result.data.get("new_status") or update_result.data.get("status") or "unknown")
378
+ return "unknown"
379
+
380
+
381
+ def _default_branch_name(family: RunnerFamily, item_id: str) -> str:
382
+ stamp = time.strftime("%Y%m%d%H%M")
383
+ return f"{family.branch_prefix}/{item_id}-{stamp}"
384
+
385
+
386
+ def _session_id(item_id: str) -> str:
387
+ return f"{item_id}-{time.strftime('%Y%m%d%H%M%S')}"
388
+
389
+
390
+ def _continuation_summary_path(project_root: Path, family: RunnerFamily, item_id: str, prompt: PromptGenerationResult | None) -> Path:
391
+ if prompt and prompt.artifact_path:
392
+ return prompt.artifact_path / "continuation-summary.md"
393
+ if family.kind == "feature":
394
+ return project_root / ".prizmkit" / "specs" / item_id / "continuation-summary.md"
395
+ return project_root / ".prizmkit" / family.artifact_root_name / item_id / "continuation-summary.md"
396
+
397
+
398
+ def _resolve_invocation_paths(invocation: RunnerInvocation, project_root: Path) -> RunnerInvocation:
399
+ if invocation.list_path.is_absolute():
400
+ return invocation
401
+ return RunnerInvocation(
402
+ action=invocation.action,
403
+ list_path=(project_root / invocation.list_path).resolve(),
404
+ item_id=invocation.item_id,
405
+ item_filter=invocation.item_filter,
406
+ max_retries=invocation.max_retries,
407
+ max_infra_retries=invocation.max_infra_retries,
408
+ mode=invocation.mode,
409
+ critic=invocation.critic,
410
+ dry_run=invocation.dry_run,
411
+ clean=invocation.clean,
412
+ no_reset=invocation.no_reset,
413
+ resume_phase=invocation.resume_phase,
414
+ help_requested=invocation.help_requested,
415
+ unknown_args=invocation.unknown_args,
416
+ raw_args=invocation.raw_args,
417
+ )
418
+
419
+
420
+ def _help_text(family: RunnerFamily) -> str:
421
+ return (
422
+ f"Python foreground runner for {family.kind}.\n"
423
+ "Supported legacy options include plan list path, item id, --features for feature, "
424
+ "--max-retries, --max-infra-retries, --mode, --critic/--no-critic, --resume-phase, and --dry-run."
425
+ )