prizmkit 1.1.130 → 1.1.134

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 (119) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/claude/command-adapter.js +0 -2
  3. package/bundled/dev-pipeline/.env.example +1 -1
  4. package/bundled/dev-pipeline/assets/skill-subagent-integration.md +11 -6
  5. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +445 -8
  6. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +2 -9
  7. package/bundled/dev-pipeline/prizmkit_runtime/processes.py +21 -1
  8. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +87 -66
  9. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +53 -3
  10. package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +55 -25
  11. package/bundled/dev-pipeline/prizmkit_runtime/runner_status.py +4 -0
  12. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +119 -18
  13. package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +3 -2
  14. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +411 -17
  15. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +57 -14
  16. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +5 -4
  17. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +55 -2
  18. package/bundled/dev-pipeline/scripts/prompt_framework.py +152 -1
  19. package/bundled/dev-pipeline/scripts/update-bug-status.py +53 -0
  20. package/bundled/dev-pipeline/scripts/update-checkpoint.py +294 -69
  21. package/bundled/dev-pipeline/scripts/update-feature-status.py +57 -0
  22. package/bundled/dev-pipeline/scripts/update-refactor-status.py +53 -0
  23. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +5 -5
  24. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +28 -22
  25. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +24 -10
  26. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +20 -2
  27. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +2 -2
  28. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +1 -1
  29. package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +5 -10
  30. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +9 -19
  31. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +21 -0
  32. package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +1 -1
  33. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +10 -10
  34. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +1 -1
  35. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +15 -0
  36. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +2 -2
  37. package/bundled/dev-pipeline/templates/sections/phase-commit.md +2 -2
  38. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +26 -23
  39. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +5 -5
  40. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +15 -11
  41. package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +1 -1
  42. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +6 -6
  43. package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +21 -0
  44. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +1 -1
  45. package/bundled/dev-pipeline/templates/sections/subagent-timeout-recovery.md +1 -1
  46. package/bundled/dev-pipeline/templates/sections/task-contract.md +4 -0
  47. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +362 -3
  48. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +349 -48
  49. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +129 -0
  50. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +91 -0
  51. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +567 -23
  52. package/bundled/dev-pipeline/tests/test_unified_cli.py +37 -10
  53. package/bundled/skills/_metadata.json +63 -26
  54. package/bundled/skills/app-planner/SKILL.md +4 -3
  55. package/bundled/skills/bug-fix-workflow/SKILL.md +89 -180
  56. package/bundled/skills/bug-planner/SKILL.md +12 -27
  57. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +131 -220
  58. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +36 -90
  59. package/bundled/skills/feature-pipeline-launcher/SKILL.md +129 -271
  60. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +35 -76
  61. package/bundled/skills/feature-planner/SKILL.md +27 -22
  62. package/bundled/skills/feature-planner/assets/planning-guide.md +4 -4
  63. package/bundled/skills/feature-workflow/SKILL.md +94 -121
  64. package/bundled/skills/prizmkit/SKILL.md +130 -94
  65. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +181 -0
  66. package/bundled/skills/prizmkit-code-review/SKILL.md +132 -86
  67. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +243 -0
  68. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +42 -1
  69. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +181 -0
  70. package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +93 -1
  71. package/bundled/skills/prizmkit-committer/SKILL.md +125 -48
  72. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +181 -0
  73. package/bundled/skills/prizmkit-implement/SKILL.md +99 -73
  74. package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +1 -1
  75. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +181 -0
  76. package/bundled/skills/prizmkit-init/SKILL.md +5 -5
  77. package/bundled/skills/prizmkit-plan/SKILL.md +146 -105
  78. package/bundled/skills/prizmkit-plan/assets/plan-template.md +18 -0
  79. package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +242 -0
  80. package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +4 -4
  81. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +181 -0
  82. package/bundled/skills/prizmkit-retrospective/SKILL.md +111 -53
  83. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +7 -6
  84. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +5 -4
  85. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +181 -0
  86. package/bundled/skills/prizmkit-test/SKILL.md +52 -6
  87. package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +63 -12
  88. package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +1 -1
  89. package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +13 -0
  90. package/bundled/skills/prizmkit-test/references/evidence-protocol.md +6 -1
  91. package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +8 -1
  92. package/bundled/skills/prizmkit-test/references/examples.md +1 -1
  93. package/bundled/skills/prizmkit-test/references/test-generation-steps.md +4 -1
  94. package/bundled/skills/prizmkit-test/references/test-report-template.md +1 -1
  95. package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +15 -0
  96. package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +181 -0
  97. package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +744 -23
  98. package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +194 -15
  99. package/bundled/skills/prizmkit-workflow/SKILL.md +266 -0
  100. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +181 -0
  101. package/bundled/skills/recovery-workflow/SKILL.md +62 -241
  102. package/bundled/skills/recovery-workflow/evals/evals.json +17 -33
  103. package/bundled/skills/recovery-workflow/references/detection.md +28 -52
  104. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +105 -439
  105. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +136 -275
  106. package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +53 -88
  107. package/bundled/skills/refactor-planner/SKILL.md +12 -57
  108. package/bundled/skills/refactor-planner/references/behavior-preservation.md +111 -230
  109. package/bundled/skills/refactor-planner/references/error-recovery.md +37 -0
  110. package/bundled/skills/refactor-planner/references/planning-phases.md +11 -17
  111. package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +1 -1
  112. package/bundled/skills/refactor-workflow/SKILL.md +98 -139
  113. package/bundled/templates/project-memory-template.md +4 -4
  114. package/package.json +1 -1
  115. package/src/index.js +4 -0
  116. package/src/prompts.js +10 -3
  117. package/src/scaffold.js +1 -1
  118. package/bundled/dev-pipeline/tests/test-deploy-safety.sh +0 -223
  119. package/bundled/skills/feature-pipeline-launcher/scripts/preflight-check.py +0 -462
@@ -30,21 +30,21 @@ Infer what needs to be done from the feature context above and follow the standa
30
30
 
31
31
  3. **Implement**: Run `/prizmkit-implement` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` to execute the plan using TDD (write tests first, then implement).
32
32
 
33
- 4. **Review**: Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The current Main Agent is the only Code Review executor. It reviews the complete current change for up to ten rounds, directly repairs accepted findings, verifies repairs, and converges when accepted and unresolved findings are both zero. Do not delegate review directly or indirectly, invoke another review skill/workflow, or relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep. `review-report.md` is the only persisted review artifact. Require the last `## Final Result` verdict before continuing.
33
+ 4. **Review**: Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. Its mandatory Main-Agent loop reviews the complete current change for up to ten internal rounds and directly repairs accepted findings. After convergence, its one skill-owned independent Reviewer is optional only under a strict structural capability gate; otherwise the skill records downgrade and creates none. Require the last `## Final Result`. `REVIEW_PASS` proceeds to test; `REVIEW_NEEDS_FIXES` increments the shared outer repair round and routes implement → code-review → test. Do not invoke another review entry point or add review execution outside the skill contract.
34
34
 
35
- 5. **Test**: Run `/prizmkit-test scope=this-change artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` to generate and verify tests only for this feature's changed scope after review. Do not use bugfix/refactor artifact directories for this gate.
35
+ 5. **Test**: After review passes, run `/prizmkit-test scope=this-change artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. Treat the Markdown report only as a derived view. Consume `.prizmkit/test/evidence/<evidence-id>/manifest.json`, `verdict.json`, and `validation.json`; verify identity/scope, every manifest hash, verdict/validator agreement, and current target hashes before accepting `TEST_PASS`. `TEST_FAIL/test-infrastructure` routes implement → test; production/runtime/schema/dependency/public-interface routes implement → code-review → test; unknown unsafe scope blocks. `TEST_BLOCKED` allows bounded environment recovery or a test-stage resume but never speculative production edits. Stop outer repairs after three rounds; preserve evidence and truthful recovery metadata.
36
36
 
37
37
  6. **Retrospective**: Run `/prizmkit-retrospective` to sync `.prizmkit/prizm-docs/` with code changes.
38
38
 
39
- 7. **Commit**: Run `/prizmkit-committer` to commit all changes. Do NOT push.
39
+ 7. **Commit**: Run `/prizmkit-committer` to commit all changes.
40
40
 
41
41
  ### Critical Rules
42
42
 
43
43
  - Do NOT ask for user input — decide autonomously.
44
- - Do NOT push to remote the user will push manually.
44
+ - Remote publication is controlled by the runtime after the local commit; do not make a publication decision in this session.
45
45
  - Write all artifacts to `.prizmkit/specs/{{FEATURE_SLUG}}/`.
46
46
  - If a step fails after 3 attempts, write a status report and stop.
47
- - **Never re-read unmodified files**: once you read a file into context, do NOT read it again unless it was modified by an Edit/Write after your last read — use `grep -n`/`sed -n` for specific lines. Before issuing a Read, ask: "Have I read this file before, and has it changed since?" If no — do NOT read it. Normal work delegation outside Code Review must rely on context-snapshot.md rather than re-reading files the Main Agent already read. Code Review runs only in the current Main Agent.
47
+ - **Never re-read unmodified files**: once you read a file into context, do NOT read it again unless it was modified by an Edit/Write after your last read — use `grep -n`/`sed -n` for specific lines. Before issuing a Read, ask: "Have I read this file before, and has it changed since?" If no — do NOT read it. Normal work delegation outside the optional skill-owned review contract must rely on context-snapshot.md rather than re-reading files the Main Agent already read. Code Review keeps mandatory Main-Agent ownership and may use only its strict-gated skill-owned Reviewer after convergence.
48
48
  - **Read offset safety**: if Read returns "shorter than offset"/"empty" — run `wc -l` then `sed -n`, do NOT retry same offset.
49
49
  - **Hard Round Cap**: after 6 total test-fix rounds, STOP trial-and-error. Switch to read-once-then-rewrite. Do NOT exceed 7 rounds.
50
50
  - **Layered test**: debug with single-file tests, only run full suite as gate when single-file is green.
@@ -10,12 +10,12 @@
10
10
 
11
11
  You are the **session orchestrator**. Implement Feature {{FEATURE_ID}}: "{{FEATURE_TITLE}}".
12
12
 
13
- **CRITICAL**: You MUST NOT exit until ALL work is complete and committed. Normal work delegation outside Code Review must finish before exit (`run_in_background=false`). Code Review never uses direct or indirect delegation.
13
+ **CRITICAL**: You MUST NOT exit until ALL work is complete and committed. Normal work delegation outside the optional skill-owned review contract must finish before exit (`run_in_background=false`).
14
14
 
15
- **Tier 3 — Main-Agent Full Guardrails**: For complex features, the Main Agent handles context, planning, implementation, and Code Review directly. Do not spawn a top-level Dev implementation subagent. Code Review runs through `/prizmkit-code-review` without direct or indirect delegation.
15
+ **Tier 3 — Main-Agent Full Guardrails**: For complex features, the Main Agent handles context, planning, and implementation directly, then runs the mandatory Main-Agent review in `/prizmkit-code-review`. After convergence, that skill may use one skill-owned independent Reviewer only when its strict structural capability gate passes; otherwise it records downgrade and creates none. Do not spawn a top-level Dev implementation subagent.
16
16
 
17
- **Agent spawn failure policy (all Agent tool calls)**:
18
- - Code Review must not invoke another review skill/workflow or relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep.
17
+ **Agent spawn failure policy (all execution-unit creation)**:
18
+ - Code Review must not invoke another review skill/workflow or add review execution outside the single optional Reviewer owned and gated by `prizmkit-code-review`.
19
19
  - If the second attempt fails, do not keep spawning variants and do not enter artifact polling for Implementation Log, challenge report, or review report markers.
20
20
  - Use the documented inline/recovery fallback for that phase: write the required report yourself where possible, complete remaining work directly in the orchestrator when safe, or write `failure-log.md` with the spawn error and last observable state before stopping for recovery.
21
21
  - Apply the same cap to any re-spawn for report repair or resume prompts; do not burn multiple minutes on identical team/config/lock failures.
@@ -52,7 +52,7 @@ You are running in **headless non-interactive mode** with a FINITE context windo
52
52
 
53
53
  1. **context-snapshot.md is your single source of truth** — After Phase 1-2 makes it available, use it instead of re-reading individual source files. If you just created or updated it in this session, continue from the in-context content; read it only when resuming/continuing, after context compaction/loss, or when handing work to a subagent.
54
54
  2. **Never re-read your own writes** — After you create/modify a file, do NOT read it back to verify. Trust your write was correct.
55
- 3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use platform file/search tools for targeted lookup; when shell-free helper lookup is needed, run `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<pattern>" --json`, then read only the smallest bounded range with the platform file-reading tool instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files including those summarized in context-snapshot.md Section 4. Normal work delegation outside Code Review must receive context-snapshot.md and rely on it rather than independently re-reading files the Main Agent already read. Code Review runs only in the current Main Agent.
55
+ 3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use platform file/search tools for targeted lookup; when shell-free helper lookup is needed, run `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<pattern>" --json`, then read only the smallest bounded range with the platform file-reading tool instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files including those summarized in context-snapshot.md Section 4. Normal work delegation outside the optional skill-owned review contract must receive context-snapshot.md and rely on it rather than independently re-reading files the Main Agent already read. Code Review keeps mandatory Main-Agent ownership and may use only its strict-gated skill-owned Reviewer after convergence.
56
56
  4. **Stay focused** — Do NOT explore code unrelated to this feature. No curiosity-driven reads.
57
57
  4. **One task at a time** — In Phase 4 (implement), complete and test one task before starting the next.
58
58
  5. **Minimize tool output** — Never load full command output into context. First capture command output to a temp file using the command/tool output option or the host-appropriate redirection, then inspect only the final relevant lines and use targeted search helpers to extract the information needed for the current task. Only read the filtered result — never the raw full output.
@@ -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. The mandatory Main-Agent loop reviews and repairs the complete change for up to ten rounds. After it converges, the skill may use its one skill-owned independent Reviewer only when every strict structural capability is proven; otherwise it records downgrade and creates none. Do not invoke another review skill or add any review execution beyond that skill contract.
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
@@ -456,7 +462,7 @@ git add .prizmkit/prizm-docs/
456
462
 
457
463
  **6d.** Run `/prizmkit-committer` → THE ONLY commit for this feature:
458
464
  `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`
459
- This single commit includes: feature code + tests + .prizmkit/prizm-docs/ updates. Do NOT push.
465
+ This single commit includes: feature code + tests + .prizmkit/prizm-docs/ updates.
460
466
  - MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
461
467
  - Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
462
468
 
@@ -518,10 +524,10 @@ If you encounter an unrecoverable error, context overflow, or are about to exit
518
524
 
519
525
  ## Reminders
520
526
 
521
- - Tier 3: orchestrator implements directly; `/prizmkit-code-review` handles review later
527
+ - Tier 3: orchestrator implements directly; `/prizmkit-code-review` runs mandatory Main-Agent review and optional strict-gated skill-owned independent review
522
528
  - context-snapshot.md contains Main-Agent implementation context; Code Review writes only review-report.md
523
529
  - Gate checks require the Implementation Log and a valid review-report.md Final Result before proceeding
524
- - Code Review never uses direct or indirect delegation; normal work delegation outside review must not use `run_in_background=true`
530
+ - Review execution outside the skill contract is forbidden; normal work delegation must not use `run_in_background=true`
525
531
  - Commit phase must use `/prizmkit-committer`; do NOT replace with manual git commit commands
526
532
  - **NEVER delete, modify, or touch any file under `.prizmkit/state/`** — those are pipeline runtime files managed by the runner
527
533
  - NEVER run `rm -rf`, `git clean`, or any destructive filesystem operations
@@ -11,7 +11,7 @@
11
11
 
12
12
  You are the **bug fix session agent**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}".
13
13
 
14
- **CRITICAL**: You MUST NOT exit until ALL automated work is complete and committed, unless a fresh manual/hybrid verification gate requires stopping as `partial` before commit.
14
+ **CRITICAL**: You MUST NOT exit until ALL automated work is complete and committed. Manual/hybrid verification labels do not authorize a partial stop: select deterministic local verification tooling and record its evidence.
15
15
 
16
16
  **SUBAGENT LIFECYCLE**: Any normal work subagent must be awaited with `run_in_background=false`. Do not spawn persistent background subagents for headless recovery.
17
17
 
@@ -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,13 +197,24 @@ 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
- **MANUAL VERIFICATION GATE**:
205
- - Fresh manual/hybrid bugfix sessions stop after automated review and before commit.
206
- - Write session-status.json with status="partial", resume_from_phase=4, and STOP — manual UAT is required before commit.
207
- - Recovery/retry/continuation sessions may substitute automated verification for manual/hybrid UAT only when evidence is documented in fix-report.md and session-status.json.
217
+ **MANUAL/HYBRID AUTOMATION**: This L4 session is always headless. Execute manual/hybrid verification with available deterministic browser, CLI/API, fixture, or test tooling. Document the method and evidence, then continue through `/prizmkit-retrospective` and `/prizmkit-committer`; never ask for UAT, wait for a user, or stop as `partial`.
208
218
  - Do not write `verifying` to the external bug-list status field; fine-grained verification is session/checkpoint metadata, while the external list status remains one of `pending`, `in_progress`, `completed`, `failed`, `skipped`, or `needs_info`.
209
219
  {{END_IF_VERIFICATION_MANUAL_OR_HYBRID}}
210
220
 
@@ -212,6 +222,10 @@ Handle `REVIEW_PASS` and `REVIEW_NEEDS_FIXES` according to task policy. `REVIEW_
212
222
 
213
223
  ### Phase 4: Commit & Learn
214
224
 
225
+ ### Headless Commit Authorization
226
+
227
+ 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`, and `local_commit_authorized=true`. The runtime controls any optional remote publication after the local commit; do not make a publication decision in this session.
228
+
215
229
  **Bug Fix Documentation Policy**:
216
230
  - **DEFAULT**: Run `/prizmkit-retrospective` with structural sync only (Job 1). Skip knowledge injection.
217
231
  - **Full retrospective** (Job 1 + Job 2): Only when the fix causes interface signature changes, dependency additions/removals, observable behavior changes, or reveals new TRAPs.
@@ -233,7 +247,7 @@ git add .prizmkit/prizm-docs/
233
247
  **d.** Run `/prizmkit-committer`:
234
248
  - Commit message prefix: `fix({{FIX_SCOPE}}): {{BUG_TITLE}}`
235
249
  - Include both fix code and reproduction test
236
- - Do NOT push
250
+ - The runtime controls any optional remote publication after the local commit; do not make a publication decision in this session
237
251
 
238
252
  **e.** Final verification:
239
253
  ```bash
@@ -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`, and `local_commit_authorized=true`. The runtime controls any optional remote publication after the local commit; do not make a publication decision in this session.
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 .`.
@@ -181,7 +199,7 @@ Run `/prizmkit-committer` with commit prefix:
181
199
  refactor({{REFACTOR_ID}}): {{REFACTOR_TITLE}}
182
200
  ```
183
201
 
184
- Do not push.
202
+ The runtime controls any optional remote publication after this local commit; do not make a publication decision in this session.
185
203
 
186
204
  Write `.prizmkit/refactor/{{REFACTOR_ID}}/refactor-report.md` with:
187
205
  - refactor summary;
@@ -249,7 +267,7 @@ Before exiting, write `{{SESSION_STATUS_PATH}}`:
249
267
  ## Reminders
250
268
 
251
269
  - Use L1 skills: `/prizmkit-plan`, `/prizmkit-implement`, `/prizmkit-code-review`, `/prizmkit-retrospective`, `/prizmkit-committer`.
252
- - Do not spawn a top-level Dev implementation subagent; Code Review runs only in the current Main Agent without delegation.
270
+ - Do not spawn a top-level Dev implementation subagent; Code Review keeps mandatory Main-Agent ownership and may use only its strict-gated skill-owned Reviewer after convergence.
253
271
  - Behavior preservation is the first priority.
254
272
  - Browser verification is a mandatory attempt by default; it blocks only when explicitly required.
255
273
  - If `DEV_PORT` is unknown, discover it from project config; do not guess port 3000.
@@ -1,6 +1,6 @@
1
1
  ### Phase 4: Commit & Learn
2
2
 
3
- This phase is included only for sessions allowed to commit. Fresh manual/hybrid bugfix prompts omit this phase entirely and stop as partial before retrospective/commit.
3
+ This phase follows successful automated, manual, or hybrid verification and runs only after the authoritative test gate permits commit.
4
4
 
5
5
  **Bug Fix Documentation Policy**:
6
6
  - Default: run `/prizmkit-retrospective` with structural sync only.
@@ -17,7 +17,7 @@ Run `/prizmkit-committer` with commit prefix:
17
17
  fix({{FIX_SCOPE}}): {{BUG_TITLE}}
18
18
  ```
19
19
 
20
- Do not push.
20
+ The runtime controls any optional remote publication after this local commit; do not make a publication decision in this session.
21
21
 
22
22
  Write `.prizmkit/bugfix/{{BUG_ID}}/fix-report.md` with:
23
23
  - root cause summary;
@@ -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
 
@@ -2,14 +2,9 @@
2
2
 
3
3
  `verification_type` is `{{VERIFICATION_TYPE}}`.
4
4
 
5
- For a fresh bugfix session, manual/hybrid verification is blocking before commit:
5
+ L4 is always headless and must complete manual/hybrid verification automatically. Do not ask for a user, wait for UAT, or stop as `partial`.
6
6
 
7
- 1. Write `{{SESSION_STATUS_PATH}}` with:
8
- - `status`: `partial`
9
- - `can_resume`: `true`
10
- - `resume_from_phase`: `4`
11
- - explanation that manual UAT is required before commit
12
- 2. Document the UAT checklist in `.prizmkit/bugfix/{{BUG_ID}}/fix-report.md` or `failure-log.md`.
13
- 3. Stop before `/prizmkit-retrospective` and `/prizmkit-committer`.
14
-
15
- Recovery-class sessions (retry, resume, continuation, context overflow) may substitute automated verification for manual/hybrid UAT, but must document the substitution evidence before committing.
7
+ 1. Select the available non-interactive verification path: browser tooling, CLI/API checks, fixtures, project test commands, or another deterministic local check.
8
+ 2. Cover the reported behavior and acceptance criteria; for browser-visible behavior, capture both the original reproduction and post-fix result when the configured tooling is available.
9
+ 3. Record the selected verification method, commands/tool, inputs, outputs, limitations, and evidence paths in `.prizmkit/bugfix/{{BUG_ID}}/fix-report.md` and the session/checkpoint metadata.
10
+ 4. Continue through the authoritative `prizmkit-test` gate, `/prizmkit-retrospective`, and `/prizmkit-committer` when all gates pass. Missing or blocked verification evidence is `TEST_BLOCKED`, not a request for user input.
@@ -1,24 +1,14 @@
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 mandatory Main-Agent review loop for up to ten completed rounds: the Main Agent reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings. After convergence, one skill-owned independent Reviewer is optional only when the strict structural capability gate passes; otherwise no Reviewer is created.
16
6
 
17
- The Code Review execution boundary is absolute for this phase:
7
+ The Code Review execution boundary is closed for this phase:
18
8
 
19
- - Do not delegate any review work directly or indirectly.
20
- - Do not invoke another review skill or review workflow.
21
- - Do not use a general-purpose execution unit for review or relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep.
9
+ - Do not delegate the mandatory Main-Agent review or invoke another review skill or workflow.
10
+ - Do not add review execution outside the single optional Reviewer owned and gated by `prizmkit-code-review`.
11
+ - The optional Reviewer must be structurally read-only, unable to execute arbitrary commands or downstream execution, and natively resumable as the same unit; otherwise strict downgrade applies.
22
12
  - Direct reading, searching, editing, and testing by the current Main Agent remain allowed.
23
13
  - `review-report.md` is the only persisted review artifact; do not append separate Review Notes to another artifact.
24
14
 
@@ -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.
@@ -28,4 +28,4 @@ Before exiting, write the session status file:
28
28
  }
29
29
  ```
30
30
 
31
- For fresh manual/hybrid partial stops, set `status="partial"`, `can_resume=true`, and `resume_from_phase=4`.
31
+ For manual/hybrid verification, record the selected automated verification method and evidence in `manual_verification_policy`; never use a partial stop solely because the plan labels verification as manual or hybrid.
@@ -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.
@@ -6,7 +6,7 @@ You are running in **headless non-interactive mode** with a FINITE context windo
6
6
 
7
7
  1. **context-snapshot.md is your single source of truth** — After it is available, use it instead of re-reading individual source files. If you just created or updated it in this session, continue from the in-context content; read it only when resuming/continuing, after context compaction/loss, or when handing work to a subagent.
8
8
  2. **Never re-read your own writes** — After you create/modify a file, do NOT read it back to verify. Trust your write was correct.
9
- 3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use platform file/search tools for targeted lookup; when shell-free helper lookup is needed, run `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<pattern>" --json`, then read only the smallest bounded range with the platform file-reading tool instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files summarized in context-snapshot.md Section 4. Normal work delegation outside Code Review must receive context-snapshot.md and rely on it rather than independently re-reading files the Main Agent already read. Code Review is excluded from normal work delegation and runs only in the current Main Agent.
9
+ 3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use platform file/search tools for targeted lookup; when shell-free helper lookup is needed, run `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<pattern>" --json`, then read only the smallest bounded range with the platform file-reading tool instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files summarized in context-snapshot.md Section 4. Normal work delegation outside the optional skill-owned review contract must receive context-snapshot.md and rely on it rather than independently re-reading files the Main Agent already read. Code Review keeps mandatory Main-Agent ownership and may use only its strict-gated skill-owned Reviewer after convergence.
10
10
  4. **Stay focused** — Do NOT explore code unrelated to this feature. No curiosity-driven reads.
11
11
  5. **One task at a time** — Complete and test one task before starting the next.
12
12
  6. **Minimize tool output** — Never load full command output into context. First capture command output to a temp file using the command/tool output option or the host-appropriate redirection, then inspect only the final relevant lines and use targeted search helpers to extract the information needed for the current task. Only read the filtered result — never the raw full output.
@@ -0,0 +1,15 @@
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
+ }
13
+ ```
14
+
15
+ 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. Remote publication is controlled by the runtime after the local commit; do not make a publication decision in this session. If the execution context is absent or invalid, mark the task blocked and exit; do not ask the user.
@@ -27,7 +27,7 @@ git add .prizmkit/prizm-docs/
27
27
 
28
28
  **d.** Run `/prizmkit-committer` → THE ONLY commit for this feature:
29
29
  `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`
30
- This single commit includes: feature code + tests + .prizmkit/prizm-docs/ updates. Do NOT push.
30
+ This single commit includes: feature code + tests + .prizmkit/prizm-docs/ updates.
31
31
  - MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
32
32
  - Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
33
33
 
@@ -72,4 +72,4 @@ After all of the following are true, the session is **TERMINAL**:
72
72
  - `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` is written
73
73
  - the `prizmkit-committer` checkpoint is marked `completed`
74
74
 
75
- At that point, stop immediately. Do **not** process delayed normal-work results, edit files, amend the commit, or start any new tool calls. Code Review cannot have delayed delegated findings because it runs only in the current Main Agent. Any normal-work result that arrives after S09 is completed is follow-up work for a later session, not part of this feature commit.
75
+ At that point, stop immediately. Do **not** process delayed normal-work results, edit files, amend the commit, or start any new tool calls. Code Review must end its optional Reviewer lifecycle before Final Result, so no independent-review response remains pending. Any normal-work result that arrives after S09 is completed is follow-up work for a later session, not part of this feature commit.
@@ -15,7 +15,7 @@ git add .prizmkit/prizm-docs/
15
15
 
16
16
  **c.** Run `/prizmkit-committer` → THE ONLY commit for this feature:
17
17
  `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`
18
- This single commit includes: feature code + tests + .prizmkit/prizm-docs/ updates. Do NOT push.
18
+ This single commit includes: feature code + tests + .prizmkit/prizm-docs/ updates.
19
19
  - MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
20
20
  - Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
21
21
 
@@ -58,4 +58,4 @@ After all of the following are true, the session is **TERMINAL**:
58
58
  - `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` is written
59
59
  - the `prizmkit-committer` checkpoint is marked `completed`
60
60
 
61
- At that point, stop immediately. Do **not** process delayed normal-work results, edit files, amend the commit, or start any new tool calls. Code Review cannot have delayed delegated findings because it runs only in the current Main Agent. Any normal-work result that arrives after S09 is completed is follow-up work for a later session, not part of this feature commit.
61
+ At that point, stop immediately. Do **not** process delayed normal-work results, edit files, amend the commit, or start any new tool calls. Code Review must end its optional Reviewer lifecycle before Final Result, so no independent-review response remains pending. Any normal-work result that arrives after S09 is completed is follow-up work for a later session, not part of this feature commit.
@@ -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.