prizmkit 1.1.125 → 1.1.127

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 (25) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/prizmkit_runtime/reset.py +49 -3
  3. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +75 -14
  4. package/bundled/dev-pipeline/prizmkit_runtime/runtime_helper.py +37 -0
  5. package/bundled/dev-pipeline/prizmkit_runtime/task_checkout.py +267 -0
  6. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +3 -2
  7. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
  8. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +6 -18
  9. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +6 -15
  10. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +8 -9
  11. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +9 -9
  12. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +15 -18
  13. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +11 -17
  14. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +9 -9
  15. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +8 -5
  16. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +1 -1
  17. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +1 -1
  18. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +206 -3
  19. package/bundled/dev-pipeline/tests/test_runtime_helper.py +36 -0
  20. package/bundled/dev-pipeline/tests/test_unified_cli.py +10 -7
  21. package/bundled/skills/_metadata.json +1 -1
  22. package/bundled/skills/prizmkit-code-review/SKILL.md +128 -95
  23. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +89 -25
  24. package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +246 -114
  25. package/package.json +1 -1
@@ -811,7 +811,7 @@ def test_session_preamble_writes_redacted_start_command_for_all_launch_profiles(
811
811
  assert str(prompt) not in "\n".join(lines[:6])
812
812
 
813
813
 
814
- def test_headless_review_guidance_uses_minimal_reviewer_loop():
814
+ def test_headless_review_guidance_uses_risk_routed_dual_layer_loop():
815
815
  headless_guidance_files = [
816
816
  REPO_ROOT / "dev-pipeline" / "templates" / "sections" / "phase-review-full.md",
817
817
  REPO_ROOT / "dev-pipeline" / "templates" / "bootstrap-tier3.md",
@@ -827,10 +827,10 @@ def test_headless_review_guidance_uses_minimal_reviewer_loop():
827
827
 
828
828
  for path in headless_guidance_files:
829
829
  text = path.read_text(encoding="utf-8")
830
- assert "platform-supported" in text, path
831
- assert "active checkout" in text, path
832
- assert "platform-forced worktree" in text, path
833
830
  assert "Main-Agent self-review" in text, path
831
+ assert "low=0" in text and "medium=1" in text and "high=2" in text, path
832
+ assert "Reviewer 3 is forbidden" in text, path
833
+ assert "text final-verdict" in text, path
834
834
  assert "workspace-equivalent" not in text, path
835
835
  assert "workspace protocol" not in text, path
836
836
  assert "current-workspace / active-checkout / no-worktree" not in text, path
@@ -838,16 +838,17 @@ def test_headless_review_guidance_uses_minimal_reviewer_loop():
838
838
  assert ".prizmkit/state/worktrees/..." not in text, path
839
839
  assert "USE_WORKTREE" not in text, path
840
840
  assert "isolation:" not in text, path
841
- assert "Read existing source files in the modules this plan touches" not in text, path
842
841
 
843
842
  skill_text = skill_path.read_text(encoding="utf-8")
844
843
  assert "staged and unstaged tracked changes" in skill_text
845
844
  assert "untracked files" in skill_text
846
845
  assert "accepted = 0" in skill_text
847
- assert "all findings are rejected" in skill_text
846
+ assert "low: 0" in skill_text and "medium: 1" in skill_text and "high: 2" in skill_text
847
+ assert "accepted high-severity finding" in skill_text
848
+ assert "Do not launch Reviewer 3" in skill_text
849
+ assert "## Final Result" in skill_text
848
850
  assert "BLOCKED" in skill_text
849
851
  assert "Do not substitute Main-Agent self-review" in skill_text
850
- assert "platform forces an isolated worktree" in skill_text
851
852
  assert "reviewer-workspace-protocol.md" not in skill_text
852
853
  assert "reviewer-execution-protocol.md" not in skill_text
853
854
  assert "WORKSPACE_MISMATCH" not in skill_text
@@ -2233,6 +2234,7 @@ def test_materialize_worktree_support_assets_copies_ignored_assets_without_retir
2233
2234
  (repo / ".prizmkit" / "dev-pipeline" / "prizmkit_runtime").mkdir(parents=True)
2234
2235
  (repo / ".prizmkit" / "dev-pipeline" / "prizmkit_runtime" / "__init__.py").write_text("", encoding="utf-8")
2235
2236
  (repo / ".prizmkit" / "dev-pipeline" / "prizmkit_runtime" / "runtime_helper.py").write_text("# helper", encoding="utf-8")
2237
+ (repo / ".prizmkit" / "dev-pipeline" / "prizmkit_runtime" / "task_checkout.py").write_text("# checkout", encoding="utf-8")
2236
2238
  (repo / ".prizmkit" / "dev-pipeline" / "run-feature.sh").write_text("retired", encoding="utf-8")
2237
2239
 
2238
2240
  runtime = worktree_runtime_context(
@@ -2253,6 +2255,7 @@ def test_materialize_worktree_support_assets_copies_ignored_assets_without_retir
2253
2255
  assert (runtime.worktree_path / ".prizmkit" / "dev-pipeline" / "scripts" / "update-checkpoint.py").is_file()
2254
2256
  assert (runtime.worktree_path / ".prizmkit" / "dev-pipeline" / "prizmkit_runtime" / "__init__.py").is_file()
2255
2257
  assert (runtime.worktree_path / ".prizmkit" / "dev-pipeline" / "prizmkit_runtime" / "runtime_helper.py").is_file()
2258
+ assert (runtime.worktree_path / ".prizmkit" / "dev-pipeline" / "prizmkit_runtime" / "task_checkout.py").is_file()
2256
2259
  assert not (runtime.worktree_path / ".prizmkit" / "dev-pipeline" / "run-feature.sh").exists()
2257
2260
 
2258
2261
  assert guarded_worktree_remove(runtime, delete_branch=False).ok
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.125",
2
+ "version": "1.1.127",
3
3
  "skills": {
4
4
  "prizmkit": {
5
5
  "description": "Full-lifecycle dev toolkit. Covers spec-driven development, Prizm context docs, code quality, debugging, deployment, and knowledge management.",
@@ -1,169 +1,202 @@
1
1
  ---
2
2
  name: "prizmkit-code-review"
3
- description: "Run a practical convergence-driven independent code review against the current spec, plan, workspace changes, applicable rules, contracts, and test evidence. Use after /prizmkit-implement, before commit when review is required, or whenever the user asks to review code, validate an implementation, find defects, assess regressions, or decide whether changes are ready. Each completed round launches one fresh read-only non-delegating Reviewer; the Main Agent filters findings, directly repairs accepted issues, and repeats until no accepted finding remains or the ten-round safety fuse stops review. (project)"
3
+ description: "Run a risk-routed dual-layer code review against the current spec, plan, workspace changes, applicable rules, contracts, and test evidence. The Main Agent first self-reviews and repairs for up to ten rounds, then semantic risk determines whether zero, one, or two fresh read-only independent Reviewers are required. Findings remain Main-Agent adjudicated, Reviewer 3 is forbidden, and one append-only progress report records the execution through PASS, NEEDS_FIXES, or BLOCKED. (project)"
4
4
  ---
5
5
 
6
6
  # PrizmKit Code Review
7
7
 
8
- Run an independent review-fix loop over the complete current change. A fresh Reviewer discovers candidate defects; the Main Agent adjudicates every finding, directly repairs accepted issues, and owns the final verdict.
8
+ Use a dual-layer review loop: the Main Agent owns iterative review and repair, while fresh independent Reviewers act only as semantic-risk gates.
9
9
 
10
10
  ## When to Use
11
11
 
12
12
  - After `/prizmkit-implement` as the Full path quality gate
13
- - For Fast path when scope, risk, or the user warrants review
14
- - When the user asks to review code, validate implementation, find defects, check regressions, or assess commit readiness
15
- - Before `/prizmkit-committer` when the selected lifecycle requires review
16
-
17
- ## When Not to Use
18
-
19
- - Direct edit or low-risk Fast path where review is intentionally skipped
20
- - No task goal, specification, plan, or other review contract can be identified
21
- - Trivial changes the user explicitly wants committed without review
13
+ - For Fast path when behavior, risk, or the user warrants review
14
+ - When the user asks to validate implementation, find defects, assess regressions, or decide commit readiness
22
15
 
23
16
  ## Input
24
17
 
25
18
  | Parameter | Required | Description |
26
19
  |---|---|---|
27
- | `artifact_dir` | No | Directory containing `spec.md` and `plan.md`. Reuse a caller-provided directory. Otherwise locate the most recently modified completed change artifact under `.prizmkit/`. |
20
+ | `artifact_dir` | No | Directory containing `spec.md` and `plan.md`. Reuse a caller-provided directory; otherwise locate the current completed change artifact. |
28
21
 
29
22
  ## Required Assets
30
23
 
31
- Read before starting the loop:
32
-
33
- - `${SKILL_DIR}/references/reviewer-agent-prompt.md`: complete Reviewer input and output contract
34
- - `${SKILL_DIR}/references/review-report-template.md`: final report contract
35
- - `${SKILL_DIR}/assets/reviewer-role.json`: semantic read-only and non-delegating Reviewer boundary used by platform adapters
24
+ - `${SKILL_DIR}/references/reviewer-agent-prompt.md`: independent Reviewer input and output contract
25
+ - `${SKILL_DIR}/references/review-report-template.md`: report lifecycle and append contract
26
+ - `${SKILL_DIR}/assets/reviewer-role.json`: semantic read-only and non-delegating Reviewer boundary
36
27
 
37
- The contract defines semantic capabilities rather than depending on a platform-specific tool or Agent name.
28
+ Do not weaken or summarize the Reviewer prompt. The protocol specifies semantic capabilities rather than platform-specific tool names.
38
29
 
39
- ## Phase 0: Collect Review Context
30
+ ## Phase 0: Initialize Report and Collect Context
40
31
 
41
- 1. Read `spec.md` and extract goals plus acceptance criteria when it exists.
42
- 2. Read `plan.md` and extract architecture decisions plus completed tasks when it exists.
43
- 3. Read scoped `/prizmkit-test` evidence when `{artifact_dir}/test-report-path.txt` exists. Preserve its verdict, in-scope failures, baseline failures, gaps, and boundary evidence.
44
- 4. Read `.prizmkit/prizm-docs/root.prizm`, applicable progressive docs, and project rules.
45
- 5. Inspect and capture the complete current Git change:
32
+ 1. Resolve `{artifact_dir}` and `{artifact_dir}/review-report.md`.
33
+ 2. replace any prior report with a new execution header using the report template. The new report begins with `## Status: IN_PROGRESS` and contains no prior Final Result.
34
+ 3. Read `spec.md`, `plan.md`, relevant `/prizmkit-test` evidence, `.prizmkit/prizm-docs/root.prizm`, applicable progressive docs, and project rules.
35
+ 4. Inspect and capture the complete current Git change:
46
36
  - staged and unstaged tracked changes;
47
37
  - untracked files;
48
38
  - deleted and renamed files;
49
- - the base revision and relevant unchanged callers, dependents, contracts, and tests.
50
- 6. Prepare the Reviewer input with staged and unstaged Git diffs plus the full content of every untracked file. Include deleted and renamed states explicitly. The Reviewer role may have file-reading capabilities without shell or Git execution, so a changed-path inventory alone is insufficient.
51
- 7. If no changes exist, skip Reviewer launch, write a zero-round `PASS` report, and finish.
39
+ - relevant unchanged callers, dependents, contracts, and tests.
40
+ 5. Preserve the existing Reviewer input behavior: staged and unstaged Git diffs, full content of every untracked file, and explicit deleted/renamed states.
41
+ 6. If no changes exist, append risk `low` and exactly one final result with `PASS`, then finish without a Reviewer.
52
42
 
53
43
  ### Checkout Access
54
44
 
55
- Prefer a Reviewer that can read the active checkout directly. Give it the repository path, staged and unstaged Git diffs, the full content of every untracked file, and the changed-path inventory. Direct checkout access lets the Reviewer perform targeted surrounding-context reads without requiring shell or Git execution.
45
+ Prefer direct access to the active checkout. If the platform forces an isolated worktree, provide the same staged and unstaged diffs, untracked file contents, and changed-path states; use the worktree only for baseline and surrounding-context reads. Do not require workspace-equivalence proof.
46
+
47
+ ## Phase 1: Semantic Risk Assessment
48
+
49
+ Classify the current change from behavior and failure impact, not changed-file count or a fixed path allowlist:
56
50
 
57
- If the platform forces an isolated worktree:
51
+ - `low: 0` independent Reviewers documentation, test text, mechanical change, local low-impact configuration, or trivially verifiable behavior.
52
+ - `medium: 1` independent Reviewer — general business behavior, internal interface changes, or non-critical data processing with user-visible regression potential.
53
+ - `high: 2` independent Reviewers maximum — payments, financial ledgers, authentication, authorization, security, migration, concurrent transactions, irreversible data operations, or public contracts.
58
54
 
59
- 1. provide the same staged and unstaged diffs, untracked file contents, and changed-path states used for active-checkout review;
60
- 2. tell the Reviewer to use the worktree only for baseline and surrounding-context reads;
61
- 3. clearly label supplied changed content separately from unchanged context;
62
- 4. do not require the Reviewer to prove that the two physical checkouts are identical.
55
+ Mixed risks use the highest applicable level. A large mechanical diff is not automatically high; a small money or authorization change is high.
63
56
 
64
- If required changed content is missing, supply it before consuming the review. If essential context cannot be made available, return `BLOCKED` with a concise infrastructure reason.
57
+ Append `## Risk Assessment` with the selected risk and concrete reasons before review begins.
65
58
 
66
- ## Phase 1: Convergence Loop
59
+ ## Phase 2: Main-Agent Self-Review Loop
67
60
 
68
- Track only:
61
+ The Main Agent reviews and repairs in the current context. Track Main-Agent rounds independently from Reviewer launch attempts:
69
62
 
70
63
  ```yaml
71
- round: 1
72
- completed_rounds: 0
73
- final_verdict: null
74
- findings: []
64
+ main_review_rounds: 0
65
+ independent_reviewers_started: 0
66
+ reviewer_1_accepted_high: false
75
67
  ```
76
68
 
77
- The safety fuse is fixed at ten completed rounds. It is not caller-configurable and never converts unresolved defects into `PASS`.
69
+ Every Reviewer Agent launch attempt increments `independent_reviewers_started`, including a retry that starts a new Agent. The total may never exceed the semantic-risk limit.
78
70
 
79
- ### Step 1: Launch One Fresh Reviewer
71
+ ### Main-Agent Self-Review Loop
72
+
73
+ Each round examines the complete current change against goals, contracts, rules, callers, dependents, regression risks, and test evidence.
74
+
75
+ 1. Identify concrete candidate findings.
76
+ 2. Classify each as:
77
+ - `accepted`: evidence supports the failure scenario;
78
+ - `rejected`: code or governing evidence disproves it or its regression path.
79
+ 3. Append `## Main Review Round N` with findings, accepted, rejected, and next action.
80
+ 4. Apply these rules:
81
+
82
+ ```text
83
+ accepted = 0 -> self-review converged
84
+ accepted > 0 and round < 10 -> Main Agent directly repairs, verifies, and continues
85
+ accepted > 0 at ten completed Main-Agent rounds -> NEEDS_FIXES
86
+ repair cannot be completed safely -> NEEDS_FIXES
87
+ unresolved new in-scope test failure -> NEEDS_FIXES
88
+ ```
80
89
 
81
- 1. Select an execution mechanism that actually limits the Reviewer to read-only inspection and prevents workspace mutation, downstream execution creation, delegation, orchestration re-entry, and skill invocation.
82
- 2. Launch exactly one fresh foreground Reviewer for this round.
83
- 3. Provide the complete current review input using `${SKILL_DIR}/references/reviewer-agent-prompt.md`.
84
- 4. Do not provide previous-round findings, verdicts, filtering decisions, rejection reasons, or repair explanations.
90
+ When all findings are rejected, `accepted = 0` and the phase converges. Main-Agent rounds never increase the independent Reviewer counter. The fixed limit is ten completed Main-Agent rounds.
85
91
 
86
- Do not substitute Main-Agent self-review. If the Reviewer cannot start or exits abnormally, return `BLOCKED`. This does not consume a completed round.
92
+ After each repair batch, append `## Repair Verification` with fixed findings, verification evidence, and next phase.
87
93
 
88
- ### Step 2: Complete Independent Review
94
+ ## Phase 3: Independent Reviewer 1
89
95
 
90
- The Reviewer evaluates the complete current change, not only the latest repair. It checks requirements, implementation completeness, concrete failure scenarios, error handling, security, data integrity, concurrency, contracts, compatibility, tests, and project rules.
96
+ After Main-Agent self-review and required tests converge:
91
97
 
92
- It may inspect unchanged callers, dependents, shared patterns, and tests when needed to establish a concrete issue. Prefer targeted read-only inspection over broad repository scans or redundant verification.
98
+ - low risk: skip all independent Reviewers and proceed to final verification;
99
+ - medium or high risk: launch Reviewer 1.
93
100
 
94
- A usable result is either:
101
+ Before launch, append:
95
102
 
96
- - `PASS`: no concrete finding;
97
- - `FINDINGS`: one or more structured candidate defects.
103
+ ```markdown
104
+ ## Independent Reviewer 1
98
105
 
99
- If output is partial, malformed, or cannot be understood safely, return `BLOCKED`. This does not consume a completed round.
106
+ - Status: RUNNING
107
+ - Risk Trigger: <medium|high>
108
+ ```
100
109
 
101
- ### Step 3: Main Agent Filters Findings
110
+ Launch exactly one fresh foreground Reviewer using the unchanged prompt and role. Do not provide previous review findings, filtering decisions, rejection reasons, or repair explanations.
102
111
 
103
- A usable Reviewer result completes the current round. Increment `completed_rounds` before adjudication.
112
+ ### Reviewer Infrastructure Failure
104
113
 
105
- For every finding, classify it as:
114
+ If the Reviewer cannot start, exits abnormally, returns unusable output, or lacks essential context:
106
115
 
107
- - `accepted`: current code and governing evidence support the concrete failure scenario;
108
- - `rejected`: code, requirements, contracts, or tests concretely disprove it, or show that it is outside scope with no regression path.
116
+ 1. append the observable failure;
117
+ 2. count the failed launch attempt against the semantic-risk Reviewer limit;
118
+ 3. allow at most one infrastructure retry at this same Reviewer position only when the risk limit still has an unused launch;
119
+ 4. append a new RUNNING retry section before retrying and increment the Reviewer launch counter;
120
+ 5. if the retry fails or the risk limit is exhausted, append Final Result `BLOCKED` and stop;
121
+ 6. do not convert infrastructure failure into a code finding;
122
+ 7. Do not substitute Main-Agent self-review for a required independent result.
109
123
 
110
- Record a concise evidence-based reason for every rejected finding. Do not reject a finding because it is inconvenient, uncertain, low severity, or expensive to repair. When a potentially real defect cannot be refuted, accept it or leave it unresolved.
124
+ ### Finding Adjudication
111
125
 
112
- Apply these rules exactly:
126
+ For a usable Reviewer result, append `## Independent Reviewer 1 Result`, then classify every finding as accepted or rejected with evidence.
113
127
 
114
128
  ```text
115
- Reviewer returns PASS -> PASS
116
- Reviewer returns findings and accepted = 0 -> PASS
117
- Reviewer returns findings and accepted > 0 -> repair or stop
129
+ accepted = 0 -> Reviewer 1 converged
130
+ accepted > 0 -> Main Agent repairs, verifies, and reruns its self-review loop
118
131
  ```
119
132
 
120
- When all findings are rejected, `accepted = 0`; the review is `PASS` because the Reviewer found no valid defect. Do not launch another Reviewer merely because the raw Reviewer result contained findings.
133
+ Accepted findings do not automatically trigger another independent Reviewer.
121
134
 
122
- ### Step 4: Repair or Stop
135
+ ## Phase 4: Reviewer 2 Eligibility
123
136
 
124
- When `accepted > 0`:
137
+ Reviewer 2 is allowed only when every condition is true:
125
138
 
126
- 1. If `completed_rounds` is ten, return `NEEDS_FIXES` and record the accepted findings as unresolved.
127
- 2. Otherwise the Main Agent directly repairs every accepted finding that can be fixed safely within scope. Do not launch a Fixer or implementation subagent.
128
- 3. Run the narrowest meaningful verification for the repair.
129
- 4. If a finding cannot be repaired safely, return `NEEDS_FIXES` and record why it remains unresolved.
130
- 5. Recollect the complete current change, increment `round`, and launch a fresh Reviewer with no previous-round findings or repair history.
139
+ - risk is `high`;
140
+ - Reviewer 1 contained at least one accepted high-severity finding;
141
+ - all accepted high findings were repaired;
142
+ - targeted verification passed;
143
+ - Main-Agent self-review reconverged.
131
144
 
132
- ## Phase 2: Persist Final Report
145
+ Accepted medium or low findings alone never trigger Reviewer 2. Medium risk never starts Reviewer 2.
133
146
 
134
- Write exactly one required review artifact:
147
+ When eligible, append a RUNNING section and launch one fresh Reviewer 2 with the unchanged complete-review prompt and current change input.
135
148
 
136
- ```text
137
- {artifact_dir}/review-report.md
138
- ```
149
+ After Reviewer 2:
150
+
151
+ - accepted = 0: proceed to final verification;
152
+ - accepted > 0: Main Agent repairs, verifies, and runs its final self-review loop;
153
+ - unresolved repair: `NEEDS_FIXES`;
154
+ - Do not launch Reviewer 3 under any condition.
155
+
156
+ ## Phase 5: Append-Only Reporting
157
+
158
+ `{artifact_dir}/review-report.md` is the only required persisted review artifact.
159
+
160
+ Within one execution, append new sections only. Do not rewrite an earlier progress section. Append after:
161
+
162
+ - risk assessment;
163
+ - every Main-Agent review round;
164
+ - every repair and verification batch;
165
+ - every Reviewer launch;
166
+ - every Reviewer result and adjudication;
167
+ - every infrastructure retry;
168
+ - final verification.
139
169
 
140
- Use `${SKILL_DIR}/references/review-report-template.md`. The report records:
170
+ A RUNNING section is not edited after completion; append a separate result section. An interrupted execution remains `IN_PROGRESS` and shows its latest running or completed phase.
141
171
 
142
- - `PASS`, `NEEDS_FIXES`, or `BLOCKED`;
143
- - completed round count;
144
- - findings and their `fixed`, `rejected`, or `unresolved` disposition;
145
- - a concise final summary;
146
- - an infrastructure reason when blocked.
172
+ ## Phase 6: Final Result
147
173
 
148
- Do not create a separate persisted review state file. Raw Reviewer output remains in the session log.
174
+ Append exactly one final result:
149
175
 
150
- The report may be rendered directly or with the optional helper by sending minimal JSON on standard input:
176
+ ```markdown
177
+ ## Final Result
151
178
 
152
- ```bash
153
- python3 ${SKILL_DIR}/scripts/render_review_report.py \
154
- {artifact_dir}/review-report.md < review-report-input.json
179
+ - Verdict: PASS | NEEDS_FIXES | BLOCKED
180
+ - Risk: low | medium | high
181
+ - Main Review Rounds: <count>
182
+ - Independent Reviewers Started: <count>
183
+ - Accepted Findings: <count>
184
+ - Fixed Findings: <count>
185
+ - Rejected Findings: <count>
186
+ - Unresolved Findings: <count>
187
+ - Summary: <concise conclusion>
155
188
  ```
156
189
 
157
- The input may be transient; it is not a required artifact.
190
+ Final outcomes:
158
191
 
159
- ## Final Outcomes
192
+ - `PASS`: Main-Agent review converged, every required independent review completed, and no accepted finding remains unresolved.
193
+ - `NEEDS_FIXES`: Main-Agent round ten still has accepted findings, a repair is unsafe, or verification remains unresolved.
194
+ - `BLOCKED`: a required independent Reviewer position failed and either its one permitted retry failed or the semantic-risk launch limit left no retry capacity; essential independent-review context is unavailable.
160
195
 
161
- - `PASS`: no changes existed, the Reviewer returned `PASS`, or a completed round left `accepted = 0`, including when all findings are rejected.
162
- - `NEEDS_FIXES`: accepted findings remain unresolved or the tenth completed round still has accepted findings.
163
- - `BLOCKED`: Reviewer execution or essential review input failed before a usable result was obtained.
196
+ Exactly one final result is allowed. Do not append progress after Final Result.
164
197
 
165
198
  Completion handoff:
166
199
 
167
200
  - `PASS`: run `/prizmkit-retrospective` when structural docs or durable knowledge changed; otherwise proceed to `/prizmkit-committer`.
168
- - `NEEDS_FIXES`: report unresolved code findings and stop.
169
- - `BLOCKED`: report the infrastructure reason and allow retry without consuming the code-convergence budget.
201
+ - `NEEDS_FIXES`: report unresolved findings and stop.
202
+ - `BLOCKED`: report infrastructure evidence and permit recovery.
@@ -1,40 +1,104 @@
1
- # Review Report Output Template
1
+ # Review Report Lifecycle Template
2
2
 
3
- Write the final result to `{artifact_dir}/review-report.md`. This is the only required persisted review artifact.
3
+ `{artifact_dir}/review-report.md` is the only required persisted review artifact.
4
+
5
+ ## Execution Start
6
+
7
+ Every `/prizmkit-code-review` execution replaces any prior report with:
4
8
 
5
9
  ```markdown
6
10
  # Review Report
7
11
 
8
- ## Verdict: <PASS|NEEDS_FIXES|BLOCKED>
9
- ## Rounds Completed: <number>
10
- ## Total Findings: <total> → Fixed: <fixed>, Rejected: <rejected>, Unresolved: <unresolved>
12
+ ## Status: IN_PROGRESS
13
+ ```
14
+
15
+ Within that execution, append sections only. Never edit or replace an earlier progress section.
16
+
17
+ ## Progress Sections
18
+
19
+ ### Risk Assessment
20
+
21
+ ```markdown
22
+ ## Risk Assessment
23
+
24
+ - Risk: <low|medium|high>
25
+ - Independent Reviewer Limit: <0|1|2>
26
+ - Reasons:
27
+ - <concrete behavioral reason>
28
+ ```
29
+
30
+ ### Main-Agent Review Round
31
+
32
+ ```markdown
33
+ ## Main Review Round <N>
34
+
35
+ - Status: COMPLETED
36
+ - Findings: <count>
37
+ - Accepted: <count>
38
+ - Rejected: <count>
39
+ - Next: <next action>
40
+ ```
41
+
42
+ ### Repair Verification
43
+
44
+ ```markdown
45
+ ## Repair Verification
46
+
47
+ - Source: <main|reviewer-1|reviewer-2>
48
+ - Fixed Findings: <count>
49
+ - Verification: <evidence summary>
50
+ - Next: <next action>
51
+ ```
52
+
53
+ ### Independent Reviewer Running
11
54
 
12
- ## Findings
55
+ ```markdown
56
+ ## Independent Reviewer <N>
13
57
 
14
- ### Finding <N>: <short title>
58
+ - Status: RUNNING
59
+ - Risk Trigger: <medium|high>
60
+ - Attempt: <1|2>
61
+ ```
15
62
 
16
- - Severity: <high|medium|low>
17
- - Location: <filepath:line|project-level>
18
- - Problem: <what was wrong and why it mattered>
19
- - Failure Scenario: <concrete input or state>
20
- - Disposition: <fixed in round N|rejected — concrete evidence|unresolved — reason>
63
+ ### Independent Reviewer Result
21
64
 
22
- ## Blocker
65
+ ```markdown
66
+ ## Independent Reviewer <N> Result
23
67
 
24
- <Include only for BLOCKED: concise infrastructure failure and required action.>
68
+ - Status: <COMPLETED|BLOCKED>
69
+ - Result: <PASS|FINDINGS|BLOCKED>
70
+ - Findings: <count>
71
+ - Accepted: <count>
72
+ - Rejected: <count>
73
+ - Accepted High: <count>
74
+ - Next: <next action>
75
+ ```
25
76
 
26
- ## Summary
77
+ ## Final Result
78
+
79
+ Exactly one Final Result terminates a completed execution:
80
+
81
+ ```markdown
82
+ ## Final Result
27
83
 
28
- <One to three sentences covering the final outcome. Do not expose private reasoning traces.>
84
+ - Verdict: <PASS|NEEDS_FIXES|BLOCKED>
85
+ - Risk: <low|medium|high>
86
+ - Main Review Rounds: <count>
87
+ - Independent Reviewers Started: <count>
88
+ - Accepted Findings: <count>
89
+ - Fixed Findings: <count>
90
+ - Rejected Findings: <count>
91
+ - Unresolved Findings: <count>
92
+ - Summary: <concise conclusion>
29
93
  ```
30
94
 
31
- ## Report Rules
95
+ ## Rules
32
96
 
33
- - A no-change review uses zero completed rounds and returns `PASS`.
34
- - A usable Reviewer result counts as one completed round.
35
- - Reviewer launch failure, abnormal exit, or unusable output returns `BLOCKED` and does not add a completed round.
36
- - `PASS` requires no accepted or unresolved finding. This includes a Reviewer `PASS` and a findings result where the Main Agent rejects every finding with concrete evidence.
37
- - The tenth completed round with accepted findings returns `NEEDS_FIXES`.
38
- - `BLOCKED` describes review infrastructure or missing essential context, not a code defect.
39
- - Overwrite the same report on each execution; keep raw round output only in the session log.
40
- - Do not persist a separate review state file.
97
+ - Start of a new execution removes stale progress and terminal results from prior executions.
98
+ - A phase appends its result before the next phase starts.
99
+ - Append RUNNING before each independent Reviewer launch or retry.
100
+ - Do not modify a RUNNING section after completion; append its Result section.
101
+ - An IN_PROGRESS report without Final Result is incomplete.
102
+ - Generic or incidental verdict text outside the last Final Result does not prove completion.
103
+ - Do not append any section after Final Result.
104
+ - Do not persist a separate review-state JSON file.