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,193 @@
1
+ """Argparse command tree for the canonical PrizmKit Python runtime."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import sys
7
+ from collections.abc import Sequence
8
+
9
+ from .commands import CommandResult, handle_diagnostics, handle_runtime_command
10
+ from .compat import UnsupportedPythonVersion, ensure_supported_python
11
+ from .paths import resolve_runtime_paths
12
+
13
+ DESCRIPTION = (
14
+ "PrizmKit canonical Python runtime CLI.\n"
15
+ "Runs pipeline, reset, daemon, recovery, status, and diagnostics commands without shell wrappers."
16
+ )
17
+
18
+
19
+ def _add_passthrough_options(parser: argparse.ArgumentParser) -> None:
20
+ parser.add_argument(
21
+ "args",
22
+ nargs=argparse.REMAINDER,
23
+ help="Arguments forwarded to the selected Python runtime command.",
24
+ )
25
+
26
+
27
+ def _set_handler(parser: argparse.ArgumentParser, group: str, action: str, target: str | None = None) -> None:
28
+ parser.set_defaults(handler="runtime", group=group, action=action, target=target)
29
+
30
+
31
+ def _add_action_subparsers(
32
+ subparsers: argparse._SubParsersAction[argparse.ArgumentParser],
33
+ group: str,
34
+ actions: Sequence[str],
35
+ ) -> None:
36
+ group_parser = subparsers.add_parser(group, help=f"{group} pipeline commands")
37
+ action_subparsers = group_parser.add_subparsers(dest="action_name", required=True)
38
+ for action in actions:
39
+ action_parser = action_subparsers.add_parser(action, help=f"Run {group} {action}")
40
+ _add_passthrough_options(action_parser)
41
+ _set_handler(action_parser, group, action)
42
+
43
+
44
+ def _add_reset_subparsers(subparsers: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
45
+ reset_parser = subparsers.add_parser("reset", help="Explicit reset commands")
46
+ reset_subparsers = reset_parser.add_subparsers(dest="reset_target", required=True)
47
+ for target in ("feature", "bugfix", "refactor"):
48
+ target_parser = reset_subparsers.add_parser(target, help=f"Run {target} reset")
49
+ _add_passthrough_options(target_parser)
50
+ _set_handler(target_parser, "reset", "reset", target)
51
+ describe_parser = reset_subparsers.add_parser("describe", help="Describe reset command boundaries")
52
+ _set_handler(describe_parser, "reset", "describe")
53
+
54
+
55
+ def _add_daemon_subparsers(subparsers: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
56
+ daemon_parser = subparsers.add_parser("daemon", help="Daemon lifecycle commands")
57
+ target_subparsers = daemon_parser.add_subparsers(dest="daemon_target", required=True)
58
+ for target in ("feature", "bugfix", "refactor"):
59
+ target_parser = target_subparsers.add_parser(target, help=f"{target} daemon commands")
60
+ action_subparsers = target_parser.add_subparsers(dest="daemon_action", required=True)
61
+ for action in ("start", "stop", "status", "logs", "restart", "describe"):
62
+ action_parser = action_subparsers.add_parser(action, help=f"Run daemon {target} {action}")
63
+ _add_passthrough_options(action_parser)
64
+ _set_handler(action_parser, "daemon", action, target)
65
+
66
+
67
+ def _add_status_subparsers(subparsers: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
68
+ status_parser = subparsers.add_parser("status", help="Status commands")
69
+ status_subparsers = status_parser.add_subparsers(dest="status_target", required=True)
70
+ for target in ("feature", "bugfix", "refactor", "all"):
71
+ target_parser = status_subparsers.add_parser(target, help=f"Show {target} status")
72
+ _add_passthrough_options(target_parser)
73
+ _set_handler(target_parser, "status", "status", target)
74
+
75
+
76
+ def _add_diagnostics_subparsers(subparsers: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
77
+ diagnostics_parser = subparsers.add_parser("diagnostics", help="Python runtime diagnostics")
78
+ diagnostics_subparsers = diagnostics_parser.add_subparsers(dest="diagnostics_action", required=True)
79
+ for action in ("paths", "entrypoints", "version"):
80
+ action_parser = diagnostics_subparsers.add_parser(action, help=f"Show {action} diagnostics")
81
+ action_parser.set_defaults(handler="diagnostics", action=action)
82
+
83
+
84
+ _PIPELINE_GROUPS = {"feature", "bugfix", "refactor", "recovery"}
85
+ _GLOBAL_OPTIONS_WITH_VALUES = {"--project-root", "--pipeline-root"}
86
+
87
+
88
+ def _split_passthrough_args(argv: Sequence[str]) -> tuple[list[str], tuple[str, ...]]:
89
+ """Split parser-owned command tokens from legacy args while preserving exact arg order."""
90
+ tokens = [str(arg) for arg in argv]
91
+ prefix: list[str] = []
92
+ index = 0
93
+ while index < len(tokens):
94
+ token = tokens[index]
95
+ if token in _GLOBAL_OPTIONS_WITH_VALUES:
96
+ prefix.append(token)
97
+ index += 1
98
+ if index < len(tokens):
99
+ prefix.append(tokens[index])
100
+ index += 1
101
+ continue
102
+ if any(token.startswith(f"{option}=") for option in _GLOBAL_OPTIONS_WITH_VALUES):
103
+ prefix.append(token)
104
+ index += 1
105
+ continue
106
+ break
107
+
108
+ if index >= len(tokens):
109
+ return tokens, ()
110
+
111
+ group = tokens[index]
112
+ if group in _PIPELINE_GROUPS:
113
+ required_parts = 2
114
+ elif group in {"reset", "status", "diagnostics"}:
115
+ required_parts = 2
116
+ elif group == "daemon":
117
+ required_parts = 3
118
+ else:
119
+ return tokens, ()
120
+
121
+ command_end = min(len(tokens), index + required_parts)
122
+ prefix.extend(tokens[index:command_end])
123
+ passthrough = tuple(tokens[command_end:])
124
+ if group == "diagnostics":
125
+ return tokens, ()
126
+ return prefix, passthrough
127
+
128
+
129
+ def build_parser() -> argparse.ArgumentParser:
130
+ """Build the standard-library argparse command tree."""
131
+ parser = argparse.ArgumentParser(
132
+ prog="prizmkit-runtime",
133
+ description=DESCRIPTION,
134
+ )
135
+ parser.add_argument(
136
+ "--project-root",
137
+ help="Optional project root used for path resolution and command execution.",
138
+ )
139
+ parser.add_argument(
140
+ "--pipeline-root",
141
+ help="Optional dev-pipeline root used for path resolution and command execution.",
142
+ )
143
+ subparsers = parser.add_subparsers(dest="command_group", required=True)
144
+
145
+ _add_action_subparsers(subparsers, "feature", ("run", "status", "reset", "unskip", "test-cli", "describe"))
146
+ _add_action_subparsers(subparsers, "bugfix", ("run", "status", "reset", "unskip", "describe"))
147
+ _add_action_subparsers(subparsers, "refactor", ("run", "status", "reset", "unskip", "describe"))
148
+ _add_action_subparsers(subparsers, "recovery", ("run", "detect", "describe"))
149
+ _add_reset_subparsers(subparsers)
150
+ _add_daemon_subparsers(subparsers)
151
+ _add_status_subparsers(subparsers)
152
+ _add_diagnostics_subparsers(subparsers)
153
+ return parser
154
+
155
+
156
+ def _runtime_paths_from_args(args: argparse.Namespace):
157
+ return resolve_runtime_paths(pipeline_root=args.pipeline_root, project_root=args.project_root)
158
+
159
+
160
+ def _dispatch(args: argparse.Namespace) -> CommandResult:
161
+ paths = _runtime_paths_from_args(args)
162
+ if args.handler == "diagnostics":
163
+ return handle_diagnostics(args.action, paths)
164
+ return handle_runtime_command(
165
+ args.group,
166
+ args.action,
167
+ target=args.target,
168
+ paths=paths,
169
+ legacy_args=tuple(getattr(args, "args", ()) or ()),
170
+ )
171
+
172
+
173
+ def main(argv: Sequence[str] | None = None) -> int:
174
+ """Run the unified runtime CLI."""
175
+ try:
176
+ ensure_supported_python()
177
+ except UnsupportedPythonVersion as exc:
178
+ print(str(exc), file=sys.stderr)
179
+ return 1
180
+
181
+ parser = build_parser()
182
+ parse_argv = list(sys.argv[1:] if argv is None else argv)
183
+ parser_argv, passthrough_args = _split_passthrough_args(parse_argv)
184
+ args = parser.parse_args(parser_argv)
185
+ if passthrough_args:
186
+ args.args = tuple(getattr(args, "args", ()) or ()) + passthrough_args
187
+ result = _dispatch(args)
188
+ if result.stderr:
189
+ print(result.stderr, file=sys.stderr)
190
+ output = result.render()
191
+ if output:
192
+ print(output)
193
+ return result.exit_code
@@ -0,0 +1,313 @@
1
+ """Command contracts for the canonical PrizmKit Python runtime."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from dataclasses import dataclass
6
+
7
+ from .compat import MIN_PYTHON
8
+ from .interoperability import UTILITY_ENTRYPOINTS, describe_existing_entrypoint
9
+ from .paths import RuntimePaths, resolve_runtime_paths
10
+
11
+ RUNTIME_STATUS = "python-runtime-canonical"
12
+ CANONICAL_RUNTIME_NOTE = "The Python CLI and prizmkit_runtime modules are the canonical runtime."
13
+ PYTHON_CLI = "dev-pipeline/cli.py"
14
+
15
+
16
+ @dataclass(frozen=True)
17
+ class RuntimeCommand:
18
+ """Unified CLI command mapped to the Python behavior provider."""
19
+
20
+ group: str
21
+ action: str
22
+ target: str | None
23
+ current_entrypoint: str | None
24
+ entrypoint_kind: str | None
25
+ entrypoint_name: str | None
26
+ transition_status: str = RUNTIME_STATUS
27
+ notes: tuple[str, ...] = (CANONICAL_RUNTIME_NOTE,)
28
+
29
+ @property
30
+ def key(self) -> tuple[str, str | None, str]:
31
+ """Return the stable command registry key."""
32
+ return (self.group, self.target, self.action)
33
+
34
+
35
+ @dataclass(frozen=True)
36
+ class CommandResult:
37
+ """Result returned by runtime command handlers."""
38
+
39
+ exit_code: int
40
+ title: str
41
+ message: str
42
+ details: tuple[str, ...] = ()
43
+ stdout: str | None = None
44
+ stderr: str | None = None
45
+
46
+ def render(self) -> str:
47
+ """Render a deterministic human-readable result."""
48
+ if self.stdout is not None:
49
+ return self.stdout
50
+ lines = [self.title, self.message]
51
+ lines.extend(self.details)
52
+ return "\n".join(line for line in lines if line)
53
+
54
+
55
+ def _runtime_invocation(group: str, action: str, target: str | None = None) -> str:
56
+ if group == "daemon" and target is not None:
57
+ return f"python3 {PYTHON_CLI} daemon {target} {action}"
58
+ if group == "reset" and target is not None and action == "reset":
59
+ return f"python3 {PYTHON_CLI} reset {target}"
60
+ if group == "status" and target is not None:
61
+ return f"python3 {PYTHON_CLI} status {target}"
62
+ return f"python3 {PYTHON_CLI} {group} {action}"
63
+
64
+
65
+ def _command(
66
+ group: str,
67
+ action: str,
68
+ *,
69
+ target: str | None = None,
70
+ notes: tuple[str, ...] = (CANONICAL_RUNTIME_NOTE,),
71
+ ) -> RuntimeCommand:
72
+ return RuntimeCommand(
73
+ group=group,
74
+ target=target,
75
+ action=action,
76
+ current_entrypoint=_runtime_invocation(group, action, target),
77
+ entrypoint_kind="python-cli",
78
+ entrypoint_name=group if target is None else f"{group}:{target}",
79
+ notes=notes,
80
+ )
81
+
82
+
83
+ def _pipeline_commands() -> tuple[RuntimeCommand, ...]:
84
+ commands: list[RuntimeCommand] = []
85
+ action_matrix = {
86
+ "feature": ("run", "status", "reset", "unskip", "test-cli", "describe"),
87
+ "bugfix": ("run", "status", "reset", "unskip", "describe"),
88
+ "refactor": ("run", "status", "reset", "unskip", "describe"),
89
+ "recovery": ("run", "detect", "describe"),
90
+ }
91
+ for group, actions in action_matrix.items():
92
+ for action in actions:
93
+ commands.append(
94
+ _command(
95
+ group,
96
+ action,
97
+ notes=(
98
+ CANONICAL_RUNTIME_NOTE,
99
+ "Foreground and recovery behavior is implemented in Python runtime modules.",
100
+ ),
101
+ )
102
+ )
103
+ return tuple(commands)
104
+
105
+
106
+ def _reset_commands() -> tuple[RuntimeCommand, ...]:
107
+ commands = [
108
+ _command(
109
+ "reset",
110
+ "reset",
111
+ target=target,
112
+ notes=(
113
+ CANONICAL_RUNTIME_NOTE,
114
+ "Reset actions are explicit manual operations and are not part of automatic continuation recovery.",
115
+ ),
116
+ )
117
+ for target in ("feature", "bugfix", "refactor")
118
+ ]
119
+ commands.append(
120
+ _command(
121
+ "reset",
122
+ "describe",
123
+ notes=(CANONICAL_RUNTIME_NOTE, "Lists destructive Python reset commands without running them."),
124
+ )
125
+ )
126
+ return tuple(commands)
127
+
128
+
129
+ def _daemon_commands() -> tuple[RuntimeCommand, ...]:
130
+ commands: list[RuntimeCommand] = []
131
+ for target in ("feature", "bugfix", "refactor"):
132
+ for action in ("start", "stop", "status", "logs", "restart", "describe"):
133
+ commands.append(
134
+ _command(
135
+ "daemon",
136
+ action,
137
+ target=target,
138
+ notes=(
139
+ CANONICAL_RUNTIME_NOTE,
140
+ "Daemon lifecycle behavior is implemented by the Python daemon runtime.",
141
+ ),
142
+ )
143
+ )
144
+ return tuple(commands)
145
+
146
+
147
+ def _status_commands() -> tuple[RuntimeCommand, ...]:
148
+ commands = [
149
+ _command(
150
+ "status",
151
+ "status",
152
+ target=target,
153
+ notes=(CANONICAL_RUNTIME_NOTE, "Status is resolved by the Python foreground runtime."),
154
+ )
155
+ for target in ("feature", "bugfix", "refactor")
156
+ ]
157
+ commands.append(
158
+ _command(
159
+ "status",
160
+ "status",
161
+ target="all",
162
+ notes=(CANONICAL_RUNTIME_NOTE, "Aggregated status is represented at the Python CLI boundary."),
163
+ )
164
+ )
165
+ return tuple(commands)
166
+
167
+
168
+ def _diagnostic_commands() -> tuple[RuntimeCommand, ...]:
169
+ return tuple(
170
+ _command(
171
+ "diagnostics",
172
+ action,
173
+ notes=(CANONICAL_RUNTIME_NOTE, "Diagnostic commands are implemented in the Python runtime."),
174
+ )
175
+ for action in ("paths", "entrypoints", "version")
176
+ )
177
+
178
+
179
+ COMMAND_REGISTRY: tuple[RuntimeCommand, ...] = (
180
+ *_pipeline_commands(),
181
+ *_reset_commands(),
182
+ *_daemon_commands(),
183
+ *_status_commands(),
184
+ *_diagnostic_commands(),
185
+ )
186
+
187
+
188
+ def list_runtime_commands() -> tuple[RuntimeCommand, ...]:
189
+ """Return the unified CLI command inventory."""
190
+ return COMMAND_REGISTRY
191
+
192
+
193
+ def find_runtime_command(group: str, action: str, target: str | None = None) -> RuntimeCommand:
194
+ """Find one command contract by group/action/target."""
195
+ for command in COMMAND_REGISTRY:
196
+ if command.group == group and command.action == action and command.target == target:
197
+ return command
198
+ target_text = "" if target is None else f" target={target}"
199
+ raise KeyError(f"Unknown runtime command: group={group}{target_text} action={action}")
200
+
201
+
202
+ def describe_command(command: RuntimeCommand, paths: RuntimePaths | None = None) -> CommandResult:
203
+ """Describe a Python runtime command contract without running behavior."""
204
+ _ = paths or resolve_runtime_paths()
205
+ details = [
206
+ f"command: {command.group} {command.target or ''} {command.action}".replace(" ", " ").strip(),
207
+ f"runtime status: {command.transition_status}",
208
+ f"current entrypoint: {command.current_entrypoint or PYTHON_CLI}",
209
+ ]
210
+ details.extend(f"note: {note}" for note in command.notes)
211
+ return CommandResult(
212
+ exit_code=0,
213
+ title="Python runtime command contract",
214
+ message="This command is available in the canonical PrizmKit Python runtime.",
215
+ details=tuple(details),
216
+ )
217
+
218
+
219
+ def handle_runtime_command(
220
+ group: str,
221
+ action: str,
222
+ *,
223
+ target: str | None = None,
224
+ paths: RuntimePaths | None = None,
225
+ legacy_args: tuple[str, ...] = (),
226
+ ) -> CommandResult:
227
+ """Handle runtime commands, dispatching ported Python runtime behavior where available."""
228
+ runtime_paths = paths or resolve_runtime_paths()
229
+ if group in {"feature", "bugfix", "refactor"} and action in {"run", "status", "unskip", "test-cli"}:
230
+ from .runners import run_pipeline_command
231
+
232
+ return run_pipeline_command(group, action, legacy_args, runtime_paths)
233
+ if group == "status" and target in {"feature", "bugfix", "refactor"} and action == "status":
234
+ from .runners import run_pipeline_command
235
+
236
+ return run_pipeline_command(target, action, legacy_args, runtime_paths)
237
+ if group == "recovery" and action in {"run", "detect"}:
238
+ from .runners import run_recovery_command
239
+
240
+ return run_recovery_command(action, legacy_args, runtime_paths)
241
+ if group == "reset" and target in {"feature", "bugfix", "refactor"} and action == "reset":
242
+ from .reset import run_reset_command
243
+
244
+ return run_reset_command(target, legacy_args, runtime_paths)
245
+ if group == "daemon" and target in {"feature", "bugfix", "refactor"} and action in {"start", "stop", "status", "logs", "restart", "describe"}:
246
+ from .daemon import run_daemon_command
247
+
248
+ try:
249
+ return run_daemon_command(target, action, legacy_args, runtime_paths)
250
+ except ValueError as exc:
251
+ return CommandResult(1, f"Python {target} daemon", str(exc), stdout="", stderr=str(exc))
252
+ command = find_runtime_command(group, action, target)
253
+ return describe_command(command, runtime_paths)
254
+
255
+
256
+ def diagnostics_paths(paths: RuntimePaths | None = None) -> CommandResult:
257
+ """Return path diagnostics for the current runtime layout."""
258
+ runtime_paths = paths or resolve_runtime_paths()
259
+ details = (
260
+ f"layout: {runtime_paths.layout}",
261
+ f"pipeline_root: {runtime_paths.pipeline_root}",
262
+ f"project_root: {runtime_paths.project_root}",
263
+ f"prizmkit_dir: {runtime_paths.prizmkit_dir}",
264
+ f"plans_dir: {runtime_paths.plans_dir}",
265
+ f"state_dir: {runtime_paths.state_dir}",
266
+ f"logs_dir: {runtime_paths.logs_dir}",
267
+ f"specs_dir: {runtime_paths.specs_dir}",
268
+ )
269
+ return CommandResult(
270
+ exit_code=0,
271
+ title="Runtime path diagnostics",
272
+ message="Resolved with pathlib; no shell-specific quoting is required.",
273
+ details=details,
274
+ )
275
+
276
+
277
+ def diagnostics_entrypoints(paths: RuntimePaths | None = None) -> CommandResult:
278
+ """Return an inventory of canonical Python runtime and utility entrypoints."""
279
+ runtime_paths = paths or resolve_runtime_paths()
280
+ details: list[str] = [
281
+ f"runtime:cli: {runtime_paths.pipeline_root / 'cli.py'}",
282
+ f"runtime:module: {runtime_paths.pipeline_root / 'prizmkit_runtime'}",
283
+ ]
284
+ for name, relative_path in sorted(UTILITY_ENTRYPOINTS.items()):
285
+ invocation = describe_existing_entrypoint("utility", name, paths=runtime_paths)
286
+ details.append(f"utility:{name}: {invocation.script_path if invocation else runtime_paths.pipeline_root / relative_path}")
287
+ return CommandResult(
288
+ exit_code=0,
289
+ title="Python runtime entrypoint inventory",
290
+ message="Inventory for canonical Python runtime and utility scripts.",
291
+ details=tuple(details),
292
+ )
293
+
294
+
295
+ def diagnostics_version() -> CommandResult:
296
+ """Return runtime version contract diagnostics."""
297
+ return CommandResult(
298
+ exit_code=0,
299
+ title="Python runtime version contract",
300
+ message="Python 3.10+ is required for the canonical PrizmKit Python runtime.",
301
+ details=(f"minimum_python: {MIN_PYTHON[0]}.{MIN_PYTHON[1]}",),
302
+ )
303
+
304
+
305
+ def handle_diagnostics(action: str, paths: RuntimePaths | None = None) -> CommandResult:
306
+ """Dispatch diagnostics actions."""
307
+ if action == "paths":
308
+ return diagnostics_paths(paths)
309
+ if action == "entrypoints":
310
+ return diagnostics_entrypoints(paths)
311
+ if action == "version":
312
+ return diagnostics_version()
313
+ raise KeyError(f"Unknown diagnostics action: {action}")
@@ -0,0 +1,32 @@
1
+ """Python version compatibility guard for the unified runtime."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+ from collections.abc import Sequence
7
+
8
+ MIN_PYTHON = (3, 10)
9
+
10
+
11
+ class UnsupportedPythonVersion(RuntimeError):
12
+ """Raised when the unified runtime starts on an unsupported Python version."""
13
+
14
+
15
+ def _major_minor(version_info: Sequence[int] | object) -> tuple[int, int]:
16
+ """Extract a major/minor tuple from sys.version_info or a tuple-like value."""
17
+ major = getattr(version_info, "major", None)
18
+ minor = getattr(version_info, "minor", None)
19
+ if major is not None and minor is not None:
20
+ return int(major), int(minor)
21
+ return int(version_info[0]), int(version_info[1]) # type: ignore[index]
22
+
23
+
24
+ def ensure_supported_python(version_info: Sequence[int] | object | None = None) -> None:
25
+ """Validate that the current interpreter satisfies the Python 3.10+ contract."""
26
+ candidate = sys.version_info if version_info is None else version_info
27
+ major, minor = _major_minor(candidate)
28
+ if (major, minor) < MIN_PYTHON:
29
+ raise UnsupportedPythonVersion(
30
+ "PrizmKit unified Python CLI requires Python 3.10+; "
31
+ f"detected Python {major}.{minor}."
32
+ )