prizmkit 1.1.99 → 1.1.101

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 (321) 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 +345 -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 +147 -0
  26. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +422 -0
  27. package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +552 -0
  28. package/bundled/dev-pipeline/prizmkit_runtime/status.py +71 -0
  29. package/bundled/dev-pipeline/scripts/check-session-status.py +74 -1
  30. package/bundled/dev-pipeline/scripts/continuation.py +374 -0
  31. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +64 -52
  32. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +35 -25
  33. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +2 -2
  34. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +15 -20
  35. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +185 -16
  36. package/bundled/dev-pipeline/scripts/update-bug-status.py +214 -6
  37. package/bundled/dev-pipeline/scripts/update-feature-status.py +237 -6
  38. package/bundled/dev-pipeline/scripts/update-refactor-status.py +214 -6
  39. package/bundled/dev-pipeline/templates/agent-prompts/dev-implement.md +8 -2
  40. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +4 -0
  41. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +14 -5
  42. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +16 -6
  43. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +16 -6
  44. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +1 -1
  45. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +3 -3
  46. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +2 -0
  47. package/bundled/dev-pipeline/templates/sections/log-size-awareness.md +13 -69
  48. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +15 -7
  49. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +42 -29
  50. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +41 -39
  51. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +4 -0
  52. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +4 -0
  53. package/bundled/dev-pipeline/templates/session-status-schema.json +1 -1
  54. package/bundled/dev-pipeline/tests/conftest.py +1 -0
  55. package/bundled/dev-pipeline/tests/test_auto_skip.py +932 -0
  56. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +207 -0
  57. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +100 -0
  58. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +43 -0
  59. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +1138 -0
  60. package/bundled/dev-pipeline/tests/test_unified_cli.py +1045 -0
  61. package/bundled/skills/_metadata.json +1 -1
  62. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +29 -34
  63. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +6 -5
  64. package/bundled/skills/feature-pipeline-launcher/SKILL.md +29 -35
  65. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +7 -6
  66. package/bundled/skills/feature-workflow/SKILL.md +3 -6
  67. package/bundled/skills/recovery-workflow/SKILL.md +23 -32
  68. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +29 -35
  69. package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +7 -6
  70. package/bundled/skills/refactor-workflow/SKILL.md +3 -6
  71. package/bundled/templates/hooks/commit-intent.json +2 -2
  72. package/bundled/templates/hooks/diff-prizm-docs.py +226 -0
  73. package/bundled/templates/hooks/prizm-pre-commit.py +45 -0
  74. package/bundled/templates/hooks/validate-prizm-docs.py +240 -0
  75. package/package.json +1 -1
  76. package/src/config.js +33 -12
  77. package/src/index.js +3 -6
  78. package/src/manifest.js +3 -2
  79. package/src/metadata.js +7 -18
  80. package/src/prompts.js +0 -12
  81. package/src/runtimes.js +18 -11
  82. package/src/scaffold.js +133 -116
  83. package/src/upgrade.js +1 -1
  84. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +0 -500
  85. package/bundled/dev-pipeline/launch-feature-daemon.sh +0 -657
  86. package/bundled/dev-pipeline/launch-refactor-daemon.sh +0 -502
  87. package/bundled/dev-pipeline/lib/branch.sh +0 -326
  88. package/bundled/dev-pipeline/lib/common.sh +0 -1257
  89. package/bundled/dev-pipeline/lib/heartbeat.sh +0 -469
  90. package/bundled/dev-pipeline/reset-bug.sh +0 -395
  91. package/bundled/dev-pipeline/reset-feature.sh +0 -406
  92. package/bundled/dev-pipeline/reset-refactor.sh +0 -393
  93. package/bundled/dev-pipeline/run-bugfix.sh +0 -1315
  94. package/bundled/dev-pipeline/run-feature.sh +0 -1602
  95. package/bundled/dev-pipeline/run-recovery.sh +0 -648
  96. package/bundled/dev-pipeline/run-refactor.sh +0 -1348
  97. package/bundled/dev-pipeline/scripts/monitor-log.sh +0 -104
  98. package/bundled/dev-pipeline/tests/test-path-resolution.sh +0 -100
  99. package/bundled/dev-pipeline-windows/.env.example +0 -36
  100. package/bundled/dev-pipeline-windows/README.md +0 -30
  101. package/bundled/dev-pipeline-windows/SCHEMA_ANALYSIS.md +0 -533
  102. package/bundled/dev-pipeline-windows/assets/feature-list-example.json +0 -146
  103. package/bundled/dev-pipeline-windows/assets/prizm-dev-team-integration.md +0 -137
  104. package/bundled/dev-pipeline-windows/launch-bugfix-daemon.ps1 +0 -9
  105. package/bundled/dev-pipeline-windows/launch-feature-daemon.ps1 +0 -9
  106. package/bundled/dev-pipeline-windows/launch-refactor-daemon.ps1 +0 -9
  107. package/bundled/dev-pipeline-windows/lib/branch.ps1 +0 -235
  108. package/bundled/dev-pipeline-windows/lib/common.ps1 +0 -829
  109. package/bundled/dev-pipeline-windows/lib/daemon.ps1 +0 -140
  110. package/bundled/dev-pipeline-windows/lib/pipeline.ps1 +0 -967
  111. package/bundled/dev-pipeline-windows/lib/reset.ps1 +0 -87
  112. package/bundled/dev-pipeline-windows/reset-bug.ps1 +0 -9
  113. package/bundled/dev-pipeline-windows/reset-feature.ps1 +0 -9
  114. package/bundled/dev-pipeline-windows/reset-refactor.ps1 +0 -9
  115. package/bundled/dev-pipeline-windows/run-bugfix.ps1 +0 -9
  116. package/bundled/dev-pipeline-windows/run-feature.ps1 +0 -9
  117. package/bundled/dev-pipeline-windows/run-recovery.ps1 +0 -179
  118. package/bundled/dev-pipeline-windows/run-refactor.ps1 +0 -9
  119. package/bundled/dev-pipeline-windows/scripts/check-session-status.py +0 -228
  120. package/bundled/dev-pipeline-windows/scripts/detect-stuck.py +0 -530
  121. package/bundled/dev-pipeline-windows/scripts/generate-bootstrap-prompt.py +0 -2282
  122. package/bundled/dev-pipeline-windows/scripts/generate-bugfix-prompt.py +0 -767
  123. package/bundled/dev-pipeline-windows/scripts/generate-recovery-prompt.py +0 -805
  124. package/bundled/dev-pipeline-windows/scripts/generate-refactor-prompt.py +0 -845
  125. package/bundled/dev-pipeline-windows/scripts/init-bugfix-pipeline.py +0 -316
  126. package/bundled/dev-pipeline-windows/scripts/init-dev-team.py +0 -134
  127. package/bundled/dev-pipeline-windows/scripts/init-pipeline.py +0 -382
  128. package/bundled/dev-pipeline-windows/scripts/init-refactor-pipeline.py +0 -399
  129. package/bundled/dev-pipeline-windows/scripts/monitor-log.ps1 +0 -102
  130. package/bundled/dev-pipeline-windows/scripts/parse-stream-progress.py +0 -1232
  131. package/bundled/dev-pipeline-windows/scripts/patch-completion-notes.py +0 -191
  132. package/bundled/dev-pipeline-windows/scripts/prizmkit-test-gate.py +0 -446
  133. package/bundled/dev-pipeline-windows/scripts/update-bug-status.py +0 -913
  134. package/bundled/dev-pipeline-windows/scripts/update-checkpoint.py +0 -173
  135. package/bundled/dev-pipeline-windows/scripts/update-feature-status.py +0 -1558
  136. package/bundled/dev-pipeline-windows/scripts/update-refactor-status.py +0 -1119
  137. package/bundled/dev-pipeline-windows/scripts/utils.py +0 -542
  138. package/bundled/dev-pipeline-windows/templates/agent-prompts/critic-plan-challenge.md +0 -7
  139. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-fix.md +0 -7
  140. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-implement.md +0 -65
  141. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-resume.md +0 -5
  142. package/bundled/dev-pipeline-windows/templates/agent-prompts/reviewer-review.md +0 -7
  143. package/bundled/dev-pipeline-windows/templates/bootstrap-prompt.md +0 -73
  144. package/bundled/dev-pipeline-windows/templates/bootstrap-tier1.md +0 -589
  145. package/bundled/dev-pipeline-windows/templates/bootstrap-tier2.md +0 -710
  146. package/bundled/dev-pipeline-windows/templates/bootstrap-tier3.md +0 -791
  147. package/bundled/dev-pipeline-windows/templates/bug-fix-list-schema.json +0 -263
  148. package/bundled/dev-pipeline-windows/templates/bugfix-bootstrap-prompt.md +0 -326
  149. package/bundled/dev-pipeline-windows/templates/feature-list-schema.json +0 -237
  150. package/bundled/dev-pipeline-windows/templates/refactor-bootstrap-prompt.md +0 -340
  151. package/bundled/dev-pipeline-windows/templates/refactor-list-schema.json +0 -270
  152. package/bundled/dev-pipeline-windows/templates/sections/ac-verification-checklist.md +0 -7
  153. package/bundled/dev-pipeline-windows/templates/sections/checkpoint-system.md +0 -91
  154. package/bundled/dev-pipeline-windows/templates/sections/context-budget-rules.md +0 -34
  155. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-agent.md +0 -10
  156. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-full.md +0 -12
  157. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-lite.md +0 -7
  158. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-agent.md +0 -8
  159. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-full.md +0 -9
  160. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-lite.md +0 -6
  161. package/bundled/dev-pipeline-windows/templates/sections/failure-capture.md +0 -21
  162. package/bundled/dev-pipeline-windows/templates/sections/feature-context.md +0 -21
  163. package/bundled/dev-pipeline-windows/templates/sections/log-size-awareness.md +0 -78
  164. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-auto.md +0 -283
  165. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-opencli.md +0 -112
  166. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification.md +0 -168
  167. package/bundled/dev-pipeline-windows/templates/sections/phase-commit-full.md +0 -82
  168. package/bundled/dev-pipeline-windows/templates/sections/phase-commit.md +0 -75
  169. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-agent-suffix.md +0 -23
  170. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-base.md +0 -14
  171. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-lite-suffix.md +0 -19
  172. package/bundled/dev-pipeline-windows/templates/sections/phase-critic-plan-full.md +0 -63
  173. package/bundled/dev-pipeline-windows/templates/sections/phase-critic-plan.md +0 -42
  174. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-agent.md +0 -44
  175. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-full.md +0 -59
  176. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-lite.md +0 -39
  177. package/bundled/dev-pipeline-windows/templates/sections/phase-plan-agent.md +0 -27
  178. package/bundled/dev-pipeline-windows/templates/sections/phase-plan-lite.md +0 -27
  179. package/bundled/dev-pipeline-windows/templates/sections/phase-prizmkit-test.md +0 -39
  180. package/bundled/dev-pipeline-windows/templates/sections/phase-review-agent.md +0 -35
  181. package/bundled/dev-pipeline-windows/templates/sections/phase-review-full.md +0 -35
  182. package/bundled/dev-pipeline-windows/templates/sections/phase-specify-plan-full.md +0 -73
  183. package/bundled/dev-pipeline-windows/templates/sections/phase0-init.md +0 -13
  184. package/bundled/dev-pipeline-windows/templates/sections/phase0-test-baseline.md +0 -21
  185. package/bundled/dev-pipeline-windows/templates/sections/session-context.md +0 -5
  186. package/bundled/dev-pipeline-windows/templates/sections/subagent-timeout-recovery.md +0 -6
  187. package/bundled/dev-pipeline-windows/templates/sections/task-contract.md +0 -34
  188. package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-agent.md +0 -48
  189. package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-lite.md +0 -48
  190. package/bundled/dev-pipeline-windows/templates/session-status-schema.json +0 -83
  191. package/bundled/skills-windows/app-planner/SKILL.md +0 -296
  192. package/bundled/skills-windows/app-planner/assets/app-design-guide.md +0 -101
  193. package/bundled/skills-windows/app-planner/references/architecture-decisions.md +0 -52
  194. package/bundled/skills-windows/app-planner/references/brainstorm-guide.md +0 -101
  195. package/bundled/skills-windows/app-planner/references/frontend-design-guide.md +0 -71
  196. package/bundled/skills-windows/app-planner/references/infrastructure-convention-discovery.md +0 -108
  197. package/bundled/skills-windows/app-planner/references/project-brief-guide.md +0 -82
  198. package/bundled/skills-windows/app-planner/references/project-conventions-discovery.md +0 -59
  199. package/bundled/skills-windows/app-planner/references/project-state-detection.md +0 -90
  200. package/bundled/skills-windows/app-planner/references/red-team-checklist.md +0 -40
  201. package/bundled/skills-windows/app-planner/references/rules/backend/derivation-rules.md +0 -619
  202. package/bundled/skills-windows/app-planner/references/rules/backend/fixed-rules.md +0 -285
  203. package/bundled/skills-windows/app-planner/references/rules/backend/question-bank.md +0 -249
  204. package/bundled/skills-windows/app-planner/references/rules/backend/question-manifest.json +0 -46
  205. package/bundled/skills-windows/app-planner/references/rules/backend/template.md +0 -173
  206. package/bundled/skills-windows/app-planner/references/rules/database/derivation-rules.md +0 -382
  207. package/bundled/skills-windows/app-planner/references/rules/database/fixed-rules.md +0 -211
  208. package/bundled/skills-windows/app-planner/references/rules/database/question-bank.md +0 -184
  209. package/bundled/skills-windows/app-planner/references/rules/database/question-manifest.json +0 -39
  210. package/bundled/skills-windows/app-planner/references/rules/database/template.md +0 -158
  211. package/bundled/skills-windows/app-planner/references/rules/frontend/derivation-rules.md +0 -820
  212. package/bundled/skills-windows/app-planner/references/rules/frontend/fixed-rules.md +0 -188
  213. package/bundled/skills-windows/app-planner/references/rules/frontend/question-bank.md +0 -319
  214. package/bundled/skills-windows/app-planner/references/rules/frontend/question-manifest.json +0 -51
  215. package/bundled/skills-windows/app-planner/references/rules/frontend/template.md +0 -339
  216. package/bundled/skills-windows/app-planner/references/rules/mobile/derivation-rules.md +0 -649
  217. package/bundled/skills-windows/app-planner/references/rules/mobile/fixed-rules.md +0 -290
  218. package/bundled/skills-windows/app-planner/references/rules/mobile/question-bank.md +0 -232
  219. package/bundled/skills-windows/app-planner/references/rules/mobile/question-manifest.json +0 -47
  220. package/bundled/skills-windows/app-planner/references/rules/mobile/template.md +0 -175
  221. package/bundled/skills-windows/app-planner/references/rules-configuration.md +0 -46
  222. package/bundled/skills-windows/bug-fix-workflow/SKILL.md +0 -379
  223. package/bundled/skills-windows/bug-fix-workflow/references/bug-diagnosis.md +0 -41
  224. package/bundled/skills-windows/bug-planner/SKILL.md +0 -402
  225. package/bundled/skills-windows/bug-planner/assets/bug-confirmation-template.md +0 -43
  226. package/bundled/skills-windows/bug-planner/references/critic-and-verification.md +0 -44
  227. package/bundled/skills-windows/bug-planner/references/error-recovery.md +0 -73
  228. package/bundled/skills-windows/bug-planner/references/input-formats.md +0 -53
  229. package/bundled/skills-windows/bug-planner/references/schema-validation.md +0 -25
  230. package/bundled/skills-windows/bug-planner/references/severity-rules.md +0 -16
  231. package/bundled/skills-windows/bug-planner/scripts/validate-bug-list.py +0 -322
  232. package/bundled/skills-windows/bugfix-pipeline-launcher/SKILL.md +0 -304
  233. package/bundled/skills-windows/bugfix-pipeline-launcher/references/configuration.md +0 -84
  234. package/bundled/skills-windows/feature-pipeline-launcher/SKILL.md +0 -381
  235. package/bundled/skills-windows/feature-pipeline-launcher/references/configuration.md +0 -67
  236. package/bundled/skills-windows/feature-pipeline-launcher/scripts/preflight-check.py +0 -462
  237. package/bundled/skills-windows/feature-planner/SKILL.md +0 -397
  238. package/bundled/skills-windows/feature-planner/assets/evaluation-guide.md +0 -64
  239. package/bundled/skills-windows/feature-planner/assets/planning-guide.md +0 -214
  240. package/bundled/skills-windows/feature-planner/references/browser-interaction.md +0 -59
  241. package/bundled/skills-windows/feature-planner/references/completeness-review.md +0 -57
  242. package/bundled/skills-windows/feature-planner/references/decomposition-patterns.md +0 -75
  243. package/bundled/skills-windows/feature-planner/references/error-recovery.md +0 -90
  244. package/bundled/skills-windows/feature-planner/references/incremental-feature-planning.md +0 -112
  245. package/bundled/skills-windows/feature-planner/references/new-project-planning.md +0 -85
  246. package/bundled/skills-windows/feature-planner/scripts/validate-and-generate.py +0 -1020
  247. package/bundled/skills-windows/feature-workflow/SKILL.md +0 -374
  248. package/bundled/skills-windows/feature-workflow/references/brainstorm-guide.md +0 -137
  249. package/bundled/skills-windows/prizm-kit/SKILL.md +0 -93
  250. package/bundled/skills-windows/prizmkit-code-review/SKILL.md +0 -161
  251. package/bundled/skills-windows/prizmkit-code-review/references/dev-agent-prompt.md +0 -30
  252. package/bundled/skills-windows/prizmkit-code-review/references/review-report-template.md +0 -31
  253. package/bundled/skills-windows/prizmkit-code-review/references/reviewer-agent-prompt.md +0 -66
  254. package/bundled/skills-windows/prizmkit-code-review/scripts/check_loop.py +0 -186
  255. package/bundled/skills-windows/prizmkit-committer/SKILL.md +0 -89
  256. package/bundled/skills-windows/prizmkit-deploy/SKILL.md +0 -444
  257. package/bundled/skills-windows/prizmkit-deploy/references/ci-cd-workflows.md +0 -115
  258. package/bundled/skills-windows/prizmkit-deploy/references/cloud-platform-deploy.md +0 -93
  259. package/bundled/skills-windows/prizmkit-deploy/references/data-safety-examples.md +0 -120
  260. package/bundled/skills-windows/prizmkit-deploy/references/database-setup.md +0 -46
  261. package/bundled/skills-windows/prizmkit-deploy/references/deploy-config-schema.md +0 -148
  262. package/bundled/skills-windows/prizmkit-deploy/references/deploy-history-schema.md +0 -62
  263. package/bundled/skills-windows/prizmkit-deploy/references/deployment-modes.md +0 -50
  264. package/bundled/skills-windows/prizmkit-deploy/references/direct-upload.md +0 -26
  265. package/bundled/skills-windows/prizmkit-deploy/references/dns-setup.md +0 -42
  266. package/bundled/skills-windows/prizmkit-deploy/references/docker-deploy.md +0 -31
  267. package/bundled/skills-windows/prizmkit-deploy/references/firewall-setup.md +0 -37
  268. package/bundled/skills-windows/prizmkit-deploy/references/live-validation-notes.md +0 -21
  269. package/bundled/skills-windows/prizmkit-deploy/references/nginx-blue-green.md +0 -59
  270. package/bundled/skills-windows/prizmkit-deploy/references/ssh-bootstrap-flow.md +0 -49
  271. package/bundled/skills-windows/prizmkit-deploy/references/ssh-execution-flow.md +0 -41
  272. package/bundled/skills-windows/prizmkit-deploy/references/ssh-takeover.md +0 -20
  273. package/bundled/skills-windows/prizmkit-deploy/references/ssl-setup.md +0 -56
  274. package/bundled/skills-windows/prizmkit-implement/SKILL.md +0 -71
  275. package/bundled/skills-windows/prizmkit-init/SKILL.md +0 -356
  276. package/bundled/skills-windows/prizmkit-init/assets/project-brief-template.md +0 -82
  277. package/bundled/skills-windows/prizmkit-init/references/config-schema.md +0 -70
  278. package/bundled/skills-windows/prizmkit-init/references/rules/layer-detection.md +0 -41
  279. package/bundled/skills-windows/prizmkit-init/references/tech-stack-catalog.md +0 -13
  280. package/bundled/skills-windows/prizmkit-init/references/update-supplement.md +0 -9
  281. package/bundled/skills-windows/prizmkit-plan/SKILL.md +0 -102
  282. package/bundled/skills-windows/prizmkit-plan/assets/plan-template.md +0 -115
  283. package/bundled/skills-windows/prizmkit-plan/assets/spec-template.md +0 -73
  284. package/bundled/skills-windows/prizmkit-plan/references/clarify-guide.md +0 -67
  285. package/bundled/skills-windows/prizmkit-plan/references/examples.md +0 -85
  286. package/bundled/skills-windows/prizmkit-plan/references/verification-checklist.md +0 -60
  287. package/bundled/skills-windows/prizmkit-prizm-docs/SKILL.md +0 -129
  288. package/bundled/skills-windows/prizmkit-prizm-docs/assets/prizm-docs-format.md +0 -613
  289. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-init.md +0 -45
  290. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-rebuild.md +0 -15
  291. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-status.md +0 -14
  292. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-update.md +0 -19
  293. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-validate.md +0 -17
  294. package/bundled/skills-windows/prizmkit-retrospective/SKILL.md +0 -87
  295. package/bundled/skills-windows/prizmkit-retrospective/references/knowledge-injection-steps.md +0 -50
  296. package/bundled/skills-windows/prizmkit-retrospective/references/structural-sync-steps.md +0 -43
  297. package/bundled/skills-windows/prizmkit-test/SKILL.md +0 -227
  298. package/bundled/skills-windows/prizmkit-test/references/boundary-coverage-protocol.md +0 -220
  299. package/bundled/skills-windows/prizmkit-test/references/examples.md +0 -143
  300. package/bundled/skills-windows/prizmkit-test/references/service-boundary-test-catalog.md +0 -225
  301. package/bundled/skills-windows/prizmkit-test/references/test-generation-steps.md +0 -109
  302. package/bundled/skills-windows/prizmkit-test/references/test-report-template.md +0 -111
  303. package/bundled/skills-windows/prizmkit-test/scripts/validate_boundary_report.py +0 -347
  304. package/bundled/skills-windows/recovery-workflow/SKILL.md +0 -355
  305. package/bundled/skills-windows/recovery-workflow/evals/evals.json +0 -46
  306. package/bundled/skills-windows/recovery-workflow/references/detection.md +0 -58
  307. package/bundled/skills-windows/recovery-workflow/scripts/detect-recovery-state.py +0 -544
  308. package/bundled/skills-windows/refactor-pipeline-launcher/SKILL.md +0 -346
  309. package/bundled/skills-windows/refactor-pipeline-launcher/references/configuration.md +0 -72
  310. package/bundled/skills-windows/refactor-planner/SKILL.md +0 -398
  311. package/bundled/skills-windows/refactor-planner/assets/planning-guide.md +0 -292
  312. package/bundled/skills-windows/refactor-planner/references/behavior-preservation.md +0 -301
  313. package/bundled/skills-windows/refactor-planner/references/fast-path.md +0 -59
  314. package/bundled/skills-windows/refactor-planner/references/planning-phases.md +0 -135
  315. package/bundled/skills-windows/refactor-planner/references/refactor-scoping-guide.md +0 -221
  316. package/bundled/skills-windows/refactor-planner/scripts/validate-and-generate-refactor.py +0 -858
  317. package/bundled/skills-windows/refactor-workflow/SKILL.md +0 -343
  318. package/bundled/skills-windows/refactor-workflow/references/brainstorm-guide.md +0 -116
  319. package/bundled/templates/hooks/diff-prizm-docs.sh +0 -158
  320. package/bundled/templates/hooks/prizm-pre-commit.sh +0 -108
  321. package/bundled/templates/hooks/validate-prizm-docs.sh +0 -139
@@ -1,109 +0,0 @@
1
- # Test Generation Steps (Phase 5)
2
-
3
- ## Scope Guard
4
-
5
- Before generating any test, determine whether the run is `scope=this-change`.
6
-
7
- For `scope=this-change`, use `generation_policy=in-scope-only` by default. Generate tests only for the in-scope source/test set built from the feature artifact directory and changed files. If a missing test is unrelated to the feature, record it in `Out of Scope Gaps` and do not generate it. Do not infer this-change scope from `.prizmkit/bugfix/` or `.prizmkit/refactor/`.
8
-
9
-
10
- Generate tests from the Phase 4 Boundary Coverage Matrix in priority order: unit → integration → E2E. After each batch, run immediately.
11
-
12
- When generated tests fail, distinguish two cases:
13
- - **Test bug** (syntax error, wrong import, wrong mock, wrong framework API usage) → fix the test and re-run
14
- - **Assertion failure** (test is valid but code returns unexpected result) → mark as "needs review" in report; do NOT modify production code. This is a potential bug discovered by the generated test.
15
-
16
- If a test fails repeatedly after 2 fix attempts, skip it and mark as "unresolved" in the report.
17
-
18
- ## 5a. Boundary Matrix First
19
-
20
- Before writing any new test, create or update the per-interface Boundary Test Matrix from `references/boundary-coverage-protocol.md`. This step matters because a test suite with broad happy-path coverage can still miss the conditions that cause production failures: invalid input, unauthorized access, ownership mistakes, state transitions, dependency errors, and product-specific invariants.
21
-
22
- For each in-scope interface or endpoint:
23
- - Identify existing happy-path coverage.
24
- - Identify existing boundary coverage by reading test assertions, not just test names.
25
- - Classify applicable categories: request validation, auth/permission/ownership, domain invariants, collection/pagination, date/time, state transitions, dependency failure, and response contract.
26
- - Mark non-applicable categories as `N/A` with a concrete reason.
27
- - Mark applicable uncovered categories as `boundary-missing`.
28
-
29
- Do not generate only happy-path tests. If happy path is missing, generate it, then continue with applicable boundary tests in the same batch.
30
-
31
- ### Existing Test Evaluation
32
-
33
- An existing test counts as boundary coverage only when it:
34
- - targets the same interface/endpoint,
35
- - sends the relevant boundary input or creates the relevant state/dependency failure,
36
- - asserts the expected business code, exception, response shape, state change, or side effect,
37
- - verifies behavior beyond "HTTP 200" or "non-empty response".
38
-
39
- A test that only checks the route returns successfully is happy-path coverage, not boundary coverage.
40
-
41
- ### API Endpoint Boundary Discovery
42
-
43
- For API endpoints, derive boundary cases from:
44
- - OpenAPI request schemas and response schemas,
45
- - handler binding tags and request parsing behavior,
46
- - service validation logic,
47
- - repository/service error handling,
48
- - Prizm L2 TRAPS and DECISIONS,
49
- - existing tests and source behavior,
50
- - product rules in project brief/specs.
51
-
52
- Map each endpoint to business-specific cases. Examples:
53
- - `POST /auth/refresh`: missing token, malformed token, reused/rotated token, revoked token, token-version race if testable.
54
- - `POST /meals/update`: missing ID, missing foods, invalid meal type, invalid timestamp, not found, wrong owner, recomputed totals, confirmed state transition.
55
- - `POST /stats/trends`: invalid type, invalid period, invalid date range, empty data, each supported trend type, inclusive end date behavior.
56
- - `POST /upload/sign-url`: unsupported content type, file_count 0/default/max/max+1, scene handling, storage provider failure.
57
-
58
- ## 5b. Unit Tests (always applicable)
59
-
60
- For each in-scope uncovered interface:
61
- - Read the source file to understand function signature, branch logic, dependencies, state changes, side effects, and failure paths.
62
- - Classify the function/class method by service responsibility using names, module path, parameters, dependencies, and related Prizm docs/spec acceptance criteria.
63
- - Read `references/service-boundary-test-catalog.md` when the unit is service-like or has business-specific inputs — it maps service responsibilities to boundary cases such as auth/session, payment/wallet, repository, pagination, file storage, notification, queue, cache/idempotency, API client, and date/expiration behavior.
64
- - Build a Unit Test Case Matrix before writing tests. Include generic boundaries plus every applicable service-specific boundary; mark non-applicable categories as `N/A` with a short reason instead of silently skipping them.
65
- - Generate test file matching project conventions (framework, naming, directory, import style, mock/fixture patterns)
66
- - Common naming patterns to match:
67
- - `src/foo.ts` → `src/__tests__/foo.test.ts` or `src/foo.spec.ts` or `tests/foo_test.py`
68
- - Mirror the existing pattern; if no tests exist, use the framework's default convention
69
- - Cover: happy path, service-specific boundary cases, edge cases (null/undefined/empty), error conditions, branch paths, boundary values, state/side effects, and dependency failures.
70
- - Verify mocks for dependency method calls, call count/order/arguments when the behavior depends on collaborators.
71
- - Do NOT test framework internals or third-party library behavior
72
- - Run tests immediately after generating
73
-
74
- ## 5c. Integration Tests
75
-
76
- For each in-scope module with dependencies:
77
- - Generate tests for the module's primary interface exercising its real dependencies.
78
- - If API endpoints exist, generate request/response tests for every applicable boundary category in the Boundary Matrix, not only valid input. Cover auth, missing params, invalid formats/enums, ownership/not-found, state transitions, and response envelope or schema.
79
- - If database operations exist, generate CRUD tests using the project's existing test database config when available. Cover transactions, duplicate keys, soft-delete visibility, rollback, and query boundary behavior when applicable.
80
- - If a dependency failure is not practical at integration level, mark it `N/A` with the reason and cover it in a unit test where mocks are available.
81
- - Run tests immediately after generating.
82
-
83
- ## 5d. E2E Tests (conditional)
84
-
85
- Preconditions (ALL must be met):
86
- - Playwright is available (`@playwright/test` or `playwright` in package.json dependencies, or `npx playwright --version` succeeds as fallback)
87
- - Playwright browsers are installed (check `npx playwright install --dry-run 2>/dev/null` exits cleanly, or `node_modules/.cache/ms-playwright/` directory exists; if missing, warn in report and skip E2E)
88
- - Project has a UI layer
89
- - Project can be started (start/dev script in package.json)
90
- - Acceptance criteria exist in spec.md files
91
-
92
- If ALL met:
93
- - **Before starting dev server**: detect whether it's already running: (1) check `package.json` scripts for port flags (`--port`, `-p`, `PORT=`), (2) fall back to framework defaults (3000 for React/Next/Express, 5173 for Vite, 8000 for Django, 5000 for Flask), (3) if still unknown, ask the user. Use the detected port in `lsof -i :<port>` to check. If running, tell user: "Dev server appears to be already running on port {N}. Use this running instance for E2E tests?" If user confirms, use existing instance. If user declines, skip E2E.
94
- - Start the project dev server (only if not already running). Wait for it to be ready.
95
- - For each in-scope uncovered acceptance criterion, generate a Playwright test script.
96
- - Include boundary user journeys when acceptance criteria mention validation, permissions, empty states, error messages, or lifecycle transitions.
97
- - Run generated E2E tests, capture screenshots of failure.
98
- - **Only stop dev server if you started it.** Never stop a server that was already running.
99
-
100
- If NOT met:
101
- - Note what was skipped and why in the report
102
- - If only the server wasn't startable: still generate E2E script files but mark as "not run — manual execution needed"
103
-
104
- ## 5e. Boundary Completion Check
105
-
106
- After generating and running tests:
107
- - Update the Boundary Matrix statuses based on passing tests and `needs-review` findings.
108
- - If any interface remains `boundary-missing` or happy-path-only, run another targeted generation pass for those categories before final reporting.
109
- - Stop only when all in-scope interfaces are `boundary-covered`, `generated-needs-review`, or `skipped-with-reason`, or when remaining gaps are explicitly listed as unresolved.
@@ -1,111 +0,0 @@
1
- # Test Report Output Template
2
-
3
- Used in Phase 6 of `/prizmkit-test`. Create `.prizmkit/test/{YYYY_MM_DD_HH_MM_SS}_testresult/` directory and write `test-report.md`.
4
-
5
- ## test-report.md Format
6
-
7
- ```markdown
8
- # Test Report — {timestamp}
9
-
10
- ## Summary
11
- - Scope: {full / module: name / feature: ###-name}
12
- - Architecture: {frontend / backend / fullstack}
13
- - Test framework: {name}
14
- - Mode: {interactive / headless}
15
-
16
- ## Scope
17
- - Mode: {full-project / module:<name> / feature:<slug> / this-change}
18
- - Artifact Dir: {none / .prizmkit/specs/<FEATURE_SLUG>/}
19
- - Diff Base: {ref or none}
20
- - Changed Files Source: {changed_files / diff_base / plan.md / context-snapshot.md / spec.md / not applicable}
21
- - Generation Policy: {in-scope-only / full-project}
22
- - In-Scope Source Files:
23
- - {...}
24
- - In-Scope Test Files:
25
- - {...}
26
-
27
-
28
- ## Existing Tests Run
29
- - Total: {N} | Passed: {N} | Failed: {N}
30
- {failed test details or "All passing"}
31
- {or "No existing tests found — generated first batch"}
32
-
33
- ## Coverage Gaps Found
34
- | Module | Interface | Type | Status |
35
- |--------|-----------|------|--------|
36
- | ... | ... | unit/integration/e2e | covered / generated / needs-review / unresolved / skipped / boundary-missing |
37
-
38
- ## Boundary Matrix
39
- | Module | Interface | Service Type | Happy Path | Request Validation | Auth / Permission / Ownership | Domain Invariants | Collection / Pagination | Date / Time | State Transitions | Dependency Failure | Response Contract | N/A Reasons | Final Status |
40
- |--------|-----------|--------------|------------|--------------------|-------------------------------|-------------------|-------------------------|-------------|-------------------|-------------------|-------------------|-------------|--------------|
41
- | ... | ... | auth/repository/upload/etc. | covered/generated/skipped | covered/generated/needs-review/skipped/boundary-missing | ... | ... | ... | ... | ... | ... | ... | category — reason | boundary-covered / generated-needs-review / skipped-with-reason / boundary-missing |
42
-
43
- ## Boundary Completion Gate
44
- - Interfaces total: {N}
45
- - Boundary-covered: {N}
46
- - Generated-needs-review: {N}
47
- - Skipped-with-reason: {N}
48
- - Boundary-missing: {N}
49
- - Happy-path-only: {N}
50
- - Completion gate passed: {yes / no}
51
-
52
- If `Boundary-missing > 0` or `Happy-path-only > 0`, write:
53
- `Tests may pass, but boundary coverage is incomplete.`
54
-
55
- ## Boundary Coverage Notes
56
- | Module | Interface | Boundary Categories Covered | Missing Applicable Boundaries | N/A Categories with Reasons |
57
- |--------|-----------|-----------------------------|-------------------------------|-----------------------------|
58
- | ... | ... | request validation, ownership, dependency failure | invalid timestamp, repo failure | pagination — endpoint has no list semantics |
59
-
60
- ## Generated / Updated Tests
61
- - Unit: {N} generated, {N} needs-review, {N} unresolved
62
- - Integration: {N} generated, {N} needs-review, {N} unresolved
63
- - E2E: {N} generated, {N} skipped ({reason})
64
-
65
- ## Boundary Validation
66
- - Validator command: `{command or "not run — reason"}`
67
- - Validator result: {passed / failed / skipped}
68
- - Validator output: {summary or path to raw output}
69
-
70
- ## In-Scope Failures
71
- - {failures caused by this-change scope, or "None"}
72
-
73
- ## Baseline Failures
74
- - {pre-existing failures, or "None"}
75
-
76
- ## Out of Scope Gaps
77
- - {unrelated historical gaps; informational only for scope=this-change}
78
-
79
- ## Verdict
80
- PASS | NEEDS_FIXES | BLOCKED
81
-
82
- ## Final Status
83
- - All tests passing: {yes / no}
84
- - Boundary completion gate passed: {yes / no}
85
- - Ready for commit: {yes / no — include reason}
86
- - Needs human review: {list of tests/interfaces marked needs-review}
87
- {remaining failures if any}
88
- ```
89
-
90
- ## Artifacts
91
-
92
- Also save alongside `test-report.md`:
93
- - `existing-test-output.txt` — raw output from Phase 2
94
- - `generated-tests/` — copies of all generated test files
95
- - `e2e-output/` — E2E logs and failure screenshots (if applicable)
96
- - `boundary-validation-output.txt` — output from `scripts/validate_boundary_report.py` when run
97
-
98
- ## Final Status Rules
99
-
100
- Use these rules so the report does not overstate quality:
101
-
102
- | Tests Passing | Boundary Gate | Needs Review | Ready for Commit |
103
- |---------------|---------------|--------------|------------------|
104
- | yes | yes | no | yes |
105
- | yes | yes | yes | no — human review required |
106
- | yes | no | any | no — boundary coverage incomplete |
107
- | no | any | any | no — tests failing |
108
-
109
- Do not write "All tests passing. Ready for commit." if any interface is `boundary-missing`, `happy-path-only`, `unresolved`, or `needs-review`.
110
-
111
- Out-of-scope gaps are informational only. They must not trigger generated tests and must not fail a `scope=this-change` run.
@@ -1,347 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Validate a prizmkit-test report's boundary coverage gate.
4
-
5
- Usage:
6
- python3 scripts/validate_boundary_report.py --report .prizmkit/test/.../test-report.md
7
- python3 scripts/validate_boundary_report.py --report .prizmkit/test/.../test-report.md --openapi openapi.yaml
8
-
9
- The script intentionally performs deterministic structural checks only. It cannot prove that every
10
- business boundary is semantically correct, but it prevents reports from silently claiming completion
11
- when interfaces are missing from the Boundary Matrix or remain happy-path-only / boundary-missing.
12
- """
13
-
14
- from __future__ import annotations
15
-
16
- import argparse
17
- import re
18
- import sys
19
- from pathlib import Path
20
- from typing import Dict, List, Set, Tuple
21
-
22
- ALLOWED_FINAL_STATUSES = {
23
- "boundary-covered",
24
- "generated-needs-review",
25
- "skipped-with-reason",
26
- }
27
- INCOMPLETE_MARKERS = {
28
- "boundary-missing",
29
- "happy-path-only",
30
- "unresolved",
31
- }
32
- REQUIRED_SECTIONS = [
33
- "## Boundary Matrix",
34
- "## Boundary Completion Gate",
35
- "## Final Status",
36
- ]
37
- REQUIRED_BOUNDARY_COLUMNS = [
38
- "Module",
39
- "Interface",
40
- "Service Type",
41
- "Happy Path",
42
- "Request Validation",
43
- "Auth / Permission / Ownership",
44
- "Domain Invariants",
45
- "Collection / Pagination",
46
- "Date / Time",
47
- "State Transitions",
48
- "Dependency Failure",
49
- "Response Contract",
50
- "N/A Reasons",
51
- "Final Status",
52
- ]
53
- BOUNDARY_CATEGORY_COLUMNS = [
54
- "Happy Path",
55
- "Request Validation",
56
- "Auth / Permission / Ownership",
57
- "Domain Invariants",
58
- "Collection / Pagination",
59
- "Date / Time",
60
- "State Transitions",
61
- "Dependency Failure",
62
- "Response Contract",
63
- ]
64
-
65
-
66
- def read_text(path: Path) -> str:
67
- try:
68
- return path.read_text(encoding="utf-8")
69
- except FileNotFoundError:
70
- raise SystemExit(f"FAIL: file not found: {path}")
71
-
72
-
73
- HTTP_METHODS = {"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "TRACE"}
74
-
75
-
76
- def extract_openapi_paths(openapi_text: str) -> List[str]:
77
- """Extract OpenAPI path keys without requiring PyYAML.
78
-
79
- Supports common YAML forms inside the `paths:` mapping:
80
- - /users:
81
- - "/users/{id}":
82
- - '/users/{id}':
83
- """
84
- return [path for _method, path in extract_openapi_operations(openapi_text)]
85
-
86
-
87
- def extract_openapi_operations(openapi_text: str) -> List[Tuple[str, str]]:
88
- """Extract OpenAPI method+path operations without requiring PyYAML."""
89
- operations: List[Tuple[str, str]] = []
90
- in_paths = False
91
- paths_indent = 0
92
- current_path = ""
93
- current_path_indent = 0
94
- path_key_re = re.compile(
95
- r"^\s*(?:(['\"])(/.*?)\1|(/[^:\s]+))\s*:\s*(?:#.*)?$"
96
- )
97
- method_re = re.compile(r"^\s*([A-Za-z]+)\s*:\s*(?:#.*)?$")
98
-
99
- for raw_line in openapi_text.splitlines():
100
- stripped = raw_line.strip()
101
- if not stripped or stripped.startswith("#"):
102
- continue
103
-
104
- indent = len(raw_line) - len(raw_line.lstrip())
105
- if not in_paths:
106
- if re.match(r"^\s*paths\s*:\s*(?:#.*)?$", raw_line):
107
- in_paths = True
108
- paths_indent = indent
109
- continue
110
-
111
- if indent <= paths_indent:
112
- break
113
-
114
- path_match = path_key_re.match(raw_line)
115
- if path_match:
116
- current_path = path_match.group(2) or path_match.group(3) or ""
117
- current_path_indent = indent
118
- continue
119
-
120
- method_match = method_re.match(raw_line)
121
- if current_path and method_match and indent > current_path_indent:
122
- method = method_match.group(1).upper()
123
- if method in HTTP_METHODS:
124
- operations.append((method, current_path))
125
-
126
- return operations
127
-
128
-
129
- def extract_section(text: str, heading: str) -> str:
130
- start = text.find(heading)
131
- if start == -1:
132
- return ""
133
- rest = text[start + len(heading) :]
134
- match = re.search(r"\n## ", rest)
135
- if not match:
136
- return rest
137
- return rest[: match.start()]
138
-
139
-
140
- def split_markdown_row(line: str) -> List[str]:
141
- return [cell.strip() for cell in line.strip().strip("|").split("|")]
142
-
143
-
144
- def parse_boundary_matrix(text: str) -> Tuple[List[str], List[Dict[str, str]]]:
145
- section = extract_section(text, "## Boundary Matrix")
146
- if not section:
147
- return [], []
148
-
149
- lines = [line.strip() for line in section.splitlines() if line.strip().startswith("|")]
150
- header_index = -1
151
- for idx, line in enumerate(lines):
152
- cells = split_markdown_row(line)
153
- if "Interface" in cells and "Final Status" in cells:
154
- header_index = idx
155
- break
156
- if header_index == -1:
157
- return [], []
158
-
159
- headers = split_markdown_row(lines[header_index])
160
- rows: List[Dict[str, str]] = []
161
- for line in lines[header_index + 1 :]:
162
- cells = split_markdown_row(line)
163
- if all(re.fullmatch(r":?-{3,}:?", cell) for cell in cells):
164
- continue
165
- if len(cells) < len(headers):
166
- cells.extend([""] * (len(headers) - len(cells)))
167
- row = {header: cells[i] if i < len(cells) else "" for i, header in enumerate(headers)}
168
- # Ignore example placeholder rows that were accidentally left in templates.
169
- if row.get("Interface", "").strip(".` ") in {"...", ""}:
170
- continue
171
- rows.append(row)
172
- return headers, rows
173
-
174
-
175
- def has_inline_reason(value: str) -> bool:
176
- normalized = value.strip().lower()
177
- if not normalized:
178
- return False
179
- if "—" in value or " - " in value or ":" in value:
180
- return True
181
- # Accept phrases longer than a bare status marker.
182
- bare = {"n/a", "na", "skipped", "skip"}
183
- return normalized not in bare and (normalized.startswith("n/a ") or normalized.startswith("skipped "))
184
-
185
-
186
- def extract_matrix_operations(interface_values: List[str]) -> Tuple[Set[Tuple[str, str]], Set[str]]:
187
- """Extract method+path and path-only tokens from Boundary Matrix Interface cells."""
188
- operations: Set[Tuple[str, str]] = set()
189
- path_only: Set[str] = set()
190
- token_re = re.compile(
191
- r"(?:(\b(?:GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS|TRACE)\b)\s+)?(/[^\s,`|)]+)",
192
- flags=re.IGNORECASE,
193
- )
194
- for value in interface_values:
195
- for match in token_re.finditer(value):
196
- method = match.group(1).upper() if match.group(1) else ""
197
- path = normalize_path(match.group(2))
198
- if not path:
199
- continue
200
- if method:
201
- operations.add((method, path))
202
- else:
203
- path_only.add(path)
204
- return operations, path_only
205
-
206
-
207
- def normalize_path(path: str) -> str:
208
- normalized = path.strip().strip("'\"`")
209
- if len(normalized) > 1:
210
- normalized = normalized.rstrip("/")
211
- return normalized
212
-
213
-
214
- def validate_report(report_text: str, openapi_paths: List[str] | None,
215
- openapi_operations: List[Tuple[str, str]] | None = None) -> List[str]:
216
- errors: List[str] = []
217
-
218
- for section in REQUIRED_SECTIONS:
219
- if section not in report_text:
220
- errors.append(f"missing required section: {section}")
221
-
222
- headers, rows = parse_boundary_matrix(report_text)
223
- if not rows:
224
- errors.append("Boundary Matrix table is missing or empty")
225
- return errors
226
-
227
- for column in REQUIRED_BOUNDARY_COLUMNS:
228
- if column not in headers:
229
- errors.append(f"Boundary Matrix missing required column: {column}")
230
-
231
- final_statuses = []
232
- interface_values = []
233
- for idx, row in enumerate(rows, start=1):
234
- interface = row.get("Interface", "").strip()
235
- interface_values.append(interface)
236
-
237
- final_status = row.get("Final Status", "").strip().lower()
238
- final_statuses.append(final_status)
239
- if not final_status:
240
- errors.append(f"row {idx} ({interface}) missing Final Status")
241
- elif final_status not in ALLOWED_FINAL_STATUSES:
242
- errors.append(
243
- f"row {idx} ({interface}) has invalid/incomplete Final Status: {row.get('Final Status', '')}"
244
- )
245
-
246
- for column in BOUNDARY_CATEGORY_COLUMNS:
247
- if column in headers and not row.get(column, "").strip():
248
- errors.append(f"row {idx} ({interface}) missing boundary category value: {column}")
249
-
250
- for header, value in row.items():
251
- normalized = value.strip().lower()
252
- if any(marker in normalized for marker in INCOMPLETE_MARKERS):
253
- errors.append(f"row {idx} ({interface}) has incomplete marker in {header}: {value}")
254
-
255
- n_a_reasons = row.get("N/A Reasons", "").strip()
256
- for header, value in row.items():
257
- if header in {"Module", "Interface", "Service Type", "Final Status", "N/A Reasons"}:
258
- continue
259
- normalized = value.strip().lower()
260
- if normalized in {"n/a", "na", "skipped", "skip"} and not n_a_reasons:
261
- errors.append(f"row {idx} ({interface}) marks {header} as {value} without N/A reason")
262
- if ("skipped" in normalized or normalized.startswith("n/a")) and not (n_a_reasons or has_inline_reason(value)):
263
- errors.append(f"row {idx} ({interface}) marks {header} as {value} without concrete reason")
264
-
265
- if openapi_operations is not None:
266
- matrix_operations, matrix_path_only = extract_matrix_operations(interface_values)
267
- for method, path in openapi_operations:
268
- normalized_path = normalize_path(path)
269
- if (method, normalized_path) not in matrix_operations:
270
- if normalized_path in matrix_path_only:
271
- errors.append(
272
- "OpenAPI operation missing from Boundary Matrix: "
273
- f"{method} {path} (path-only row is ambiguous)"
274
- )
275
- else:
276
- errors.append(
277
- f"OpenAPI operation missing from Boundary Matrix: {method} {path}"
278
- )
279
- elif openapi_paths is not None:
280
- _matrix_operations, matrix_path_only = extract_matrix_operations(interface_values)
281
- missing_paths = [path for path in openapi_paths
282
- if normalize_path(path) not in matrix_path_only]
283
- for path in missing_paths:
284
- errors.append(f"OpenAPI path missing from Boundary Matrix: {path}")
285
-
286
- gate_section = extract_section(report_text, "## Boundary Completion Gate")
287
- if gate_section:
288
- for label in ["Interfaces total", "Boundary-covered", "Boundary-missing", "Happy-path-only", "Completion gate passed"]:
289
- if label not in gate_section:
290
- errors.append(f"Boundary Completion Gate missing metric: {label}")
291
- for label in ["Boundary-missing", "Happy-path-only"]:
292
- match = re.search(rf"{re.escape(label)}:\s*(\d+)", gate_section)
293
- if match and int(match.group(1)) > 0:
294
- errors.append(f"Boundary Completion Gate reports {label}: {match.group(1)}")
295
- if re.search(r"Completion gate passed:\s*no", gate_section, flags=re.IGNORECASE):
296
- errors.append("Boundary Completion Gate reports failure")
297
-
298
- final_section = extract_section(report_text, "## Final Status")
299
- if final_section:
300
- if re.search(r"Ready for commit:\s*yes", final_section, flags=re.IGNORECASE):
301
- if any(status != "boundary-covered" for status in final_statuses):
302
- errors.append("Final Status says ready for commit but not every interface is boundary-covered")
303
- review_match = re.search(r"Needs human review:\s*(.+)", final_section, flags=re.IGNORECASE)
304
- if review_match and review_match.group(1).strip().lower() not in {"none", "no", "n/a", ""}:
305
- errors.append("Final Status says ready for commit while human review is still needed")
306
-
307
- return errors
308
-
309
-
310
- def main() -> int:
311
- parser = argparse.ArgumentParser(description="Validate prizmkit-test boundary coverage report")
312
- parser.add_argument("--report", required=True, help="Path to test-report.md")
313
- parser.add_argument("--openapi", help="Optional OpenAPI file whose paths must appear in Boundary Matrix")
314
- args = parser.parse_args()
315
-
316
- report_path = Path(args.report)
317
- report_text = read_text(report_path)
318
-
319
- openapi_paths = None
320
- openapi_operations = None
321
- if args.openapi:
322
- openapi_path = Path(args.openapi)
323
- if openapi_path.exists():
324
- openapi_text = read_text(openapi_path)
325
- openapi_operations = extract_openapi_operations(openapi_text)
326
- openapi_paths = [path for _method, path in openapi_operations]
327
- else:
328
- print(f"WARN: OpenAPI file not found, skipping path coverage check: {openapi_path}")
329
-
330
- errors = validate_report(report_text, openapi_paths, openapi_operations)
331
- if errors:
332
- print("Boundary report validation: FAIL")
333
- for error in errors:
334
- print(f"- {error}")
335
- return 1
336
-
337
- print("Boundary report validation: PASS")
338
- print(f"Report: {report_path}")
339
- if openapi_operations is not None:
340
- print(f"OpenAPI operations checked: {len(openapi_operations)}")
341
- elif openapi_paths is not None:
342
- print(f"OpenAPI paths checked: {len(openapi_paths)}")
343
- return 0
344
-
345
-
346
- if __name__ == "__main__":
347
- sys.exit(main())