prizmkit 1.1.128 → 1.1.130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +88 -58
  3. package/bundled/dev-pipeline/prizmkit_runtime/reset.py +4 -3
  4. package/bundled/dev-pipeline/prizmkit_runtime/runner_bookkeeping.py +53 -1
  5. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +33 -17
  6. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +30 -28
  7. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +8 -3
  8. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +3 -2
  9. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +11 -4
  10. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +3 -3
  11. package/bundled/dev-pipeline/scripts/prompt_framework.py +4 -6
  12. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +2 -2
  13. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +20 -19
  14. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +2 -2
  15. package/bundled/dev-pipeline/templates/sections/bugfix-mission.md +1 -1
  16. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +10 -2
  17. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +1 -1
  18. package/bundled/dev-pipeline/templates/sections/directory-convention-agent.md +3 -2
  19. package/bundled/dev-pipeline/templates/sections/directory-convention-full.md +3 -2
  20. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +1 -1
  21. package/bundled/dev-pipeline/templates/sections/phase-commit.md +1 -1
  22. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +1 -1
  23. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +1 -1
  24. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +11 -3
  25. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +11 -3
  26. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +1 -1
  27. package/bundled/dev-pipeline/templates/sections/phase0-init.md +1 -1
  28. package/bundled/dev-pipeline/templates/sections/refactor-mission.md +1 -1
  29. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +11 -3
  30. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +1 -1
  31. package/bundled/dev-pipeline/templates/sections/subagent-timeout-recovery.md +6 -4
  32. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +1 -1
  33. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +192 -5
  34. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +139 -11
  35. package/bundled/dev-pipeline/tests/test_unified_cli.py +215 -9
  36. package/bundled/skills/_metadata.json +1 -1
  37. package/bundled/skills/feature-planner/SKILL.md +2 -2
  38. package/bundled/skills/prizmkit/SKILL.md +1 -1
  39. package/bundled/skills/prizmkit-code-review/SKILL.md +10 -1
  40. package/package.json +1 -1
  41. package/src/manifest.js +8 -3
@@ -377,13 +377,13 @@ def _refactor_header(pipeline_mode):
377
377
  title = "# Dev-Pipeline Refactor Session Bootstrap — {}\n".format(pipeline_mode.title())
378
378
  desc = {
379
379
  "lite": "**Tier 1 — Single Agent**: direct behavior-preserving refactor by the main orchestrator.",
380
- "standard": "**Tier 2 — Orchestrator + Reviewer**: direct refactor with review gates.",
380
+ "standard": "**Tier 2 — Main-Agent Review Gates**: direct refactor with Main-Agent-only review gates.",
381
381
  "full": "**Tier 3 — Full Refactor Guardrails**: direct refactor with stronger behavior-preservation evidence.",
382
382
  }.get(pipeline_mode, "**Refactor pipeline**")
383
383
  return title + "\n" + desc + "\n"
384
384
 
385
385
 
386
- def assemble_refactor_sections(pipeline_mode, sections_dir, browser_enabled):
386
+ def assemble_refactor_sections(pipeline_mode, sections_dir, browser_enabled, browser_tool="auto"):
387
387
  sections = [
388
388
  ("header", _refactor_header(pipeline_mode)),
389
389
  ("refactor-session-context", load_section(sections_dir, "refactor-session-context.md")),
@@ -401,7 +401,11 @@ def assemble_refactor_sections(pipeline_mode, sections_dir, browser_enabled):
401
401
  ("refactor-phase-review", load_section(sections_dir, "refactor-phase-review.md")),
402
402
  ])
403
403
  if browser_enabled:
404
- sections.append(("phase-browser", load_section(sections_dir, "phase-browser-verification-auto.md")))
404
+ browser_section_file = {
405
+ "playwright-cli": "phase-browser-verification.md",
406
+ "opencli": "phase-browser-verification-opencli.md",
407
+ }.get(browser_tool, "phase-browser-verification-auto.md")
408
+ sections.append(("phase-browser", load_section(sections_dir, browser_section_file)))
405
409
  sections.extend([
406
410
  ("refactor-phase-commit-report", load_section(sections_dir, "refactor-phase-commit-report.md")),
407
411
  ("refactor-session-status", load_section(sections_dir, "refactor-session-status.md")),
@@ -469,7 +473,10 @@ def main():
469
473
  sections = []
470
474
  if use_sections:
471
475
  try:
472
- sections = assemble_refactor_sections(pipeline_mode, sections_dir, browser_enabled)
476
+ sections = assemble_refactor_sections(
477
+ pipeline_mode, sections_dir, browser_enabled,
478
+ browser_tool=replacements["{{BROWSER_TOOL}}"],
479
+ )
473
480
  rendered = render_from_sections(sections, replacements)
474
481
  except FileNotFoundError as exc:
475
482
  LOGGER.warning("Refactor section assembly failed (%s), falling back to legacy template", exc)
@@ -977,8 +977,8 @@ class ProgressTracker:
977
977
  self.errors.append(normalized_code)
978
978
 
979
979
  def _record_agent_tool_call(self, provider, tool_name, raw_args, *, source_event="tool_use", event_id=""):
980
- """Record Agent/TaskCreate tool calls as session-log subagent spawns."""
981
- if tool_name not in ("Agent", "TaskCreate"):
980
+ """Record delegated execution tool calls as session-log subagent spawns."""
981
+ if tool_name != "Agent":
982
982
  return
983
983
  if isinstance(raw_args, dict):
984
984
  args = raw_args
@@ -1019,7 +1019,7 @@ class ProgressTracker:
1019
1019
  )
1020
1020
 
1021
1021
  def _record_cb_agent_tool_call(self, tool_name, raw_args, *, event_id="", source_event="tool_use"):
1022
- """Record a CodeBuddy Agent/TaskCreate tool invocation for sub-agent tracking."""
1022
+ """Record a CodeBuddy delegated execution invocation for sub-agent tracking."""
1023
1023
  self._record_agent_tool_call(
1024
1024
  "codebuddy",
1025
1025
  tool_name,
@@ -327,21 +327,19 @@ def detect_dev_server_port(project_root):
327
327
 
328
328
 
329
329
  def browser_enabled_from_item(item):
330
- """Return browser enabled/tool/steps with mandatory-attempt defaults."""
330
+ """Return browser enabled/tool/steps with explicit opt-in semantics."""
331
331
  browser_interaction = item.get("browser_interaction") if isinstance(item, dict) else None
332
332
  env_value = os.environ.get("BROWSER_VERIFY", "").lower()
333
333
  if env_value == "false":
334
334
  return False, "auto", "", False
335
335
 
336
- enabled = True
336
+ enabled = False
337
337
  tool = "auto"
338
338
  blocking = False
339
339
  steps = []
340
340
 
341
- if isinstance(browser_interaction, bool):
342
- enabled = browser_interaction
343
- elif isinstance(browser_interaction, dict):
344
- enabled = browser_interaction.get("enabled", True)
341
+ if isinstance(browser_interaction, dict):
342
+ enabled = True
345
343
  tool = browser_interaction.get("tool", "auto")
346
344
  blocking = bool(browser_interaction.get("blocking", False))
347
345
  steps = browser_interaction.get("verify_steps", []) or []
@@ -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}}/`. The Main Agent reviews the complete current change for up to ten rounds, directly repairs accepted findings, verifies repairs, and converges when accepted and unresolved findings are both zero. Do not spawn a code-review-specific subagent. Require the last `## Final Result` verdict before continuing.
33
+ 4. **Review**: Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The current Main Agent is the only Code Review executor. It reviews the complete current change for up to ten rounds, directly repairs accepted findings, verifies repairs, and converges when accepted and unresolved findings are both zero. Do not delegate review directly or indirectly, invoke another review skill/workflow, or relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep. `review-report.md` is the only persisted review artifact. Require the last `## Final Result` verdict before continuing.
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
 
@@ -44,7 +44,7 @@ Infer what needs to be done from the feature context above and follow the standa
44
44
  - Do NOT push to remote — the user will push manually.
45
45
  - Write all artifacts to `.prizmkit/specs/{{FEATURE_SLUG}}/`.
46
46
  - If a step fails after 3 attempts, write a status report and stop.
47
- - **Never re-read unmodified files**: once you read a file into context, do NOT read it again unless it was modified by an Edit/Write after your last read — use `grep -n`/`sed -n` for specific lines. Before issuing a Read, ask: "Have I read this file before, and has it changed since?" If no — do NOT read it. Reviewer subagents must rely on context-snapshot.md rather than re-reading files the orchestrator already read.
47
+ - **Never re-read unmodified files**: once you read a file into context, do NOT read it again unless it was modified by an Edit/Write after your last read — use `grep -n`/`sed -n` for specific lines. Before issuing a Read, ask: "Have I read this file before, and has it changed since?" If no — do NOT read it. Normal work delegation outside Code Review must rely on context-snapshot.md rather than re-reading files the Main Agent already read. Code Review runs only in the current Main Agent.
48
48
  - **Read offset safety**: if Read returns "shorter than offset"/"empty" — run `wc -l` then `sed -n`, do NOT retry same offset.
49
49
  - **Hard Round Cap**: after 6 total test-fix rounds, STOP trial-and-error. Switch to read-once-then-rewrite. Do NOT exceed 7 rounds.
50
50
  - **Layered test**: debug with single-file tests, only run full suite as gate when single-file is green.
@@ -1,4 +1,4 @@
1
- # Dev-Pipeline Session Bootstrap — Tier 3 (Orchestrator + Reviewer)
1
+ # Dev-Pipeline Session Bootstrap — Tier 3 (Main-Agent Full Guardrails)
2
2
 
3
3
  ## Session Context
4
4
 
@@ -10,12 +10,12 @@
10
10
 
11
11
  You are the **session orchestrator**. Implement Feature {{FEATURE_ID}}: "{{FEATURE_TITLE}}".
12
12
 
13
- **CRITICAL**: You MUST NOT exit until ALL work is complete and committed. When you spawn Reviewer agents, wait for each to finish (run_in_background=false). Do NOT spawn agents in background and exit — that kills the session.
13
+ **CRITICAL**: You MUST NOT exit until ALL work is complete and committed. Normal work delegation outside Code Review must finish before exit (`run_in_background=false`). Code Review never uses direct or indirect delegation.
14
14
 
15
- **Tier 3 — Orchestrator + Reviewer**: For complex features, the main orchestrator handles context, planning, and implementation directly. Do not spawn top-level Dev or Reviewer subagents; code review runs later through `/prizmkit-code-review`.
15
+ **Tier 3 — Main-Agent Full Guardrails**: For complex features, the Main Agent handles context, planning, implementation, and Code Review directly. Do not spawn a top-level Dev implementation subagent. Code Review runs through `/prizmkit-code-review` without direct or indirect delegation.
16
16
 
17
17
  **Agent spawn failure policy (all Agent tool calls)**:
18
- - If spawning Reviewer fails with team/config/lock errors, retry at most once.
18
+ - Code Review must not invoke another review skill/workflow or relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep.
19
19
  - If the second attempt fails, do not keep spawning variants and do not enter artifact polling for Implementation Log, challenge report, or review report markers.
20
20
  - Use the documented inline/recovery fallback for that phase: write the required report yourself where possible, complete remaining work directly in the orchestrator when safe, or write `failure-log.md` with the spawn error and last observable state before stopping for recovery.
21
21
  - Apply the same cap to any re-spawn for report repair or resume prompts; do not burn multiple minutes on identical team/config/lock failures.
@@ -52,7 +52,7 @@ You are running in **headless non-interactive mode** with a FINITE context windo
52
52
 
53
53
  1. **context-snapshot.md is your single source of truth** — After Phase 1-2 makes it available, use it instead of re-reading individual source files. If you just created or updated it in this session, continue from the in-context content; read it only when resuming/continuing, after context compaction/loss, or when handing work to a subagent.
54
54
  2. **Never re-read your own writes** — After you create/modify a file, do NOT read it back to verify. Trust your write was correct.
55
- 3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use platform file/search tools for targeted lookup; when shell-free helper lookup is needed, run `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<pattern>" --json`, then read only the smallest bounded range with the platform file-reading tool instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files including those summarized in context-snapshot.md Section 4. Reviewer subagents must receive context-snapshot.md and rely on it rather than independently re-reading the same files the orchestrator already read.
55
+ 3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use platform file/search tools for targeted lookup; when shell-free helper lookup is needed, run `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<pattern>" --json`, then read only the smallest bounded range with the platform file-reading tool instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files including those summarized in context-snapshot.md Section 4. Normal work delegation outside Code Review must receive context-snapshot.md and rely on it rather than independently re-reading files the Main Agent already read. Code Review runs only in the current Main Agent.
56
56
  4. **Stay focused** — Do NOT explore code unrelated to this feature. No curiosity-driven reads.
57
57
  4. **One task at a time** — In Phase 4 (implement), complete and test one task before starting the next.
58
58
  5. **Minimize tool output** — Never load full command output into context. First capture command output to a temp file using the command/tool output option or the host-appropriate redirection, then inspect only the final relevant lines and use targeted search helpers to extract the information needed for the current task. Only read the filtered result — never the raw full output.
@@ -67,12 +67,12 @@ You are running in **headless non-interactive mode** with a FINITE context windo
67
67
  ## PrizmKit Directory Convention
68
68
 
69
69
  ```
70
- .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md ← orchestrator writes Sections 1-4 + Implementation Log; Reviewer appends Review Notes
70
+ .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md ← Main Agent writes Sections 1-4 + Implementation Log
71
71
  .prizmkit/specs/{{FEATURE_SLUG}}/spec.md
72
72
  .prizmkit/specs/{{FEATURE_SLUG}}/plan.md ← includes Tasks section
73
73
  ```
74
74
 
75
- **`context-snapshot.md`** is the shared knowledge base. Orchestrator writes Sections 1-4 and the Implementation Log; Reviewer appends Review Notes. This eliminates redundant I/O across review and orchestration phases.
75
+ **`context-snapshot.md`** is the implementation knowledge base. The Main Agent writes Sections 1-4 and the Implementation Log. Code Review writes only `review-report.md` and never appends separate Review Notes.
76
76
 
77
77
  ---
78
78
 
@@ -80,7 +80,7 @@ You are running in **headless non-interactive mode** with a FINITE context windo
80
80
 
81
81
  If any agent times out:
82
82
  1. `{{RUNTIME_HELPER_CMD}} artifact list .prizmkit/specs/{{FEATURE_SLUG}}` — check what exists
83
- 2. If `context-snapshot.md` exists: open recovery prompt with `"Read .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md for project context and any Implementation Log/Review Notes from previous agents. Run git diff HEAD to see actual code changes already made. Do NOT re-read individual source files unless the File Manifest directs you to."` + only remaining steps + `model: "lite"`
83
+ 2. If `context-snapshot.md` exists: open recovery prompt with `"Read .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md for project context and the Implementation Log from previous normal work execution. Run git diff HEAD to see actual code changes already made. Do NOT re-read individual source files unless the File Manifest directs you to."` + only remaining steps + `model: "lite"`
84
84
  3. Max 2 retries per phase. After 2 failures, orchestrator completes the work directly and appends a Recovery Note to context-snapshot.md.
85
85
 
86
86
  ---
@@ -90,22 +90,21 @@ If any agent times out:
90
90
  {{IF_INIT_NEEDED}}
91
91
  ### Phase 0: Project Bootstrap
92
92
  - Run `/prizmkit-init` (invoke the prizmkit-init skill)
93
- - Run `{{PYTHON_CMD}} {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
93
+ - Run `{{PYTHON_CMD}} .prizmkit/dev-pipeline/scripts/init-change-artifact.py --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
94
94
  - **CP-0**: Verify `.prizmkit/prizm-docs/root.prizm`, `.prizmkit/config.json` exist
95
95
  {{END_IF_INIT_NEEDED}}
96
- {{IF_INIT_DONE}}
97
96
 
98
97
  ### Step 1: Initialize
99
98
 
100
99
  1. Run init script:
101
- `{{PYTHON_CMD}} {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
100
+ `{{PYTHON_CMD}} .prizmkit/dev-pipeline/scripts/init-change-artifact.py --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
102
101
 
103
102
  2. Check for existing artifacts:
104
103
  `{{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}`
105
104
 
106
105
  {{IF_FRESH_START}}
107
106
  ```bash
108
- {{PYTHON_CMD}} {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}
107
+ {{PYTHON_CMD}} .prizmkit/dev-pipeline/scripts/init-change-artifact.py --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}
109
108
  ```
110
109
  {{END_IF_FRESH_START}}
111
110
 
@@ -182,7 +181,7 @@ Before proceeding past CP-1, verify:
182
181
 
183
182
  ### Phase 3: Plan Self-Check — Orchestrator Direct
184
183
 
185
- Do not spawn a top-level Reviewer subagent for planning analysis. Perform a bounded self-check before implementation:
184
+ Do not delegate planning analysis. The current Main Agent performs a bounded self-check before implementation:
186
185
 
187
186
  1. Re-read only `context-snapshot.md`, `spec.md`, and `plan.md`.
188
187
  2. Cross-check spec.md and plan.md Tasks against the feature description and acceptance criteria.
@@ -208,7 +207,7 @@ Before starting, check plan.md Tasks:
208
207
  **3a.** Run `/prizmkit-implement` directly:
209
208
  - Continue from the `spec.md` / `plan.md` / `context-snapshot.md` content you created in Phase 1-2; do not re-read self-authored artifacts just because implementation starts
210
209
  - Re-read `plan.md` or `context-snapshot.md` only when resuming/continuing, when current context was compacted or lost, or when task checkbox state may have changed outside this session
211
- - If implementation is delegated to a Dev subagent, the subagent must read `spec.md` if the artifact exists, plus `plan.md` and `context-snapshot.md`, before editing
210
+ - Implementation remains in the current Main Agent; do not delegate it to a Dev subagent
212
211
  - Use context-snapshot.md Section 4 File Manifest for targeted source reads; avoid re-reading source files already summarized there unless they changed after the snapshot
213
212
  - Implements task-by-task, marking each `[x]` immediately
214
213
  - Remeber to update checkpoints after finishing a series of tasks
@@ -238,9 +237,11 @@ For each Verification Gate from the Task Contract, write one evidence line to Im
238
237
 
239
238
  ### Review — Code Review
240
239
 
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.
240
+ Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so `/prizmkit-code-review` can read the spec, plan, context snapshot, implementation log, and current diff. Do not require or read a prior `/prizmkit-test` report here; test generation and test-fix looping happen in the next phase.
242
241
 
243
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds, directly repairs accepted findings, verifies repairs, and converges when accepted and unresolved findings are both zero. Do not spawn a code-review-specific subagent. Missing required evidence, unsafe repair, failed verification, or round-ten non-convergence produces `NEEDS_FIXES`. The skill owns append-only report progress.
242
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The current Main Agent is the only Code Review executor: it directly reviews, repairs accepted findings, verifies repairs, and converges when accepted and unresolved findings are both zero.
243
+
244
+ The Code Review execution boundary is absolute: do not delegate review directly or indirectly. Do not invoke another review skill or review workflow. Do not relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep. Direct reading, searching, editing, and testing by the current Main Agent remain allowed. `review-report.md` is the only persisted review artifact. Missing required evidence, unsafe repair, failed verification, or round-ten non-convergence produces `NEEDS_FIXES`.
244
245
 
245
246
  **Gate Check — Final Review Result**:
246
247
  ```bash
@@ -518,9 +519,9 @@ If you encounter an unrecoverable error, context overflow, or are about to exit
518
519
  ## Reminders
519
520
 
520
521
  - Tier 3: orchestrator implements directly; `/prizmkit-code-review` handles review later
521
- - context-snapshot.md is append-only: orchestrator writes Sections 1-4 + Implementation Log, Reviewer appends Review Notes
522
- - Gate checks enforce Implementation Log and Review Notes are written before proceeding
523
- - Do NOT use `run_in_background=true` when spawning Reviewer agents
522
+ - context-snapshot.md contains Main-Agent implementation context; Code Review writes only review-report.md
523
+ - Gate checks require the Implementation Log and a valid review-report.md Final Result before proceeding
524
+ - Code Review never uses direct or indirect delegation; normal work delegation outside review must not use `run_in_background=true`
524
525
  - Commit phase must use `/prizmkit-committer`; do NOT replace with manual git commit commands
525
526
  - **NEVER delete, modify, or touch any file under `.prizmkit/state/`** — those are pipeline runtime files managed by the runner
526
527
  - NEVER run `rm -rf`, `git clean`, or any destructive filesystem operations
@@ -17,7 +17,7 @@ You are the **refactor session orchestrator**. Execute Refactor {{REFACTOR_ID}}:
17
17
 
18
18
  **NON-INTERACTIVE MODE**: You are running in headless non-interactive mode. There is NO human on the other end. NEVER ask for user confirmation, NEVER wait for user input, and NEVER use interactive prompts. Resolve uncertainty from existing code, project docs, and conservative behavior-preserving defaults.
19
19
 
20
- **ORCHESTRATOR-DIRECT RULE**: Do not spawn top-level Dev or Reviewer subagents. The main orchestrator plans, implements via `/prizmkit-implement`, and runs `/prizmkit-code-review` directly.
20
+ **MAIN-AGENT-DIRECT RULE**: Do not spawn a top-level Dev implementation subagent. The Main Agent plans, implements via `/prizmkit-implement`, and runs `/prizmkit-code-review` directly without direct or indirect review delegation.
21
21
 
22
22
  **REFACTOR DOCUMENTATION POLICY**:
23
23
  - Default: run `/prizmkit-retrospective` with full sync because refactoring changes structure and interfaces.
@@ -249,7 +249,7 @@ Before exiting, write `{{SESSION_STATUS_PATH}}`:
249
249
  ## Reminders
250
250
 
251
251
  - Use L1 skills: `/prizmkit-plan`, `/prizmkit-implement`, `/prizmkit-code-review`, `/prizmkit-retrospective`, `/prizmkit-committer`.
252
- - Do not spawn top-level Dev or Reviewer subagents.
252
+ - Do not spawn a top-level Dev implementation subagent; Code Review runs only in the current Main Agent without delegation.
253
253
  - Behavior preservation is the first priority.
254
254
  - Browser verification is a mandatory attempt by default; it blocks only when explicitly required.
255
255
  - If `DEV_PORT` is unknown, discover it from project config; do not guess port 3000.
@@ -6,4 +6,4 @@ You are the **bug fix session orchestrator**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}
6
6
 
7
7
  **NON-INTERACTIVE MODE**: There is NO human on the other end. NEVER ask for user confirmation, NEVER wait for user input. Make decisions autonomously from the bug report, existing code, tests, and conservative project patterns.
8
8
 
9
- **Execution model**: You implement directly in the current checkout. Do not spawn a top-level Dev subagent. `/prizmkit-code-review` owns its internal Reviewer Agent filter orchestrator fix loop.
9
+ **Execution model**: You implement directly in the current checkout. Do not spawn a top-level Dev subagent. The current Main Agent runs `/prizmkit-code-review` directly and owns its complete review, repair, verification, and reporting loop without direct or indirect review delegation.
@@ -12,9 +12,17 @@ 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 runs a Main-Agent review loop for up to ten completed rounds. The Main Agent reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
15
+ Otherwise, run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The current Main Agent is the only Code Review executor: it reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
16
16
 
17
- The skill owns the full loop and append-only progress in `review-report.md`. Do not spawn a top-level or code-review-specific subagent. Missing required evidence, an unsafe repair, a failed verification, or failure to converge by round ten produces `NEEDS_FIXES`.
17
+ The Code Review execution boundary is absolute for this phase:
18
+
19
+ - Do not delegate any review work directly or indirectly.
20
+ - Do not invoke another review skill or review workflow.
21
+ - Do not use a general-purpose execution unit for review or relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep.
22
+ - Direct reading, searching, editing, and testing by the current Main Agent remain allowed.
23
+ - `review-report.md` is the only persisted review artifact; do not append separate Review Notes to another artifact.
24
+
25
+ Missing required evidence, an unsafe repair, a failed verification, or failure to converge by round ten produces `NEEDS_FIXES`.
18
26
 
19
27
  **Gate Check — Final Review Result**:
20
28
 
@@ -6,7 +6,7 @@ You are running in **headless non-interactive mode** with a FINITE context windo
6
6
 
7
7
  1. **context-snapshot.md is your single source of truth** — After it is available, use it instead of re-reading individual source files. If you just created or updated it in this session, continue from the in-context content; read it only when resuming/continuing, after context compaction/loss, or when handing work to a subagent.
8
8
  2. **Never re-read your own writes** — After you create/modify a file, do NOT read it back to verify. Trust your write was correct.
9
- 3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use platform file/search tools for targeted lookup; when shell-free helper lookup is needed, run `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<pattern>" --json`, then read only the smallest bounded range with the platform file-reading tool instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files including those summarized in context-snapshot.md Section 4. Reviewer subagents must receive context-snapshot.md and rely on it rather than independently re-reading the same files the orchestrator already read.
9
+ 3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use platform file/search tools for targeted lookup; when shell-free helper lookup is needed, run `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<pattern>" --json`, then read only the smallest bounded range with the platform file-reading tool instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files summarized in context-snapshot.md Section 4. Normal work delegation outside Code Review must receive context-snapshot.md and rely on it rather than independently re-reading files the Main Agent already read. Code Review is excluded from normal work delegation and runs only in the current Main Agent.
10
10
  4. **Stay focused** — Do NOT explore code unrelated to this feature. No curiosity-driven reads.
11
11
  5. **One task at a time** — Complete and test one task before starting the next.
12
12
  6. **Minimize tool output** — Never load full command output into context. First capture command output to a temp file using the command/tool output option or the host-appropriate redirection, then inspect only the final relevant lines and use targeted search helpers to extract the information needed for the current task. Only read the filtered result — never the raw full output.
@@ -1,8 +1,9 @@
1
1
  ## PrizmKit Directory Convention
2
2
 
3
3
  ```
4
- .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md ← orchestrator writes Sections 1-4 + Implementation Log; Reviewer appends Review Notes
4
+ .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md ← Main Agent writes Sections 1-4 + Implementation Log
5
5
  .prizmkit/specs/{{FEATURE_SLUG}}/plan.md ← includes Tasks section
6
+ .prizmkit/specs/{{FEATURE_SLUG}}/review-report.md ← Main Agent writes Code Review progress and Final Result
6
7
  ```
7
8
 
8
- **`context-snapshot.md`** is the shared knowledge base. Orchestrator writes Sections 1-4 and the Implementation Log; Reviewer appends Review Notes. Append-only after initial creation.
9
+ **`context-snapshot.md`** is the implementation knowledge base and remains append-only after initial creation. Code Review writes only `review-report.md`; it does not append separate Review Notes to the context snapshot.
@@ -1,9 +1,10 @@
1
1
  ## PrizmKit Directory Convention
2
2
 
3
3
  ```
4
- .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md ← orchestrator writes Sections 1-4 + Implementation Log; Reviewer appends Review Notes
4
+ .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md ← Main Agent writes Sections 1-4 + Implementation Log
5
5
  .prizmkit/specs/{{FEATURE_SLUG}}/spec.md
6
6
  .prizmkit/specs/{{FEATURE_SLUG}}/plan.md ← includes Tasks section
7
+ .prizmkit/specs/{{FEATURE_SLUG}}/review-report.md ← Main Agent writes Code Review progress and Final Result
7
8
  ```
8
9
 
9
- **`context-snapshot.md`** is the shared knowledge base. Orchestrator writes Sections 1-4 and the Implementation Log; Reviewer appends Review Notes. This eliminates redundant I/O across review and orchestration phases.
10
+ **`context-snapshot.md`** is the implementation knowledge base. The Main Agent writes Sections 1-4 and the Implementation Log. Code Review writes only `review-report.md`; it does not append separate Review Notes to the context snapshot.
@@ -72,4 +72,4 @@ After all of the following are true, the session is **TERMINAL**:
72
72
  - `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` is written
73
73
  - the `prizmkit-committer` checkpoint is marked `completed`
74
74
 
75
- At that point, stop immediately. Do **not** process delayed teammate/reviewer findings, do **not** edit files, do **not** amend the commit, and do **not** start any new tool calls. Any findings that arrive after S09 is completed are follow-up work for a later session, not part of this feature commit.
75
+ At that point, stop immediately. Do **not** process delayed normal-work results, edit files, amend the commit, or start any new tool calls. Code Review cannot have delayed delegated findings because it runs only in the current Main Agent. Any normal-work result that arrives after S09 is completed is follow-up work for a later session, not part of this feature commit.
@@ -58,4 +58,4 @@ After all of the following are true, the session is **TERMINAL**:
58
58
  - `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` is written
59
59
  - the `prizmkit-committer` checkpoint is marked `completed`
60
60
 
61
- At that point, stop immediately. Do **not** process delayed teammate/reviewer findings, do **not** edit files, do **not** amend the commit, and do **not** start any new tool calls. Any findings that arrive after S09 is completed are follow-up work for a later session, not part of this feature commit.
61
+ At that point, stop immediately. Do **not** process delayed normal-work results, edit files, amend the commit, or start any new tool calls. Code Review cannot have delayed delegated findings because it runs only in the current Main Agent. Any normal-work result that arrives after S09 is completed is follow-up work for a later session, not part of this feature commit.
@@ -14,7 +14,7 @@ Before starting, check plan.md Tasks:
14
14
  **3a.** Run `/prizmkit-implement` directly:
15
15
  - Continue from the `spec.md` / `plan.md` / `context-snapshot.md` content you created in Phase 1-2; do not re-read self-authored artifacts just because implementation starts
16
16
  - Re-read `plan.md` or `context-snapshot.md` only when resuming/continuing, when current context was compacted or lost, or when task checkbox state may have changed outside this session
17
- - If implementation is delegated to a Dev subagent, the subagent must read `spec.md` if the artifact exists, plus `plan.md` and `context-snapshot.md`, before editing
17
+ - Implementation remains in the current Main Agent; do not delegate it to a Dev subagent
18
18
  - Use context-snapshot.md Section 4 File Manifest for targeted source reads; avoid re-reading source files already summarized there unless they changed after the snapshot
19
19
  - Implements task-by-task, marking each `[x]` immediately
20
20
  - Remeber to update checkpoints after finishing a series of tasks
@@ -14,7 +14,7 @@ Before starting, check plan.md Tasks:
14
14
  **3a.** Run `/prizmkit-implement` directly:
15
15
  - Continue from the `spec.md` / `plan.md` / `context-snapshot.md` content you created in Phase 1-2; do not re-read self-authored artifacts just because implementation starts
16
16
  - Re-read `plan.md` or `context-snapshot.md` only when resuming/continuing, when current context was compacted or lost, or when task checkbox state may have changed outside this session
17
- - If implementation is delegated to a Dev subagent, the subagent must read `spec.md` if the artifact exists, plus `plan.md` and `context-snapshot.md`, before editing
17
+ - Implementation remains in the current Main Agent; do not delegate it to a Dev subagent
18
18
  - Use context-snapshot.md Section 4 File Manifest for targeted source reads; avoid re-reading source files already summarized there unless they changed after the snapshot
19
19
  - Implements task-by-task, marking each `[x]` immediately
20
20
  - Remeber to update checkpoints after finishing a series of tasks
@@ -1,10 +1,18 @@
1
1
  ### Review — Code Review
2
2
 
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 a prior `/prizmkit-test` report here; the next phase owns the formal test gate.
3
+ Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so `/prizmkit-code-review` can read the spec, plan, context snapshot, implementation log, and current diff. Do not require a prior `/prizmkit-test` report here; the next phase owns the formal test gate.
4
4
 
5
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The Main Agent reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
5
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The current Main Agent is the only Code Review executor: it reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
6
6
 
7
- The skill owns the full loop and append-only progress in `review-report.md`. Do not spawn a top-level or code-review-specific subagent. Missing required evidence, an unsafe repair, a failed verification, or failure to converge by round ten produces `NEEDS_FIXES`.
7
+ The Code Review execution boundary is absolute for this phase:
8
+
9
+ - Do not delegate any review work directly or indirectly.
10
+ - Do not invoke another review skill or review workflow.
11
+ - Do not use a general-purpose execution unit for review or relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep.
12
+ - Direct reading, searching, editing, and testing by the current Main Agent remain allowed.
13
+ - `review-report.md` is the only persisted review artifact; do not append separate Review Notes to `context-snapshot.md`.
14
+
15
+ Missing required evidence, an unsafe repair, a failed verification, or failure to converge by round ten produces `NEEDS_FIXES`.
8
16
 
9
17
  **Gate Check — Final Review Result**:
10
18
 
@@ -1,10 +1,18 @@
1
1
  ### Review — Code Review
2
2
 
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 a prior `/prizmkit-test` report here; the next phase owns the formal test gate.
3
+ Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so `/prizmkit-code-review` can read the spec, plan, context snapshot, implementation log, and current diff. Do not require a prior `/prizmkit-test` report here; the next phase owns the formal test gate.
4
4
 
5
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The Main Agent reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
5
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The current Main Agent is the only Code Review executor: it reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
6
6
 
7
- The skill owns the full loop and append-only progress in `review-report.md`. Do not spawn a top-level or code-review-specific subagent. Missing required evidence, an unsafe repair, a failed verification, or failure to converge by round ten produces `NEEDS_FIXES`.
7
+ The Code Review execution boundary is absolute for this phase:
8
+
9
+ - Do not delegate any review work directly or indirectly.
10
+ - Do not invoke another review skill or review workflow.
11
+ - Do not use a general-purpose execution unit for review or relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep.
12
+ - Direct reading, searching, editing, and testing by the current Main Agent remain allowed.
13
+ - `review-report.md` is the only persisted review artifact; do not append separate Review Notes to `context-snapshot.md`.
14
+
15
+ Missing required evidence, an unsafe repair, a failed verification, or failure to converge by round ten produces `NEEDS_FIXES`.
8
16
 
9
17
  **Gate Check — Final Review Result**:
10
18
 
@@ -71,7 +71,7 @@ Before proceeding past CP-1, verify:
71
71
 
72
72
  ### Plan Self-Check — Orchestrator Direct
73
73
 
74
- Do not spawn a top-level Reviewer subagent for planning analysis. Perform a bounded self-check before implementation:
74
+ Do not delegate planning analysis. The current Main Agent performs a bounded self-check before implementation:
75
75
 
76
76
  1. Re-read only `context-snapshot.md`, `spec.md`, and `plan.md`.
77
77
  2. Cross-check spec.md and plan.md Tasks against the feature description and Verification Gates in the Task Contract.
@@ -1,6 +1,6 @@
1
1
  ### Phase 0: Project Bootstrap
2
2
  - Run `/prizmkit-init` (invoke the prizmkit-init skill)
3
- - Run `{{PYTHON_CMD}} {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
3
+ - Run `{{PYTHON_CMD}} .prizmkit/dev-pipeline/scripts/init-change-artifact.py --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
4
4
  - **CP-0**: Verify `.prizmkit/prizm-docs/root.prizm`, `.prizmkit/config.json` exist
5
5
 
6
6
 
@@ -4,6 +4,6 @@ You are the **refactor session orchestrator**. Execute Refactor {{REFACTOR_ID}}:
4
4
 
5
5
  **CRITICAL**: Preserve observable behavior. Do not change product behavior unless the refactor contract explicitly requires it.
6
6
 
7
- **Execution model**: You implement directly in the current checkout. Do not spawn a top-level Dev subagent. Do not spawn a top-level Reviewer subagent. `/prizmkit-code-review` owns its internal Reviewer Agent filter orchestrator fix loop.
7
+ **Execution model**: You implement directly in the current checkout. Do not spawn a top-level Dev subagent. The current Main Agent runs `/prizmkit-code-review` directly and owns its complete review, repair, verification, and reporting loop without direct or indirect review delegation.
8
8
 
9
9
  **NON-INTERACTIVE MODE**: There is NO human on the other end. Resolve uncertainty from existing code and conservative project patterns.
@@ -1,8 +1,16 @@
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 runs a Main-Agent review loop for up to ten completed rounds. The Main Agent reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
3
+ Run `/prizmkit-code-review` directly with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The current Main Agent is the only Code Review executor: it reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
4
4
 
5
- Do not spawn a top-level or code-review-specific subagent. The code-review skill owns the complete loop and append-only report progress. Missing required evidence, an unsafe repair, a failed verification, or failure to converge by round ten produces `NEEDS_FIXES`.
5
+ The Code Review execution boundary is absolute for this phase:
6
+
7
+ - Do not delegate any review work directly or indirectly.
8
+ - Do not invoke another review skill or review workflow.
9
+ - Do not use a general-purpose execution unit for review or relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep.
10
+ - Direct reading, searching, editing, and testing by the current Main Agent remain allowed.
11
+ - `review-report.md` is the only persisted review artifact; do not append separate Review Notes to another artifact.
12
+
13
+ Missing required evidence, an unsafe repair, a failed verification, or failure to converge by round ten produces `NEEDS_FIXES`.
6
14
 
7
15
  **Gate Check — Final Review Result**:
8
16
 
@@ -14,6 +22,6 @@ Do not spawn a top-level or code-review-specific subagent. The code-review skill
14
22
  - `REVIEW_NEEDS_FIXES` → log unresolved findings and proceed only when they do not block behavior preservation under explicit task policy.
15
23
  - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` → inspect progress once, write `failure-log.md`, and stop. Do not accept stale verdict text or synthesize a passing result outside the skill.
16
24
 
17
- Verify the review explicitly checks behavior preservation, public API compatibility, imports, tests, and rollback assumptions.
25
+ Verify directly that the review checks behavior preservation, public API compatibility, imports, tests, and rollback assumptions.
18
26
 
19
27
  **Checkpoint update**: Set step `prizmkit-code-review` to `completed` only for an accepted valid Final Result. Do not complete the checkpoint for incomplete or invalid reports.
@@ -3,7 +3,7 @@
3
3
  - Use L1 skills: `/prizmkit-plan`, `/prizmkit-implement`, `/prizmkit-code-review`, `/prizmkit-retrospective`, `/prizmkit-committer`.
4
4
  - All refactor skills use `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`.
5
5
  - Behavior preservation is the first priority.
6
- - Do not spawn top-level Dev or Reviewer subagents.
6
+ - Do not spawn a top-level Dev implementation subagent; Code Review runs only in the current Main Agent without delegation.
7
7
  - Main orchestrator runs `/prizmkit-code-review` directly.
8
8
  - Commit with `refactor(<scope>):`, not `feat:` or `fix:`.
9
9
  - Checkpoint state is the recovery truth; skipped steps must be marked `skipped`.
@@ -1,6 +1,8 @@
1
- ## Subagent Timeout Recovery
1
+ ## Normal Work Delegation Timeout Recovery
2
2
 
3
- If any agent times out:
3
+ This recovery path applies only to normal work delegated outside Code Review. Code Review never uses delegated execution or this retry procedure.
4
+
5
+ If a normal work execution unit times out:
4
6
  1. `{{RUNTIME_HELPER_CMD}} artifact list .prizmkit/specs/{{FEATURE_SLUG}}` — check what exists
5
- 2. If `context-snapshot.md` exists: open recovery prompt with `"Read .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md for project context and any Implementation Log/Review Notes from previous agents. Run git diff HEAD to see actual code changes already made. Do NOT re-read individual source files unless the File Manifest directs you to."` + only remaining steps + `model: "lite"`
6
- 3. Max 2 retries per phase. After 2 failures, orchestrator completes the work directly and appends a Recovery Note to context-snapshot.md.
7
+ 2. If `context-snapshot.md` exists: open a recovery prompt with `"Read .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md for project context and the Implementation Log. Run git diff HEAD to see actual code changes already made. Do NOT re-read individual source files unless the File Manifest directs you to."` + only remaining steps + `model: "lite"`
8
+ 3. Max 2 retries per phase. After 2 failures, the Main Agent completes the work directly and appends a Recovery Note to context-snapshot.md.
@@ -6,7 +6,7 @@ Use this protocol whenever the post-review PrizmKit Test gate fails. Its purpose
6
6
 
7
7
  | Class | Meaning | Required Action | May Continue? |
8
8
  |-------|---------|-----------------|---------------|
9
- | Baseline failure | Existed before this session | Document in Implementation Log or review notes | Yes |
9
+ | Baseline failure | Existed before this session | Document in the Implementation Log or `failure-log.md` | Yes |
10
10
  | New regression | Introduced by this session | Fix before reporting success | No |
11
11
  | Brittle test | Test expectation/setup is wrong for the intended behavior | Fix the test or environment setup, then rerun | Only after fixed or documented as blocked |
12
12
  | Environment/tooling failure | External tool, network, install, or local environment prevents verification | Document in `failure-log.md` with impact on gates | Only if no Verification Gate is blocked |