prizmkit 1.1.122 → 1.1.124
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 +77 -0
- package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +16 -5
- package/bundled/dev-pipeline/prizmkit_runtime/runner_bookkeeping.py +121 -9
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +46 -38
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +365 -22
- package/bundled/dev-pipeline/tests/test_unified_cli.py +21 -12
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/prizmkit-code-review/SKILL.md +118 -109
- package/bundled/skills/prizmkit-code-review/assets/reviewer-role.json +21 -0
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +33 -17
- package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +109 -63
- package/bundled/skills/prizmkit-code-review/references/reviewer-execution-protocol.md +179 -0
- package/bundled/skills/prizmkit-code-review/references/reviewer-workspace-protocol.md +80 -52
- package/bundled/skills/prizmkit-code-review/scripts/check_loop.py +348 -154
- package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +188 -0
- package/bundled/skills/prizmkit-code-review/scripts/workspace_snapshot.py +222 -0
- package/package.json +1 -1
- package/src/scaffold.js +15 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Reviewer Execution Protocol
|
|
2
|
+
|
|
3
|
+
This protocol is the mandatory execution contract for `/prizmkit-code-review`. It defines semantic guarantees rather than platform tool, agent, workflow, or command names.
|
|
4
|
+
|
|
5
|
+
## Terms
|
|
6
|
+
|
|
7
|
+
| Term | Meaning |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Orchestrator | The single Main Agent that controls rounds, filters findings, and applies accepted fixes |
|
|
10
|
+
| Reviewer | The single independent read-only review authority for one round |
|
|
11
|
+
| Downstream execution unit | Any separately scheduled or executed worker, reviewer, task, workflow child, team member, remote job, or equivalent delegated execution |
|
|
12
|
+
| Delegation-equivalent capability | Any capability that can create, schedule, resume, continue, request, or coordinate downstream execution |
|
|
13
|
+
| Orchestration re-entry | Entering a process that can delegate, fan out, or become another review orchestrator |
|
|
14
|
+
| Capability attestation | Launch-time evidence that the Reviewer environment satisfies the mandatory capability boundary |
|
|
15
|
+
| Completed round | A round whose Reviewer output passed execution and workspace validation |
|
|
16
|
+
| Convergence | A completed round leaves zero accepted findings |
|
|
17
|
+
| Safety fuse | The internal ten-round automation limit |
|
|
18
|
+
|
|
19
|
+
## Normative Invariants
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
reviewer_execution:
|
|
23
|
+
sole_review_authority_per_round: true
|
|
24
|
+
fresh_execution_per_round: true
|
|
25
|
+
observational_workspace_access: true
|
|
26
|
+
mutation_capability: unavailable
|
|
27
|
+
delegation_equivalent_capability: unavailable
|
|
28
|
+
orchestration_reentry_capability: unavailable
|
|
29
|
+
max_reviewers_per_round: 1
|
|
30
|
+
max_descendant_execution_units: 0
|
|
31
|
+
max_delegation_depth: 0
|
|
32
|
+
normal_termination: convergence
|
|
33
|
+
internal_safety_review_limit: 10
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Additional invariants:
|
|
37
|
+
|
|
38
|
+
1. Only the Main Agent starts a Reviewer or the next round.
|
|
39
|
+
2. A Reviewer cannot create, request, continue, resume, refresh, replace, or coordinate another execution unit.
|
|
40
|
+
3. A Reviewer cannot invoke an equivalent review orchestrator.
|
|
41
|
+
4. A Reviewer performs the complete review itself and cannot delegate a subset.
|
|
42
|
+
5. If the review does not fit its execution context, it returns `REVIEW_INFRASTRUCTURE_BLOCKED` rather than delegating.
|
|
43
|
+
6. Reviewer output is unusable until execution and workspace validation both pass.
|
|
44
|
+
7. Every round uses a fresh execution identity. Reviewer sessions are never reused.
|
|
45
|
+
8. A Reviewer receives no prior findings, verdicts, filtering decisions, repair descriptions, or reasoning.
|
|
46
|
+
9. The Main Agent applies accepted fixes directly; it does not create a separate Fixer or Dev Agent.
|
|
47
|
+
|
|
48
|
+
## Capability Attestation
|
|
49
|
+
|
|
50
|
+
Before every launch, establish this claim with platform-native evidence:
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
capability_attestation:
|
|
54
|
+
mutation_capability: unavailable
|
|
55
|
+
delegation_equivalent_capability: unavailable
|
|
56
|
+
downstream_execution_creation: unavailable
|
|
57
|
+
orchestration_reentry_capability: unavailable
|
|
58
|
+
review_execution: foreground-single-authority
|
|
59
|
+
status: VERIFIED
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
A prompt promise is not evidence. The selected execution environment must actually remove the prohibited capabilities through a capability-scoped role, restricted tool surface, sandbox policy, launch wrapper, capability token, or equivalent mechanism.
|
|
63
|
+
|
|
64
|
+
If the platform cannot establish the boundary:
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
Do not launch Reviewer
|
|
68
|
+
→ verdict: NEEDS_FIXES
|
|
69
|
+
→ blockerCode: REVIEW_INFRASTRUCTURE_BLOCKED
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## One-Reviewer Topology
|
|
73
|
+
|
|
74
|
+
Required topology:
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
Main Agent
|
|
78
|
+
├── Round 1: one fresh Reviewer, no descendants
|
|
79
|
+
├── Round 2: one fresh Reviewer, no descendants
|
|
80
|
+
├── ...
|
|
81
|
+
└── Round N: one fresh Reviewer, no descendants
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The Main Agent owns all loop state. No Reviewer may start its successor.
|
|
85
|
+
|
|
86
|
+
## Execution Validation
|
|
87
|
+
|
|
88
|
+
Validate topology before consuming output:
|
|
89
|
+
|
|
90
|
+
1. Exactly one fresh Reviewer started in the active round.
|
|
91
|
+
2. Capability attestation is `VERIFIED`.
|
|
92
|
+
3. Observed descendant execution units equal zero.
|
|
93
|
+
4. Observed delegation depth equals zero.
|
|
94
|
+
5. Orchestration status is `COMPLIANT`.
|
|
95
|
+
6. Execution evidence is sufficient to support those claims.
|
|
96
|
+
|
|
97
|
+
The Reviewer's own compliance declaration is supplementary. It never replaces launch-time attestation or platform-observed evidence.
|
|
98
|
+
|
|
99
|
+
## Runtime Violation
|
|
100
|
+
|
|
101
|
+
A violation exists when a Reviewer creates or requests downstream execution, re-enters orchestration, causes more than one Reviewer in a round, exceeds zero delegation depth, or makes compliance unverifiable.
|
|
102
|
+
|
|
103
|
+
On violation:
|
|
104
|
+
|
|
105
|
+
1. Stop the Reviewer and identifiable descendants on a best-effort basis.
|
|
106
|
+
2. Discard the complete Reviewer output.
|
|
107
|
+
3. Do not consume or filter findings.
|
|
108
|
+
4. Do not count the round as completed.
|
|
109
|
+
5. Do not retry or start another Reviewer.
|
|
110
|
+
6. Terminate Code Review.
|
|
111
|
+
7. Return `NEEDS_FIXES` with `REVIEW_ORCHESTRATION_VIOLATION`.
|
|
112
|
+
|
|
113
|
+
Cleanup success is not required to declare failure.
|
|
114
|
+
|
|
115
|
+
## Complete Independent Review
|
|
116
|
+
|
|
117
|
+
Every valid round reviews the complete current implementation against the complete applicable specification, plan, rules, contracts, callers, dependents, and test evidence. Later rounds are not finding reconciliation or fix-only verification.
|
|
118
|
+
|
|
119
|
+
A fresh Reviewer may independently rediscover an unresolved defect or find a defect earlier Reviewers missed. Historical findings are intentionally withheld to avoid anchoring.
|
|
120
|
+
|
|
121
|
+
## Convergence and Safety Fuse
|
|
122
|
+
|
|
123
|
+
Normal completion occurs only when a usable completed round leaves zero accepted findings:
|
|
124
|
+
|
|
125
|
+
- the Reviewer reports no findings; or
|
|
126
|
+
- the Main Agent rejects every finding with concrete evidence.
|
|
127
|
+
|
|
128
|
+
When accepted findings remain, the Main Agent repairs the accepted batch and starts a fresh complete round.
|
|
129
|
+
|
|
130
|
+
The internal limit is ten Reviewer executions. Rounds one through ten may return `PASS` when they converge. If round ten leaves accepted findings:
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
Do not apply another automatic repair
|
|
134
|
+
Do not start round 11
|
|
135
|
+
→ verdict: NEEDS_FIXES
|
|
136
|
+
→ blockerCode: REVIEW_SAFETY_LIMIT_REACHED
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## External Verdicts and Blockers
|
|
140
|
+
|
|
141
|
+
External verdicts:
|
|
142
|
+
|
|
143
|
+
```text
|
|
144
|
+
PASS
|
|
145
|
+
NEEDS_FIXES
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Diagnostic blocker codes:
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
REVIEW_INFRASTRUCTURE_BLOCKED
|
|
152
|
+
REVIEW_ORCHESTRATION_VIOLATION
|
|
153
|
+
WORKSPACE_MISMATCH
|
|
154
|
+
REVIEW_SAFETY_LIMIT_REACHED
|
|
155
|
+
INVALID_REVIEW_RESULT
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
A blocker code is metadata, not a third verdict.
|
|
159
|
+
|
|
160
|
+
## Non-Normative Recognition Examples
|
|
161
|
+
|
|
162
|
+
These examples help identify prohibited semantics but do not define compliance:
|
|
163
|
+
|
|
164
|
+
- starting another Agent to inspect a subsystem;
|
|
165
|
+
- invoking a Workflow that fans out workers;
|
|
166
|
+
- entering another code-review Skill;
|
|
167
|
+
- asking a task runner or Main Agent to create a helper on the Reviewer's behalf;
|
|
168
|
+
- creating a remote review job;
|
|
169
|
+
- resuming a stopped helper or successor execution.
|
|
170
|
+
|
|
171
|
+
A future capability with a different name remains prohibited when it creates or coordinates downstream execution.
|
|
172
|
+
|
|
173
|
+
## Platform Mapping
|
|
174
|
+
|
|
175
|
+
A platform mapping is valid only when its actual launch configuration proves all normative capabilities.
|
|
176
|
+
|
|
177
|
+
For a current platform that supports project-defined subagent roles and a strict capability allowlist, a role containing only observational file-inspection capabilities can satisfy the launch boundary. Omitting downstream-execution and skill-orchestration capabilities is required; a deny instruction in prose is insufficient.
|
|
178
|
+
|
|
179
|
+
Platforms without an equivalent enforceable role or launch restriction are unsupported for independent Reviewer execution and fail closed. Platform support may be added later through canonical adapters or runtime launchers without changing this protocol.
|
|
@@ -1,90 +1,118 @@
|
|
|
1
1
|
# Reviewer Workspace Protocol
|
|
2
2
|
|
|
3
|
-
Use this protocol
|
|
3
|
+
Use this protocol for every `/prizmkit-code-review` round. Workspace equivalence and execution compliance are independent requirements; both must pass before Reviewer output is usable.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Invariants
|
|
6
6
|
|
|
7
|
-
1. **
|
|
8
|
-
2. **
|
|
9
|
-
3. **
|
|
10
|
-
4. **
|
|
11
|
-
5. **Verifiability**:
|
|
12
|
-
6. **
|
|
7
|
+
1. **Complete logical view**: represent staged, unstaged, untracked, deleted, and renamed changes plus required unchanged callers and dependents.
|
|
8
|
+
2. **Currency**: capture a new snapshot after every accepted repair batch.
|
|
9
|
+
3. **Equivalence**: the Reviewer's logical view matches the captured Main-Agent workspace even when physical location or transport differs.
|
|
10
|
+
4. **Determinism**: the same repository state and inputs produce the same manifest identity.
|
|
11
|
+
5. **Verifiability**: missing, extra, stale, mixed, or unverifiable content produces `WORKSPACE_MISMATCH`.
|
|
12
|
+
6. **Execution separation**: a matched workspace does not prove the non-delegating execution boundary, and execution compliance does not prove workspace equivalence.
|
|
13
|
+
7. **Main-Agent ownership**: only the Main Agent refreshes snapshots or launches successor Reviewers.
|
|
13
14
|
|
|
14
|
-
##
|
|
15
|
+
## Deterministic Manifest
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
Prefer `${SKILL_DIR}/scripts/workspace_snapshot.py` when Python and Git are available.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
The manifest contains:
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
```text
|
|
22
|
+
protocol version
|
|
23
|
+
repository identity
|
|
24
|
+
baseline identity
|
|
25
|
+
snapshot identity
|
|
26
|
+
path inventory
|
|
27
|
+
change type
|
|
28
|
+
staged and unstaged composition
|
|
29
|
+
rename and delete state
|
|
30
|
+
content identity for available blobs
|
|
31
|
+
supporting-context identity
|
|
32
|
+
```
|
|
21
33
|
|
|
22
|
-
|
|
34
|
+
Use path-safe Git output so spaces, Unicode, quoting, renames, and deletions remain unambiguous. A prose summary is not a deterministic manifest.
|
|
23
35
|
|
|
24
|
-
|
|
36
|
+
## Review Payload
|
|
25
37
|
|
|
26
|
-
|
|
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
|
|
38
|
+
Provide both:
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
1. the complete manifest used for verification;
|
|
41
|
+
2. a reviewable representation of every manifest entry.
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
A representation may be workspace files, complete content, patches plus required base content, or equivalent materialization. Diff summaries alone are insufficient for new files or findings that depend on surrounding code.
|
|
39
44
|
|
|
40
|
-
|
|
45
|
+
Supporting unchanged context must be clearly distinguished from changed content.
|
|
41
46
|
|
|
42
|
-
|
|
43
|
-
2. A reviewable representation of every manifest entry.
|
|
47
|
+
## Content-Addressed Reuse
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
Round one establishes the complete logical snapshot. Later rounds may transfer only changed blobs while referring to unchanged content by stable identity:
|
|
46
50
|
|
|
47
|
-
|
|
51
|
+
```text
|
|
52
|
+
current logical workspace
|
|
53
|
+
= unchanged content-addressed blobs
|
|
54
|
+
+ current-round changed blobs
|
|
55
|
+
+ current complete manifest
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Reuse optimizes transport, never review scope. Every Reviewer remains responsible for the complete current change.
|
|
48
59
|
|
|
49
60
|
## Reviewer Verification
|
|
50
61
|
|
|
51
|
-
Before normal review,
|
|
62
|
+
Before normal review, verify:
|
|
52
63
|
|
|
53
|
-
1.
|
|
54
|
-
2.
|
|
55
|
-
3.
|
|
56
|
-
4.
|
|
57
|
-
5.
|
|
58
|
-
6.
|
|
64
|
+
1. repository and baseline identity;
|
|
65
|
+
2. every path and state in the manifest is represented;
|
|
66
|
+
3. no unexplained changed path exists outside the manifest;
|
|
67
|
+
4. staged, unstaged, untracked, deleted, and renamed states are preserved;
|
|
68
|
+
5. content identities match;
|
|
69
|
+
6. supporting-context identities match;
|
|
70
|
+
7. the snapshot belongs to the active round.
|
|
59
71
|
|
|
60
|
-
|
|
72
|
+
On success, return `Snapshot Verification: VERIFIED` and proceed.
|
|
61
73
|
|
|
62
|
-
|
|
74
|
+
On failure:
|
|
63
75
|
|
|
64
76
|
```text
|
|
65
77
|
### Result: WORKSPACE_MISMATCH
|
|
66
78
|
|
|
67
79
|
### Snapshot Verification
|
|
68
80
|
- Status: FAILED
|
|
69
|
-
-
|
|
70
|
-
-
|
|
81
|
+
- Identity: <expected and observed identity>
|
|
82
|
+
- Mismatch: <missing, extra, stale, mixed, or unverifiable entries>
|
|
83
|
+
- Required action: <what snapshot preparation failed>
|
|
71
84
|
```
|
|
72
85
|
|
|
73
|
-
Do not emit ordinary
|
|
86
|
+
Do not emit ordinary findings after a mismatch.
|
|
74
87
|
|
|
75
|
-
##
|
|
88
|
+
## Transport Preparation and Failure Boundary
|
|
76
89
|
|
|
77
|
-
|
|
90
|
+
Before launch, snapshot transport may use:
|
|
78
91
|
|
|
79
|
-
1.
|
|
80
|
-
2.
|
|
81
|
-
3. Establish a fresh independent Reviewer view using any valid strategy.
|
|
82
|
-
4. Repeat Reviewer verification before the next review.
|
|
92
|
+
1. the preferred strategy;
|
|
93
|
+
2. at most one alternate strategy.
|
|
83
94
|
|
|
84
|
-
|
|
95
|
+
Both attempts occur before a Reviewer starts. Do not spend the one-Reviewer budget on transport discovery.
|
|
96
|
+
|
|
97
|
+
After launch, any mismatch makes the Reviewer output unusable and terminates Code Review:
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
Discard output
|
|
101
|
+
Do not launch a replacement Reviewer
|
|
102
|
+
→ verdict: NEEDS_FIXES
|
|
103
|
+
→ blockerCode: WORKSPACE_MISMATCH
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
This prevents workspace repair from becoming another unbounded Reviewer loop.
|
|
107
|
+
|
|
108
|
+
## Round Refresh
|
|
85
109
|
|
|
86
|
-
|
|
110
|
+
After the Main Agent applies accepted fixes:
|
|
87
111
|
|
|
88
|
-
|
|
112
|
+
1. retain prior identities only as internal report evidence;
|
|
113
|
+
2. capture a new complete manifest and payload;
|
|
114
|
+
3. reuse unchanged blobs by content identity where supported;
|
|
115
|
+
4. create a fresh Reviewer execution identity;
|
|
116
|
+
5. repeat workspace verification.
|
|
89
117
|
|
|
90
|
-
|
|
118
|
+
Never reuse a Reviewer session or send historical findings to the fresh Reviewer.
|