prizmkit 1.1.123 → 1.1.125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/VERSION.json +3 -3
- package/bundled/adapters/claude/command-adapter.js +75 -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/scripts/generate-recovery-prompt.py +3 -4
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +4 -3
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +4 -3
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +7 -2
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +5 -4
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +4 -4
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +5 -4
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +6 -5
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +2 -1
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +197 -9
- package/bundled/dev-pipeline/tests/test_unified_cli.py +31 -16
- package/bundled/skills/_metadata.json +4 -4
- package/bundled/skills/prizmkit-code-review/SKILL.md +113 -110
- package/bundled/skills/prizmkit-code-review/assets/reviewer-role.json +19 -0
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +24 -21
- package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +95 -67
- package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +162 -0
- package/package.json +1 -1
- package/src/scaffold.js +15 -0
- package/bundled/skills/prizmkit-code-review/references/reviewer-workspace-protocol.md +0 -90
- package/bundled/skills/prizmkit-code-review/scripts/check_loop.py +0 -186
package/bundled/VERSION.json
CHANGED
|
@@ -20,6 +20,67 @@ function toClaudePrizmkitCommand(sub) {
|
|
|
20
20
|
return `prizmkit-${normalized}`;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
const REVIEWER_ROLE_SKILL = 'prizmkit-code-review';
|
|
24
|
+
const REVIEWER_ROLE_FILE = 'prizmkit-code-reviewer.md';
|
|
25
|
+
const REVIEWER_REQUIRED_UNAVAILABLE = new Set([
|
|
26
|
+
'workspace-mutation',
|
|
27
|
+
'shell-execution',
|
|
28
|
+
'downstream-execution-creation',
|
|
29
|
+
'delegation-equivalent-behavior',
|
|
30
|
+
'orchestration-reentry',
|
|
31
|
+
'skill-invocation',
|
|
32
|
+
]);
|
|
33
|
+
const CLAUDE_OBSERVATIONAL_TOOLS = new Map([
|
|
34
|
+
['read-files', 'Read'],
|
|
35
|
+
['search-content', 'Grep'],
|
|
36
|
+
['search-paths', 'Glob'],
|
|
37
|
+
]);
|
|
38
|
+
|
|
39
|
+
function buildReviewerRoleDefinition(roleManifest) {
|
|
40
|
+
if (!roleManifest || roleManifest.role_name !== 'prizmkit-code-reviewer') {
|
|
41
|
+
throw new Error('prizmkit-code-review requires assets/reviewer-role.json');
|
|
42
|
+
}
|
|
43
|
+
const unavailable = new Set(roleManifest.unavailable_capabilities || []);
|
|
44
|
+
for (const capability of REVIEWER_REQUIRED_UNAVAILABLE) {
|
|
45
|
+
if (!unavailable.has(capability)) {
|
|
46
|
+
throw new Error(`Reviewer role must make ${capability} unavailable`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (roleManifest.execution_mode !== 'foreground-independent-review') {
|
|
50
|
+
throw new Error('Reviewer role must use foreground independent review');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const tools = (roleManifest.observational_capabilities || []).map(capability => {
|
|
54
|
+
const tool = CLAUDE_OBSERVATIONAL_TOOLS.get(capability);
|
|
55
|
+
if (!tool) throw new Error(`Unsupported Reviewer observational capability: ${capability}`);
|
|
56
|
+
return tool;
|
|
57
|
+
});
|
|
58
|
+
if (tools.length === 0) throw new Error('Reviewer role requires observational capabilities');
|
|
59
|
+
|
|
60
|
+
return `---
|
|
61
|
+
name: ${roleManifest.role_name}
|
|
62
|
+
description: ${roleManifest.description}
|
|
63
|
+
tools: ${tools.join(', ')}
|
|
64
|
+
permissionMode: dontAsk
|
|
65
|
+
maxTurns: 80
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
You are a capability-restricted read-only Reviewer execution role.
|
|
69
|
+
|
|
70
|
+
Read and follow the complete prompt supplied by the Main Agent. Perform the complete review yourself. Your tool allowlist intentionally excludes workspace mutation, shell execution, skill invocation, downstream execution creation, delegation-equivalent behavior, and orchestration re-entry.
|
|
71
|
+
|
|
72
|
+
If the supplied review cannot be completed with the available read-only capabilities and current context, return \`BLOCKED\` with the missing capability or context. Do not delegate, request a helper, mutate the workspace, or claim \`PASS\` from incomplete work.
|
|
73
|
+
`;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function getClaudeSkillAgentDefinitions(skillName, roleManifest = null) {
|
|
77
|
+
if (skillName !== REVIEWER_ROLE_SKILL) return [];
|
|
78
|
+
return [{
|
|
79
|
+
fileName: REVIEWER_ROLE_FILE,
|
|
80
|
+
content: buildReviewerRoleDefinition(roleManifest),
|
|
81
|
+
}];
|
|
82
|
+
}
|
|
83
|
+
|
|
23
84
|
/**
|
|
24
85
|
* Convert a core SKILL.md to Claude Code command.md format.
|
|
25
86
|
* @param {string} skillContent - Content of the core SKILL.md
|
|
@@ -97,6 +158,20 @@ export async function installCommand(corePath, targetRoot) {
|
|
|
97
158
|
for (const subdir of subdirs) {
|
|
98
159
|
cpSync(path.join(corePath, subdir), path.join(targetDir, subdir), { recursive: true });
|
|
99
160
|
}
|
|
161
|
+
|
|
162
|
+
// Install platform-native capability roles generated from canonical skill semantics.
|
|
163
|
+
const roleManifestPath = path.join(corePath, 'assets', 'reviewer-role.json');
|
|
164
|
+
const roleManifest = existsSync(roleManifestPath)
|
|
165
|
+
? JSON.parse(await readFile(roleManifestPath, 'utf8'))
|
|
166
|
+
: null;
|
|
167
|
+
const agentDefinitions = getClaudeSkillAgentDefinitions(skillName, roleManifest);
|
|
168
|
+
if (agentDefinitions.length > 0) {
|
|
169
|
+
const agentsDir = path.join(targetRoot, '.claude', 'agents');
|
|
170
|
+
mkdirSync(agentsDir, { recursive: true });
|
|
171
|
+
for (const definition of agentDefinitions) {
|
|
172
|
+
await writeFile(path.join(agentsDir, definition.fileName), definition.content);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
100
175
|
} else {
|
|
101
176
|
// Single file command
|
|
102
177
|
const targetDir = path.join(targetRoot, COMMANDS_DIR);
|
|
@@ -11,14 +11,20 @@ from dataclasses import dataclass
|
|
|
11
11
|
from pathlib import Path
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
PIPELINE_TRANSIENT_EXCLUDES = (
|
|
15
15
|
":(top,exclude).prizmkit-worktree",
|
|
16
|
-
":(top,exclude).skills-lock.json",
|
|
17
|
-
":(top,exclude).AGENTS.md",
|
|
18
16
|
":(top,exclude,glob).*/worktree",
|
|
19
17
|
":(top,exclude,glob).*/worktree/**",
|
|
20
18
|
":(top,exclude,glob).*/worktrees",
|
|
21
19
|
":(top,exclude,glob).*/worktrees/**",
|
|
20
|
+
":(top,exclude).prizmkit/state",
|
|
21
|
+
":(top,exclude,glob).prizmkit/state/**",
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
HIDDEN_TOOL_WORKTREE_EXCLUDES = (
|
|
25
|
+
*PIPELINE_TRANSIENT_EXCLUDES,
|
|
26
|
+
":(top,exclude).skills-lock.json",
|
|
27
|
+
":(top,exclude).AGENTS.md",
|
|
22
28
|
":(top,exclude).claude",
|
|
23
29
|
":(top,exclude,glob).claude/**",
|
|
24
30
|
":(top,exclude).codebuddy",
|
|
@@ -31,12 +37,17 @@ HIDDEN_TOOL_WORKTREE_EXCLUDES = (
|
|
|
31
37
|
":(top,exclude,glob).prizmkit/prizm-docs/**",
|
|
32
38
|
":(top,exclude).prizmkit/config.json",
|
|
33
39
|
":(top,exclude).prizmkit/manifest.json",
|
|
34
|
-
":(top,exclude).prizmkit/state",
|
|
35
|
-
":(top,exclude,glob).prizmkit/state/**",
|
|
36
40
|
":(top,exclude).prizmkit/dev-pipeline",
|
|
37
41
|
":(top,exclude,glob).prizmkit/dev-pipeline/**",
|
|
38
42
|
)
|
|
39
43
|
|
|
44
|
+
UNTRACKED_TRANSIENT_EXCLUDES = (
|
|
45
|
+
*HIDDEN_TOOL_WORKTREE_EXCLUDES,
|
|
46
|
+
":(top,exclude,glob)**/__pycache__",
|
|
47
|
+
":(top,exclude,glob)**/__pycache__/**",
|
|
48
|
+
":(top,exclude,glob)**/*.py[cod]",
|
|
49
|
+
)
|
|
50
|
+
|
|
40
51
|
PIPELINE_FALLBACK_GIT_NAME = "PrizmKit Pipeline"
|
|
41
52
|
PIPELINE_FALLBACK_GIT_EMAIL = "prizmkit-pipeline@example.invalid"
|
|
42
53
|
|
|
@@ -11,10 +11,37 @@ from collections.abc import Sequence
|
|
|
11
11
|
from dataclasses import dataclass
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
|
|
14
|
-
from .gitops import
|
|
14
|
+
from .gitops import (
|
|
15
|
+
HIDDEN_TOOL_WORKTREE_EXCLUDES,
|
|
16
|
+
UNTRACKED_TRANSIENT_EXCLUDES,
|
|
17
|
+
GitCommandResult,
|
|
18
|
+
git_status_safe,
|
|
19
|
+
run_git_command,
|
|
20
|
+
)
|
|
15
21
|
from .runner_models import RunnerFamily
|
|
16
22
|
|
|
17
23
|
|
|
24
|
+
LOCAL_ONLY_PLATFORM_PATHS = (
|
|
25
|
+
".claude/settings.local.json",
|
|
26
|
+
".codebuddy/settings.local.json",
|
|
27
|
+
".codex/settings.local.json",
|
|
28
|
+
".agents/settings.local.json",
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass(frozen=True)
|
|
33
|
+
class PreflightWorkspace:
|
|
34
|
+
"""Exact Git paths participating in startup preservation."""
|
|
35
|
+
|
|
36
|
+
tracked: tuple[str, ...]
|
|
37
|
+
visible_untracked: tuple[str, ...]
|
|
38
|
+
unsafe_local: tuple[str, ...]
|
|
39
|
+
|
|
40
|
+
@property
|
|
41
|
+
def preservable(self) -> tuple[str, ...]:
|
|
42
|
+
return _unique_paths((*self.tracked, *self.visible_untracked))
|
|
43
|
+
|
|
44
|
+
|
|
18
45
|
@dataclass(frozen=True)
|
|
19
46
|
class BookkeepingResult:
|
|
20
47
|
"""Result from an optional bookkeeping commit boundary."""
|
|
@@ -42,6 +69,81 @@ def _repo_path(project_root: Path, path: Path) -> str:
|
|
|
42
69
|
return path.as_posix()
|
|
43
70
|
|
|
44
71
|
|
|
72
|
+
def _tracked_status_result(project_root: Path) -> GitCommandResult:
|
|
73
|
+
return run_git_command(project_root, ("status", "--porcelain=v1", "-z", "--untracked-files=no", "--", "."))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def _untracked_status_result(project_root: Path) -> GitCommandResult:
|
|
77
|
+
return run_git_command(
|
|
78
|
+
project_root,
|
|
79
|
+
("ls-files", "--others", "--exclude-standard", "-z", "--", ".", *UNTRACKED_TRANSIENT_EXCLUDES),
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _unique_paths(paths: Sequence[str]) -> tuple[str, ...]:
|
|
84
|
+
return tuple(dict.fromkeys(path for path in paths if path))
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def _literal_pathspecs(paths: Sequence[str]) -> tuple[str, ...]:
|
|
88
|
+
return tuple(f":(top,literal){path}" for path in paths)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _status_record_paths(stdout: str) -> tuple[str, ...]:
|
|
92
|
+
"""Decode exact paths from NUL-delimited porcelain-v1 records."""
|
|
93
|
+
records = stdout.split("\0")
|
|
94
|
+
changed: list[str] = []
|
|
95
|
+
index = 0
|
|
96
|
+
while index < len(records):
|
|
97
|
+
record = records[index]
|
|
98
|
+
index += 1
|
|
99
|
+
if not record:
|
|
100
|
+
continue
|
|
101
|
+
if len(record) < 4 or record[2] != " ":
|
|
102
|
+
continue
|
|
103
|
+
status = record[:2]
|
|
104
|
+
changed.append(record[3:])
|
|
105
|
+
if "R" in status or "C" in status:
|
|
106
|
+
if index < len(records) and records[index]:
|
|
107
|
+
changed.append(records[index])
|
|
108
|
+
index += 1
|
|
109
|
+
return _unique_paths(changed)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def _preflight_workspace(project_root: Path) -> tuple[PreflightWorkspace | None, GitCommandResult | None]:
|
|
113
|
+
tracked_result = _tracked_status_result(project_root)
|
|
114
|
+
if tracked_result.return_code != 0:
|
|
115
|
+
return None, tracked_result
|
|
116
|
+
untracked_result = _untracked_status_result(project_root)
|
|
117
|
+
if untracked_result.return_code != 0:
|
|
118
|
+
return None, untracked_result
|
|
119
|
+
|
|
120
|
+
tracked = _status_record_paths(tracked_result.stdout)
|
|
121
|
+
visible_untracked = _unique_paths(untracked_result.stdout.split("\0"))
|
|
122
|
+
unsafe_local = tuple(path for path in tracked if path in LOCAL_ONLY_PLATFORM_PATHS)
|
|
123
|
+
return PreflightWorkspace(tracked, visible_untracked, unsafe_local), None
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def _preflight_failure(message: str) -> GitCommandResult:
|
|
127
|
+
return GitCommandResult(args=("status", "preflight"), return_code=1, stdout="", stderr=message)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def _remaining_preflight_changes(project_root: Path) -> GitCommandResult:
|
|
131
|
+
workspace, failure = _preflight_workspace(project_root)
|
|
132
|
+
if failure is not None:
|
|
133
|
+
return failure
|
|
134
|
+
assert workspace is not None
|
|
135
|
+
if workspace.unsafe_local:
|
|
136
|
+
return _preflight_failure(
|
|
137
|
+
"Refusing to auto-commit local-only platform settings: " + ", ".join(workspace.unsafe_local)
|
|
138
|
+
)
|
|
139
|
+
return GitCommandResult(
|
|
140
|
+
args=("status", "preflight"),
|
|
141
|
+
return_code=0,
|
|
142
|
+
stdout="\0".join(workspace.preservable),
|
|
143
|
+
stderr="",
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
|
|
45
147
|
def _visible_status_result(project_root: Path) -> GitCommandResult:
|
|
46
148
|
return run_git_command(project_root, ("status", "--porcelain", "--", ".", *HIDDEN_TOOL_WORKTREE_EXCLUDES))
|
|
47
149
|
|
|
@@ -85,23 +187,33 @@ def commit_bookkeeping_changes(
|
|
|
85
187
|
|
|
86
188
|
|
|
87
189
|
def commit_preflight_ready_changes(project_root: Path, item_id: str) -> BookkeepingResult:
|
|
88
|
-
"""Preserve visible
|
|
89
|
-
|
|
90
|
-
if
|
|
91
|
-
return BookkeepingResult(attempted=True, committed=False, result=
|
|
92
|
-
|
|
190
|
+
"""Preserve tracked changes and visible untracked files before task branch setup."""
|
|
191
|
+
workspace, failure = _preflight_workspace(project_root)
|
|
192
|
+
if failure is not None:
|
|
193
|
+
return BookkeepingResult(attempted=True, committed=False, result=failure)
|
|
194
|
+
assert workspace is not None
|
|
195
|
+
if workspace.unsafe_local:
|
|
196
|
+
return BookkeepingResult(
|
|
197
|
+
attempted=True,
|
|
198
|
+
committed=False,
|
|
199
|
+
result=_preflight_failure(
|
|
200
|
+
"Refusing to auto-commit local-only platform settings: " + ", ".join(workspace.unsafe_local)
|
|
201
|
+
),
|
|
202
|
+
)
|
|
203
|
+
paths = workspace.preservable
|
|
93
204
|
if not paths:
|
|
94
205
|
return BookkeepingResult(attempted=False, committed=False)
|
|
95
|
-
|
|
206
|
+
pathspecs = _literal_pathspecs(paths)
|
|
207
|
+
add_result = run_git_command(project_root, ("add", "-A", "-f", "--", *pathspecs))
|
|
96
208
|
if add_result.return_code != 0:
|
|
97
209
|
return BookkeepingResult(attempted=True, committed=False, result=add_result)
|
|
98
210
|
result = run_git_command(
|
|
99
211
|
project_root,
|
|
100
|
-
("commit", "--no-verify", "-m", f"chore: ready for {item_id}", "--", *
|
|
212
|
+
("commit", "--no-verify", "-m", f"chore: ready for {item_id}", "--", *pathspecs),
|
|
101
213
|
)
|
|
102
214
|
if result.return_code != 0:
|
|
103
215
|
return BookkeepingResult(attempted=True, committed=False, result=result)
|
|
104
|
-
clean_result =
|
|
216
|
+
clean_result = _remaining_preflight_changes(project_root)
|
|
105
217
|
if clean_result.return_code != 0 or clean_result.stdout.strip():
|
|
106
218
|
return BookkeepingResult(attempted=True, committed=False, result=clean_result)
|
|
107
219
|
return BookkeepingResult(attempted=True, committed=True, result=result)
|
|
@@ -96,10 +96,9 @@ Implement the minimal fix (red → green):
|
|
|
96
96
|
"Review",
|
|
97
97
|
"""\
|
|
98
98
|
Verify fix quality:
|
|
99
|
-
1.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
3. If any issues found, fix and re-review (max 3 rounds)""",
|
|
99
|
+
1. Run `/prizmkit-code-review` with the current bugfix artifact directory.
|
|
100
|
+
2. The skill launches one fresh read-only Reviewer per completed round; the Main Agent filters and directly fixes accepted findings.
|
|
101
|
+
3. Continue until no accepted finding remains or the ten-round safety fuse returns `NEEDS_FIXES`; stop and retry later if review returns `BLOCKED`.""",
|
|
103
102
|
),
|
|
104
103
|
6: (
|
|
105
104
|
"User Verification",
|
|
@@ -30,7 +30,7 @@ Infer what needs to be done from the feature context above and follow the standa
|
|
|
30
30
|
|
|
31
31
|
3. **Implement**: Run `/prizmkit-implement` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` to execute the plan using TDD (write tests first, then implement).
|
|
32
32
|
|
|
33
|
-
4. **Review**: Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}
|
|
33
|
+
4. **Review**: Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill uses one fresh read-only Reviewer per completed round, lets the Main Agent filter and directly fix accepted findings, and stops after at most ten completed rounds.
|
|
34
34
|
|
|
35
35
|
5. **Test**: Run `/prizmkit-test scope=this-change artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` to generate and verify tests only for this feature's changed scope after review. Do not use bugfix/refactor artifact directories for this gate.
|
|
36
36
|
|
|
@@ -240,9 +240,9 @@ For each Verification Gate from the Task Contract, write one evidence line to Im
|
|
|
240
240
|
|
|
241
241
|
Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so the code-review skill can read spec, plan, context snapshot, implementation log, and current diff artifacts. Do not require or read a prior `/prizmkit-test` report here; test generation and test-fix looping happen in the next phase.
|
|
242
242
|
|
|
243
|
-
Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill chooses a platform-supported
|
|
243
|
+
Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill chooses a platform-supported fresh read-only Reviewer, prefers direct access to the active checkout, and supplies changed content that a platform-forced worktree cannot see. Do not prescribe Agent launch parameters from this bootstrap prompt.
|
|
244
244
|
|
|
245
|
-
The skill runs an internal review-fix loop (Reviewer Agent
|
|
245
|
+
The skill runs an internal review-fix loop (fresh Reviewer → Main-Agent filter → Main-Agent fix, up to ten completed rounds) and writes `review-report.md` to the artifact directory.
|
|
246
246
|
|
|
247
247
|
**Gate Check — Review Report**:
|
|
248
248
|
After `/prizmkit-code-review` returns, verify the review report:
|
|
@@ -257,7 +257,8 @@ If GATE:MISSING:
|
|
|
257
257
|
|
|
258
258
|
Read `review-report.md` and check the Verdict:
|
|
259
259
|
- `PASS` → proceed to next phase
|
|
260
|
-
- `NEEDS_FIXES` → the
|
|
260
|
+
- `NEEDS_FIXES` → log the unresolved accepted findings and proceed according to the task failure policy (do not retry externally)
|
|
261
|
+
- `BLOCKED` → log the infrastructure reason and stop so the review can be retried
|
|
261
262
|
|
|
262
263
|
**CP-3**: Review complete, report written.
|
|
263
264
|
|
|
@@ -180,8 +180,8 @@ After implement completes, verify:
|
|
|
180
180
|
If `FAST_PATH=true` (≤ 2 tasks, obvious root cause), skip this phase entirely and mark checkpoint step `prizmkit-code-review` as `skipped` before continuing.
|
|
181
181
|
|
|
182
182
|
Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`:
|
|
183
|
-
- The skill chooses a platform-supported
|
|
184
|
-
- The skill runs an internal review-fix loop (Reviewer → filter →
|
|
183
|
+
- The skill chooses a platform-supported fresh read-only Reviewer, prefers direct access to the active checkout, and supplies changed content that a platform-forced worktree cannot see
|
|
184
|
+
- The skill runs an internal review-fix loop (Reviewer → Main-Agent filter → Main-Agent fix, up to ten completed rounds) and writes `review-report.md`
|
|
185
185
|
- `review-report.md` must contain `## Verdict`
|
|
186
186
|
|
|
187
187
|
**Gate Check — Review Report**:
|
|
@@ -196,7 +196,8 @@ If GATE:MISSING:
|
|
|
196
196
|
|
|
197
197
|
Read `review-report.md` and check the Verdict:
|
|
198
198
|
- `PASS` → proceed
|
|
199
|
-
- `NEEDS_FIXES` → the skill
|
|
199
|
+
- `NEEDS_FIXES` → the skill reached the ten-round safety fuse or left an accepted finding unresolved; log remaining findings and proceed according to the task failure policy
|
|
200
|
+
- `BLOCKED` → log the infrastructure reason and stop so the review can be retried
|
|
200
201
|
|
|
201
202
|
{{IF_BROWSER_INTERACTION}}
|
|
202
203
|
|
|
@@ -139,7 +139,7 @@ Apply the browser behavior preservation protocol where UI behavior can be affect
|
|
|
139
139
|
|
|
140
140
|
### Phase 4: Review — Code Review & Behavior Verification
|
|
141
141
|
|
|
142
|
-
Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/` directly from the main orchestrator. The skill loads its skill-owned `references/reviewer-agent-prompt.md
|
|
142
|
+
Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/` directly from the main orchestrator. The skill loads its skill-owned `references/reviewer-agent-prompt.md`, chooses a platform-supported fresh read-only Reviewer, prefers direct access to the active checkout, and supplies changed content that a platform-forced worktree cannot see.
|
|
143
143
|
|
|
144
144
|
Review requirements:
|
|
145
145
|
- verify refactor quality against spec.md and plan.md;
|
|
@@ -149,7 +149,12 @@ Review requirements:
|
|
|
149
149
|
|
|
150
150
|
If the report is missing after one bounded status check, write `failure-log.md` and stop with a clear recovery failure. Do not replace the independent Reviewer with Main-Agent self-review.
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
Read `review-report.md` and check the Verdict:
|
|
153
|
+
- `PASS` → proceed.
|
|
154
|
+
- `NEEDS_FIXES` → log unresolved accepted findings and proceed only when they do not block behavior preservation.
|
|
155
|
+
- `BLOCKED` → log the infrastructure reason and stop so the review can be retried.
|
|
156
|
+
|
|
157
|
+
**Checkpoint update**: set step `prizmkit-code-review` to `completed` only after `PASS`, or after an explicitly accepted non-blocking `NEEDS_FIXES` result. Do not complete the checkpoint for `BLOCKED`.
|
|
153
158
|
|
|
154
159
|
---
|
|
155
160
|
|
|
@@ -12,9 +12,9 @@ If `FAST_PATH=true`, skip this phase intentionally:
|
|
|
12
12
|
|
|
13
13
|
Then continue to the next checkpoint step.
|
|
14
14
|
|
|
15
|
-
Otherwise, run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`. The skill
|
|
15
|
+
Otherwise, run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`. The skill chooses a platform-supported fresh read-only Reviewer, prefers direct access to the active checkout, and supplies changed content that a platform-forced worktree cannot see.
|
|
16
16
|
|
|
17
|
-
The skill runs its internal Reviewer Agent
|
|
17
|
+
The skill runs its internal fresh Reviewer → Main-Agent filter → Main-Agent fix loop for up to ten completed rounds and writes `review-report.md`. Do not prescribe Agent launch parameters from this pipeline template.
|
|
18
18
|
|
|
19
19
|
**Gate Check — Review Report**:
|
|
20
20
|
|
|
@@ -23,7 +23,8 @@ The skill runs its internal Reviewer Agent → filter → orchestrator fix loop
|
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
- `PASS` → proceed.
|
|
26
|
-
- `NEEDS_FIXES` →
|
|
27
|
-
-
|
|
26
|
+
- `NEEDS_FIXES` → log unresolved accepted findings and proceed only when they do not block acceptance criteria.
|
|
27
|
+
- `BLOCKED` → log the infrastructure reason and stop so the review can be retried.
|
|
28
|
+
- Missing report → one bounded retry, then write `failure-log.md` and stop if independent review remains blocked; do not replace it with Main-Agent self-review.
|
|
28
29
|
|
|
29
30
|
**Checkpoint update**: Set step `prizmkit-code-review` to `completed` when review is complete, or `skipped` for FAST_PATH.
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so the code-review skill can read spec, plan, context snapshot, implementation log, and current diff artifacts. Do not require or read a prior `/prizmkit-test` report here; test generation and test-fix looping happen in the next phase.
|
|
4
4
|
|
|
5
|
-
Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill
|
|
5
|
+
Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill chooses a platform-supported fresh read-only Reviewer, prefers direct access to the active checkout, and supplies changed content that a platform-forced worktree cannot see. Do not prescribe Agent launch parameters from this pipeline template.
|
|
6
6
|
|
|
7
|
-
The skill runs an internal review-fix loop (Reviewer Agent
|
|
7
|
+
The skill runs an internal review-fix loop (fresh Reviewer → Main-Agent filter → Main-Agent fix, up to ten completed rounds) and writes `review-report.md` to the artifact directory.
|
|
8
8
|
|
|
9
9
|
**Gate Check — Review Report**:
|
|
10
10
|
After `/prizmkit-code-review` returns, verify the review report:
|
|
@@ -19,8 +19,8 @@ If GATE:MISSING:
|
|
|
19
19
|
|
|
20
20
|
Read `review-report.md` and check the Verdict:
|
|
21
21
|
- `PASS` → proceed to next phase
|
|
22
|
-
- `NEEDS_FIXES` → the
|
|
22
|
+
- `NEEDS_FIXES` → log the unresolved accepted findings and proceed according to the task failure policy (do not retry externally)
|
|
23
|
+
- `BLOCKED` → log the infrastructure reason and stop so the review can be retried
|
|
23
24
|
|
|
24
25
|
**CP-3**: Review complete, report written.
|
|
25
26
|
|
|
26
|
-
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so the code-review skill can read spec, plan, context snapshot, implementation log, and current diff artifacts. Do not require or read a prior `/prizmkit-test` report here; test generation and test-fix looping happen in the next phase.
|
|
4
4
|
|
|
5
|
-
Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill
|
|
5
|
+
Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill chooses a platform-supported fresh read-only Reviewer, prefers direct access to the active checkout, and supplies changed content that a platform-forced worktree cannot see. Do not prescribe Agent launch parameters from this bootstrap prompt.
|
|
6
6
|
|
|
7
|
-
If the independent Reviewer cannot start or
|
|
7
|
+
If the independent Reviewer cannot start or return usable output because of a transient platform error, retry at most once. If the second attempt fails, do not keep spawning variants or enter report-polling loops; write `failure-log.md` with the observable error and let the skill report `BLOCKED`. Do not replace the independent Reviewer with Main-Agent self-review.
|
|
8
8
|
|
|
9
|
-
The skill runs an internal review-fix loop (Reviewer Agent
|
|
9
|
+
The skill runs an internal review-fix loop (fresh Reviewer → Main-Agent filter → Main-Agent fix, up to ten completed rounds) and writes `review-report.md` to the artifact directory. The review skill owns strategy selection and forced-worktree content fallback.
|
|
10
10
|
|
|
11
11
|
**Gate Check — Review Report**:
|
|
12
12
|
After `/prizmkit-code-review` returns, verify the review report:
|
|
@@ -21,7 +21,8 @@ If GATE:MISSING:
|
|
|
21
21
|
|
|
22
22
|
Read `review-report.md` and check the Verdict:
|
|
23
23
|
- `PASS` → proceed to next phase
|
|
24
|
-
- `NEEDS_FIXES` → the
|
|
24
|
+
- `NEEDS_FIXES` → log the unresolved accepted findings and proceed according to the task failure policy (do not retry externally)
|
|
25
|
+
- `BLOCKED` → log the infrastructure reason and stop so the review can be retried
|
|
25
26
|
|
|
26
27
|
**CP-3**: Review complete, report written.
|
|
27
28
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
### Phase 3: Review — Code Review & Behavior Verification
|
|
2
2
|
|
|
3
|
-
Run `/prizmkit-code-review` directly with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`. The skill loads its skill-owned `references/reviewer-agent-prompt.md
|
|
3
|
+
Run `/prizmkit-code-review` directly with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`. The skill loads its skill-owned `references/reviewer-agent-prompt.md`, chooses a platform-supported fresh read-only Reviewer, prefers direct access to the active checkout, and supplies changed content that a platform-forced worktree cannot see.
|
|
4
4
|
|
|
5
|
-
Do not spawn a top-level Reviewer subagent. The code-review skill owns its internal Reviewer Agent
|
|
5
|
+
Do not spawn a top-level Reviewer subagent. The code-review skill owns its internal fresh Reviewer → Main-Agent filter → Main-Agent fix loop for up to ten completed rounds. Do not prescribe Agent launch parameters from this pipeline template.
|
|
6
6
|
|
|
7
7
|
**Gate Check — Review Report**:
|
|
8
8
|
|
|
@@ -11,9 +11,10 @@ Do not spawn a top-level Reviewer subagent. The code-review skill owns its inter
|
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
- `PASS` → proceed.
|
|
14
|
-
- `NEEDS_FIXES` →
|
|
15
|
-
-
|
|
14
|
+
- `NEEDS_FIXES` → log unresolved accepted findings and proceed only when they do not block behavior preservation.
|
|
15
|
+
- `BLOCKED` → log the infrastructure reason and stop so the review can be retried.
|
|
16
|
+
- Missing report → one bounded retry, then write `failure-log.md` and stop if independent review remains blocked; do not replace it with Main-Agent self-review.
|
|
16
17
|
|
|
17
18
|
Verify the review explicitly checks behavior preservation, public API compatibility, imports, tests, and rollback assumptions.
|
|
18
19
|
|
|
19
|
-
**Checkpoint update**: Set step `prizmkit-code-review` to `completed`
|
|
20
|
+
**Checkpoint update**: Set step `prizmkit-code-review` to `completed` only after `PASS`, or after an explicitly accepted non-blocking `NEEDS_FIXES` result. Do not complete the checkpoint for `BLOCKED`.
|
|
@@ -882,7 +882,8 @@ class TestDirectOrchestratorImplementationPrompts:
|
|
|
882
882
|
assert FORBIDDEN_TEST_CMD_PLACEHOLDER not in rendered
|
|
883
883
|
assert FORBIDDEN_THREE_STRIKE not in rendered
|
|
884
884
|
assert FORBIDDEN_TWENTY_STEP not in rendered
|
|
885
|
-
assert "Reviewer Agent
|
|
885
|
+
assert "fresh Reviewer → Main-Agent filter → Main-Agent fix" in rendered
|
|
886
|
+
assert "up to ten completed rounds" in rendered
|
|
886
887
|
|
|
887
888
|
def test_retained_tier3_fallback_template_uses_direct_orchestrator_implementation(self):
|
|
888
889
|
rendered = Path("dev-pipeline/templates/bootstrap-tier3.md").read_text(encoding="utf-8")
|