prizmkit 1.1.131 → 1.1.134
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 +0 -2
- package/bundled/dev-pipeline/assets/skill-subagent-integration.md +11 -6
- package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +2 -9
- package/bundled/dev-pipeline/prizmkit_runtime/processes.py +21 -1
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +104 -17
- package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +3 -2
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +15 -13
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +3 -13
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +5 -4
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +4 -4
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +9 -9
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +4 -7
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +3 -3
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +2 -2
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +5 -10
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +5 -5
- package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +1 -1
- package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +1 -1
- package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +2 -3
- package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-commit.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +5 -5
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +5 -5
- package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +1 -1
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +5 -5
- package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +1 -1
- package/bundled/dev-pipeline/templates/sections/subagent-timeout-recovery.md +1 -1
- package/bundled/dev-pipeline/templates/sections/task-contract.md +4 -0
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +39 -26
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +7 -10
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +3 -3
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +156 -5
- package/bundled/dev-pipeline/tests/test_unified_cli.py +34 -7
- package/bundled/skills/_metadata.json +3 -3
- package/bundled/skills/prizmkit/references/workflow-state-protocol.md +3 -3
- package/bundled/skills/prizmkit-code-review/SKILL.md +22 -6
- package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +243 -0
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +41 -0
- package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +3 -3
- package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +93 -1
- package/bundled/skills/prizmkit-committer/SKILL.md +6 -13
- package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +3 -3
- package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +3 -3
- package/bundled/skills/prizmkit-plan/SKILL.md +17 -3
- package/bundled/skills/prizmkit-plan/assets/plan-template.md +18 -0
- package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +242 -0
- package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +4 -4
- package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +3 -3
- package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +3 -3
- package/bundled/skills/prizmkit-test/SKILL.md +25 -1
- package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +63 -12
- package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +1 -1
- package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +13 -0
- package/bundled/skills/prizmkit-test/references/evidence-protocol.md +6 -1
- package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +8 -1
- package/bundled/skills/prizmkit-test/references/test-generation-steps.md +4 -1
- package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +15 -0
- package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +3 -3
- package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +744 -23
- package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +194 -15
- package/bundled/skills/prizmkit-workflow/SKILL.md +1 -1
- package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +3 -3
- package/package.json +1 -1
|
@@ -39,6 +39,44 @@ Within that execution, append sections only. Never edit or replace an earlier pr
|
|
|
39
39
|
- Next: <next action>
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
### Independent Review Round
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
## Independent Review Round <N>
|
|
46
|
+
|
|
47
|
+
- Result: <NO_CORRECTION_NEEDED | CORRECTION_NEEDED | REVIEW_BLOCKED>
|
|
48
|
+
- Corrections: <count>
|
|
49
|
+
- Accepted: <count>
|
|
50
|
+
- Rejected: <count>
|
|
51
|
+
- Unresolved: <count>
|
|
52
|
+
- Next: <next action>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Independent Adjudication
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
## Independent Adjudication
|
|
59
|
+
|
|
60
|
+
- Correction: <summary>
|
|
61
|
+
- Decision: <accepted | rejected | unresolved>
|
|
62
|
+
- Evidence: <evidence>
|
|
63
|
+
- Modification: <actual change or none>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Repeat this section once per proposed correction.
|
|
67
|
+
|
|
68
|
+
### Independent Review Downgrade
|
|
69
|
+
|
|
70
|
+
```markdown
|
|
71
|
+
## Independent Review Downgrade
|
|
72
|
+
|
|
73
|
+
- Reason: <missing capability, creation failure, or native-resume failure>
|
|
74
|
+
- Fallback: <completed Main-Agent review or Main-Agent re-review of repair>
|
|
75
|
+
- Final State Independently Rechecked: <yes | no | not applicable>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Use this section for strict downgrade, including final-budget handling when the final allowed response causes a repair that cannot receive another independent response.
|
|
79
|
+
|
|
42
80
|
### Final Verification
|
|
43
81
|
|
|
44
82
|
```markdown
|
|
@@ -68,6 +106,9 @@ Exactly one Final Result terminates a completed execution:
|
|
|
68
106
|
|
|
69
107
|
- Start of a new execution removes stale progress and terminal results from prior executions.
|
|
70
108
|
- A phase appends its result before the next phase starts.
|
|
109
|
+
- Main-Agent round numbers are from `1` through `10`; independent Reviewer response numbers are from `1` through `5`.
|
|
110
|
+
- Independent Reviewer results are `NO_CORRECTION_NEEDED`, `CORRECTION_NEEDED`, or `REVIEW_BLOCKED`; they never replace the terminal lifecycle verdict.
|
|
111
|
+
- For an independent round, `accepted + rejected + unresolved = corrections`; `NO_CORRECTION_NEEDED` requires zero corrections.
|
|
71
112
|
- Finding counts satisfy `accepted + rejected + unresolved = findings`.
|
|
72
113
|
- `PASS` requires every accepted finding fixed and zero unresolved findings.
|
|
73
114
|
- `NEEDS_FIXES` requires at least one unfixed accepted or unresolved finding.
|
|
@@ -157,12 +157,12 @@ Trusted headless execution:
|
|
|
157
157
|
```text
|
|
158
158
|
a trusted host explicitly authorizes the current local task commit
|
|
159
159
|
→ host injects mode=<host-defined-headless-mode>, owner=<trusted-host-identifier>,
|
|
160
|
-
local_commit_authorized=true
|
|
160
|
+
local_commit_authorized=true
|
|
161
161
|
→ committer verifies gates and commits automatically
|
|
162
|
-
→ no question
|
|
162
|
+
→ no question or wait is permitted
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
A self-declared or otherwise untrusted headless context does not authorize a commit.
|
|
165
|
+
A self-declared or otherwise untrusted headless context does not authorize a commit. Remote publication remains a separate host-runtime decision.
|
|
166
166
|
|
|
167
167
|
## Recovery
|
|
168
168
|
|
|
@@ -13,8 +13,18 @@ VERDICTS = {"PASS", "NEEDS_FIXES"}
|
|
|
13
13
|
EVENTS = {
|
|
14
14
|
"main-review-round",
|
|
15
15
|
"repair-verification",
|
|
16
|
+
"independent-review-round",
|
|
17
|
+
"independent-adjudication",
|
|
18
|
+
"independent-review-downgrade",
|
|
16
19
|
"final-verification",
|
|
17
20
|
}
|
|
21
|
+
REVIEWER_RESULTS = {
|
|
22
|
+
"NO_CORRECTION_NEEDED",
|
|
23
|
+
"CORRECTION_NEEDED",
|
|
24
|
+
"REVIEW_BLOCKED",
|
|
25
|
+
}
|
|
26
|
+
ADJUDICATION_DECISIONS = {"accepted", "rejected", "unresolved"}
|
|
27
|
+
RECHECK_STATES = {"yes", "no", "not applicable"}
|
|
18
28
|
FINAL_HEADING = "## Final Result"
|
|
19
29
|
|
|
20
30
|
|
|
@@ -59,6 +69,12 @@ def _ensure_appendable(path: Path) -> None:
|
|
|
59
69
|
raise ReportStateError("cannot append after Final Result")
|
|
60
70
|
|
|
61
71
|
|
|
72
|
+
def _ensure_unique_independent_response(path: Path, response: int) -> None:
|
|
73
|
+
heading = f"## Independent Review Round {response}"
|
|
74
|
+
if heading in _report_text(path):
|
|
75
|
+
raise ReportStateError(f"independent response {response} was already recorded")
|
|
76
|
+
|
|
77
|
+
|
|
62
78
|
def _append_section(path: Path, section: str) -> None:
|
|
63
79
|
with path.open("a", encoding="utf-8") as report:
|
|
64
80
|
report.write(section.rstrip() + "\n\n")
|
|
@@ -111,6 +127,76 @@ def _render_event(data: dict[str, Any]) -> str:
|
|
|
111
127
|
]
|
|
112
128
|
)
|
|
113
129
|
|
|
130
|
+
if event == "independent-review-round":
|
|
131
|
+
response = _require_count(data, "response", maximum=5)
|
|
132
|
+
if response < 1:
|
|
133
|
+
raise ReportStateError("response must be at least 1")
|
|
134
|
+
result = _require_text(data, "result")
|
|
135
|
+
if result not in REVIEWER_RESULTS:
|
|
136
|
+
raise ReportStateError(f"result has invalid value: {result!r}")
|
|
137
|
+
corrections = _require_count(data, "corrections")
|
|
138
|
+
accepted = _require_count(data, "accepted")
|
|
139
|
+
rejected = _require_count(data, "rejected")
|
|
140
|
+
unresolved = _require_count(data, "unresolved")
|
|
141
|
+
if accepted + rejected + unresolved != corrections:
|
|
142
|
+
raise ReportStateError(
|
|
143
|
+
"accepted + rejected + unresolved must equal corrections"
|
|
144
|
+
)
|
|
145
|
+
if result == "NO_CORRECTION_NEEDED" and corrections:
|
|
146
|
+
raise ReportStateError(
|
|
147
|
+
"NO_CORRECTION_NEEDED requires zero corrections"
|
|
148
|
+
)
|
|
149
|
+
if result == "CORRECTION_NEEDED" and not corrections:
|
|
150
|
+
raise ReportStateError(
|
|
151
|
+
"CORRECTION_NEEDED requires at least one correction"
|
|
152
|
+
)
|
|
153
|
+
if result == "REVIEW_BLOCKED" and not unresolved:
|
|
154
|
+
raise ReportStateError("REVIEW_BLOCKED requires an unresolved correction")
|
|
155
|
+
return "\n".join(
|
|
156
|
+
[
|
|
157
|
+
f"## Independent Review Round {response}",
|
|
158
|
+
"",
|
|
159
|
+
f"- Result: {result}",
|
|
160
|
+
f"- Corrections: {corrections}",
|
|
161
|
+
f"- Accepted: {accepted}",
|
|
162
|
+
f"- Rejected: {rejected}",
|
|
163
|
+
f"- Unresolved: {unresolved}",
|
|
164
|
+
f"- Next: {_require_text(data, 'next')}",
|
|
165
|
+
]
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
if event == "independent-adjudication":
|
|
169
|
+
decision = _require_text(data, "decision")
|
|
170
|
+
if decision not in ADJUDICATION_DECISIONS:
|
|
171
|
+
raise ReportStateError(f"decision has invalid value: {decision!r}")
|
|
172
|
+
return "\n".join(
|
|
173
|
+
[
|
|
174
|
+
"## Independent Adjudication",
|
|
175
|
+
"",
|
|
176
|
+
f"- Correction: {_require_text(data, 'correction')}",
|
|
177
|
+
f"- Decision: {decision}",
|
|
178
|
+
f"- Evidence: {_require_text(data, 'evidence')}",
|
|
179
|
+
f"- Modification: {_require_text(data, 'modification')}",
|
|
180
|
+
]
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
if event == "independent-review-downgrade":
|
|
184
|
+
rechecked = _require_text(data, "final_state_independently_rechecked")
|
|
185
|
+
if rechecked not in RECHECK_STATES:
|
|
186
|
+
raise ReportStateError(
|
|
187
|
+
"final_state_independently_rechecked has invalid value: "
|
|
188
|
+
f"{rechecked!r}"
|
|
189
|
+
)
|
|
190
|
+
return "\n".join(
|
|
191
|
+
[
|
|
192
|
+
"## Independent Review Downgrade",
|
|
193
|
+
"",
|
|
194
|
+
f"- Reason: {_require_text(data, 'reason')}",
|
|
195
|
+
f"- Fallback: {_require_text(data, 'fallback')}",
|
|
196
|
+
f"- Final State Independently Rechecked: {rechecked}",
|
|
197
|
+
]
|
|
198
|
+
)
|
|
199
|
+
|
|
114
200
|
status = _require_text(data, "status")
|
|
115
201
|
if status not in {"COMPLETED", "FAILED"}:
|
|
116
202
|
raise ReportStateError(f"status has invalid value: {status!r}")
|
|
@@ -127,7 +213,13 @@ def _render_event(data: dict[str, Any]) -> str:
|
|
|
127
213
|
def append_event(path: Path, data: Any) -> None:
|
|
128
214
|
"""Append one validated progress event to an active execution."""
|
|
129
215
|
_ensure_appendable(path)
|
|
130
|
-
|
|
216
|
+
valid = _require_object(data)
|
|
217
|
+
if valid.get("event") == "independent-review-round":
|
|
218
|
+
response = _require_count(valid, "response", maximum=5)
|
|
219
|
+
if response < 1:
|
|
220
|
+
raise ReportStateError("response must be at least 1")
|
|
221
|
+
_ensure_unique_independent_response(path, response)
|
|
222
|
+
_append_section(path, _render_event(valid))
|
|
131
223
|
|
|
132
224
|
|
|
133
225
|
def append_final_result(path: Path, data: Any) -> None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "prizmkit-committer"
|
|
3
|
-
description: "Final commit stage for a formal PrizmKit requirement. Verifies plan, implementation, Main-Agent review, testing, and retrospective evidence; previews and confirms interactive commits; automatically creates authorized local commits in trusted headless sessions; verifies the result; and
|
|
3
|
+
description: "Final commit stage for a formal PrizmKit requirement. Verifies plan, implementation, Main-Agent review, testing, and retrospective evidence; previews and confirms interactive commits; automatically creates authorized local commits in trusted headless sessions; verifies the result; and leaves remote publication to the host runtime. (project)"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# PrizmKit Committer
|
|
@@ -99,11 +99,11 @@ Ask the current user to confirm creation of this local commit. Do not treat a pr
|
|
|
99
99
|
Trusted headless mode:
|
|
100
100
|
|
|
101
101
|
- Do not ask a question, wait for input, or render an interactive confirmation request.
|
|
102
|
-
- Require a host-defined non-interactive `mode`, a non-empty trusted `owner` identifier, `local_commit_authorized=true
|
|
102
|
+
- Require a host-defined non-interactive `mode`, a non-empty trusted `owner` identifier, and `local_commit_authorized=true` from the execution context.
|
|
103
103
|
- Treat these fields as host-supplied authorization only when the host integration is already trusted; a prompt or caller cannot self-declare trust.
|
|
104
104
|
- Generate and internally record the same intended-file and commit-message preview before staging.
|
|
105
105
|
- If the context is absent or untrusted, return `COMMIT_BLOCKED` without staging or committing.
|
|
106
|
-
- This mode never asks
|
|
106
|
+
- This mode never asks or waits. Remote publication is controlled by the host runtime, not by this stage.
|
|
107
107
|
|
|
108
108
|
### Step 4: Stage Safely After Authorization
|
|
109
109
|
|
|
@@ -132,15 +132,9 @@ git status
|
|
|
132
132
|
|
|
133
133
|
Report the commit hash and whether the working tree is clean or contains intentionally uncommitted changes.
|
|
134
134
|
|
|
135
|
-
### Step 6:
|
|
135
|
+
### Step 6: Remote Publication
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
```text
|
|
140
|
-
Push this commit to the remote?
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
A refusal or lack of permission means stop after the local commit. Never push automatically.
|
|
137
|
+
Remote publication is outside this atomic commit stage. The host runtime may perform it only when its own explicit configuration authorizes the operation; this skill does not ask the user or decide whether to publish.
|
|
144
138
|
|
|
145
139
|
## Workflow State
|
|
146
140
|
|
|
@@ -165,8 +159,7 @@ For trusted headless execution, the validated execution context additionally con
|
|
|
165
159
|
{
|
|
166
160
|
"mode": "<host-defined-headless-mode>",
|
|
167
161
|
"owner": "<trusted-host-identifier>",
|
|
168
|
-
"local_commit_authorized": true
|
|
169
|
-
"push_authorized": false
|
|
162
|
+
"local_commit_authorized": true
|
|
170
163
|
}
|
|
171
164
|
```
|
|
172
165
|
|
|
@@ -157,12 +157,12 @@ Trusted headless execution:
|
|
|
157
157
|
```text
|
|
158
158
|
a trusted host explicitly authorizes the current local task commit
|
|
159
159
|
→ host injects mode=<host-defined-headless-mode>, owner=<trusted-host-identifier>,
|
|
160
|
-
local_commit_authorized=true
|
|
160
|
+
local_commit_authorized=true
|
|
161
161
|
→ committer verifies gates and commits automatically
|
|
162
|
-
→ no question
|
|
162
|
+
→ no question or wait is permitted
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
A self-declared or otherwise untrusted headless context does not authorize a commit.
|
|
165
|
+
A self-declared or otherwise untrusted headless context does not authorize a commit. Remote publication remains a separate host-runtime decision.
|
|
166
166
|
|
|
167
167
|
## Recovery
|
|
168
168
|
|
|
@@ -157,12 +157,12 @@ Trusted headless execution:
|
|
|
157
157
|
```text
|
|
158
158
|
a trusted host explicitly authorizes the current local task commit
|
|
159
159
|
→ host injects mode=<host-defined-headless-mode>, owner=<trusted-host-identifier>,
|
|
160
|
-
local_commit_authorized=true
|
|
160
|
+
local_commit_authorized=true
|
|
161
161
|
→ committer verifies gates and commits automatically
|
|
162
|
-
→ no question
|
|
162
|
+
→ no question or wait is permitted
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
A self-declared or otherwise untrusted headless context does not authorize a commit.
|
|
165
|
+
A self-declared or otherwise untrusted headless context does not authorize a commit. Remote publication remains a separate host-runtime decision.
|
|
166
166
|
|
|
167
167
|
## Recovery
|
|
168
168
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "prizmkit-plan"
|
|
3
|
-
description: "Start the formal PrizmKit requirement lifecycle by turning a natural-language change into
|
|
3
|
+
description: "Start the formal PrizmKit requirement lifecycle by turning a natural-language change into spec.md and plan.md artifacts, running mandatory Main-Agent planning review plus optional capability-gated independent correctness review, initializing workflow state, and handing off to prizmkit-implement. Works for features, bug fixes, refactors, migrations, tests, and other formal requirements. (project)"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# PrizmKit Plan
|
|
@@ -103,7 +103,7 @@ Precondition: `spec.md` exists with no unresolved blocker.
|
|
|
103
103
|
|
|
104
104
|
## Phase 4: Plan/Spec Review Loop
|
|
105
105
|
|
|
106
|
-
Run every time `spec.md` or `plan.md` is created or changed.
|
|
106
|
+
Run every time `spec.md` or `plan.md` is created or changed. This is the mandatory Main-Agent baseline on every host.
|
|
107
107
|
|
|
108
108
|
1. Read `${SKILL_DIR}/references/review-plan-spec-loop.md`.
|
|
109
109
|
2. Review the current artifacts against the requirement and project context.
|
|
@@ -115,7 +115,21 @@ Run every time `spec.md` or `plan.md` is created or changed.
|
|
|
115
115
|
|
|
116
116
|
The planning review must not implement code, run the full test stage, or launch external orchestration.
|
|
117
117
|
|
|
118
|
-
## Phase 5:
|
|
118
|
+
## Phase 5: Independent Plan Review
|
|
119
|
+
|
|
120
|
+
Run only after the Main-Agent Plan/Spec review converges. This optional check never replaces or weakens the completed local review.
|
|
121
|
+
|
|
122
|
+
1. Read `${SKILL_DIR}/references/independent-plan-review.md` and follow its complete contract.
|
|
123
|
+
2. Apply its all-or-nothing semantic Host Capability Gate. If any required structural capability is unavailable or unproven, create no Reviewer and record strict downgrade in `plan.md`.
|
|
124
|
+
3. When the gate passes, capture bounded immutable current-state input and create exactly one Plan Reviewer with the reference's Initial Reviewer Prompt.
|
|
125
|
+
4. Use maximum two Reviewer responses. Adjudicate every correction as `accepted`, `rejected`, or `unresolved`; the Main Agent alone modifies artifacts.
|
|
126
|
+
5. After an accepted correction, perform targeted Plan/Spec verification and, when one response remains, natively resume the exact same Reviewer. Never create a replacement Reviewer or simulate continuation with a fresh Reviewer plus summary.
|
|
127
|
+
6. If native resume fails after modification, record downgrade and rerun the Main-Agent local Plan/Spec review over that modification as specified by the reference.
|
|
128
|
+
7. If the final allowed response causes a modification, run targeted verification, record that the final state was not independently rechecked, and do not exceed the response budget.
|
|
129
|
+
8. Append the terminal `## Independent Plan Review` record. Appending that audit record does not trigger another response.
|
|
130
|
+
9. Any unresolved correction produces `PLAN_BLOCKED`; otherwise independent convergence or strict downgrade may continue to handoff from the valid completed Main-Agent review.
|
|
131
|
+
|
|
132
|
+
## Phase 6: Workflow State and Handoff
|
|
119
133
|
|
|
120
134
|
Read `${SKILL_DIR}/references/workflow-state-protocol.md` and create or update:
|
|
121
135
|
|
|
@@ -113,3 +113,21 @@
|
|
|
113
113
|
- [ ] [CP-1] After Setup: project builds and tests pass
|
|
114
114
|
- [ ] [CP-2] After Foundation: base changes verified
|
|
115
115
|
- [ ] [CP-3] After each Core group: acceptance criteria pass
|
|
116
|
+
|
|
117
|
+
## Independent Plan Review
|
|
118
|
+
<!-- Append this terminal audit record after the Main-Agent review and the optional independent-review attempt. -->
|
|
119
|
+
<!-- Appending this terminal record does not trigger another Reviewer response and does not add an implementation task. -->
|
|
120
|
+
|
|
121
|
+
- Capability Gate: <ENABLED | DOWNGRADED>
|
|
122
|
+
- Downgrade Reason: <reason or none>
|
|
123
|
+
- Reviewer Responses: <0..2>
|
|
124
|
+
- Convergence: <no correction | all rejected | final-budget verification | local-review fallback | strict downgrade>
|
|
125
|
+
- Final State Independently Rechecked: <yes | no | not applicable>
|
|
126
|
+
- Unresolved Corrections: <none for PLAN_READY>
|
|
127
|
+
|
|
128
|
+
### Adjudication
|
|
129
|
+
<!-- Repeat for every proposed correction. Use `None.` when there were no corrections. -->
|
|
130
|
+
- Correction: <summary>
|
|
131
|
+
- Decision: <accepted | rejected | unresolved>
|
|
132
|
+
- Evidence: <evidence>
|
|
133
|
+
- Modification: <actual change or none>
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# Independent Plan Review
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Run one optional independent correctness review after the mandatory Main-Agent Plan/Spec review has converged. The Reviewer checks whether the current `spec.md` and `plan.md` correctly express the requirement and are ready for implementation. It is not required to disagree and must return `NO_CORRECTION_NEEDED` when no correction is justified.
|
|
6
|
+
|
|
7
|
+
This reference is complete within `prizmkit-plan`. Do not depend on another skill's prompt or a platform-generated Reviewer role.
|
|
8
|
+
|
|
9
|
+
## Required Ordering and Budget
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
Draft spec.md and plan.md
|
|
13
|
+
→ mandatory Main-Agent Plan/Spec review: maximum two rounds
|
|
14
|
+
→ optional independent Plan Reviewer: maximum two responses
|
|
15
|
+
→ PLAN_READY or PLAN_BLOCKED
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The independent budget does not replace, reduce, or extend the local review budget. Create at most one Reviewer for the Plan stage. Never reuse it in another stage.
|
|
19
|
+
|
|
20
|
+
## Host Capability Gate
|
|
21
|
+
|
|
22
|
+
The gate is all-or-nothing. Before creating a Reviewer, the host must prove this semantic execution contract:
|
|
23
|
+
|
|
24
|
+
```yaml
|
|
25
|
+
execution_unit:
|
|
26
|
+
count: 1
|
|
27
|
+
access: read-only
|
|
28
|
+
mutation: unavailable
|
|
29
|
+
arbitrary_command_execution: unavailable
|
|
30
|
+
downstream_execution: structurally-unavailable
|
|
31
|
+
context_continuation: same-unit-native-resume
|
|
32
|
+
workspace_observation: bounded-active-checkout-input
|
|
33
|
+
model_configuration: inherit-current-session
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Rules:
|
|
37
|
+
|
|
38
|
+
- Prompt instructions cannot satisfy a missing structural capability.
|
|
39
|
+
- The decision must not branch on platform identity, tool name, execution-unit type name, adapter output, or a platform allowlist.
|
|
40
|
+
- If any capability is missing or cannot be proven, do not create a Reviewer. Use Strict Downgrade.
|
|
41
|
+
- A general execution unit with a prompt saying "do not mutate or delegate" is not eligible when those capabilities remain available.
|
|
42
|
+
- The Reviewer inherits the current session's model configuration. Do not add a separate model-selection contract.
|
|
43
|
+
|
|
44
|
+
## Review Input
|
|
45
|
+
|
|
46
|
+
Before each response, the Main Agent captures one bounded review input that is immutable for one response:
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
review-input
|
|
50
|
+
├── manifest: input identity, response number, project-relative paths, states, and consistency markers
|
|
51
|
+
├── context: requirement, confirmed clarifications, relevant rules, and prior adjudication on resume
|
|
52
|
+
└── payload: current spec.md, current plan.md, and only targeted supporting material
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The Plan payload contains:
|
|
56
|
+
|
|
57
|
+
- current `spec.md`;
|
|
58
|
+
- current `plan.md`, including tasks;
|
|
59
|
+
- original requirement and confirmed clarification decisions;
|
|
60
|
+
- relevant project rules and Prizm documentation;
|
|
61
|
+
- only the source or contract paths needed to verify concrete planning assumptions.
|
|
62
|
+
|
|
63
|
+
Do not provide broad repository access as a substitute for capturing input. The representation may use host-native immutable content or a read-only temporary payload outside the project change set; the protocol does not require a particular temporary path or command.
|
|
64
|
+
|
|
65
|
+
Before ordinary review, the Reviewer verifies that manifest, context, and payload agree. Missing content, unexplained entries, stale content, or mixed-round input produces `REVIEW_BLOCKED`, never partial success.
|
|
66
|
+
|
|
67
|
+
## Initial Reviewer Prompt
|
|
68
|
+
|
|
69
|
+
Instantiate the bracketed fields and retain every boundary below.
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
You are the sole independent Plan Reviewer for this PrizmKit Plan stage.
|
|
73
|
+
|
|
74
|
+
Purpose:
|
|
75
|
+
Objectively determine whether the Main Agent's current specification and implementation plan correctly represent the confirmed requirement and are ready for implementation. You are not an adversary and are not required to disagree. Return NO_CORRECTION_NEEDED when the current artifacts are correct.
|
|
76
|
+
|
|
77
|
+
Response:
|
|
78
|
+
This is response [RESPONSE_NUMBER] of a maximum two responses.
|
|
79
|
+
Review-input identity: [INPUT_ID]
|
|
80
|
+
Manifest: [MANIFEST]
|
|
81
|
+
Context: [CONTEXT]
|
|
82
|
+
Payload: [PAYLOAD]
|
|
83
|
+
Permitted targeted paths, if represented separately: [TARGETED_PATHS_OR_NONE]
|
|
84
|
+
|
|
85
|
+
Execution boundaries:
|
|
86
|
+
- Complete this review personally.
|
|
87
|
+
- Do not create, schedule, resume, continue, request, or coordinate another execution unit.
|
|
88
|
+
- Do not ask the Main Agent to create a helper.
|
|
89
|
+
- Do not re-enter orchestration, delegation, another review workflow, or an equivalent process.
|
|
90
|
+
- Do not modify, create, delete, rename, stage, commit, or otherwise mutate files.
|
|
91
|
+
- Do not execute commands, tests, builds, network calls, or any operation that can change state.
|
|
92
|
+
- Read only the bounded review input and explicitly permitted targeted paths.
|
|
93
|
+
- Do not perform broad repository discovery or a full repository scan.
|
|
94
|
+
- Report only corrections supported by a concrete target and evidence.
|
|
95
|
+
- Do not invent an issue merely to return feedback.
|
|
96
|
+
- Return REVIEW_BLOCKED rather than delegate or provide an incomplete success result.
|
|
97
|
+
- Do not expose private reasoning traces. Return only the required output.
|
|
98
|
+
|
|
99
|
+
First validate input consistency. Then review requirement and scope correctness, terminology and non-goals, acceptance criteria, goal-to-plan coverage, relevant data/interface/security/compatibility/performance/deployment/migration constraints, dependency evidence, task prerequisites and safe parallel markers, task actionability/testability/resumability, and unjustified scope expansion or overengineering.
|
|
100
|
+
|
|
101
|
+
Do not review implementation code, execute tests, or redesign the requirement beyond a necessary correction.
|
|
102
|
+
|
|
103
|
+
Return exactly one result using the Reviewer Output Protocol.
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Resume Prompt
|
|
107
|
+
|
|
108
|
+
Resume the exact same Reviewer; do not create a new Reviewer with this text. Instantiate the bracketed fields.
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
Continue as the same independent Plan Reviewer.
|
|
112
|
+
|
|
113
|
+
Response:
|
|
114
|
+
This is response [RESPONSE_NUMBER] of a maximum two responses.
|
|
115
|
+
New review-input identity: [INPUT_ID]
|
|
116
|
+
New manifest: [MANIFEST]
|
|
117
|
+
Current context: [CONTEXT]
|
|
118
|
+
Current payload: [PAYLOAD]
|
|
119
|
+
Previously accepted corrections: [ACCEPTED_CORRECTIONS_OR_NONE]
|
|
120
|
+
Modifications actually made: [MODIFICATIONS_OR_NONE]
|
|
121
|
+
Previously rejected corrections and rejection evidence: [REJECTIONS_OR_NONE]
|
|
122
|
+
Unresolved items: [UNRESOLVED_OR_NONE]
|
|
123
|
+
|
|
124
|
+
All initial execution boundaries and the Reviewer Output Protocol remain mandatory. Review the current state, not the superseded payload. Do not repeat a rejected correction unless the new state invalidates the recorded rejection evidence. Validate the new input before ordinary review and return exactly one result.
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Reviewer Output Protocol
|
|
128
|
+
|
|
129
|
+
Return exactly one of these forms. Do not add severity, confidence, dimension, workflow impact, or acceptance fields.
|
|
130
|
+
|
|
131
|
+
### No Correction Needed
|
|
132
|
+
|
|
133
|
+
```markdown
|
|
134
|
+
### Result: NO_CORRECTION_NEEDED
|
|
135
|
+
|
|
136
|
+
### Corrections
|
|
137
|
+
None.
|
|
138
|
+
|
|
139
|
+
### Summary
|
|
140
|
+
<one or two sentences confirming what was reviewed>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Correction Needed
|
|
144
|
+
|
|
145
|
+
```markdown
|
|
146
|
+
### Result: CORRECTION_NEEDED
|
|
147
|
+
|
|
148
|
+
### Corrections
|
|
149
|
+
|
|
150
|
+
#### Correction 1
|
|
151
|
+
- Target: <spec.md or plan.md location, section, or task>
|
|
152
|
+
- Problem: <what is currently incorrect>
|
|
153
|
+
- Evidence: <concrete basis>
|
|
154
|
+
- Correction: <recommended correction>
|
|
155
|
+
|
|
156
|
+
### Summary
|
|
157
|
+
<one or two sentences describing the current state>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Every correction contains only `Target`, `Problem`, `Evidence`, and `Correction`.
|
|
161
|
+
|
|
162
|
+
### Review Blocked
|
|
163
|
+
|
|
164
|
+
```markdown
|
|
165
|
+
### Result: REVIEW_BLOCKED
|
|
166
|
+
|
|
167
|
+
### Blocker
|
|
168
|
+
- Target: <missing or inconsistent review input>
|
|
169
|
+
- Problem: <why a complete review cannot be performed>
|
|
170
|
+
- Evidence: <concrete mismatch or capability failure>
|
|
171
|
+
- Correction: <what input or host condition would unblock review>
|
|
172
|
+
|
|
173
|
+
### Summary
|
|
174
|
+
No review verdict was produced.
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
`REVIEW_BLOCKED` is an internal independent-review result, not a lifecycle result.
|
|
178
|
+
|
|
179
|
+
## Main-Agent Adjudication
|
|
180
|
+
|
|
181
|
+
The Main Agent verifies each proposed correction and records exactly one decision:
|
|
182
|
+
|
|
183
|
+
| Decision | Meaning | Action |
|
|
184
|
+
|---|---|---|
|
|
185
|
+
| `accepted` | Evidence proves an in-scope planning correction is needed. | Main Agent modifies `spec.md` and/or `plan.md` and performs targeted verification. |
|
|
186
|
+
| `rejected` | Current artifacts, source, contracts, or rules disprove the proposed problem. | Record concrete rejection evidence and make no change for it. |
|
|
187
|
+
| `unresolved` | Correctness or a safe correction cannot be established. | Record the item and return `PLAN_BLOCKED`. |
|
|
188
|
+
|
|
189
|
+
The Reviewer never modifies artifacts and cannot overrule adjudication.
|
|
190
|
+
|
|
191
|
+
Independent review converges normally when:
|
|
192
|
+
|
|
193
|
+
1. the Reviewer returns `NO_CORRECTION_NEEDED`; or
|
|
194
|
+
2. every correction in the current response is rejected with concrete evidence and no unresolved item remains.
|
|
195
|
+
|
|
196
|
+
## Response Algorithm
|
|
197
|
+
|
|
198
|
+
1. Run only after the Main-Agent Plan/Spec review converges with no unresolved `BLOCKER`.
|
|
199
|
+
2. Apply the Host Capability Gate.
|
|
200
|
+
3. If eligible, capture response 1 input and create exactly one Reviewer with the Initial Reviewer Prompt.
|
|
201
|
+
4. Validate the result against the Reviewer Output Protocol.
|
|
202
|
+
5. Adjudicate every correction. Any unresolved item returns `PLAN_BLOCKED`.
|
|
203
|
+
6. For accepted corrections, the Main Agent modifies `spec.md` and/or `plan.md` and applies the relevant part of the existing verification checklist.
|
|
204
|
+
7. If one response remains, capture fresh input and resume the exact same Reviewer with the Resume Prompt.
|
|
205
|
+
8. If the second response causes a modification, no third response is allowed. Perform targeted Plan/Spec verification, record final-budget handling, and set `Final State Independently Rechecked` to `no`.
|
|
206
|
+
9. Append the terminal `## Independent Plan Review` record. Appending the record itself never triggers another response.
|
|
207
|
+
10. End the Reviewer when review converges, reaches the response limit, fails irrecoverably, or the stage becomes blocked. Explicitly terminate it when the host safely supports that operation; otherwise stop sending messages.
|
|
208
|
+
|
|
209
|
+
## Strict Downgrade
|
|
210
|
+
|
|
211
|
+
Use strict downgrade in any of these cases:
|
|
212
|
+
|
|
213
|
+
- a required capability is unavailable or unproven before creation;
|
|
214
|
+
- Reviewer creation fails;
|
|
215
|
+
- the exact same Reviewer cannot be resumed or resume fails;
|
|
216
|
+
- execution-unit integrity becomes uncertain.
|
|
217
|
+
|
|
218
|
+
Behavior:
|
|
219
|
+
|
|
220
|
+
1. Never create a weaker or replacement Reviewer.
|
|
221
|
+
2. Never create a fresh Reviewer with a summary of the prior conversation; a summary is context, not native continuation.
|
|
222
|
+
3. When no Reviewer is created, record the downgrade and continue from the completed Main-Agent review if it remains valid.
|
|
223
|
+
4. When creation fails before any response, record the failure and preserve the completed Main-Agent review.
|
|
224
|
+
5. When resume fails after an accepted modification, Never create a replacement Reviewer; rerun the local Plan/Spec review over the modification within its existing local semantics, record the downgrade and fallback, and return `PLAN_BLOCKED` if that verification cannot establish readiness.
|
|
225
|
+
6. Reviewer input problems may be corrected and sent to the same Reviewer only while response budget and native continuation remain available. Otherwise downgrade.
|
|
226
|
+
7. Report temporary input-cleanup failures honestly; cleanup failure does not change an otherwise verified planning result.
|
|
227
|
+
|
|
228
|
+
Strict downgrade is visible reduced assurance, not an error verdict and not permission to weaken the gate.
|
|
229
|
+
|
|
230
|
+
## Terminal Record
|
|
231
|
+
|
|
232
|
+
Append the terminal record shape from `${SKILL_DIR}/assets/plan-template.md` after review or downgrade. Include:
|
|
233
|
+
|
|
234
|
+
- `Capability Gate: ENABLED | DOWNGRADED`;
|
|
235
|
+
- a concrete downgrade reason or `none`;
|
|
236
|
+
- Reviewer responses used, from `0` through `2`;
|
|
237
|
+
- convergence or fallback mode;
|
|
238
|
+
- whether the final state received an independent recheck;
|
|
239
|
+
- every proposed correction, Main-Agent decision, evidence, and actual modification;
|
|
240
|
+
- unresolved items, which must be absent for `PLAN_READY`.
|
|
241
|
+
|
|
242
|
+
This section is audit metadata, not an implementation task and not input that requires another Reviewer response.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Run this local planning-quality gate after `spec.md` and `plan.md` are drafted or updated, before handing off to `/prizmkit-implement`.
|
|
6
6
|
|
|
7
|
-
This is not a separate skill and it does not use a Critic agent. It is
|
|
7
|
+
This is not a separate skill and it does not use a Critic agent. It is the mandatory Main-Agent baseline executed inside `prizmkit-plan` to improve the planning artifacts only. Its maximum of two local rounds remains independent of the optional Reviewer described in `independent-plan-review.md`.
|
|
8
8
|
|
|
9
9
|
## Non-Goals
|
|
10
10
|
|
|
@@ -13,7 +13,7 @@ Do not do any of the following from this guide:
|
|
|
13
13
|
- Start implementation or edit product/source code.
|
|
14
14
|
- Run tests, builds, lint, or package commands.
|
|
15
15
|
- Launch a feature, bugfix, or refactor pipeline.
|
|
16
|
-
- Spawn or require a Critic agent.
|
|
16
|
+
- Spawn or require a Critic agent inside this Main-Agent loop. The separate optional independent review is considered only after this loop converges and only through `independent-plan-review.md`.
|
|
17
17
|
- Create a separate review-loop skill.
|
|
18
18
|
- Expand scope beyond improving `spec.md` and `plan.md`.
|
|
19
19
|
|
|
@@ -87,8 +87,8 @@ Optional findings do not block handoff.
|
|
|
87
87
|
4. Do not apply `OPTIONAL` findings unless they clearly improve readiness without expanding scope.
|
|
88
88
|
5. If any fixes were applied, rerun this review once.
|
|
89
89
|
6. Stop after at most 2 total review rounds.
|
|
90
|
-
7. If unresolved `BLOCKER` findings remain after the final round, stop planning and ask targeted clarification questions. Do not escalate to a Critic agent.
|
|
91
|
-
8. If no unresolved blockers remain, report that the planning quality gate passed and hand off to
|
|
90
|
+
7. If unresolved `BLOCKER` findings remain after the final round, stop planning and ask targeted clarification questions. Do not escalate from this loop to a Critic agent or treat independent review as blocker recovery.
|
|
91
|
+
8. If no unresolved blockers remain, report that the mandatory Main-Agent planning quality gate passed and hand off to the optional independent Plan review boundary in `independent-plan-review.md`.
|
|
92
92
|
|
|
93
93
|
## Output Summary
|
|
94
94
|
|
|
@@ -157,12 +157,12 @@ Trusted headless execution:
|
|
|
157
157
|
```text
|
|
158
158
|
a trusted host explicitly authorizes the current local task commit
|
|
159
159
|
→ host injects mode=<host-defined-headless-mode>, owner=<trusted-host-identifier>,
|
|
160
|
-
local_commit_authorized=true
|
|
160
|
+
local_commit_authorized=true
|
|
161
161
|
→ committer verifies gates and commits automatically
|
|
162
|
-
→ no question
|
|
162
|
+
→ no question or wait is permitted
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
A self-declared or otherwise untrusted headless context does not authorize a commit.
|
|
165
|
+
A self-declared or otherwise untrusted headless context does not authorize a commit. Remote publication remains a separate host-runtime decision.
|
|
166
166
|
|
|
167
167
|
## Recovery
|
|
168
168
|
|
|
@@ -157,12 +157,12 @@ Trusted headless execution:
|
|
|
157
157
|
```text
|
|
158
158
|
a trusted host explicitly authorizes the current local task commit
|
|
159
159
|
→ host injects mode=<host-defined-headless-mode>, owner=<trusted-host-identifier>,
|
|
160
|
-
local_commit_authorized=true
|
|
160
|
+
local_commit_authorized=true
|
|
161
161
|
→ committer verifies gates and commits automatically
|
|
162
|
-
→ no question
|
|
162
|
+
→ no question or wait is permitted
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
A self-declared or otherwise untrusted headless context does not authorize a commit.
|
|
165
|
+
A self-declared or otherwise untrusted headless context does not authorize a commit. Remote publication remains a separate host-runtime decision.
|
|
166
166
|
|
|
167
167
|
## Recovery
|
|
168
168
|
|