prizmkit 1.1.120 → 1.1.122

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 (46) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/prizmkit_runtime/cli.py +1 -0
  3. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +23 -25
  4. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +8 -2
  5. package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +10 -1
  6. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +43 -29
  7. package/bundled/dev-pipeline/scripts/continuation.py +51 -6
  8. package/bundled/dev-pipeline/scripts/update-bug-status.py +57 -14
  9. package/bundled/dev-pipeline/scripts/update-feature-status.py +54 -5
  10. package/bundled/dev-pipeline/scripts/update-refactor-status.py +57 -14
  11. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +2 -2
  12. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +2 -1
  13. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +2 -2
  14. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -3
  15. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +3 -3
  16. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +4 -4
  17. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +3 -3
  18. package/bundled/dev-pipeline/tests/test_auto_skip.py +5 -5
  19. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +10 -3
  20. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +9 -2
  21. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +9 -1
  22. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +222 -18
  23. package/bundled/dev-pipeline/tests/test_unified_cli.py +24 -11
  24. package/bundled/skills/_metadata.json +4 -4
  25. package/bundled/skills/prizmkit-code-review/SKILL.md +49 -48
  26. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +13 -8
  27. package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +46 -32
  28. package/bundled/skills/prizmkit-code-review/references/reviewer-workspace-protocol.md +90 -0
  29. package/bundled/skills/prizmkit-test/SKILL.md +160 -155
  30. package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +420 -0
  31. package/bundled/skills/prizmkit-test/assets/behavior-risk-matrix.schema.json +116 -0
  32. package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +112 -0
  33. package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +97 -0
  34. package/bundled/skills/prizmkit-test/references/boundary-coverage-protocol.md +76 -192
  35. package/bundled/skills/prizmkit-test/references/contract-mock-protocol.md +65 -0
  36. package/bundled/skills/prizmkit-test/references/evidence-protocol.md +201 -0
  37. package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +78 -0
  38. package/bundled/skills/prizmkit-test/references/examples.md +65 -108
  39. package/bundled/skills/prizmkit-test/references/service-boundary-test-catalog.md +10 -7
  40. package/bundled/skills/prizmkit-test/references/test-generation-steps.md +90 -82
  41. package/bundled/skills/prizmkit-test/references/test-report-template.md +77 -98
  42. package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +97 -0
  43. package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +739 -0
  44. package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +1442 -0
  45. package/package.json +1 -1
  46. package/bundled/skills/prizmkit-test/scripts/validate_boundary_report.py +0 -347
@@ -1,56 +1,53 @@
1
1
  ---
2
2
  name: "prizmkit-code-review"
3
- description: "Iterative review-fix loop against spec and plan. Always uses an independent inline reviewer subagent in the active checkout with a skill-owned prompt reference and no worktree/copy/remote isolation; the Main Agent filters findings and applies accepted fixes directly. If the platform cannot start an active-checkout inline reviewer, stop with checkout-isolation incompatibility instead of falling back to Main-Agent self-review. Loops until PASS or max 3 rounds. Use after /prizmkit-implement for Full path quality gate or when the user says 'review', 'check code', 'code review', or 'is it ready to commit'. (project)"
3
+ description: "Iterative independent review-fix loop against spec, plan, workspace changes, and test evidence. Establishes a verified review snapshot using any platform-supported subagent strategy while keeping review judgment separate from Main-Agent filtering and fixes. Use after /prizmkit-implement as a Full path quality gate or when the user asks to review, check code, validate implementation, or decide whether changes are ready to commit. Loops until PASS or max 3 rounds. (project)"
4
4
  ---
5
5
 
6
6
  # PrizmKit Code Review
7
7
 
8
- An iterative review-fix loop that checks workspace changes against the task spec and plan. It separates review judgment from fix application by requiring an independent inline reviewer subagent launched from the active checkout with a prompt loaded from this skill's references. Main Agent applies accepted fixes directly after filtering reviewer findings.
8
+ Run an iterative review-fix loop against the current change. Keep review judgment independent from fix application: an independent read-only Reviewer evaluates a verified snapshot, then the Main Agent filters findings and applies accepted fixes.
9
9
 
10
10
  Review modes:
11
- - `inline-reviewer-active-checkout`: required mode. Always spawn an independent reviewer subagent in the current active checkout with no worktree, copied checkout, remote checkout, or branch isolation.
11
+ - `independent-reviewer-verified-snapshot`: an independent Reviewer verified that its review snapshot is equivalent to the Main Agent's current change.
12
12
  - `not-run-no-changes`: no workspace changes were detected.
13
13
 
14
- If the platform cannot launch an inline reviewer subagent in current-workspace / active-checkout / no-worktree mode, stop with this checkout-isolation incompatibility message:
14
+ The skill defines review invariants rather than platform tool parameters. Choose any platform-supported subagent launch and snapshot transport strategy that satisfies `${SKILL_DIR}/references/reviewer-workspace-protocol.md`.
15
15
 
16
- ```text
17
- Cannot run /prizmkit-code-review because this platform cannot start an inline reviewer subagent in the active checkout without worktree, copy, remote, or branch isolation.
18
- ```
16
+ If no independent Reviewer can receive and verify an equivalent snapshot, stop normal review and report the workspace verification failure. Do not replace the independent review with Main-Agent self-review because that would remove the separation between judgment and implementation.
19
17
 
20
18
  ### When to Use
21
19
  - After `/prizmkit-implement` as the Full path quality gate
22
- - For Fast path only when risk, scope, or user request warrants review
23
- - User says "review", "check code", "review my implementation", or "is it ready to commit"
20
+ - For Fast path when risk, scope, or the user warrants review
21
+ - When the user says "review", "check code", "review my implementation", or "is it ready to commit"
24
22
  - Before `/prizmkit-committer` when the chosen lifecycle path requires review
25
23
 
26
24
  ### When NOT to Use
27
25
  - Direct edit or low-risk Fast path where review is not required
28
- - No spec.md or plan.md exists and there is no clear task goal to review against
26
+ - No `spec.md` or `plan.md` exists and there is no clear task goal to review against
29
27
  - Trivial typo, formatting, or config-only changes that the user wants committed directly
30
28
 
31
29
  ## Input
32
30
 
33
31
  | Parameter | Required | Description |
34
32
  |-----------|----------|-------------|
35
- | `artifact_dir` | No | Directory containing `spec.md` + `plan.md`. If omitted, scan `.prizmkit/` subdirectories for the most recently modified directory with a completed `plan.md`. When invoked as a handoff step, reuse the caller's `artifact_dir` rather than re-detecting. |
33
+ | `artifact_dir` | No | Directory containing `spec.md` and `plan.md`. If omitted, scan `.prizmkit/` subdirectories for the most recently modified directory with a completed `plan.md`. When invoked as a handoff step, reuse the caller's `artifact_dir` rather than re-detecting. |
36
34
 
37
- ## Phase 0: Context Loading
35
+ ## Phase 0: Context and Snapshot
38
36
 
39
37
  1. Read `spec.md` from the artifact directory and extract goals plus acceptance criteria.
40
38
  2. Read `plan.md` from the artifact directory and extract architecture decisions plus completed tasks.
41
- 3. Read scoped `/prizmkit-test` report when present:
39
+ 3. Read a scoped `/prizmkit-test` report when present:
42
40
  - If `{artifact_dir}/test-report-path.txt` exists, read the pointed report.
43
41
  - Extract Scope, Generated / Updated Tests, In-Scope Failures, Baseline Failures, Out of Scope Gaps, Boundary Matrix / Boundary Completion Gate, and Verdict when present.
44
- - If no test report exists, pass `No scoped /prizmkit-test report found` as informational context. Do not treat missing tests as a review finding unless the current lifecycle path explicitly required testing.
42
+ - If no report exists, pass `No scoped /prizmkit-test report found` as informational context. Treat missing tests as a finding only when the lifecycle path required testing before review.
45
43
  4. Read dev rules when configured: load `.prizmkit/prizm-docs/root.prizm`, then referenced `.prizmkit/rules/<layer>-rules.md` files if any exist.
46
- 5. Capture active checkout workspace context:
47
- - `git status`
48
- - `git diff`
49
- - `git diff --cached`
50
- - full paths for untracked and renamed files
51
- - expected active checkout git top-level from `git rev-parse --show-toplevel`
52
- - relevant root.prizm RULES and plan decisions
53
- 6. If no changes are detected, skip Phase 1 and write `review-report.md` with verdict PASS, rounds 0, and review mode `not-run-no-changes`.
44
+ 5. Capture the current workspace manifest and review payload according to `${SKILL_DIR}/references/reviewer-workspace-protocol.md`. Include:
45
+ - baseline repository and revision identity
46
+ - `git status`, `git diff`, and `git diff --cached` evidence
47
+ - staged, unstaged, untracked, deleted, and renamed path inventory
48
+ - changed content and stable content identities sufficient to detect missing, stale, or mixed snapshots
49
+ - relevant root Prizm rules and plan decisions
50
+ 6. If no changes are detected, skip Phase 1 and write `review-report.md` with verdict PASS, rounds 0, review mode `not-run-no-changes`, and snapshot verification `NOT_APPLICABLE`.
54
51
 
55
52
  ## Phase 1: Review-Fix Loop
56
53
 
@@ -70,42 +67,43 @@ python3 --version 2>/dev/null && echo "SCRIPT_MODE" || echo "TEXT_MODE"
70
67
  - `round = 1`
71
68
  - `max_rounds = 3`
72
69
  - `findings_history = []`
73
- - `review_mode = inline-reviewer-active-checkout` after confirming an inline reviewer subagent can launch in the active checkout
70
+ - `review_mode = independent-reviewer-verified-snapshot` after snapshot verification succeeds
74
71
 
75
- ### Step 1: Launch Required Inline Reviewer
72
+ ### Step 1: Establish Independent Review
76
73
 
77
- Always spawn an independent reviewer subagent using this skill-owned inline contract:
74
+ Use the skill-owned review contract:
78
75
 
79
76
  ```yaml
80
77
  prompt_reference: ${SKILL_DIR}/references/reviewer-agent-prompt.md
81
- isolation: current-workspace / active-checkout / no-worktree
82
- subagent_kind: inline reviewer prompt, not a platform-installed named agent
78
+ workspace_protocol: ${SKILL_DIR}/references/reviewer-workspace-protocol.md
79
+ reviewer_contract: independent, read-only, workspace-equivalent
83
80
  ```
84
81
 
85
- 1. Read `${SKILL_DIR}/references/reviewer-agent-prompt.md` and fill it with the active-checkout context from Phase 0.
86
- 2. The captured git diff, staged diff, untracked files, spec, plan, dev rules, and scoped test report are the primary review scope.
87
- 3. Never use worktree isolation, remote isolation, copied checkouts, branch switching, broad repository exploration, or a generic code explorer as a substitute for the required inline reviewer prompt. Do not request or create tool-managed worktrees, pipeline-managed worktrees, copied repositories, or remote checkouts. Do not use `.claude/worktrees/...` or `.prizmkit/state/worktrees/...`. Pipeline runner `USE_WORKTREE` controls outer infrastructure only; it does not change this skill's active-checkout reviewer requirement.
88
- 4. Never perform Main-Agent self-review or fallback review; the Main Agent's job is filtering and fixing, not acting as the reviewer.
89
- 5. If the platform cannot launch the reviewer in the active checkout without worktree/copy/remote/branch isolation, stop with the checkout-isolation incompatibility message from this skill's introduction.
82
+ 1. Read both references and fill the Reviewer prompt with Phase 0 context plus the workspace manifest and payload.
83
+ 2. Choose a subagent launch and snapshot transport strategy supported by the current platform. Strategy choice belongs to the Main Agent because platforms expose different capabilities; do not treat a particular tool parameter, checkout layout, branch name, or transport as part of the skill contract.
84
+ 3. Require the Reviewer to verify snapshot equivalence before reviewing. Different physical paths or execution environments are acceptable when the verified review view is content-equivalent to the captured Main-Agent workspace.
85
+ 4. If the Reviewer returns `WORKSPACE_MISMATCH`, repair or replace the strategy only when equivalence can be established safely. Otherwise write a `NEEDS_FIXES` report with the verification failure unresolved and stop; do not perform Main-Agent self-review.
86
+ 5. After the Main Agent applies fixes, capture and verify a fresh snapshot for the next round because the previous snapshot is stale by definition.
90
87
 
91
88
  ### Step 2: Run Review
92
89
 
93
90
  Round context:
94
91
  - Round 1: examine all current changes comprehensively.
95
- - Round 2+: focus on whether prior fixes are correct, whether fixes introduced new issues, and whether accepted findings remain.
92
+ - Round 2+: verify prior fixes, look for regressions introduced by the fixes, and identify accepted findings that remain.
96
93
 
97
94
  Review result:
98
95
  - `PASS`: no findings.
99
96
  - `NEEDS_FIXES`: one or more findings with severity, dimension, location, problem, and suggested fix.
97
+ - `WORKSPACE_MISMATCH`: snapshot equivalence was not established; this is a review transport failure, not a code verdict.
100
98
 
101
99
  ### Step 3: Loop Exit Gate
102
100
 
103
- Call the gate only in these cases:
101
+ Call the gate only when:
104
102
 
105
103
  1. Review returned `PASS`.
106
- 2. Main Agent has filtered `NEEDS_FIXES` findings.
104
+ 2. The Main Agent has filtered `NEEDS_FIXES` findings.
107
105
 
108
- Do not call the gate for `NEEDS_FIXES` before filtering because `accepted_count` is not known yet.
106
+ Do not call the gate for `NEEDS_FIXES` before filtering because `accepted_count` is not known. Handle `WORKSPACE_MISMATCH` through Step 1 rather than passing it to the code-verdict gate.
109
107
 
110
108
  Script mode invocation:
111
109
 
@@ -113,7 +111,7 @@ Script mode invocation:
113
111
  echo '{"reviewer_result":"NEEDS_FIXES","accepted_count":2,"findings_count":3,"round":1,"findings_history":[],"max_rounds":3,"filtering_done":true}' | python3 ${SKILL_DIR}/scripts/check_loop.py
114
112
  ```
115
113
 
116
- Gate output determines whether to end the loop. If `divergenceWarning` is true, warn the user that the loop may not be converging.
114
+ The gate output determines whether to end the loop. If `divergenceWarning` is true, warn the user that the loop may not be converging.
117
115
 
118
116
  ### Text Fallback Constraints
119
117
 
@@ -130,36 +128,39 @@ When Python is unavailable, apply these rules manually:
130
128
 
131
129
  For each finding, decide whether it is reasonable:
132
130
 
133
- - Is this relevant to the current changes?
134
- - Is this a real problem rather than subjective style preference?
135
- - Would fixing this improve the code without broad out-of-scope refactoring?
136
- - Does it conflict with spec, plan, dev rules, or current test evidence?
131
+ - Is the finding relevant to the current changes?
132
+ - Is it a real problem rather than a subjective style preference?
133
+ - Would the fix improve the code without broad out-of-scope refactoring?
134
+ - Does the finding conflict with the spec, plan, dev rules, or current test evidence?
137
135
 
138
136
  Output per finding:
139
137
  - Accepted: queue for direct Main Agent fix work.
140
- - Rejected: record a short reason such as out of scope, not a defect, or too risky for current task.
138
+ - Rejected: record a short reason such as out of scope, not a defect, or too risky for the current task.
141
139
 
142
140
  After filtering, call the Loop Exit Gate. If `endLoop=true`, proceed to Phase 2.
143
141
 
144
142
  ### Step 5: Main Agent Applies Accepted Fixes
145
143
 
146
- The Main Agent applies accepted findings directly in the active checkout. Do not spawn a separate implementation subagent for review fixes.
144
+ The Main Agent applies accepted findings directly in its current workspace. Keeping fix ownership with the Main Agent prevents the read-only Reviewer from becoming a second, conflicting implementation authority.
147
145
 
148
- If an accepted finding cannot be safely fixed within scope, record the reason and carry it into `review-report.md` as unresolved.
146
+ If an accepted finding cannot be fixed safely within scope, record the reason and carry the finding into `review-report.md` as unresolved.
149
147
 
150
- After fixes are complete, record results, increment the round, and return to Step 2.
148
+ After fixes are complete, record results, increment the round, capture a fresh workspace snapshot, and return to Step 1.
151
149
 
152
150
  ## Phase 2: Output
153
151
 
154
- Always write `review-report.md` to the artifact directory, including no-change PASS results. Read `${SKILL_DIR}/references/review-report-template.md` for the full output format.
152
+ Write `review-report.md` to the artifact directory, including no-change PASS and workspace-verification failure results. Read `${SKILL_DIR}/references/review-report-template.md` for the full output format.
155
153
 
156
154
  Required report fields:
157
155
  - Verdict: `PASS` or `NEEDS_FIXES`
158
- - Review Mode: `inline-reviewer-active-checkout` or `not-run-no-changes`
156
+ - Review Mode: `independent-reviewer-verified-snapshot` or `not-run-no-changes`
157
+ - Reviewer Strategy: concise strategy summary without relying on platform-specific parameter names
158
+ - Snapshot Verification: `VERIFIED`, `FAILED`, or `NOT_APPLICABLE`
159
+ - Snapshot Identity: manifest identity or failure reason
159
160
  - Rounds and total findings
160
161
  - Fixed, rejected, and unresolved findings
161
162
  - Final summary
162
163
 
163
164
  Completion summary:
164
165
  - `PASS`: hand off to `/prizmkit-retrospective` when docs or durable knowledge changed, otherwise `/prizmkit-committer`.
165
- - `NEEDS_FIXES`: inform the caller of remaining unresolved findings.
166
+ - `NEEDS_FIXES`: inform the caller of unresolved code findings or snapshot-verification blockers.
@@ -1,13 +1,16 @@
1
1
  # Review Report Output Template
2
2
 
3
- Used in Phase 2 of `/prizmkit-code-review`. Always write `review-report.md` to the artifact directory using this format.
3
+ Used in Phase 2 of `/prizmkit-code-review`. Write `review-report.md` to the artifact directory using this format.
4
4
 
5
5
  ```markdown
6
6
  # Review Report
7
7
 
8
8
  ## Verdict: <PASS|NEEDS_FIXES>
9
- ## Review Mode: <reviewer-agent-active-checkout|not-run-no-changes>
10
- ## Rounds: <number of review rounds completed; use 0 for no-change PASS>
9
+ ## Review Mode: <independent-reviewer-verified-snapshot|not-run-no-changes>
10
+ ## Reviewer Strategy: <platform-selected strategy summary|not-applicable>
11
+ ## Snapshot Verification: <VERIFIED|FAILED|NOT_APPLICABLE>
12
+ ## Snapshot Identity: <manifest identity or failure reason>
13
+ ## Rounds: <number of completed review rounds; use 0 for no-change PASS or pre-review snapshot failure>
11
14
  ## Total findings: <total> → Fixed: <fixed>, Rejected: <rejected>, Unresolved: <unresolved>
12
15
 
13
16
  ## Round <N>
@@ -15,18 +18,20 @@ Findings: <count> | Accepted: <count>, Rejected: <count>
15
18
 
16
19
  ### Finding <N>: <short title>
17
20
  - Severity: <high|medium|low>
18
- - Dimension: <goal-alignment|defect|completeness|consistency|security|rules-compliance>
21
+ - Dimension: <goal-alignment|defect|completeness|consistency|security|test-quality|rules-compliance>
19
22
  - Location: <filepath:line or project-level>
20
23
  - Problem: <what was wrong and why it mattered>
21
24
  - Status: <fixed (round N)|rejected — reason|unresolved — reason>
22
25
 
23
26
  ## Final Summary
24
- <One to three sentences summarizing the review outcome, including no-change PASS when applicable.>
27
+ <One to three sentences summarizing the review outcome, snapshot verification, and any remaining blocker.>
25
28
  ```
26
29
 
27
- For `PASS` with no findings, write `Total findings: 0 → Fixed: 0, Rejected: 0, Unresolved: 0` and `## Round 0: PASS — no workspace changes to review` or `## Round N: PASS — no issues found`.
30
+ For `PASS` with no findings, write `Total findings: 0 → Fixed: 0, Rejected: 0, Unresolved: 0` and either `## Round 0: PASS — no workspace changes to review` or `## Round N: PASS — no issues found`.
31
+
32
+ For snapshot verification failure, use verdict `NEEDS_FIXES`, snapshot verification `FAILED`, and record the mismatch as an unresolved review blocker rather than an ordinary code finding.
28
33
 
29
34
  ## Verdict Rules
30
35
 
31
- - `PASS`: Reviewer returned no findings, no workspace changes existed, or all remaining findings were rejected as unreasonable.
32
- - `NEEDS_FIXES`: Max rounds completed but accepted findings remain unresolved.
36
+ - `PASS`: Reviewer returned no findings from a verified snapshot, no workspace changes existed, or all findings from a verified snapshot were rejected as unreasonable.
37
+ - `NEEDS_FIXES`: Max rounds completed with accepted findings unresolved, or no independent Reviewer could verify an equivalent current snapshot.
@@ -1,9 +1,9 @@
1
1
  # Reviewer Subagent Prompt Template
2
2
 
3
- Used in Phase 1 Step 1 of `/prizmkit-code-review`. The orchestrator fills `{goals}`, `{plan decisions}`, `{scoped test report}`, `{workspace context}`, `{dev rules}`, `{round N}`, and `{round_context}` before spawning an independent inline reviewer subagent from the active checkout.
3
+ Used in Phase 1 Step 1 of `/prizmkit-code-review`. The orchestrator fills the placeholders before spawning an independent read-only Reviewer under `${SKILL_DIR}/references/reviewer-workspace-protocol.md`.
4
4
 
5
5
  ```
6
- You are an independent PrizmKit reviewer subagent launched by `/prizmkit-code-review` from the active checkout. Review workspace changes against the spec goals, plan decisions, scoped test evidence, and per-layer dev rules. Do not modify files and do not apply fixes; the Main Agent will filter findings and apply accepted fixes directly.
6
+ You are the independent read-only Reviewer for `/prizmkit-code-review`. Review the verified workspace snapshot against the spec goals, plan decisions, scoped test evidence, and dev rules. Do not modify files or apply fixes; the Main Agent will filter findings and apply accepted fixes.
7
7
 
8
8
  ## Spec Goals
9
9
  {goals and acceptance criteria from spec.md}
@@ -12,53 +12,67 @@ You are an independent PrizmKit reviewer subagent launched by `/prizmkit-code-re
12
12
  {architecture decisions and task list from plan.md}
13
13
 
14
14
  ## Scoped Test Report
15
- {summary from artifact_dir/test-report-path.txt and test-report.md, including Scope, Generated / Updated Tests, In-Scope Failures, Baseline Failures, Out of Scope Gaps, Boundary Matrix / Boundary Completion Gate if present, and Verdict. If no scoped report exists for a change artifact, write "No scoped /prizmkit-test report found (expected for pre-test review)." Treat that absence as informational unless the calling workflow explicitly requires a prior test report.}
15
+ {summary from artifact_dir/test-report-path.txt and test-report.md, including Scope, Generated / Updated Tests, In-Scope Failures, Baseline Failures, Out of Scope Gaps, Boundary Matrix / Boundary Completion Gate if present, and Verdict. If no scoped report exists, write "No scoped /prizmkit-test report found (expected for pre-test review)." Treat that absence as informational unless the calling workflow requires a prior report.}
16
16
 
17
- ## Workspace Context
18
- {git status, unstaged diff summary, staged diff summary, current working directory, expected active checkout git top-level, and new-file paths captured by the Main Agent in Phase 0 from the active checkout. This is your primary review scope — use this context to understand what changed. Request targeted file reads only when you need specific line-level detail for a finding, not to re-discover or re-index the repository. Do not read files that are not in the workspace context unless you need them to verify impact (callers, dependents, shared patterns).}
17
+ ## Workspace Manifest
18
+ {repository and baseline identity, review-round identity, changed path inventory and statuses, staged/unstaged composition, untracked content entries, delete markers, rename pairs, and stable content identities captured by the Main Agent}
19
19
 
20
- ## Active Checkout Guard
21
- The orchestrator must provide the expected active checkout git top-level in Workspace Context. Before reviewing, verify that your current git top-level matches that expected active checkout.
20
+ ## Review Payload
21
+ {the reviewable representation of every manifest entry, plus clearly identified unchanged context needed to evaluate callers, dependents, or shared patterns}
22
22
 
23
- If your current checkout is different, or appears to be under `.claude/worktrees/`, `.prizmkit/state/worktrees/`, a copied checkout, a remote isolated checkout, a temporary repository clone, or any branch/top-level other than the orchestrator-provided active checkout:
24
- - Stop immediately.
25
- - Do not review files.
26
- - Do not produce normal findings.
27
- - Report `WRONG_CHECKOUT` and state that `/prizmkit-code-review` cannot continue because the reviewer subagent was not started in the active checkout/no-worktree mode required by this skill.
23
+ ## Reviewer Strategy
24
+ {concise description of how the current platform made the snapshot available. This is diagnostic context, not a required parameter contract.}
28
25
 
29
- Worktree, copied-checkout, remote-checkout, and branch-switched review are not supported by `/prizmkit-code-review`; do not continue even if the files appear similar. Do not request or create worktrees, copied repositories, branch switches, or remote checkouts.
26
+ ## Workspace Equivalence Guard
27
+ Validate the supplied manifest and payload according to the Reviewer Workspace Protocol before normal review:
28
+ - Every manifest path and state must be represented.
29
+ - Staged, unstaged, untracked, deleted, and renamed changes must not be silently lost.
30
+ - Changed content identities and review-round identity must match.
31
+ - Unexplained changed paths, stale content, or unverifiable entries are mismatches.
30
32
 
31
- ## Dev Rules (per-layer conventions)
33
+ Do not reject a snapshot merely because its physical path, checkout layout, branch label, host, or transport differs from the Main Agent's environment. Content equivalence is the invariant.
34
+
35
+ If equivalence cannot be proven:
36
+ - Stop before normal review.
37
+ - Do not produce ordinary findings.
38
+ - Return `WORKSPACE_MISMATCH` with concrete mismatch evidence and required corrective action.
39
+
40
+ ## Dev Rules
32
41
  {rules from .prizmkit/rules/<layer>-rules.md, or "No custom dev rules configured — use general best practices."}
33
42
 
34
43
  ## Review Round
35
44
  Round {N}. {round_context}
36
45
 
37
46
  ## What to Review
38
- Use the orchestrator-provided workspace context as the source of truth for changed files:
39
- - For new files listed in workspace status, read their full content.
40
- - For modified files, read enough surrounding context to understand the change.
41
- - Do not edit files, stage changes, run test suites, spawn other agents, or invoke tools that modify the workspace.
42
- - Do not request or create worktrees — you are reviewing the active checkout's changes. The orchestrator has already captured the full diff and status context; re-discovering the whole repository is wasteful and unnecessary.
47
+ Use the verified workspace snapshot as the primary review scope:
48
+ - Read the full content of new files.
49
+ - For modified files, read enough surrounding context to understand behavior and impact.
50
+ - Read unchanged callers, dependents, or shared patterns only when needed to verify a potential finding.
51
+ - Do not edit files, stage changes, run tools that modify the review view, spawn other agents, or apply fixes.
52
+ - Do not broadly re-index the repository when the supplied snapshot and targeted reads are sufficient.
43
53
 
44
54
  ## Review Dimensions
45
- Evaluate the changes across these dimensions (focus on what's relevant):
55
+ Evaluate the relevant dimensions:
46
56
 
47
- 1. **Goal alignment**: Do the changes accomplish all goals from spec.md? Anything missing or off-target?
48
- 2. **Defects**: Logic bugs, missing error handling, boundary condition issues, incorrect behavior.
49
- 3. **Completeness**: Files that should have been changed but weren't? Missing tests, types, imports, exports?
50
- 4. **Consistency**: Do changes follow the project's existing patterns, naming conventions, and code style?
51
- 5. **Security**: Hardcoded secrets, injection vulnerabilities, unsafe operations.
52
- 6. **Test quality**: If a scoped `/prizmkit-test` report is present, verify the report scope is `this-change`, the artifact dir matches the reviewed change, generated/updated tests assert real behavior rather than mock success or empty assertions, in-scope failures are not mislabeled as baseline failures, baseline failures are genuinely unrelated or pre-existing, out-of-scope gaps were not turned into unrelated test changes, and the report verdict is compatible with proceeding.
53
- 7. **Rules compliance**: (Skip this dimension if no dev rules were provided.) Do changes follow the per-layer dev rules? Flag violations of framework conventions, naming patterns, state management, or other rules defined for that layer.
57
+ 1. **Goal alignment**: Do the changes accomplish the spec goals and acceptance criteria?
58
+ 2. **Defects**: Are there logic bugs, boundary failures, or missing error handling?
59
+ 3. **Completeness**: Are required files, tests, types, imports, or exports missing?
60
+ 4. **Consistency**: Do the changes follow existing project patterns, naming, and style?
61
+ 5. **Security**: Do the changes introduce secrets, injection paths, or unsafe operations?
62
+ 6. **Test quality**: When a scoped report exists, verify its scope and artifact identity, meaningful assertions, failure classification, boundary evidence, and verdict compatibility.
63
+ 7. **Rules compliance**: When dev rules exist, verify the relevant layer conventions.
54
64
 
55
65
  ## Output Format
56
- Respond with EXACTLY this format:
66
+ Respond with exactly this structure:
67
+
68
+ ### Result: PASS | NEEDS_FIXES | WORKSPACE_MISMATCH
57
69
 
58
- ### Result: PASS | NEEDS_FIXES | WRONG_CHECKOUT
70
+ ### Snapshot Verification
71
+ - Status: VERIFIED | FAILED
72
+ - Identity: <manifest identity or mismatch summary>
59
73
 
60
74
  ### Findings
61
- (If PASS, write "No issues found." If WRONG_CHECKOUT, include only checkout mismatch evidence and do not include normal review findings.)
75
+ (If PASS, write "No issues found." If WORKSPACE_MISMATCH, include only mismatch evidence and required action.)
62
76
 
63
77
  #### Finding N
64
78
  - **Severity**: high | medium | low
@@ -69,10 +83,10 @@ Respond with EXACTLY this format:
69
83
  - **Verification**: How to confirm the fix is correct
70
84
 
71
85
  ### Summary
72
- One to two sentences about the overall state of the changes.
86
+ One to two sentences about the snapshot and overall state of the changes.
73
87
  ```
74
88
 
75
89
  ## Round Context
76
90
 
77
91
  - Round 1: "This is the first review. Examine all changes comprehensively."
78
- - Round 2+: "Previous round found issues that were fixed. Focus on: (1) whether previous fixes are correct, (2) whether fixes introduced new problems, (3) any remaining issues. Do not re-report issues that have already been fixed."
92
+ - Round 2+: "Previous findings were filtered and accepted fixes were applied. Verify those fixes, check for regressions, and identify remaining issues without re-reporting resolved findings."
@@ -0,0 +1,90 @@
1
+ # Reviewer Workspace Protocol
2
+
3
+ Use this protocol whenever `/prizmkit-code-review` delegates review to an independent Reviewer. The protocol defines observable guarantees, not Agent API parameters, so the Main Agent can adapt to the capabilities of the current platform.
4
+
5
+ ## Protocol Invariants
6
+
7
+ 1. **Independence**: A subagent separate from the Main Agent performs review judgment. The Main Agent may prepare the snapshot, filter findings, and apply fixes, but does not substitute its own review when delegation fails.
8
+ 2. **Completeness**: The review snapshot represents every in-scope staged, unstaged, untracked, deleted, and renamed change captured for the round.
9
+ 3. **Currency**: Each review round uses a snapshot captured after the previous round's fixes. Never reuse a prior-round snapshot as evidence of current state.
10
+ 4. **Equivalence**: The Reviewer's view must be content-equivalent to the captured Main-Agent workspace. Physical path, checkout layout, branch label, host, and transport may differ without violating equivalence.
11
+ 5. **Verifiability**: The Reviewer validates the supplied manifest before normal review. Missing, extra, stale, or mixed content produces `WORKSPACE_MISMATCH`, not code findings.
12
+ 6. **Read-only review**: The Reviewer does not modify files or apply fixes. This keeps review evidence stable and preserves clear fix ownership.
13
+
14
+ ## Strategy Selection
15
+
16
+ Choose a platform-supported strategy that can satisfy all protocol invariants. The strategy may use a shared workspace, an isolated workspace populated with the captured change, a remote environment supplied with equivalent content, a materialized snapshot, or another mechanism the platform supports.
17
+
18
+ Do not encode a particular Agent type, model, isolation value, branch convention, directory prefix, or transport command into the skill contract. Those details are implementation choices and may change across platforms or sessions.
19
+
20
+ Prefer the least elaborate strategy that can prove equivalence. If a candidate strategy cannot carry or expose all workspace states, choose another strategy rather than weakening the protocol.
21
+
22
+ ## Workspace Manifest
23
+
24
+ Create a manifest for each round containing enough information to detect an incomplete or stale review view:
25
+
26
+ - repository identity and baseline revision
27
+ - round number or equivalent monotonic round identity
28
+ - changed path inventory and each path's status
29
+ - staged and unstaged composition when both exist for a path
30
+ - untracked file content required for review
31
+ - deleted-path markers
32
+ - rename source and destination pairs
33
+ - stable content identities for changed content and any review-critical context
34
+ - relevant spec, plan, dev-rule, and scoped-test evidence identities or embedded content
35
+
36
+ The exact encoding is implementation-defined. Use hashes when available, but another deterministic content identity is acceptable when the environment lacks a hashing utility. A prose summary alone is insufficient when it cannot detect omitted or stale content.
37
+
38
+ ## Review Payload
39
+
40
+ Provide the Reviewer with both:
41
+
42
+ 1. The manifest used for verification.
43
+ 2. A reviewable representation of every manifest entry.
44
+
45
+ A reviewable representation may be workspace files, complete file content, patches plus required base content, or an equivalent materialization. Diff summaries alone are insufficient for new files or when surrounding code is necessary to evaluate behavior.
46
+
47
+ Supply targeted dependency or caller context when required to verify impact. Keep that context distinguishable from changed content so the Reviewer does not mistake unchanged files for part of the patch.
48
+
49
+ ## Reviewer Verification
50
+
51
+ Before normal review, the Reviewer checks:
52
+
53
+ 1. Repository and baseline identity are consistent with the supplied snapshot.
54
+ 2. Every changed path in the manifest is available in the review payload.
55
+ 3. No unexplained changed path appears outside the manifest.
56
+ 4. Staged, unstaged, untracked, deleted, and renamed states are represented without silent loss.
57
+ 5. Content identities match the manifest.
58
+ 6. The snapshot belongs to the current review round.
59
+
60
+ When all checks pass, report snapshot verification as `VERIFIED` and proceed with review.
61
+
62
+ When a check cannot be completed or fails, stop normal review and return:
63
+
64
+ ```text
65
+ ### Result: WORKSPACE_MISMATCH
66
+
67
+ ### Snapshot Verification
68
+ - Status: FAILED
69
+ - Mismatch: <missing, extra, stale, or unverifiable manifest entries>
70
+ - Required action: <what the Main Agent must re-capture, transport, or verify>
71
+ ```
72
+
73
+ Do not emit ordinary code findings after `WORKSPACE_MISMATCH`, because findings from an unverified snapshot could misrepresent the current change.
74
+
75
+ ## Round Refresh
76
+
77
+ After accepted fixes are applied:
78
+
79
+ 1. Discard the previous manifest as current evidence.
80
+ 2. Capture a new manifest and review payload from the Main Agent's updated workspace.
81
+ 3. Establish a fresh independent Reviewer view using any valid strategy.
82
+ 4. Repeat Reviewer verification before the next review.
83
+
84
+ A platform may reuse an existing Reviewer session only when the refreshed payload replaces stale state and equivalence is verified again.
85
+
86
+ ## Failure Boundary
87
+
88
+ Retry or change strategy when the mismatch is repairable. Stop when the platform cannot provide an independent Reviewer with a verifiable equivalent snapshot.
89
+
90
+ Record the failure as an unresolved review blocker with verdict `NEEDS_FIXES`, snapshot verification `FAILED`, and the mismatch evidence. Do not downgrade to Main-Agent self-review, because doing so would satisfy neither the independence invariant nor the user's expectation of an independent quality gate.