prizmkit 1.1.129 → 1.1.131

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 (88) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/.env.example +1 -1
  3. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +445 -8
  4. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +87 -66
  5. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +53 -3
  6. package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +55 -25
  7. package/bundled/dev-pipeline/prizmkit_runtime/runner_status.py +4 -0
  8. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +15 -1
  9. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +398 -6
  10. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +61 -3
  11. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +64 -4
  12. package/bundled/dev-pipeline/scripts/prompt_framework.py +156 -7
  13. package/bundled/dev-pipeline/scripts/update-bug-status.py +53 -0
  14. package/bundled/dev-pipeline/scripts/update-checkpoint.py +294 -69
  15. package/bundled/dev-pipeline/scripts/update-feature-status.py +57 -0
  16. package/bundled/dev-pipeline/scripts/update-refactor-status.py +53 -0
  17. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +2 -2
  18. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +20 -14
  19. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +21 -4
  20. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +18 -0
  21. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +1 -1
  22. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +5 -15
  23. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +21 -0
  24. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +10 -10
  25. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +16 -0
  26. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +26 -23
  27. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +12 -8
  28. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +1 -1
  29. package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +21 -0
  30. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +362 -3
  31. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +404 -24
  32. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +132 -0
  33. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +91 -0
  34. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +411 -18
  35. package/bundled/dev-pipeline/tests/test_unified_cli.py +3 -3
  36. package/bundled/skills/_metadata.json +62 -25
  37. package/bundled/skills/app-planner/SKILL.md +4 -3
  38. package/bundled/skills/bug-fix-workflow/SKILL.md +89 -180
  39. package/bundled/skills/bug-planner/SKILL.md +12 -27
  40. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +131 -220
  41. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +36 -90
  42. package/bundled/skills/feature-pipeline-launcher/SKILL.md +129 -271
  43. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +35 -76
  44. package/bundled/skills/feature-planner/SKILL.md +27 -22
  45. package/bundled/skills/feature-planner/assets/planning-guide.md +4 -4
  46. package/bundled/skills/feature-workflow/SKILL.md +94 -121
  47. package/bundled/skills/prizmkit/SKILL.md +130 -94
  48. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +181 -0
  49. package/bundled/skills/prizmkit-code-review/SKILL.md +114 -84
  50. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +1 -1
  51. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +181 -0
  52. package/bundled/skills/prizmkit-committer/SKILL.md +131 -47
  53. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +181 -0
  54. package/bundled/skills/prizmkit-implement/SKILL.md +99 -73
  55. package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +1 -1
  56. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +181 -0
  57. package/bundled/skills/prizmkit-init/SKILL.md +5 -5
  58. package/bundled/skills/prizmkit-plan/SKILL.md +132 -105
  59. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +181 -0
  60. package/bundled/skills/prizmkit-retrospective/SKILL.md +111 -53
  61. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +7 -6
  62. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +5 -4
  63. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +181 -0
  64. package/bundled/skills/prizmkit-test/SKILL.md +28 -6
  65. package/bundled/skills/prizmkit-test/references/examples.md +1 -1
  66. package/bundled/skills/prizmkit-test/references/test-report-template.md +1 -1
  67. package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +181 -0
  68. package/bundled/skills/prizmkit-workflow/SKILL.md +266 -0
  69. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +181 -0
  70. package/bundled/skills/recovery-workflow/SKILL.md +62 -241
  71. package/bundled/skills/recovery-workflow/evals/evals.json +17 -33
  72. package/bundled/skills/recovery-workflow/references/detection.md +28 -52
  73. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +105 -439
  74. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +136 -275
  75. package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +53 -88
  76. package/bundled/skills/refactor-planner/SKILL.md +12 -57
  77. package/bundled/skills/refactor-planner/references/behavior-preservation.md +111 -230
  78. package/bundled/skills/refactor-planner/references/error-recovery.md +37 -0
  79. package/bundled/skills/refactor-planner/references/planning-phases.md +11 -17
  80. package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +1 -1
  81. package/bundled/skills/refactor-workflow/SKILL.md +98 -139
  82. package/bundled/templates/project-memory-template.md +4 -4
  83. package/package.json +1 -1
  84. package/src/index.js +4 -0
  85. package/src/prompts.js +10 -3
  86. package/src/scaffold.js +1 -1
  87. package/bundled/dev-pipeline/tests/test-deploy-safety.sh +0 -223
  88. package/bundled/skills/feature-pipeline-launcher/scripts/preflight-check.py +0 -462
@@ -237,37 +237,43 @@ For each Verification Gate from the Task Contract, write one evidence line to Im
237
237
 
238
238
  ### Review — Code Review
239
239
 
240
- Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so `/prizmkit-code-review` can read the spec, plan, context snapshot, implementation log, and current diff. Do not require or read a prior `/prizmkit-test` report here; test generation and test-fix looping happen in the next phase.
240
+ Review the completed implementation before the full Feature test gate. Run `/prizmkit-code-review artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` in the current Main Agent; never delegate review directly or indirectly. The current Main Agent is the only Code Review executor. Do not invoke another review skill or review workflow, and do not relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep.
241
241
 
242
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The current Main Agent is the only Code Review executor: it directly reviews, repairs accepted findings, verifies repairs, and converges when accepted and unresolved findings are both zero.
242
+ - `REVIEW_PASS` record `stage=code-review`, `status=REVIEW_PASS`, `stage_result=PASS`, `next_stage=prizmkit-test`, and `resume_from=prizmkit-test`; then run the test gate.
243
+ - `REVIEW_NEEDS_FIXES` → increment the shared outer `repair_round` and route `prizmkit-implement` → `prizmkit-code-review` → `prizmkit-test`.
244
+ - Stop as `WORKFLOW_BLOCKED` when the outer repair round is already three. The Main-Agent review loop has its separate limit of up to ten completed rounds.
243
245
 
244
- The Code Review execution boundary is absolute: do not delegate review directly or indirectly. Do not invoke another review skill or review workflow. Do not relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep. Direct reading, searching, editing, and testing by the current Main Agent remain allowed. `review-report.md` is the only persisted review artifact. Missing required evidence, unsafe repair, failed verification, or round-ten non-convergence produces `NEEDS_FIXES`.
246
+ `review-report.md` is the only persisted review artifact; do not append separate Review Notes to `context-snapshot.md`. Missing evidence, unsafe repair, failed verification, or non-convergence produces `REVIEW_NEEDS_FIXES`.
245
247
 
246
248
  **Gate Check — Final Review Result**:
247
249
  ```bash
248
250
  {{RUNTIME_HELPER_CMD}} text final-verdict .prizmkit/specs/{{FEATURE_SLUG}}/review-report.md
249
251
  ```
250
- Handle `REVIEW_PASS` and `REVIEW_NEEDS_FIXES` according to task policy. `REVIEW_INCOMPLETE` or `REVIEW_INVALID` means review did not complete: inspect progress once, write `failure-log.md`, and stop. Do not accept old or incidental verdict text or synthesize a passing result through Main-Agent self-review.
251
252
 
252
- **CP-3**: Review has a valid Final Result and the report preserves this execution's progress.
253
+ Only `REVIEW_PASS` can proceed to the structured Feature test gate. `REVIEW_INCOMPLETE` or `REVIEW_INVALID` writes `failure-log.md` and stops.
253
254
 
254
255
  ### Scoped Feature Test Gate — PrizmKit Test
255
256
 
256
- Run `/prizmkit-test scope=this-change artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` after review and before commit.
257
+ Create the current-run marker, then invoke the Feature gate:
257
258
 
258
- Before invoking the skill, create a current-run marker so stale reports are ignored:
259
259
  ```bash
260
260
  {{RUNTIME_HELPER_CMD}} artifact ensure-dir .prizmkit/specs/{{FEATURE_SLUG}}
261
261
  {{RUNTIME_HELPER_CMD}} artifact touch .prizmkit/specs/{{FEATURE_SLUG}}/.prizmkit-test-started
262
262
  ```
263
263
 
264
- Gate requirements:
265
- - Generate or update tests only for this feature's changed files, changed public interfaces, and acceptance criteria.
266
- - Do NOT use `.prizmkit/bugfix/` or `.prizmkit/refactor/` artifact directories.
267
- - Record unrelated historical gaps under `Out of Scope Gaps`; do not generate tests for them and do not fail this feature because of them.
268
- - Accept only a current-run `.prizmkit/test/*/test-report.md` whose `Scope` mode is `this-change`, whose `Artifact Dir` matches `.prizmkit/specs/{{FEATURE_SLUG}}/`, whose `Verdict` is `PASS`, whose `Boundary Completion Gate` reports `Completion gate passed: yes` with zero `Boundary-missing` and zero `Happy-path-only`, and whose `Boundary Validation` result is `passed`.
269
- - Only after a valid `PASS`, write the report path to `.prizmkit/specs/{{FEATURE_SLUG}}/test-report-path.txt` and append a 3-5 bullet `## PrizmKit Test Gate` summary to `context-snapshot.md`.
270
- - If the report verdict is `NEEDS_FIXES`, fix in-scope implementation/test issues and rerun `/prizmkit-test`. If the report is missing, stale, invalid, or for the wrong scope/artifact dir, write `failure-log.md` and stop for recovery.
264
+ ```text
265
+ /prizmkit-test scope=this-change artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/
266
+ ```
267
+
268
+ The Markdown `test-report.md` is a derived view only. Locate its package through `.prizmkit/specs/{{FEATURE_SLUG}}/test-report-path.txt` and consume authoritative `.prizmkit/test/evidence/<evidence-id>/manifest.json`, `verdict.json`, and `validation.json`. Before accepting `TEST_PASS`, verify evidence identity/scope, every manifest file hash, final-verdict agreement, validator result and payload hash, current inventory target hashes, and the compatibility value `legacy-test-report-interface-not-supported`. Never accept a Markdown-only PASS.
269
+
270
+ Repair routes:
271
+ - `TEST_FAIL` with `repair_scope=test-infrastructure` → implement → test, without speculative production edits.
272
+ - `TEST_FAIL` with production/runtime/schema/dependency/public-interface scope → implement → code-review → test.
273
+ - Unknown unsafe scope → `WORKFLOW_BLOCKED`; do not guess a production edit.
274
+ - `TEST_BLOCKED` → preserve evidence/artifacts, perform bounded environment recovery, then resume from test or finish terminal `WORKFLOW_BLOCKED`; never edit production speculatively.
275
+
276
+ Record `stage`, `status`, `stage_result`, `repair_scope`, `repair_round`, structured evidence paths, `next_stage`, and `resume_from` in truthful recovery metadata. Keep L1 workflow state separate from L4 `workflow-checkpoint.json`. The outer repair round stops after three and is independent of the internal review loop.
271
277
 
272
278
  {{IF_BROWSER_INTERACTION}}
273
279
  ### Phase 5.5: Browser Verification — MANDATORY
@@ -132,8 +132,7 @@ Run `/prizmkit-plan` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`:
132
132
  - **Browser Verification**: If the bug is UI-reproducible, plan.md should reference the Browser Verification Protocol above instead of redefining browser steps.
133
133
  {{END_IF_BROWSER_INTERACTION}}
134
134
 
135
- **DECISION GATE Fast Path Check**:
136
- - If plan.md has ≤ 2 tasks AND root cause is obvious → mark `FAST_PATH=true`, skip Phase 3 (Review) later
135
+ **ATOMIC GATE**: Every committable Bugfix must complete code review and the mandatory post-review `prizmkit-test` stage. Small or obvious fixes do not bypass either gate.
137
136
 
138
137
  **CP-1**: spec.md and plan.md exist with Tasks section.
139
138
 
@@ -177,7 +176,7 @@ After implement completes, verify:
177
176
 
178
177
  ### Phase 3: Review
179
178
 
180
- If `FAST_PATH=true` (≤ 2 tasks, obvious root cause), skip this phase entirely and mark checkpoint step `prizmkit-code-review` as `skipped` before continuing.
179
+ Code review is mandatory for every committable Bugfix. Do not skip this phase for small or obvious fixes.
181
180
 
182
181
  Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`:
183
182
  - The skill runs up to ten Main-Agent review rounds, directly repairs accepted findings, and verifies each repair
@@ -198,7 +197,21 @@ Handle `REVIEW_PASS` and `REVIEW_NEEDS_FIXES` according to task policy. `REVIEW_
198
197
 
199
198
  **CP-3**: Code review complete, `review-report.md` written, and all tests green.
200
199
 
201
- **Checkpoint update**: Set step `prizmkit-code-review` to `"completed"`.
200
+ **Checkpoint update**: Set step `prizmkit-code-review` to `"completed"` only for an accepted valid Final Result.
201
+
202
+ ---
203
+
204
+ ### Phase 4: Post-Review Test Gate — PrizmKit Test
205
+
206
+ After a valid code-review PASS, run the mandatory authoritative test gate against the same artifact root:
207
+
208
+ ```text
209
+ /prizmkit-test scope=this-change artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/
210
+ ```
211
+
212
+ Read the current structured `manifest.json`, `verdict.json`, and `validation.json`; Markdown alone is never completion authority. `TEST_FAIL` with `test-infrastructure` returns through implementation directly to test. Production/runtime/schema/dependency/public-interface fixes return through implementation, fresh review, and test. Unknown scope is blocked. `TEST_BLOCKED` permits bounded automatic environment recovery at the test stage or terminal `WORKFLOW_BLOCKED`, never speculative production edits. The shared outer repair cap is three.
213
+
214
+ Only validated `TEST_PASS` may proceed to commit.
202
215
 
203
216
  {{IF_VERIFICATION_MANUAL_OR_HYBRID}}
204
217
  **MANUAL VERIFICATION GATE**:
@@ -212,6 +225,10 @@ Handle `REVIEW_PASS` and `REVIEW_NEEDS_FIXES` according to task policy. `REVIEW_
212
225
 
213
226
  ### Phase 4: Commit & Learn
214
227
 
228
+ ### Headless Commit Authorization
229
+
230
+ This pipeline launch authorizes one local task commit only after review and authoritative test evidence pass. Never ask a question, wait for input, or request confirmation. Invoke `/prizmkit-committer` with `mode=l4-headless`, `owner=prizmkit-l4`, `local_commit_authorized=true`, and `push_authorized=false`. Never push.
231
+
215
232
  **Bug Fix Documentation Policy**:
216
233
  - **DEFAULT**: Run `/prizmkit-retrospective` with structural sync only (Job 1). Skip knowledge injection.
217
234
  - **Full retrospective** (Job 1 + Job 2): Only when the fix causes interface signature changes, dependency additions/removals, observable behavior changes, or reveals new TRAPs.
@@ -157,6 +157,20 @@ Handle `REVIEW_PASS` and `REVIEW_NEEDS_FIXES` according to behavior-preservation
157
157
 
158
158
  ---
159
159
 
160
+ ### Phase 5: Post-Review Test Gate — PrizmKit Test
161
+
162
+ After a valid code-review PASS, run the mandatory authoritative test gate against the same artifact root:
163
+
164
+ ```text
165
+ /prizmkit-test scope=this-change artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/
166
+ ```
167
+
168
+ Behavior-preservation checks remain supporting evidence and never replace current structured `manifest.json`, `verdict.json`, and `validation.json`. `TEST_FAIL` with `test-infrastructure` returns through implementation directly to test. Production/runtime/schema/dependency/public-interface fixes return through implementation, fresh review, and test. Unknown scope is blocked. `TEST_BLOCKED` permits bounded automatic environment recovery at the test stage or terminal `WORKFLOW_BLOCKED`, never speculative production edits. The shared outer repair cap is three.
169
+
170
+ Only validated `TEST_PASS` may proceed to browser verification or commit.
171
+
172
+ ---
173
+
160
174
  {{IF_BROWSER_INTERACTION}}
161
175
  ### Phase 5: Browser Verification
162
176
 
@@ -171,6 +185,10 @@ Record tool choice, URL, steps, screenshot path if available, result, and cleanu
171
185
  {{END_IF_BROWSER_INTERACTION}}
172
186
  ### Phase 6: Commit, Report & Completion Summary
173
187
 
188
+ ### Headless Commit Authorization
189
+
190
+ This pipeline launch authorizes one local task commit only after review, authoritative test evidence, and required behavior-preservation gates pass. Never ask a question, wait for input, or request confirmation. Invoke `/prizmkit-committer` with `mode=l4-headless`, `owner=prizmkit-l4`, `local_commit_authorized=true`, and `push_authorized=false`. Never push.
191
+
174
192
  Run `/prizmkit-retrospective` using the current working tree and staged changes as input context. Do not rely only on `git diff --cached`.
175
193
 
176
194
  Stage changed files explicitly; never use `git add -A` or `git add .`.
@@ -16,7 +16,7 @@
16
16
  - Relevant TRAPS/RULES
17
17
  4. Run `/prizmkit-plan` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`.
18
18
  5. Ensure `plan.md` starts with a reproduction test task that would fail before the fix.
19
- 6. Decide `FAST_PATH=true` only when root cause is obvious and plan has no more than 2 tasks.
19
+ 6. Do not create a FAST_PATH that bypasses code review or the mandatory post-review test gate; all committable Bugfixes use the same atomic stages.
20
20
 
21
21
  **CP-BF-1**: `spec.md` and `plan.md` exist, and the first plan task is a reproduction test.
22
22
 
@@ -1,18 +1,8 @@
1
1
  ### Phase 3: Review
2
2
 
3
- If `FAST_PATH=true`, skip this phase intentionally:
3
+ Code review is mandatory for every committable Bugfix, including small or obvious fixes. Do not create a FAST_PATH that skips this gate.
4
4
 
5
- ```bash
6
- {{CHECKPOINT_PYTHON_CMD}} \
7
- --checkpoint-path {{CHECKPOINT_PATH}} \
8
- --step prizmkit-code-review \
9
- --status skipped \
10
- --note "FAST_PATH: obvious root cause and <=2 tasks"
11
- ```
12
-
13
- Then continue to the next checkpoint step.
14
-
15
- Otherwise, run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The current Main Agent is the only Code Review executor: it reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
5
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The current Main Agent is the only Code Review executor: it reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
16
6
 
17
7
  The Code Review execution boundary is absolute for this phase:
18
8
 
@@ -30,8 +20,8 @@ Missing required evidence, an unsafe repair, a failed verification, or failure t
30
20
  {{RUNTIME_HELPER_CMD}} text final-verdict .prizmkit/bugfix/{{BUG_ID}}/review-report.md
31
21
  ```
32
22
 
33
- - `REVIEW_PASS` → proceed.
34
- - `REVIEW_NEEDS_FIXES` → log unresolved findings and proceed only when explicit task policy allows them.
23
+ - `REVIEW_PASS` → proceed to the mandatory post-review test gate.
24
+ - `REVIEW_NEEDS_FIXES` → route through bounded implementation/review/test repair; do not commit.
35
25
  - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` → inspect progress once, write `failure-log.md`, and stop. Do not accept old or incidental verdict text and do not synthesize a passing result outside the skill.
36
26
 
37
- **Checkpoint update**: Set step `prizmkit-code-review` to `completed` only for an accepted valid Final Result, or `skipped` for FAST_PATH.
27
+ **Checkpoint update**: Set step `prizmkit-code-review` to `completed` with `stage_result=REVIEW_PASS` only for an accepted valid Final Result.
@@ -0,0 +1,21 @@
1
+ ### Bugfix Test Gate — PrizmKit Test
2
+
3
+ After Main-Agent code review returns a valid `PASS`, run the mandatory post-review test stage against the same Bugfix artifact root. Implementation and review completion alone can never classify the task complete.
4
+
5
+ ```text
6
+ /prizmkit-test scope=this-change artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/
7
+ ```
8
+
9
+ Read the current structured evidence package under `.prizmkit/test/evidence/<evidence-id>/`: `manifest.json`, `verdict.json`, and `validation.json`. A derived Markdown report is not completion authority. Confirm scope, hashes, final verdict, and validator result before accepting `TEST_PASS`.
10
+
11
+ Gate outcomes and authoritative routing:
12
+
13
+ - `TEST_PASS`: update the checkpoint handoff and continue to retrospective.
14
+ - `TEST_FAIL` with `repair_scope=test-infrastructure`: return to `/prizmkit-implement`, then return directly to this test gate; do not make speculative production edits.
15
+ - `TEST_FAIL` with `repair_scope=production|runtime|schema|dependency|public-interface`: return to implementation, obtain a fresh code-review result, then return to this test gate.
16
+ - `TEST_FAIL` with an unknown or missing `repair_scope`: record `WORKFLOW_BLOCKED` and leave a safe checkpoint at the test stage; do not guess a production edit.
17
+ - `TEST_BLOCKED`: preserve all evidence and artifacts, perform only bounded automatic environment recovery, then terminate as `WORKFLOW_BLOCKED` with `blocked_reason=test_blocked`. Never edit production speculatively and never ask the user.
18
+
19
+ The `repair_round` counter is shared with review failures and may not exceed three outer rounds. At the limit, leave a truthful blocked terminal result. Internal code-review convergence has its separate ten-round limit.
20
+
21
+ **Checkpoint update**: Only a validated structured `TEST_PASS` may complete `prizmkit-test` with `stage_result=TEST_PASS` plus `manifest`, `verdict`, and `validation` evidence paths, then proceed to retrospective.
@@ -1,6 +1,6 @@
1
1
  ## Workflow Checkpoint System
2
2
 
3
- A checkpoint file tracks your progress through this workflow:
3
+ A checkpoint file tracks this task family's L4 execution. It is not the L1 workflow-state record.
4
4
 
5
5
  **Path**: `{{CHECKPOINT_PATH}}`
6
6
 
@@ -21,12 +21,12 @@ Use this helper to update checkpoint status. Do not hand-edit `workflow-checkpoi
21
21
 
22
22
  ### Rules
23
23
 
24
- 1. **Before each skill**: Read `workflow-checkpoint.json`, verify the previous step has `status: "completed"` or `status: "skipped"`. If it is still `"pending"` or `"in_progress"`, complete it first before moving on.
25
-
26
- 2. **Starting a skill**: Use the checkpoint update helper to mark the current step as `status: "in_progress"`.
27
-
28
- 3. **After each skill completes**: Use the checkpoint update helper to mark the current step as `status: "completed"`.
29
-
30
- 4. **On failure**: Use the checkpoint update helper to mark the step as `status: "failed"`, write `failure-log.md` with the reason, and continue only when the workflow rules allow it.
31
-
32
- 5. **On session exit**: The checkpoint file reflects your actual progress. Do NOT manually set future steps to `"completed"`.
24
+ 1. Before each skill, read the checkpoint and verify the previous step is `completed` or `skipped`. A pending or in-progress predecessor must be completed first.
25
+ 2. Starting a skill marks its step `in_progress`; completion marks it `completed`; failures mark it `failed` and write `failure-log.md`.
26
+ 3. L4 checkpoint metadata must preserve `current_stage`, `next_stage`, `stage_result`, `repair_scope`, `repair_round`, `authoritative_evidence_paths`, `blocked_reason`, and `terminal_status`.
27
+ 4. `authoritative_evidence_paths` may point only to validated structured `manifest.json`, `verdict.json`, and `validation.json`; a Markdown report is never completion authority.
28
+ 5. Preserve all evidence and session artifacts on recovery. Never replace the task family's L1 workflow state with this L4 checkpoint or merge their schemas.
29
+ 6. The outer repair round is shared across review/test failures and stops at three. The internal Code Review loop has its separate ten-round limit.
30
+ 7. `TEST_BLOCKED`, an unknown result, an unsafe repair scope, or an exhausted third repair round records terminal `WORKFLOW_BLOCKED` with a deterministic `blocked_reason`; never speculate on production edits.
31
+ 8. `WORKFLOW_COMPLETED` is valid only when the expected family stage sequence is complete, Code Review records `REVIEW_PASS`, and the test stage records `TEST_PASS` with all three authoritative evidence records.
32
+ 9. On session exit, leave the checkpoint at the truthful stage. Do not mark future steps completed.
@@ -0,0 +1,16 @@
1
+ ### Headless Commit Authorization
2
+
3
+ This pipeline session is non-interactive. Do not ask questions, wait for user input, or request commit confirmation.
4
+
5
+ The pipeline launch has already authorized local commits for this task. Invoke `/prizmkit-committer` with the L4-managed execution context:
6
+
7
+ ```json
8
+ {
9
+ "mode": "l4-headless",
10
+ "owner": "prizmkit-l4",
11
+ "local_commit_authorized": true,
12
+ "push_authorized": false
13
+ }
14
+ ```
15
+
16
+ The committer must still verify every lifecycle gate, inspect the intended diff, generate a Conventional Commit message, stage only intended files, create the local commit, and verify it. It must never push. If the execution context is absent or invalid, mark the task blocked and exit; do not ask the user.
@@ -1,6 +1,6 @@
1
1
  ### Scoped Feature Test Gate — PrizmKit Test
2
2
 
3
- **Goal**: After code review completes, generate and verify tests for this feature's changed scope through the `/prizmkit-test` skill.
3
+ **Goal**: After Code Review completes, generate and verify tests for this Feature's changed scope through `/prizmkit-test`. Review is a hard precondition for accepting any full test result.
4
4
 
5
5
  Create a current-run marker immediately before invoking the skill:
6
6
 
@@ -9,30 +9,33 @@ Create a current-run marker immediately before invoking the skill:
9
9
  {{RUNTIME_HELPER_CMD}} artifact touch .prizmkit/specs/{{FEATURE_SLUG}}/.prizmkit-test-started
10
10
  ```
11
11
 
12
- Run `/prizmkit-test` with the feature artifact directory:
12
+ Run `/prizmkit-test` with the Feature artifact directory. This gate is Feature-only: never substitute `.prizmkit/bugfix/` or `.prizmkit/refactor/` artifact roots.
13
13
 
14
14
  ```text
15
15
  /prizmkit-test scope=this-change artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/
16
16
  ```
17
17
 
18
- Rules:
19
- - This gate is feature-pipeline only. Do NOT use `.prizmkit/bugfix/` or `.prizmkit/refactor/` artifact directories here.
20
- - Generate or update tests only for this feature's changed files, changed public interfaces, and acceptance criteria.
21
- - Record unrelated historical coverage gaps under `Out of Scope Gaps`; do not generate tests for them and do not fail this feature because of them.
22
- - If generated tests fail because implementation is wrong, fix implementation within this feature scope and rerun the affected tests.
23
- - If failures are baseline or unrelated to this feature, document them in the report and continue only when no in-scope failure remains unexplained.
24
-
25
- **Gate Check — Test Report**:
26
- After `/prizmkit-test` returns, read `.prizmkit/specs/{{FEATURE_SLUG}}/test-report-path.txt` if it exists; otherwise locate the newest `.prizmkit/test/*/test-report.md` created by the current test run. Accept the report only when it states:
27
- - `Scope` mode is `this-change`
28
- - `Artifact Dir` matches `.prizmkit/specs/{{FEATURE_SLUG}}/`
29
- - `Verdict` is `PASS`
30
- - `Boundary Matrix` is present
31
- - `Boundary Completion Gate` is present and reports `Boundary-missing: 0`, `Happy-path-only: 0`, and `Completion gate passed: yes`
32
- - `Boundary Validation` is present and reports `Validator result: passed`
33
-
34
- Gate outcomes:
35
- - `PASS` ensure `.prizmkit/specs/{{FEATURE_SLUG}}/test-report-path.txt` points to the accepted report, append the report path and a 3-5 bullet summary to `context-snapshot.md` under `## PrizmKit Test Gate`, then proceed.
36
- - `NEEDS_FIXES` → read the report's `In-Scope Failures`, fix the feature implementation or generated tests within this feature scope, rerun `/prizmkit-test`, and repeat the gate check. Do not proceed to retrospective/commit while the verdict is not `PASS`.
37
- - `BLOCKED`, wrong mode, wrong artifact dir, unreadable report, stale scope, or boundary failure write `.prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md` with the scoped test failure and stop for recovery.
38
- - Missing report → perform one bounded status check: inspect `/prizmkit-test` output and `.prizmkit/test/` for a report directory. If no current-run report exists, write `failure-log.md` and stop for recovery.
18
+ ## Authoritative Evidence Gate
19
+
20
+ The report is a derived view only. Its historical Boundary Matrix and Boundary Completion Gate are useful context but never completion authority. A valid derived view may state `Boundary-missing: 0`, `Happy-path-only: 0`, `Completion gate passed: yes`, and `Validator result: passed`, but those Markdown fields cannot establish success. Locate the evidence package through `.prizmkit/specs/{{FEATURE_SLUG}}/test-report-path.txt`, then consume and validate these structured records:
21
+
22
+ - `.prizmkit/test/evidence/<evidence-id>/manifest.json`
23
+ - `.prizmkit/test/evidence/<evidence-id>/verdict.json`
24
+ - `.prizmkit/test/evidence/<evidence-id>/validation.json`
25
+
26
+ Before accepting `TEST_PASS`, verify all three records are present, JSON is complete and non-duplicated, the evidence ID and scope match this Feature, every manifest-listed file hash matches, `final_verdict` and `verdict.verdict` agree, `validation.result=passed`, `validation.verdict` agrees, validator/payload hashes are present, the compatibility boundary rejects the legacy report interface, and current inventoried target hashes still match. Never accept a Markdown-only report or a Markdown `PASS` as completion evidence.
27
+
28
+ ## Repair Routing
29
+
30
+ Preserve the same artifact directory and update the L1 workflow state plus this L4 checkpoint with `current_stage`, `next_stage`, `stage_result`, `repair_scope`, `repair_round`, authoritative evidence paths, `blocked_reason`, and `terminal_status`. L1 workflow state and `workflow-checkpoint.json` are separate contracts; never substitute one for the other.
31
+
32
+ - `REVIEW_NEEDS_FIXES` `prizmkit-implement` `prizmkit-code-review` `prizmkit-test`.
33
+ - `TEST_FAIL` with `repair_scope=test-infrastructure` → `prizmkit-implement` → `prizmkit-test`; do not make speculative production edits.
34
+ - `TEST_FAIL` with `repair_scope=production|runtime|schema|dependency|public-interface` → `prizmkit-implement` → `prizmkit-code-review` → `prizmkit-test`.
35
+ - `TEST_FAIL` with unknown or unsafe scope do not guess a production edit; record `WORKFLOW_BLOCKED` and a safe resume entry.
36
+ - `TEST_BLOCKED` → preserve all evidence and artifacts, perform only bounded environment recovery, then finish terminal `WORKFLOW_BLOCKED` with `blocked_reason=test_blocked`; never edit production speculatively.
37
+ - The outer `repair_round` is shared across review/test failures and may not exceed three. The Code Review internal loop limit remains separate and is at most ten completed rounds.
38
+
39
+ A missing, stale, incomplete, mismatched, tampered, or wrong-scope package is not `TEST_PASS`: preserve the evidence, write `failure-log.md`, and leave the checkpoint resumable or blocked according to headless policy.
40
+
41
+ **CP-4**: Only a validated structured `TEST_PASS` may complete `prizmkit-test` with `stage_result=TEST_PASS` plus `manifest`, `verdict`, and `validation` evidence paths, then proceed to retrospective. `TEST_FAIL` and `TEST_BLOCKED` remain in the repair/recovery state machine.
@@ -1,10 +1,16 @@
1
1
  ### Review — Code Review
2
2
 
3
- Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so `/prizmkit-code-review` can read the spec, plan, context snapshot, implementation log, and current diff. Do not require a prior `/prizmkit-test` report here; the next phase owns the formal test gate.
3
+ Review the completed implementation before the full Feature test gate runs. A review result is a required predecessor; never accept or route around testing as if a review had passed.
4
4
 
5
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The current Main Agent is the only Code Review executor: it reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
5
+ Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so `/prizmkit-code-review` can read the spec, plan, context snapshot, implementation log, and current diff. The current Main Agent is the only Code Review executor. The skill runs a bounded Main-Agent review loop of at most ten completed internal rounds and writes only `review-report.md`. The Main-Agent review loop permits up to ten completed rounds.
6
6
 
7
- The Code Review execution boundary is absolute for this phase:
7
+ - `REVIEW_PASS` update checkpoint metadata with `stage=code-review`, `status=REVIEW_PASS`, `stage_result=REVIEW_PASS`, `next_stage=prizmkit-test`, and `resume_from=prizmkit-test`; then run the full test gate.
8
+ - `REVIEW_NEEDS_FIXES` → preserve findings, increment the shared outer `repair_round`, route `prizmkit-implement` → `prizmkit-code-review` → `prizmkit-test`, and do not accept any test result from before the repaired review.
9
+ - If the outer repair round is already three, record `WORKFLOW_BLOCKED`; do not start another repair route.
10
+
11
+ Missing required evidence, unsafe repair, failed verification, or failure to converge by round ten produces `REVIEW_NEEDS_FIXES`.
12
+
13
+ The Code Review execution boundary is absolute:
8
14
 
9
15
  - Do not delegate any review work directly or indirectly.
10
16
  - Do not invoke another review skill or review workflow.
@@ -12,8 +18,6 @@ The Code Review execution boundary is absolute for this phase:
12
18
  - Direct reading, searching, editing, and testing by the current Main Agent remain allowed.
13
19
  - `review-report.md` is the only persisted review artifact; do not append separate Review Notes to `context-snapshot.md`.
14
20
 
15
- Missing required evidence, an unsafe repair, a failed verification, or failure to converge by round ten produces `NEEDS_FIXES`.
16
-
17
21
  **Gate Check — Final Review Result**:
18
22
 
19
23
  ```bash
@@ -22,9 +26,9 @@ Missing required evidence, an unsafe repair, a failed verification, or failure t
22
26
 
23
27
  Handle the marker:
24
28
 
25
- - `REVIEW_PASS` → proceed to next phase.
26
- - `REVIEW_NEEDS_FIXES` → log unresolved findings and follow the task failure policy; do not externally restart the review loop.
27
- - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` → inspect the append-only progress once, write `failure-log.md`, and stop. Do not treat an old or incidental verdict as completion and do not synthesize a passing result outside the skill.
29
+ - `REVIEW_PASS` → proceed to the structured test gate.
30
+ - `REVIEW_NEEDS_FIXES` → follow the repair route above; do not externally restart the review loop.
31
+ - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` → inspect append-only progress once, write `failure-log.md`, and stop. Do not accept old/incidental verdict text or synthesize a pass.
28
32
 
29
33
  **CP-3**: Review has a valid Final Result and `review-report.md` preserves this execution's progress.
30
34
 
@@ -24,4 +24,4 @@ Missing required evidence, an unsafe repair, a failed verification, or failure t
24
24
 
25
25
  Verify directly that the review checks behavior preservation, public API compatibility, imports, tests, and rollback assumptions.
26
26
 
27
- **Checkpoint update**: Set step `prizmkit-code-review` to `completed` only for an accepted valid Final Result. Do not complete the checkpoint for incomplete or invalid reports.
27
+ **Checkpoint update**: Set step `prizmkit-code-review` to `completed` with `stage_result=REVIEW_PASS` only for an accepted valid Final Result. Do not complete the checkpoint for incomplete or invalid reports.
@@ -0,0 +1,21 @@
1
+ ### Refactor Test Gate — PrizmKit Test
2
+
3
+ After Main-Agent code review returns a valid `PASS`, run the mandatory post-review test stage against the same Refactor artifact root. Behavior-preservation checks collected during planning and implementation remain supporting evidence; they never replace this authoritative evidence gate.
4
+
5
+ ```text
6
+ /prizmkit-test scope=this-change artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/
7
+ ```
8
+
9
+ Read the current structured evidence package under `.prizmkit/test/evidence/<evidence-id>/`: `manifest.json`, `verdict.json`, and `validation.json`. A derived Markdown report is not completion authority. Confirm scope, hashes, final verdict, and validator result before accepting `TEST_PASS`.
10
+
11
+ Gate outcomes and authoritative routing:
12
+
13
+ - `TEST_PASS`: verify behavior-preservation evidence remains recorded, update the checkpoint handoff, and continue to retrospective.
14
+ - `TEST_FAIL` with `repair_scope=test-infrastructure`: return to `/prizmkit-implement`, preserve the behavior baseline, then return directly to this test gate; do not make speculative production edits.
15
+ - `TEST_FAIL` with `repair_scope=production|runtime|schema|dependency|public-interface`: return to implementation, obtain a fresh code-review result, then return to this test gate.
16
+ - `TEST_FAIL` with an unknown or missing `repair_scope`: record `WORKFLOW_BLOCKED` and leave a safe checkpoint at the test stage; do not guess a production edit.
17
+ - `TEST_BLOCKED`: preserve all evidence and artifacts, perform only bounded automatic environment recovery, then terminate as `WORKFLOW_BLOCKED` with `blocked_reason=test_blocked`. Never edit production speculatively and never ask the user.
18
+
19
+ The `repair_round` counter is shared with review failures and may not exceed three outer rounds. At the limit, leave a truthful blocked terminal result. Internal code-review convergence has its separate ten-round limit.
20
+
21
+ **Checkpoint update**: Only a validated structured `TEST_PASS` may complete `prizmkit-test` with `stage_result=TEST_PASS` plus `manifest`, `verdict`, and `validation` evidence paths, then proceed to retrospective.