prizmkit 1.1.124 → 1.1.126
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.
- package/bundled/VERSION.json +3 -3
- package/bundled/adapters/claude/command-adapter.js +4 -6
- package/bundled/dev-pipeline/prizmkit_runtime/reset.py +49 -3
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +75 -14
- package/bundled/dev-pipeline/prizmkit_runtime/runtime_helper.py +37 -0
- package/bundled/dev-pipeline/prizmkit_runtime/task_checkout.py +267 -0
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +4 -4
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +5 -16
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +6 -14
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +8 -4
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +9 -8
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +12 -15
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +11 -16
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +9 -8
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +8 -4
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +1 -1
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +1 -1
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +206 -3
- package/bundled/dev-pipeline/tests/test_runtime_helper.py +36 -0
- package/bundled/dev-pipeline/tests/test_unified_cli.py +21 -12
- package/bundled/skills/_metadata.json +4 -4
- package/bundled/skills/prizmkit-code-review/SKILL.md +130 -103
- package/bundled/skills/prizmkit-code-review/assets/reviewer-role.json +3 -5
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +89 -38
- package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +44 -62
- package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +249 -143
- package/package.json +1 -1
- package/bundled/skills/prizmkit-code-review/references/reviewer-execution-protocol.md +0 -179
- package/bundled/skills/prizmkit-code-review/references/reviewer-workspace-protocol.md +0 -118
- package/bundled/skills/prizmkit-code-review/scripts/check_loop.py +0 -380
- package/bundled/skills/prizmkit-code-review/scripts/workspace_snapshot.py +0 -222
|
@@ -75,6 +75,42 @@ class TestArtifactAndTextHelpers:
|
|
|
75
75
|
missing = run_helper("text", "contains", str(target), "--pattern", "gamma")
|
|
76
76
|
assert first_line(missing) == "GATE:MISSING"
|
|
77
77
|
|
|
78
|
+
def test_final_verdict_requires_last_final_result_section(self, tmp_path):
|
|
79
|
+
report = tmp_path / "review-report.md"
|
|
80
|
+
report.write_text(
|
|
81
|
+
"# Review Report\n\n## Status: IN_PROGRESS\n\n"
|
|
82
|
+
"## Main Review Round 1\n\n- Note: incidental PASS text\n",
|
|
83
|
+
encoding="utf-8",
|
|
84
|
+
)
|
|
85
|
+
incomplete = run_helper("text", "final-verdict", str(report))
|
|
86
|
+
assert incomplete.returncode != 0
|
|
87
|
+
assert first_line(incomplete) == "REVIEW_INCOMPLETE"
|
|
88
|
+
|
|
89
|
+
report.write_text(
|
|
90
|
+
report.read_text(encoding="utf-8")
|
|
91
|
+
+ "\n## Final Result\n\n- Verdict: PASS\n- Summary: done\n",
|
|
92
|
+
encoding="utf-8",
|
|
93
|
+
)
|
|
94
|
+
complete = run_helper("text", "final-verdict", str(report))
|
|
95
|
+
assert complete.returncode == 0
|
|
96
|
+
assert first_line(complete) == "REVIEW_PASS"
|
|
97
|
+
assert "verdict: PASS" in complete.stdout
|
|
98
|
+
|
|
99
|
+
def test_final_verdict_uses_last_final_result_and_rejects_unknown_value(self, tmp_path):
|
|
100
|
+
report = tmp_path / "review-report.md"
|
|
101
|
+
report.write_text(
|
|
102
|
+
"## Final Result\n- Verdict: PASS\n\n"
|
|
103
|
+
"## Final Result\n- Verdict: BLOCKED\n",
|
|
104
|
+
encoding="utf-8",
|
|
105
|
+
)
|
|
106
|
+
blocked = run_helper("text", "final-verdict", str(report))
|
|
107
|
+
assert first_line(blocked) == "REVIEW_BLOCKED"
|
|
108
|
+
|
|
109
|
+
report.write_text("## Final Result\n- Verdict: UNKNOWN\n", encoding="utf-8")
|
|
110
|
+
invalid = run_helper("text", "final-verdict", str(report))
|
|
111
|
+
assert invalid.returncode != 0
|
|
112
|
+
assert first_line(invalid) == "REVIEW_INVALID"
|
|
113
|
+
|
|
78
114
|
|
|
79
115
|
class TestPlatformExecutableAndPortHelpers:
|
|
80
116
|
def test_platform_detection_and_skill_lookup_follow_config(self, tmp_path, monkeypatch):
|
|
@@ -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
|
|
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,25 +827,32 @@ def test_headless_review_guidance_uses_workspace_and_execution_protocols():
|
|
|
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 "snapshot" in text and "equivalent" in text, path
|
|
832
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
|
+
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
|
|
836
839
|
assert "USE_WORKTREE" not in text, path
|
|
837
840
|
assert "isolation:" not in text, path
|
|
838
|
-
assert "Read existing source files in the modules this plan touches" not in text, path
|
|
839
841
|
|
|
840
842
|
skill_text = skill_path.read_text(encoding="utf-8")
|
|
841
|
-
assert "
|
|
842
|
-
assert "
|
|
843
|
-
assert "
|
|
844
|
-
assert "
|
|
845
|
-
assert "
|
|
846
|
-
assert "
|
|
847
|
-
assert "
|
|
848
|
-
assert "
|
|
843
|
+
assert "staged and unstaged tracked changes" in skill_text
|
|
844
|
+
assert "untracked files" in skill_text
|
|
845
|
+
assert "accepted = 0" 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
|
|
850
|
+
assert "BLOCKED" in skill_text
|
|
851
|
+
assert "Do not substitute Main-Agent self-review" in skill_text
|
|
852
|
+
assert "reviewer-workspace-protocol.md" not in skill_text
|
|
853
|
+
assert "reviewer-execution-protocol.md" not in skill_text
|
|
854
|
+
assert "WORKSPACE_MISMATCH" not in skill_text
|
|
855
|
+
assert "REVIEW_INFRASTRUCTURE_BLOCKED" not in skill_text
|
|
849
856
|
|
|
850
857
|
|
|
851
858
|
def test_progress_parser_adds_required_metadata(tmp_path):
|
|
@@ -2227,6 +2234,7 @@ def test_materialize_worktree_support_assets_copies_ignored_assets_without_retir
|
|
|
2227
2234
|
(repo / ".prizmkit" / "dev-pipeline" / "prizmkit_runtime").mkdir(parents=True)
|
|
2228
2235
|
(repo / ".prizmkit" / "dev-pipeline" / "prizmkit_runtime" / "__init__.py").write_text("", encoding="utf-8")
|
|
2229
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")
|
|
2230
2238
|
(repo / ".prizmkit" / "dev-pipeline" / "run-feature.sh").write_text("retired", encoding="utf-8")
|
|
2231
2239
|
|
|
2232
2240
|
runtime = worktree_runtime_context(
|
|
@@ -2247,6 +2255,7 @@ def test_materialize_worktree_support_assets_copies_ignored_assets_without_retir
|
|
|
2247
2255
|
assert (runtime.worktree_path / ".prizmkit" / "dev-pipeline" / "scripts" / "update-checkpoint.py").is_file()
|
|
2248
2256
|
assert (runtime.worktree_path / ".prizmkit" / "dev-pipeline" / "prizmkit_runtime" / "__init__.py").is_file()
|
|
2249
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()
|
|
2250
2259
|
assert not (runtime.worktree_path / ".prizmkit" / "dev-pipeline" / "run-feature.sh").exists()
|
|
2251
2260
|
|
|
2252
2261
|
assert guarded_worktree_remove(runtime, delete_branch=False).ok
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.1.
|
|
2
|
+
"version": "1.1.126",
|
|
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": "
|
|
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":
|
|
37
|
-
"hasScripts":
|
|
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,175 +1,202 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "prizmkit-code-review"
|
|
3
|
-
description: "Run a
|
|
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
|
-
|
|
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
|
+
Use a dual-layer review loop: the Main Agent owns iterative review and repair, while fresh independent Reviewers act only as semantic-risk gates.
|
|
11
9
|
|
|
12
10
|
## When to Use
|
|
13
11
|
|
|
14
12
|
- After `/prizmkit-implement` as the Full path quality gate
|
|
15
|
-
- For Fast path when
|
|
16
|
-
- When the user asks to
|
|
17
|
-
- Before `/prizmkit-committer` when the selected lifecycle requires review
|
|
18
|
-
|
|
19
|
-
## When Not to Use
|
|
20
|
-
|
|
21
|
-
- Direct edit or low-risk Fast path where review is intentionally skipped
|
|
22
|
-
- No task goal, specification, plan, or other review contract can be identified
|
|
23
|
-
- 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
|
|
24
15
|
|
|
25
16
|
## Input
|
|
26
17
|
|
|
27
18
|
| Parameter | Required | Description |
|
|
28
19
|
|---|---|---|
|
|
29
|
-
| `artifact_dir` | No | Directory containing `spec.md` and `plan.md`. Reuse a caller-provided directory
|
|
20
|
+
| `artifact_dir` | No | Directory containing `spec.md` and `plan.md`. Reuse a caller-provided directory; otherwise locate the current completed change artifact. |
|
|
30
21
|
|
|
31
|
-
##
|
|
22
|
+
## Required Assets
|
|
32
23
|
|
|
33
|
-
|
|
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
|
|
34
27
|
|
|
35
|
-
|
|
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
|
|
28
|
+
Do not weaken or summarize the Reviewer prompt. The protocol specifies semantic capabilities rather than platform-specific tool names.
|
|
39
29
|
|
|
40
|
-
|
|
30
|
+
## Phase 0: Initialize Report and Collect Context
|
|
41
31
|
|
|
42
|
-
|
|
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:
|
|
36
|
+
- staged and unstaged tracked changes;
|
|
37
|
+
- untracked files;
|
|
38
|
+
- deleted and renamed files;
|
|
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.
|
|
43
42
|
|
|
44
|
-
|
|
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`.
|
|
43
|
+
### Checkout Access
|
|
50
44
|
|
|
51
|
-
|
|
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.
|
|
52
46
|
|
|
53
|
-
|
|
47
|
+
## Phase 1: Semantic Risk Assessment
|
|
54
48
|
|
|
55
|
-
|
|
49
|
+
Classify the current change from behavior and failure impact, not changed-file count or a fixed path allowlist:
|
|
56
50
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
```
|
|
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.
|
|
54
|
+
|
|
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
|
-
|
|
57
|
+
Append `## Risk Assessment` with the selected risk and concrete reasons before review begins.
|
|
65
58
|
|
|
66
|
-
|
|
59
|
+
## Phase 2: Main-Agent Self-Review Loop
|
|
67
60
|
|
|
68
|
-
|
|
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:
|
|
61
|
+
The Main Agent reviews and repairs in the current context. Track Main-Agent rounds independently from Reviewer launch attempts:
|
|
72
62
|
|
|
73
|
-
```
|
|
74
|
-
|
|
63
|
+
```yaml
|
|
64
|
+
main_review_rounds: 0
|
|
65
|
+
independent_reviewers_started: 0
|
|
66
|
+
reviewer_1_accepted_high: false
|
|
75
67
|
```
|
|
76
68
|
|
|
77
|
-
|
|
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
|
-
|
|
71
|
+
### Main-Agent Self-Review Loop
|
|
80
72
|
|
|
81
|
-
|
|
73
|
+
Each round examines the complete current change against goals, contracts, rules, callers, dependents, regression risks, and test evidence.
|
|
82
74
|
|
|
83
|
-
|
|
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:
|
|
84
81
|
|
|
85
|
-
|
|
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
|
+
```
|
|
89
|
+
|
|
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.
|
|
91
|
+
|
|
92
|
+
After each repair batch, append `## Repair Verification` with fixed findings, verification evidence, and next phase.
|
|
86
93
|
|
|
87
|
-
|
|
94
|
+
## Phase 3: Independent Reviewer 1
|
|
88
95
|
|
|
89
|
-
|
|
96
|
+
After Main-Agent self-review and required tests converge:
|
|
90
97
|
|
|
91
|
-
-
|
|
92
|
-
-
|
|
98
|
+
- low risk: skip all independent Reviewers and proceed to final verification;
|
|
99
|
+
- medium or high risk: launch Reviewer 1.
|
|
93
100
|
|
|
94
|
-
|
|
101
|
+
Before launch, append:
|
|
95
102
|
|
|
96
|
-
|
|
103
|
+
```markdown
|
|
104
|
+
## Independent Reviewer 1
|
|
97
105
|
|
|
98
|
-
|
|
106
|
+
- Status: RUNNING
|
|
107
|
+
- Risk Trigger: <medium|high>
|
|
108
|
+
```
|
|
109
|
+
|
|
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.
|
|
99
111
|
|
|
100
|
-
|
|
112
|
+
### Reviewer Infrastructure Failure
|
|
101
113
|
|
|
102
|
-
|
|
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.
|
|
114
|
+
If the Reviewer cannot start, exits abnormally, returns unusable output, or lacks essential context:
|
|
109
115
|
|
|
110
|
-
|
|
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.
|
|
111
123
|
|
|
112
|
-
|
|
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`.
|
|
124
|
+
### Finding Adjudication
|
|
116
125
|
|
|
117
|
-
|
|
126
|
+
For a usable Reviewer result, append `## Independent Reviewer 1 Result`, then classify every finding as accepted or rejected with evidence.
|
|
118
127
|
|
|
119
|
-
|
|
128
|
+
```text
|
|
129
|
+
accepted = 0 -> Reviewer 1 converged
|
|
130
|
+
accepted > 0 -> Main Agent repairs, verifies, and reruns its self-review loop
|
|
131
|
+
```
|
|
120
132
|
|
|
121
|
-
|
|
133
|
+
Accepted findings do not automatically trigger another independent Reviewer.
|
|
122
134
|
|
|
123
|
-
|
|
124
|
-
- `rejected`: not a defect, out of scope under the governing contract, or disproven with concrete evidence.
|
|
135
|
+
## Phase 4: Reviewer 2 Eligibility
|
|
125
136
|
|
|
126
|
-
|
|
137
|
+
Reviewer 2 is allowed only when every condition is true:
|
|
127
138
|
|
|
128
|
-
|
|
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.
|
|
129
144
|
|
|
130
|
-
|
|
131
|
-
- `CONTINUE`: accepted findings remain before the safety limit;
|
|
132
|
-
- `STOP`: a blocker exists or round ten remains non-converged.
|
|
145
|
+
Accepted medium or low findings alone never trigger Reviewer 2. Medium risk never starts Reviewer 2.
|
|
133
146
|
|
|
134
|
-
|
|
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
|
-
|
|
149
|
+
After Reviewer 2:
|
|
137
150
|
|
|
138
|
-
|
|
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.
|
|
139
155
|
|
|
140
|
-
|
|
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.
|
|
156
|
+
## Phase 5: Append-Only Reporting
|
|
144
157
|
|
|
145
|
-
|
|
158
|
+
`{artifact_dir}/review-report.md` is the only required persisted review artifact.
|
|
146
159
|
|
|
147
|
-
|
|
160
|
+
Within one execution, append new sections only. Do not rewrite an earlier progress section. Append after:
|
|
148
161
|
|
|
149
|
-
|
|
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.
|
|
150
169
|
|
|
151
|
-
|
|
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.
|
|
152
171
|
|
|
153
|
-
## Phase
|
|
172
|
+
## Phase 6: Final Result
|
|
154
173
|
|
|
155
|
-
|
|
174
|
+
Append exactly one final result:
|
|
156
175
|
|
|
157
|
-
|
|
176
|
+
```markdown
|
|
177
|
+
## Final Result
|
|
158
178
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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>
|
|
163
188
|
```
|
|
164
189
|
|
|
165
|
-
|
|
190
|
+
Final outcomes:
|
|
166
191
|
|
|
167
|
-
|
|
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.
|
|
168
195
|
|
|
169
|
-
|
|
170
|
-
- `NEEDS_FIXES`: code findings remain unresolved or any review infrastructure, execution, workspace, result, or safety blocker prevents valid completion.
|
|
196
|
+
Exactly one final result is allowed. Do not append progress after Final Result.
|
|
171
197
|
|
|
172
198
|
Completion handoff:
|
|
173
199
|
|
|
174
200
|
- `PASS`: run `/prizmkit-retrospective` when structural docs or durable knowledge changed; otherwise proceed to `/prizmkit-committer`.
|
|
175
|
-
- `NEEDS_FIXES`: report unresolved findings
|
|
201
|
+
- `NEEDS_FIXES`: report unresolved findings and stop.
|
|
202
|
+
- `BLOCKED`: report infrastructure evidence and permit recovery.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"protocol_version":
|
|
2
|
+
"protocol_version": 2,
|
|
3
3
|
"role_name": "prizmkit-code-reviewer",
|
|
4
|
-
"description": "Use only as the
|
|
4
|
+
"description": "Use only as the one fresh independent read-only Reviewer for a completed /prizmkit-code-review round.",
|
|
5
5
|
"observational_capabilities": [
|
|
6
6
|
"read-files",
|
|
7
7
|
"search-content",
|
|
@@ -15,7 +15,5 @@
|
|
|
15
15
|
"orchestration-reentry",
|
|
16
16
|
"skill-invocation"
|
|
17
17
|
],
|
|
18
|
-
"execution_mode": "foreground-
|
|
19
|
-
"max_descendant_execution_units": 0,
|
|
20
|
-
"max_delegation_depth": 0
|
|
18
|
+
"execution_mode": "foreground-independent-review"
|
|
21
19
|
}
|
|
@@ -1,53 +1,104 @@
|
|
|
1
|
-
# Review Report
|
|
1
|
+
# Review Report Lifecycle Template
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
##
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
##
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
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
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
## Independent Reviewer <N>
|
|
57
|
+
|
|
58
|
+
- Status: RUNNING
|
|
59
|
+
- Risk Trigger: <medium|high>
|
|
60
|
+
- Attempt: <1|2>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Independent Reviewer Result
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
## Independent Reviewer <N> Result
|
|
67
|
+
|
|
68
|
+
- Status: <COMPLETED|BLOCKED>
|
|
69
|
+
- Result: <PASS|FINDINGS|BLOCKED>
|
|
27
70
|
- Findings: <count>
|
|
28
71
|
- Accepted: <count>
|
|
29
72
|
- Rejected: <count>
|
|
73
|
+
- Accepted High: <count>
|
|
74
|
+
- Next: <next action>
|
|
75
|
+
```
|
|
30
76
|
|
|
31
|
-
|
|
77
|
+
## Final Result
|
|
32
78
|
|
|
33
|
-
|
|
34
|
-
- Dimension: <dimension>
|
|
35
|
-
- Location: <filepath:line|project-level>
|
|
36
|
-
- Problem: <what was wrong and why it mattered>
|
|
37
|
-
- Failure Scenario: <concrete input or state>
|
|
38
|
-
- Status: <fixed in round N|rejected — concrete evidence|unresolved — reason>
|
|
79
|
+
Exactly one Final Result terminates a completed execution:
|
|
39
80
|
|
|
40
|
-
|
|
81
|
+
```markdown
|
|
82
|
+
## Final Result
|
|
41
83
|
|
|
42
|
-
|
|
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>
|
|
43
93
|
```
|
|
44
94
|
|
|
45
|
-
##
|
|
95
|
+
## Rules
|
|
46
96
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
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.
|