prizmkit 1.1.124 → 1.1.125

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 (24) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/claude/command-adapter.js +4 -6
  3. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +3 -4
  4. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
  5. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +4 -3
  6. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +4 -3
  7. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +7 -2
  8. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +5 -4
  9. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +4 -4
  10. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +5 -4
  11. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +6 -5
  12. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +2 -1
  13. package/bundled/dev-pipeline/tests/test_unified_cli.py +16 -10
  14. package/bundled/skills/_metadata.json +4 -4
  15. package/bundled/skills/prizmkit-code-review/SKILL.md +90 -96
  16. package/bundled/skills/prizmkit-code-review/assets/reviewer-role.json +3 -5
  17. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +18 -31
  18. package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +44 -62
  19. package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +86 -112
  20. package/package.json +1 -1
  21. package/bundled/skills/prizmkit-code-review/references/reviewer-execution-protocol.md +0 -179
  22. package/bundled/skills/prizmkit-code-review/references/reviewer-workspace-protocol.md +0 -118
  23. package/bundled/skills/prizmkit-code-review/scripts/check_loop.py +0 -380
  24. package/bundled/skills/prizmkit-code-review/scripts/workspace_snapshot.py +0 -222
@@ -1,5 +1,5 @@
1
1
  {
2
- "frameworkVersion": "1.1.124",
3
- "bundledAt": "2026-07-12T05:54:30.044Z",
4
- "bundledFrom": "f15301f"
2
+ "frameworkVersion": "1.1.125",
3
+ "bundledAt": "2026-07-12T10:06:26.471Z",
4
+ "bundledFrom": "ae3f6a3"
5
5
  }
@@ -46,10 +46,8 @@ function buildReviewerRoleDefinition(roleManifest) {
46
46
  throw new Error(`Reviewer role must make ${capability} unavailable`);
47
47
  }
48
48
  }
49
- if (roleManifest.execution_mode !== 'foreground-single-authority'
50
- || roleManifest.max_descendant_execution_units !== 0
51
- || roleManifest.max_delegation_depth !== 0) {
52
- throw new Error('Reviewer role violates the single-authority execution topology');
49
+ if (roleManifest.execution_mode !== 'foreground-independent-review') {
50
+ throw new Error('Reviewer role must use foreground independent review');
53
51
  }
54
52
 
55
53
  const tools = (roleManifest.observational_capabilities || []).map(capability => {
@@ -64,14 +62,14 @@ name: ${roleManifest.role_name}
64
62
  description: ${roleManifest.description}
65
63
  tools: ${tools.join(', ')}
66
64
  permissionMode: dontAsk
67
- maxTurns: 200
65
+ maxTurns: 80
68
66
  ---
69
67
 
70
68
  You are a capability-restricted read-only Reviewer execution role.
71
69
 
72
70
  Read and follow the complete prompt supplied by the Main Agent. Perform the complete review yourself. Your tool allowlist intentionally excludes workspace mutation, shell execution, skill invocation, downstream execution creation, delegation-equivalent behavior, and orchestration re-entry.
73
71
 
74
- If the supplied review cannot be completed with the available observational capabilities and current execution context, return \`REVIEW_INFRASTRUCTURE_BLOCKED\`. Do not delegate, request a helper, mutate the workspace, or claim \`PASS\` from incomplete work.
72
+ If the supplied review cannot be completed with the available read-only capabilities and current context, return \`BLOCKED\` with the missing capability or context. Do not delegate, request a helper, mutate the workspace, or claim \`PASS\` from incomplete work.
75
73
  `;
76
74
  }
77
75
 
@@ -96,10 +96,9 @@ Implement the minimal fix (red → green):
96
96
  "Review",
97
97
  """\
98
98
  Verify fix quality:
99
- 1. Self-review: does the fix address root cause (not just symptom)?
100
- Edge cases covered? Follows project conventions?
101
- 2. Run full test suite one final time
102
- 3. If any issues found, fix and re-review (max 3 rounds)""",
99
+ 1. Run `/prizmkit-code-review` with the current bugfix artifact directory.
100
+ 2. The skill launches one fresh read-only Reviewer per completed round; the Main Agent filters and directly fixes accepted findings.
101
+ 3. Continue until no accepted finding remains or the ten-round safety fuse returns `NEEDS_FIXES`; stop and retry later if review returns `BLOCKED`.""",
103
102
  ),
104
103
  6: (
105
104
  "User Verification",
@@ -30,7 +30,7 @@ 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}}/` to review and auto-fix changes against the spec (internal review-fix loop, max 3 rounds).
33
+ 4. **Review**: Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill uses one fresh read-only Reviewer per completed round, lets the Main Agent filter and directly fix accepted findings, and stops after at most ten completed rounds.
34
34
 
35
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.
36
36
 
@@ -240,9 +240,9 @@ For each Verification Gate from the Task Contract, write one evidence line to Im
240
240
 
241
241
  Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so the code-review skill can read spec, plan, context snapshot, implementation log, and current diff artifacts. Do not require or read a prior `/prizmkit-test` report here; test generation and test-fix looping happen in the next phase.
242
242
 
243
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill chooses a platform-supported independent Reviewer strategy and verifies that the Reviewer's snapshot is equivalent to the current workspace under its skill-owned workspace protocol. Do not prescribe Agent launch parameters from this bootstrap prompt.
243
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill chooses a platform-supported fresh read-only Reviewer, prefers direct access to the active checkout, and supplies changed content that a platform-forced worktree cannot see. Do not prescribe Agent launch parameters from this bootstrap prompt.
244
244
 
245
- The skill runs an internal review-fix loop (Reviewer Agent filter → orchestrator fix, max 3 rounds) and writes `review-report.md` to the artifact directory.
245
+ The skill runs an internal review-fix loop (fresh Reviewer → Main-Agent filter → Main-Agent fix, up to ten completed rounds) and writes `review-report.md` to the artifact directory.
246
246
 
247
247
  **Gate Check — Review Report**:
248
248
  After `/prizmkit-code-review` returns, verify the review report:
@@ -257,7 +257,8 @@ If GATE:MISSING:
257
257
 
258
258
  Read `review-report.md` and check the Verdict:
259
259
  - `PASS` → proceed to next phase
260
- - `NEEDS_FIXES` → the skill exhausted its max rounds; log the remaining findings and proceed (do not retry externally)
260
+ - `NEEDS_FIXES` → log the unresolved accepted findings and proceed according to the task failure policy (do not retry externally)
261
+ - `BLOCKED` → log the infrastructure reason and stop so the review can be retried
261
262
 
262
263
  **CP-3**: Review complete, report written.
263
264
 
@@ -180,8 +180,8 @@ After implement completes, verify:
180
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.
181
181
 
182
182
  Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`:
183
- - The skill chooses a platform-supported independent Reviewer strategy and verifies a workspace-equivalent snapshot under its skill-owned protocol
184
- - The skill runs an internal review-fix loop (Reviewer → filter → orchestrator fix, max 3 rounds) and writes `review-report.md`
183
+ - The skill chooses a platform-supported fresh read-only Reviewer, prefers direct access to the active checkout, and supplies changed content that a platform-forced worktree cannot see
184
+ - The skill runs an internal review-fix loop (Reviewer → Main-Agent filter → Main-Agent fix, up to ten completed rounds) and writes `review-report.md`
185
185
  - `review-report.md` must contain `## Verdict`
186
186
 
187
187
  **Gate Check — Review Report**:
@@ -196,7 +196,8 @@ If GATE:MISSING:
196
196
 
197
197
  Read `review-report.md` and check the Verdict:
198
198
  - `PASS` → proceed
199
- - `NEEDS_FIXES` → the skill exhausted its max rounds; log remaining findings and proceed
199
+ - `NEEDS_FIXES` → the skill reached the ten-round safety fuse or left an accepted finding unresolved; log remaining findings and proceed according to the task failure policy
200
+ - `BLOCKED` → log the infrastructure reason and stop so the review can be retried
200
201
 
201
202
  {{IF_BROWSER_INTERACTION}}
202
203
 
@@ -139,7 +139,7 @@ Apply the browser behavior preservation protocol where UI behavior can be affect
139
139
 
140
140
  ### Phase 4: Review — Code Review & Behavior Verification
141
141
 
142
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/` directly from the main orchestrator. The skill loads its skill-owned `references/reviewer-agent-prompt.md` and `references/reviewer-workspace-protocol.md`, chooses a platform-supported independent Reviewer strategy, and verifies a workspace-equivalent snapshot.
142
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/` directly from the main orchestrator. The skill loads its skill-owned `references/reviewer-agent-prompt.md`, chooses a platform-supported fresh read-only Reviewer, prefers direct access to the active checkout, and supplies changed content that a platform-forced worktree cannot see.
143
143
 
144
144
  Review requirements:
145
145
  - verify refactor quality against spec.md and plan.md;
@@ -149,7 +149,12 @@ Review requirements:
149
149
 
150
150
  If the report is missing after one bounded status check, write `failure-log.md` and stop with a clear recovery failure. Do not replace the independent Reviewer with Main-Agent self-review.
151
151
 
152
- **Checkpoint update**: set step `prizmkit-code-review` to `completed` in `{{CHECKPOINT_PATH}}`.
152
+ Read `review-report.md` and check the Verdict:
153
+ - `PASS` → proceed.
154
+ - `NEEDS_FIXES` → log unresolved accepted findings and proceed only when they do not block behavior preservation.
155
+ - `BLOCKED` → log the infrastructure reason and stop so the review can be retried.
156
+
157
+ **Checkpoint update**: set step `prizmkit-code-review` to `completed` only after `PASS`, or after an explicitly accepted non-blocking `NEEDS_FIXES` result. Do not complete the checkpoint for `BLOCKED`.
153
158
 
154
159
  ---
155
160
 
@@ -12,9 +12,9 @@ If `FAST_PATH=true`, skip this phase intentionally:
12
12
 
13
13
  Then continue to the next checkpoint step.
14
14
 
15
- Otherwise, run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`. The skill loads its skill-owned Reviewer prompt and workspace protocol, chooses a platform-supported subagent strategy, and verifies that the Reviewer's snapshot is equivalent to the current workspace before review.
15
+ Otherwise, run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`. The skill chooses a platform-supported fresh read-only Reviewer, prefers direct access to the active checkout, and supplies changed content that a platform-forced worktree cannot see.
16
16
 
17
- The skill runs its internal Reviewer Agent filter → orchestrator fix loop and writes `review-report.md`. Do not prescribe Agent launch parameters from this pipeline template; the review skill owns strategy selection and workspace-equivalence verification.
17
+ The skill runs its internal fresh Reviewer → Main-Agent filter → Main-Agent fix loop for up to ten completed rounds and writes `review-report.md`. Do not prescribe Agent launch parameters from this pipeline template.
18
18
 
19
19
  **Gate Check — Review Report**:
20
20
 
@@ -23,7 +23,8 @@ The skill runs its internal Reviewer Agent → filter → orchestrator fix loop
23
23
  ```
24
24
 
25
25
  - `PASS` → proceed.
26
- - `NEEDS_FIXES` → the skill exhausted its internal rounds; log remaining findings and proceed only when they do not block acceptance criteria.
27
- - Missing report one bounded retry, then write `failure-log.md` and stop if the independent review protocol remains blocked; do not replace it with Main-Agent self-review.
26
+ - `NEEDS_FIXES` → log unresolved accepted findings and proceed only when they do not block acceptance criteria.
27
+ - `BLOCKED`log the infrastructure reason and stop so the review can be retried.
28
+ - Missing report → one bounded retry, then write `failure-log.md` and stop if independent review remains blocked; do not replace it with Main-Agent self-review.
28
29
 
29
30
  **Checkpoint update**: Set step `prizmkit-code-review` to `completed` when review is complete, or `skipped` for FAST_PATH.
@@ -2,9 +2,9 @@
2
2
 
3
3
  Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so the code-review skill can read spec, plan, context snapshot, implementation log, and current diff artifacts. Do not require or read a prior `/prizmkit-test` report here; test generation and test-fix looping happen in the next phase.
4
4
 
5
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill loads its skill-owned Reviewer prompt and workspace protocol, chooses a platform-supported subagent strategy, and verifies that the Reviewer's snapshot is equivalent to the current workspace before review.
5
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill chooses a platform-supported fresh read-only Reviewer, prefers direct access to the active checkout, and supplies changed content that a platform-forced worktree cannot see. Do not prescribe Agent launch parameters from this pipeline template.
6
6
 
7
- The skill runs an internal review-fix loop (Reviewer Agent filter → orchestrator fix, max 3 rounds) and writes `review-report.md` to the artifact directory. Do not prescribe Agent launch parameters from this pipeline template; the review skill owns strategy selection and workspace-equivalence verification.
7
+ The skill runs an internal review-fix loop (fresh Reviewer → Main-Agent filter → Main-Agent fix, up to ten completed rounds) and writes `review-report.md` to the artifact directory.
8
8
 
9
9
  **Gate Check — Review Report**:
10
10
  After `/prizmkit-code-review` returns, verify the review report:
@@ -19,8 +19,8 @@ If GATE:MISSING:
19
19
 
20
20
  Read `review-report.md` and check the Verdict:
21
21
  - `PASS` → proceed to next phase
22
- - `NEEDS_FIXES` → the skill exhausted its max rounds; log the remaining findings and proceed (do not retry externally)
22
+ - `NEEDS_FIXES` → log the unresolved accepted findings and proceed according to the task failure policy (do not retry externally)
23
+ - `BLOCKED` → log the infrastructure reason and stop so the review can be retried
23
24
 
24
25
  **CP-3**: Review complete, report written.
25
26
 
26
-
@@ -2,11 +2,11 @@
2
2
 
3
3
  Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so the code-review skill can read spec, plan, context snapshot, implementation log, and current diff artifacts. Do not require or read a prior `/prizmkit-test` report here; test generation and test-fix looping happen in the next phase.
4
4
 
5
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill loads its skill-owned Reviewer prompt and workspace protocol, chooses a platform-supported subagent strategy, and verifies that the Reviewer's snapshot is equivalent to the current workspace before review.
5
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill chooses a platform-supported fresh read-only Reviewer, prefers direct access to the active checkout, and supplies changed content that a platform-forced worktree cannot see. Do not prescribe Agent launch parameters from this bootstrap prompt.
6
6
 
7
- If the independent Reviewer cannot start or verify the snapshot because of a transient platform error, retry at most once. If the second attempt fails, do not keep spawning variants or enter report-polling loops; write `failure-log.md` with the observable error and let the skill report the unresolved verification blocker. Do not replace the independent Reviewer with Main-Agent self-review.
7
+ If the independent Reviewer cannot start or return usable output because of a transient platform error, retry at most once. If the second attempt fails, do not keep spawning variants or enter report-polling loops; write `failure-log.md` with the observable error and let the skill report `BLOCKED`. Do not replace the independent Reviewer with Main-Agent self-review.
8
8
 
9
- The skill runs an internal review-fix loop (Reviewer Agent filter → orchestrator fix, max 3 rounds) and writes `review-report.md` to the artifact directory. Do not prescribe Agent launch parameters from this pipeline template; the review skill owns strategy selection and workspace-equivalence verification.
9
+ The skill runs an internal review-fix loop (fresh Reviewer → Main-Agent filter → Main-Agent fix, up to ten completed rounds) and writes `review-report.md` to the artifact directory. The review skill owns strategy selection and forced-worktree content fallback.
10
10
 
11
11
  **Gate Check — Review Report**:
12
12
  After `/prizmkit-code-review` returns, verify the review report:
@@ -21,7 +21,8 @@ If GATE:MISSING:
21
21
 
22
22
  Read `review-report.md` and check the Verdict:
23
23
  - `PASS` → proceed to next phase
24
- - `NEEDS_FIXES` → the skill exhausted its max rounds; log the remaining findings and proceed (do not retry externally)
24
+ - `NEEDS_FIXES` → log the unresolved accepted findings and proceed according to the task failure policy (do not retry externally)
25
+ - `BLOCKED` → log the infrastructure reason and stop so the review can be retried
25
26
 
26
27
  **CP-3**: Review complete, report written.
27
28
 
@@ -1,8 +1,8 @@
1
1
  ### Phase 3: Review — Code Review & Behavior Verification
2
2
 
3
- Run `/prizmkit-code-review` directly with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`. The skill loads its skill-owned `references/reviewer-agent-prompt.md` and `references/reviewer-workspace-protocol.md`, chooses a platform-supported subagent strategy, and verifies that the Reviewer's snapshot is equivalent to the current workspace before review.
3
+ Run `/prizmkit-code-review` directly with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`. The skill loads its skill-owned `references/reviewer-agent-prompt.md`, chooses a platform-supported fresh read-only Reviewer, prefers direct access to the active checkout, and supplies changed content that a platform-forced worktree cannot see.
4
4
 
5
- Do not spawn a top-level Reviewer subagent. The code-review skill owns its internal Reviewer Agent filter → orchestrator fix loop. Do not prescribe Agent launch parameters from this pipeline template; the review skill owns strategy selection and workspace-equivalence verification.
5
+ Do not spawn a top-level Reviewer subagent. The code-review skill owns its internal fresh Reviewer → Main-Agent filter → Main-Agent fix loop for up to ten completed rounds. Do not prescribe Agent launch parameters from this pipeline template.
6
6
 
7
7
  **Gate Check — Review Report**:
8
8
 
@@ -11,9 +11,10 @@ Do not spawn a top-level Reviewer subagent. The code-review skill owns its inter
11
11
  ```
12
12
 
13
13
  - `PASS` → proceed.
14
- - `NEEDS_FIXES` → the skill exhausted its internal rounds; log remaining findings and proceed only when they do not block behavior preservation.
15
- - Missing report one bounded retry, then write `failure-log.md` and stop if the independent review protocol remains blocked; do not replace it with Main-Agent self-review.
14
+ - `NEEDS_FIXES` → log unresolved accepted findings and proceed only when they do not block behavior preservation.
15
+ - `BLOCKED`log the infrastructure reason and stop so the review can be retried.
16
+ - Missing report → one bounded retry, then write `failure-log.md` and stop if independent review remains blocked; do not replace it with Main-Agent self-review.
16
17
 
17
18
  Verify the review explicitly checks behavior preservation, public API compatibility, imports, tests, and rollback assumptions.
18
19
 
19
- **Checkpoint update**: Set step `prizmkit-code-review` to `completed` when review is complete.
20
+ **Checkpoint update**: Set step `prizmkit-code-review` to `completed` only after `PASS`, or after an explicitly accepted non-blocking `NEEDS_FIXES` result. Do not complete the checkpoint for `BLOCKED`.
@@ -882,7 +882,8 @@ class TestDirectOrchestratorImplementationPrompts:
882
882
  assert FORBIDDEN_TEST_CMD_PLACEHOLDER not in rendered
883
883
  assert FORBIDDEN_THREE_STRIKE not in rendered
884
884
  assert FORBIDDEN_TWENTY_STEP not in rendered
885
- assert "Reviewer Agent filter → orchestrator fix" in rendered
885
+ assert "fresh Reviewer → Main-Agent filter → Main-Agent fix" in rendered
886
+ assert "up to ten completed rounds" in rendered
886
887
 
887
888
  def test_retained_tier3_fallback_template_uses_direct_orchestrator_implementation(self):
888
889
  rendered = Path("dev-pipeline/templates/bootstrap-tier3.md").read_text(encoding="utf-8")
@@ -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_workspace_and_execution_protocols():
814
+ def test_headless_review_guidance_uses_minimal_reviewer_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",
@@ -828,8 +828,11 @@ def test_headless_review_guidance_uses_workspace_and_execution_protocols():
828
828
  for path in headless_guidance_files:
829
829
  text = path.read_text(encoding="utf-8")
830
830
  assert "platform-supported" in text, path
831
- assert "snapshot" in text and "equivalent" in text, path
831
+ assert "active checkout" in text, path
832
+ assert "platform-forced worktree" in text, path
832
833
  assert "Main-Agent self-review" in text, path
834
+ assert "workspace-equivalent" not in text, path
835
+ assert "workspace protocol" not in text, path
833
836
  assert "current-workspace / active-checkout / no-worktree" not in text, path
834
837
  assert ".claude/worktrees/..." not in text, path
835
838
  assert ".prizmkit/state/worktrees/..." not in text, path
@@ -838,14 +841,17 @@ def test_headless_review_guidance_uses_workspace_and_execution_protocols():
838
841
  assert "Read existing source files in the modules this plan touches" not in text, path
839
842
 
840
843
  skill_text = skill_path.read_text(encoding="utf-8")
841
- assert "reviewer-workspace-protocol.md" in skill_text
842
- assert "reviewer-execution-protocol.md" in skill_text
843
- assert "staged, unstaged, untracked, deleted, and renamed" in skill_text
844
- assert "content-equivalent" in skill_text
845
- assert "WORKSPACE_MISMATCH" in skill_text
846
- assert "REVIEW_INFRASTRUCTURE_BLOCKED" in skill_text
847
- assert "do not substitute Main-Agent self-review" in skill_text
848
- assert "platform-specific role" in skill_text
844
+ assert "staged and unstaged tracked changes" in skill_text
845
+ assert "untracked files" in skill_text
846
+ assert "accepted = 0" in skill_text
847
+ assert "all findings are rejected" in skill_text
848
+ assert "BLOCKED" in skill_text
849
+ assert "Do not substitute Main-Agent self-review" in skill_text
850
+ assert "platform forces an isolated worktree" in skill_text
851
+ assert "reviewer-workspace-protocol.md" not in skill_text
852
+ assert "reviewer-execution-protocol.md" not in skill_text
853
+ assert "WORKSPACE_MISMATCH" not in skill_text
854
+ assert "REVIEW_INFRASTRUCTURE_BLOCKED" not in skill_text
849
855
 
850
856
 
851
857
  def test_progress_parser_adds_required_metadata(tmp_path):
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.124",
2
+ "version": "1.1.125",
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.",
@@ -30,11 +30,11 @@
30
30
  "hasScripts": false
31
31
  },
32
32
  "prizmkit-code-review": {
33
- "description": "Code review with fix strategy formulation. Diagnoses issues, then produces structured Fix Instructions with root cause, impact analysis, and verification criteria.",
33
+ "description": "Independent read-only review with Main-Agent finding adjudication, direct repairs, bounded convergence, and a minimal final report.",
34
34
  "tier": "1",
35
35
  "category": "prizmkit-skill",
36
- "hasAssets": false,
37
- "hasScripts": false
36
+ "hasAssets": true,
37
+ "hasScripts": true
38
38
  },
39
39
  "prizmkit-committer": {
40
40
  "description": "Pure git commit workflow with safety checks. Does NOT modify .prizmkit/prizm-docs/.",
@@ -1,13 +1,11 @@
1
1
  ---
2
2
  name: "prizmkit-code-review"
3
- description: "Run a fail-closed, convergence-driven independent code review against the current spec, plan, complete workspace snapshot, 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 round launches exactly one fresh read-only non-delegating Reviewer, validates execution and workspace compliance, then has the Main Agent filter and directly fix accepted findings until PASS or the internal safety fuse stops review. (project)"
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)"
4
4
  ---
5
5
 
6
6
  # PrizmKit Code Review
7
7
 
8
- Run an independent review-fix loop until the current implementation converges. One fresh Reviewer performs each complete review; the Main Agent alone controls rounds, filters findings, and applies accepted fixes.
9
-
10
- The safety boundary is fail-closed. A Reviewer may run only when its execution environment makes workspace mutation, downstream execution creation, delegation-equivalent behavior, and orchestration re-entry unavailable. Prompt promises alone do not establish this boundary.
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.
11
9
 
12
10
  ## When to Use
13
11
 
@@ -28,148 +26,144 @@ The safety boundary is fail-closed. A Reviewer may run only when its execution e
28
26
  |---|---|---|
29
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/`. |
30
28
 
31
- ## Authoritative Protocols
29
+ ## Required Assets
32
30
 
33
- Read these references before starting Phase 1:
31
+ Read before starting the loop:
34
32
 
35
- - `${SKILL_DIR}/references/reviewer-execution-protocol.md`: mandatory execution topology, capability attestation, fail-closed behavior, and convergence rules
36
- - `${SKILL_DIR}/references/reviewer-workspace-protocol.md`: deterministic complete snapshots, content identities, transport reuse, and mismatch handling
37
- - `${SKILL_DIR}/references/reviewer-agent-prompt.md`: complete Reviewer prompt contract; fill placeholders without summarizing or omitting normative sections
38
- - `${SKILL_DIR}/assets/reviewer-role.json`: canonical semantic capability manifest used by platform adapters to construct enforceable Reviewer roles
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
39
36
 
40
- The protocol describes semantic capabilities rather than a platform-specific command or tool denylist. Current platform names in references are non-normative recognition examples only.
37
+ The contract defines semantic capabilities rather than depending on a platform-specific tool or Agent name.
41
38
 
42
- ## Phase 0: Context and Initial Snapshot
39
+ ## Phase 0: Collect Review Context
43
40
 
44
- 1. Read `spec.md` and extract goals plus acceptance criteria.
45
- 2. Read `plan.md` and extract architecture decisions plus completed tasks.
46
- 3. Read scoped `/prizmkit-test` evidence when `{artifact_dir}/test-report-path.txt` exists. Preserve scope, generated or updated tests, in-scope failures, baseline failures, gaps, boundary evidence, and verdict.
47
- 4. Read `.prizmkit/prizm-docs/root.prizm` and applicable project rules. Load only relevant progressive documentation.
48
- 5. Capture a content-equivalent complete current logical workspace according to the workspace protocol, including staged, unstaged, untracked, deleted, and renamed states. Prefer `${SKILL_DIR}/scripts/workspace_snapshot.py` when Python is available.
49
- 6. If no changes exist, skip Reviewer launch and write a no-change `PASS` report with execution metadata `NOT_APPLICABLE`.
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:
46
+ - staged and unstaged tracked changes;
47
+ - untracked files;
48
+ - 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.
50
52
 
51
- ## Phase 1: Convergence Loop
53
+ ### Checkout Access
52
54
 
53
- ### Loop State
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.
54
56
 
55
- Track:
57
+ If the platform forces an isolated worktree:
56
58
 
57
- ```yaml
58
- round: 1
59
- reviewers_started_total: 0
60
- completed_rounds: 0
61
- structured_result_state: <artifact_dir>/review-result-state.json
62
- ```
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.
63
63
 
64
- The internal safety fuse is fixed at ten rounds. It is not caller-configurable, is not a quality target, and never converts unresolved review into `PASS`.
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.
65
65
 
66
- ### Step 1: Establish the Reviewer Boundary
66
+ ## Phase 1: Convergence Loop
67
67
 
68
- 1. Select a fresh Reviewer execution mechanism that satisfies every invariant in the execution protocol.
69
- 2. Establish launch-time capability attestation. Verify that mutation, delegation-equivalent behavior, downstream execution creation, and orchestration re-entry are unavailable.
70
- 3. Ensure the Reviewer receives the complete authoritative prompt template and current snapshot, but no prior findings, verdicts, filtering decisions, Reviewer reasoning, or fix explanations.
71
- 4. In script mode, authorize launch through the strict preflight gate:
68
+ Track only:
72
69
 
73
- ```bash
74
- python3 ${SKILL_DIR}/scripts/check_loop.py < preflight-payload.json
70
+ ```yaml
71
+ round: 1
72
+ completed_rounds: 0
73
+ final_verdict: null
74
+ findings: []
75
75
  ```
76
76
 
77
- 5. Launch exactly one foreground Reviewer only when the gate returns `launchAuthorized: true`.
78
-
79
- A platform-specific role may be used only when its actual launch configuration proves the semantic boundary. For example, an installed project role whose capability allowlist contains only observational file-inspection capabilities can establish the boundary; a generic subagent with prompt-only restrictions cannot.
80
-
81
- If the boundary cannot be established or attested, do not launch a weaker Reviewer and do not substitute Main-Agent self-review. Stop with `NEEDS_FIXES` and blocker `REVIEW_INFRASTRUCTURE_BLOCKED`.
82
-
83
- ### Step 2: Complete Independent Review
84
-
85
- The fresh Reviewer performs the complete review itself. Every round evaluates the complete current change against all applicable requirements, contracts, rules, callers, dependents, regression risks, and test evidence.
86
-
87
- Later rounds are not historical fix verification. They remain complete independent reviews of current code and receive no previous-round finding context.
77
+ The safety fuse is fixed at ten completed rounds. It is not caller-configurable and never converts unresolved defects into `PASS`.
88
78
 
89
- The Reviewer uses two-direction inspection inside the same execution:
79
+ ### Step 1: Launch One Fresh Reviewer
90
80
 
91
- - Code-forward: changed code affected symbols callers and dependents concrete failure scenarios
92
- - Requirement-backward: requirements and contracts required behavior implementation path → side effects → test evidence
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.
93
85
 
94
- Prefer direct read-only inspection, existing valid evidence, and the narrowest verification that can establish or refute a concrete issue. Broad verification is allowed when a concrete cross-cutting risk requires it and narrower evidence is insufficient.
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.
95
87
 
96
- ### Step 3: Validate Reviewer Output Before Consumption
88
+ ### Step 2: Complete Independent Review
97
89
 
98
- Before reading, filtering, or acting on any finding, run the result gate with `filtering_done: false`.
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.
99
91
 
100
- The result is usable only when all of these are proven:
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.
101
93
 
102
- - exactly one fresh Reviewer started in the round;
103
- - capability attestation remains verified;
104
- - descendant execution-unit count is zero;
105
- - delegation depth is zero;
106
- - orchestration status is compliant;
107
- - workspace identity is matched;
108
- - output is complete and structurally valid.
94
+ A usable result is either:
109
95
 
110
- On orchestration violation or unverifiable topology:
96
+ - `PASS`: no concrete finding;
97
+ - `FINDINGS`: one or more structured candidate defects.
111
98
 
112
- 1. Stop the Reviewer and identifiable descendants on a best-effort basis.
113
- 2. Discard all Reviewer output without consuming findings.
114
- 3. Do not count the round as completed, retry it, or launch another Reviewer.
115
- 4. Stop Code Review with `NEEDS_FIXES` and `REVIEW_ORCHESTRATION_VIOLATION`.
99
+ If output is partial, malformed, or cannot be understood safely, return `BLOCKED`. This does not consume a completed round.
116
100
 
117
- On post-launch workspace mismatch, discard the output and stop with `NEEDS_FIXES` and `WORKSPACE_MISMATCH`. Do not launch a replacement Reviewer in that round.
101
+ ### Step 3: Main Agent Filters Findings
118
102
 
119
- ### Step 4: Main Agent Filters Findings
103
+ A usable Reviewer result completes the current round. Increment `completed_rounds` before adjudication.
120
104
 
121
- Only after the pre-filter result gate authorizes consumption, classify every finding:
105
+ For every finding, classify it as:
122
106
 
123
- - `accepted`: a concrete issue that cannot be refuted with current evidence;
124
- - `rejected`: not a defect, out of scope under the governing contract, or disproven with concrete evidence.
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.
125
109
 
126
- Do not reject a finding because it is inconvenient, uncertain, or low confidence. If a potentially valid defect cannot be concretely refuted, accept it for repair or leave it unresolved with `NEEDS_FIXES` when repair is unsafe.
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.
127
111
 
128
- Call the result gate again with `filtering_done: true`, `accepted_count`, and `rejected_count`. Its internal action controls the loop:
112
+ Apply these rules exactly:
129
113
 
130
- - `PASS`: no accepted findings remain;
131
- - `CONTINUE`: accepted findings remain before the safety limit;
132
- - `STOP`: a blocker exists or round ten remains non-converged.
114
+ ```text
115
+ Reviewer returns PASS -> PASS
116
+ Reviewer returns findings and accepted = 0 -> PASS
117
+ Reviewer returns findings and accepted > 0 -> repair or stop
118
+ ```
133
119
 
134
- `CONTINUE` and `STOP` are orchestration actions, not external verdicts.
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.
135
121
 
136
- ### Step 5: Main Agent Applies Accepted Fixes
122
+ ### Step 4: Repair or Stop
137
123
 
138
- When the gate returns `CONTINUE`:
124
+ When `accepted > 0`:
139
125
 
140
- 1. The Main Agent directly applies the accepted batch in the current workspace. Do not launch a separate Fixer or Dev Agent.
141
- 2. If a repair cannot be completed safely within scope, stop with `NEEDS_FIXES` and record the unresolved finding.
142
- 3. Capture a fresh complete snapshot after fixes.
143
- 4. Increment `round`, create a new execution identity, and return to Step 1.
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.
144
131
 
145
- Do not send the next Reviewer any prior finding, filtering, or repair history.
132
+ ## Phase 2: Persist Final Report
146
133
 
147
- ### Text Fallback
134
+ Write exactly one required review artifact:
148
135
 
149
- When Python is unavailable, manually enforce the same protocol and state transitions. Text fallback removes only script automation; it does not weaken capability attestation, one-Reviewer topology, result validation, output-discard rules, workspace matching, convergence, or the ten-round safety fuse.
136
+ ```text
137
+ {artifact_dir}/review-report.md
138
+ ```
150
139
 
151
- If exact validation cannot be performed manually, fail closed with `REVIEW_INFRASTRUCTURE_BLOCKED` rather than guessing compliance.
140
+ Use `${SKILL_DIR}/references/review-report-template.md`. The report records:
152
141
 
153
- ## Phase 2: Persist and Report
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.
154
147
 
155
- Persist the minimum structured result needed to regenerate the report before rendering Markdown. Include final verdict, blocker code, completed rounds, Reviewers started, execution metadata, snapshot identities, and accepted, rejected, fixed, or unresolved findings.
148
+ Do not create a separate persisted review state file. Raw Reviewer output remains in the session log.
156
149
 
157
- Write `{artifact_dir}/review-report.md` using `${SKILL_DIR}/references/review-report-template.md`. Prefer deterministic rendering:
150
+ The report may be rendered directly or with the optional helper by sending minimal JSON on standard input:
158
151
 
159
152
  ```bash
160
153
  python3 ${SKILL_DIR}/scripts/render_review_report.py \
161
- {artifact_dir}/review-result-state.json \
162
- {artifact_dir}/review-report.md
154
+ {artifact_dir}/review-report.md < review-report-input.json
163
155
  ```
164
156
 
165
- If report rendering or path verification fails after review completed, regenerate the report from `review-result-state.json`. Do not rerun Code Review.
157
+ The input may be transient; it is not a required artifact.
166
158
 
167
- External verdicts are limited to:
159
+ ## Final Outcomes
168
160
 
169
- - `PASS`: a usable completed round leaves zero accepted findings, or no workspace changes existed;
170
- - `NEEDS_FIXES`: code findings remain unresolved or any review infrastructure, execution, workspace, result, or safety blocker prevents valid completion.
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.
171
164
 
172
165
  Completion handoff:
173
166
 
174
167
  - `PASS`: run `/prizmkit-retrospective` when structural docs or durable knowledge changed; otherwise proceed to `/prizmkit-committer`.
175
- - `NEEDS_FIXES`: report unresolved findings or the diagnostic blocker and stop.
168
+ - `NEEDS_FIXES`: report unresolved code findings and stop.
169
+ - `BLOCKED`: report the infrastructure reason and allow retry without consuming the code-convergence budget.