pi-gauntlet 7.43.1 → 8.0.0

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 (38) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +2 -2
  3. package/agents/plan-writer.md +3 -3
  4. package/agents/wave-reviewer.md +111 -0
  5. package/extensions/lib/phase-tracker-helpers.test.ts +7 -8
  6. package/extensions/lib/phase-tracker-helpers.ts +2 -5
  7. package/extensions/lib/plan-check.test.ts +45 -0
  8. package/extensions/lib/plan-check.ts +19 -7
  9. package/extensions/lib/telemetry-collect.test.ts +21 -1
  10. package/extensions/lib/telemetry-collect.ts +23 -1
  11. package/extensions/phase-tracker.test.ts +80 -73
  12. package/extensions/phase-tracker.ts +10 -13
  13. package/extensions/telemetry.test.ts +11 -5
  14. package/extensions/telemetry.ts +2 -2
  15. package/package.json +1 -1
  16. package/skills/brainstorming/reference/amendment-surface.md +9 -1
  17. package/skills/chase-bug/hotfix.md +1 -1
  18. package/skills/dispatching-parallel-agents/SKILL.md +2 -2
  19. package/skills/finishing-a-development-branch/reference/disposition-protocol.md +1 -1
  20. package/skills/gatekeep-pr/SKILL.md +1 -1
  21. package/skills/gatekeep-pr/reference/assessment.md +1 -1
  22. package/skills/gatekeep-pr/reference/sync.md +1 -1
  23. package/skills/loop-implementation/SKILL.md +1 -1
  24. package/skills/requesting-code-review/SKILL.md +9 -9
  25. package/skills/requesting-code-review/{code-reviewer.md → wave-reviewer.md} +2 -2
  26. package/skills/subagent-driven-development/SKILL.md +124 -121
  27. package/skills/subagent-driven-development/reference/dispatch-contract.md +10 -9
  28. package/skills/subagent-driven-development/reference/implement-amendments.md +3 -1
  29. package/skills/subagent-driven-development/stop-note.md +4 -4
  30. package/skills/subagent-driven-development/wave-reviewer-prompt.md +55 -0
  31. package/skills/verification-before-completion/reference/conformance-check.md +2 -2
  32. package/skills/writing-plans/SKILL.md +7 -1
  33. package/skills/writing-plans/reference/plan-contract.md +6 -0
  34. package/agents/code-reviewer.md +0 -115
  35. package/agents/spec-reviewer.md +0 -121
  36. package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +0 -67
  37. package/skills/subagent-driven-development/reference/fix-loop.md +0 -45
  38. package/skills/subagent-driven-development/spec-reviewer-prompt.md +0 -125
@@ -39,7 +39,7 @@ Mint and initialize the continuation record before progress initialization (`ref
39
39
 
40
40
  ## Harness notes
41
41
 
42
- Every helper is a fresh context with `cwd` the PR worktree; its task names its output path and ends with the output contract. Every dispatch on either harness gets its own output path from `mktemp "${TMPDIR:-/tmp}/gatekeep-<role>.XXXXXX"` outside the worktree. On pi: `subagent({ agent: <persona>, context: "fresh", async: false, cwd: <worktree> })` with `worker` for Verify, `code-reviewer` for Review and the pre-push review, `implementer` for payloads; `gauntlet_setting({ key: "closureReview" })` supplies the fix-round cap. On Claude Code: the harness's subagent dispatch tool with the duty text as the prompt - Verify: `verification-brief.md` Section B; Review, pre-push review, and comment-delta review: Section C plus `review-baseline.md` (the pre-push review adds the closure-line contract); implementer: the payload task of `reference/fix-wave.md` `## Wave`; sync conflict stop: the task `reference/sync.md` `## Conflict stop` builds; sync review: Section C plus `review-baseline.md` with the `## Review before push` subject, no closure lines; the no-tool accounting fallback is `2 x 5`. A Claude Code helper inherits the session's directory, so its prompt opens with the absolute worktree path and the rule that every command runs as `git -C <worktree> ...` or `(cd <worktree> && ...)`, checks that `git -C <worktree> rev-parse HEAD` equals the head its task names (the assessed head for Verify, Review, and the comment-delta reviewer; the current wave HEAD for wave helpers) before working, and names the output path; the orchestrator awaits the tool result before reading the file. For description recheck on pi, use the fresh worker duty in Section B with mode `description recheck`; on Claude Code, use Section B's separate recheck duty as the native helper prompt. Both tasks supply actual body/head, affected claim IDs, existing evidence, and the affected-only disposition/closure contract, never the CI-emitting claim-only contract. A harness with neither facility is unsupported: stop at step 3 and say so - at step 2b, before any sync write, when `--rebase` was passed (`reference/sync.md`).
42
+ Every helper is a fresh context with `cwd` the PR worktree; its task names its output path and ends with the output contract. Every dispatch on either harness gets its own output path from `mktemp "${TMPDIR:-/tmp}/gatekeep-<role>.XXXXXX"` outside the worktree. On pi: `subagent({ agent: <persona>, context: "fresh", async: false, cwd: <worktree> })` with `worker` for Verify, `wave-reviewer` for Review and the pre-push review, `implementer` for payloads; `gauntlet_setting({ key: "closureReview" })` supplies the fix-round cap. On Claude Code: the harness's subagent dispatch tool with the duty text as the prompt - Verify: `verification-brief.md` Section B; Review, pre-push review, and comment-delta review: Section C plus `review-baseline.md` (the pre-push review adds the closure-line contract); implementer: the payload task of `reference/fix-wave.md` `## Wave`; sync conflict stop: the task `reference/sync.md` `## Conflict stop` builds; sync review: Section C plus `review-baseline.md` with the `## Review before push` subject, no closure lines; the no-tool accounting fallback is `2 x 5`. A Claude Code helper inherits the session's directory, so its prompt opens with the absolute worktree path and the rule that every command runs as `git -C <worktree> ...` or `(cd <worktree> && ...)`, checks that `git -C <worktree> rev-parse HEAD` equals the head its task names (the assessed head for Verify, Review, and the comment-delta reviewer; the current wave HEAD for wave helpers) before working, and names the output path; the orchestrator awaits the tool result before reading the file. For description recheck on pi, use the fresh worker duty in Section B with mode `description recheck`; on Claude Code, use Section B's separate recheck duty as the native helper prompt. Both tasks supply actual body/head, affected claim IDs, existing evidence, and the affected-only disposition/closure contract, never the CI-emitting claim-only contract. A harness with neither facility is unsupported: stop at step 3 and say so - at step 2b, before any sync write, when `--rebase` was passed (`reference/sync.md`).
43
43
 
44
44
  ## Wording rules
45
45
 
@@ -85,6 +85,6 @@ Before step 3, mint the two output paths outside the worktree - `mktemp "${TMPDI
85
85
  | Step | Helper | Detail |
86
86
  |---|---|---|
87
87
  | 3 Verify | the `worker` persona, or `../verification-brief.md` Section B as the prompt (`../SKILL.md` `## Harness notes`) | task prefixed "report only - do not edit, fix, or commit anything"; writes the Verifier output schema to its output path; the orchestrator reads `source`, `head_sha`, `worktree_root`, each `run_cwd`, each check's `name`, `url`, `status`, and `conclusion`, each run's `command`, `result`, `exit_code`, and `log_path`, and the claim dispositions - never a log's contents |
88
- | 4 Review | the `code-reviewer` persona, or Section C plus `../review-baseline.md` as the prompt | emits its native report to its output path; the one call-time addition is the closure-line contract of `fix-wave.md` `## Review before push`, used only in the wave |
88
+ | 4 Review | the `wave-reviewer` persona, or Section C plus `../review-baseline.md` as the prompt | emits its native report to its output path; the one call-time addition is the closure-line contract of `fix-wave.md` `## Review before push`, used only in the wave |
89
89
 
90
90
  Verify and Review share the provisioned worktree via `cwd`, dispatched sequentially - never `worktree: true`, which provisions a separate tree and breaks the shared-tree contract. A helper that leaves its output file empty or not in its section's output contract (the Verifier output schema for Verify, the reviewer's native report for Review), returns a non-zero result, or returns an async handle stops the step: quote the failure and offer `stop`.
@@ -53,7 +53,7 @@ Continue by running `GIT_EDITOR=true git rebase --continue` spelled exactly so,
53
53
 
54
54
  ## Review before push
55
55
 
56
- Runs on every rewritten head, with or without a stop; only a `no-op` skips it. One fresh `code-reviewer`, `cwd` the PR worktree, read-only, dispatched per SKILL.md `## Harness notes` (Claude Code: the sync review duty), over `git range-diff origin/<base> <pre_head> HEAD` and, when stops were resolved, `git diff <pre_head> HEAD -- <resolved files>`; the task asks for the reviewer's native findings report with "rebase replay and conflict resolutions" as the review subject and no closure lines. Write out the dispatch as the harness call with `context: "fresh"`, `async: false`, and the worktree `cwd` (pi: `subagent({ agent: "code-reviewer", context: "fresh", async: false, cwd: <worktree> })`). A Critical or Moderate finding takes `## Failure path`; no second helper.
56
+ Runs on every rewritten head, with or without a stop; only a `no-op` skips it. One fresh `wave-reviewer`, `cwd` the PR worktree, read-only, dispatched per SKILL.md `## Harness notes` (Claude Code: the sync review duty), over `git range-diff origin/<base> <pre_head> HEAD` and, when stops were resolved, `git diff <pre_head> HEAD -- <resolved files>`; the task asks for the reviewer's native findings report with "rebase replay and conflict resolutions" as the review subject and no closure lines. Write out the dispatch as the harness call with `context: "fresh"`, `async: false`, and the worktree `cwd` (pi: `subagent({ agent: "wave-reviewer", context: "fresh", async: false, cwd: <worktree> })`). A Critical or Moderate finding takes `## Failure path`; no second helper.
57
57
 
58
58
  ## Push
59
59
 
@@ -217,7 +217,7 @@ For coordinated runs, route each verification and review below to every leg with
217
217
 
218
218
  0. Call `phase_tracker({ action: "start", phase: "verify" })`.
219
219
  1. Parent full verification uses the ledger command. Reuse the passing exit run only when HEAD and clean/no-change worktree still match. Commit verification-produced tracked changes. Any repair invalidates that run: rerun the full command successfully before the next gate. No task reopen/update is awaited.
220
- 2. Dispatch foreground whole-diff `code-reviewer` per `/skill:requesting-code-review`, from ledger base through committed HEAD, with `SCOPED_TEST_COMMANDS: none`. Apply its fix rounds. Rerun full verification after every repair before re-review/next gate. Carry final SHIP Minor lines verbatim as `whole-diff minors:`, or `whole-diff minors: none`.
220
+ 2. Dispatch foreground whole-diff `wave-reviewer` per `/skill:requesting-code-review`, from ledger base through committed HEAD, with `SCOPED_TEST_COMMANDS: none`. Apply its fix rounds. Rerun full verification after every repair before re-review/next gate. Carry final SHIP Minor lines verbatim as `whole-diff minors:`, or `whole-diff minors: none`.
221
221
  3. Run happy path per the fully read reference when overrides has `## Happy path` or the diff selects a row; use the diff-derived row, not a plan header. Pass summary and outcome to the separate fresh `conformance-reviewer`, along with spec path, verbatim original prompt and full diff. Use spec AC rows against the ledger as the checklist. Follow the reference's partition, concern decomposition, fix rounds and Convergence with the ledger command replacing plan Verification. Keep durable Gn identities in reports, without plan_tracker initialization or lifecycle updates. Rerun full verification after repairs. Resolve closureReview settings and reviewer dispatch per the reference. Reviews happen only after complete implement; none inside the iteration loop.
222
222
  4. Complete verify only on current CONFORMS or valid carried-open deferred inventory per the reference. A started positive-cap fix loop blocking/failing/exhausting with an open fix gap stops, never completes verify. Summarize rows closed, iterations consumed, files changed, test counts and review verdict. Emit exact `## Closure / conformance` schema from the reference: `status: CONFORMS (0 open)` or `status: GAPS (N open)`, then `audited-base: <full HEAD SHA>`, happy-path exactly when run, Deferred/deviates per spec exactly when applicable, all gap/concern fields unchanged, auto-applied fix commits index and whole-diff minors. Read its whole-diff-minors companion when directed. Never rename fields.
223
223
  5. Immediately invoke `/skill:finishing-a-development-branch <abs worktree path>`. Its menu is the human gate; do not add a ready-to-finish prompt.
@@ -7,14 +7,14 @@ description: Use when completing tasks, implementing major features, or before m
7
7
 
8
8
  # Requesting Code Review
9
9
 
10
- Dispatch a subagent with the code-reviewer prompt template to catch issues before they cascade.
10
+ Dispatch a subagent with the wave-reviewer prompt template to catch issues before they cascade.
11
11
 
12
12
  **Core principle:** Review early, review often.
13
13
 
14
14
  ## When to Request Review
15
15
 
16
16
  **Mandatory:**
17
- - Dispatch one initial code review per code-touching wave in subagent-driven development, over the integrated wave diff; doc-only waves are SR-only
17
+ - Dispatch one integrated wave review per green wave in subagent-driven development, including doc-only waves, over the integrated wave diff
18
18
  - After completing major feature
19
19
  - Before merge to main
20
20
 
@@ -25,22 +25,22 @@ Dispatch a subagent with the code-reviewer prompt template to catch issues befor
25
25
 
26
26
  ## How to Request
27
27
 
28
- **1. Select the review source.** For an integrated uncommitted wave, use its recorded base as `BASE_SHA` and the literal `WORKTREE` as `HEAD_SHA`; stage new deliverables before dispatch, per `code-reviewer.md`. For the whole-diff review only, use the committed range:
28
+ **1. Select the review source.** For an integrated uncommitted wave, use its recorded base as `BASE_SHA` and the literal `WORKTREE` as `HEAD_SHA`; stage new deliverables before dispatch, per `wave-reviewer.md`. For the whole-diff review only, use the committed range:
29
29
  ```bash
30
30
  BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
31
31
  HEAD_SHA=$(git rev-parse HEAD)
32
32
  ```
33
33
 
34
- **2. Dispatch code-reviewer subagent:**
34
+ **2. Dispatch wave-reviewer subagent:**
35
35
 
36
- Fill the template at `code-reviewer.md` in this skill directory, then dispatch a subagent with it.
36
+ Fill the template at `wave-reviewer.md` in this skill directory, then dispatch a subagent with it.
37
37
 
38
38
  **How to dispatch:**
39
39
 
40
- Use the `subagent` tool with the code-reviewer template filled in. This foreground dispatch must return a terminal result before acting on review feedback:
40
+ Use the `subagent` tool with the wave-reviewer template filled in. This foreground dispatch must return a terminal result before acting on review feedback:
41
41
 
42
42
  ```ts
43
- subagent({ agent: "code-reviewer", async: false, task: "... filled template ..." })
43
+ subagent({ agent: "wave-reviewer", async: false, task: "... filled template ..." })
44
44
  ```
45
45
 
46
46
  **Placeholders:**
@@ -60,7 +60,7 @@ Take the recipient stance from `receiving-code-review`: verify each finding, ans
60
60
  ## Integration with Workflows
61
61
 
62
62
  **Subagent-Driven Development:**
63
- - Dispatch one initial code review per code-touching wave over the integrated wave diff; doc-only waves are SR-only
63
+ - Dispatch one integrated wave review per green wave over the integrated wave diff, including doc-only waves
64
64
  - Fix and re-review before the accepted-wave commit and before moving to the next wave
65
65
 
66
66
  **Ad-Hoc Development:**
@@ -75,7 +75,7 @@ Take the recipient stance from `receiving-code-review`: verify each finding, ans
75
75
  - Proceed with unfixed Moderate issues
76
76
  - Argue with valid technical feedback
77
77
 
78
- See template at: `code-reviewer.md` in this skill directory
78
+ See template at: `wave-reviewer.md` in this skill directory
79
79
 
80
80
  ## Project overrides
81
81
 
@@ -1,4 +1,4 @@
1
- # Code Review Agent
1
+ # Wave Review Agent
2
2
 
3
3
  You are reviewing code changes for production readiness.
4
4
 
@@ -84,4 +84,4 @@ fi
84
84
  - Documentation complete?
85
85
  - No obvious bugs?
86
86
 
87
- Report in the output format `agents/code-reviewer.md` defines in your system prompt.
87
+ Report in the output format `agents/wave-reviewer.md` defines in your system prompt.
@@ -7,9 +7,9 @@ description: Use when executing an implementation plan in the current session (t
7
7
 
8
8
  # Subagent-Driven Development
9
9
 
10
- Execute a plan by dispatching a **fresh subagent per task**, with two-stage review after each: spec compliance first, then code quality.
10
+ Execute a plan by dispatching a **fresh subagent per task**, then review each integrated wave once for spec compliance and code quality.
11
11
 
12
- **Core principle:** Fresh subagent per task + two-stage review = high quality, fast iteration.
12
+ **Core principle:** Fresh subagent per task + one integrated wave review.
13
13
 
14
14
  If a tool result contains a ⚠️ workflow warning, stop immediately and address it before continuing.
15
15
 
@@ -17,18 +17,20 @@ Gauntlet execution dispatches are foreground: set top-level `async: false` on ev
17
17
 
18
18
  ## Orchestrator holds
19
19
 
20
- Keep only the plan_check manifest, tracker state, skill resources read at their absolute paths, structured JSON, `Artifacts:` patch paths, coordination/scoped-gate output, `Worktree ready` values, and delegated essence during implement. Delegate every plan/spec/task/report/source read, including content-loading shell commands. A file-only pointer never authorizes opening a report. Apply this boundary from `phase_tracker start implement` through implement completion; leave other phases and the loop engine unchanged.
20
+ Keep the plan_check manifest, tracker state, skill resources read at their absolute paths, structured JSON, `Artifacts:` patch paths, coordination/scoped-gate output, `Worktree ready` values and delegated source facts during implement. Delegate plan/spec/task/source reads, including content-loading shell commands. Apply this boundary from implement start through completion; leave other phases and the loop engine unchanged.
21
+
22
+ Consume structured `status`, `verdict`, `maxSeverity`, `findingCount`, `findings`, `touchedTasks`, `trajectory`, `concerns`, `question` and `anchorUnreadable` first. Use a direct `read` with `limit: 300` only for unresolved `DONE_WITH_CONCERNS` concerns, `BLOCKED` / `NEEDS_CONTEXT` question evidence, or `FIX_FIRST` / `REJECT` findings needed for repair or a stop note. Read at most once per printed `report <path>` observation per wave; never paginate or use an offset past the bound. When the read does not reach the report's footer (its `Parallel-safe:` line; `TRAJECTORY:` on a re-review), re-dispatch the same wave-reviewer once with `Compact report: findings and footer only, at most 150 lines`. Read its saved report under the same bound; stop naming the oversized path on a second overflow. Never dispatch `scout`, `delegate` or another child to relay reports. Retain delegated source-fact lookup.
21
23
 
22
24
  Read [reference/dispatch-contract.md](./reference/dispatch-contract.md) now for schemas, anchored payloads and one-step carriers. Read [reference/implement-amendments.md](./reference/implement-amendments.md) now for delegated amendments.
23
25
 
24
- Use primary shell coordination only: `rev-parse`, `status --porcelain`, `diff --stat`, `apply`, `reset --soft`, `add -A`, `commit`, `update-ref`, plus the marked preflight, snapshot and scratch-index recipes and scoped-command redirection. Prohibit content-loading `cat`, `sed -n`, `git show <path>`, `git diff` without `--stat`, and contextual `grep`/`rg` over source. Route source questions, provenance and human escalation wording through the answer/evidence carrier; stop on delegated failure.
26
+ Use primary shell coordination only: `rev-parse`, `status --porcelain`, `diff --stat`, `apply`, `reset --soft`, `add -A`, `commit`, `update-ref`, plus the marked preflight, repair-base and scratch-index recipes and scoped-command redirection. Prohibit content-loading `cat`, `sed -n`, `git show <path>`, `git diff` without `--stat`, and contextual `grep`/`rg` over source. Route source questions, provenance and human escalation wording through the answer/evidence carrier; stop on delegated failure.
25
27
 
26
28
  ## Continuous Execution
27
29
 
28
30
  **Do not pause to check in with the user between tasks.** The plan is already approved. Pause only when:
29
31
 
30
32
  - A subagent returns `NEEDS_CONTEXT` or `BLOCKED` (see [Implementer Status](#implementer-status))
31
- - An escalated round fails with no funded round left (stop note per [Fix-Loop Rounds](#fix-loop-rounds))
33
+ - An escalated round fails with no funded round left (stop note per [The Wave Loop](#the-wave-loop))
32
34
  - A ⚠️ workflow warning fires
33
35
 
34
36
  Reaching the end of the plan is not a pause: continue through verification and invoke `/skill:finishing-a-development-branch <abs worktree path>` as defined in [After All Tasks](#after-all-tasks-complete).
@@ -37,46 +39,17 @@ Periodic "should I continue?" prompts add latency without adding safety. The pla
37
39
 
38
40
  ## Prerequisites
39
41
 
40
- - The worktree path is known - from the `using-git-worktrees` Step 4 report in this session or the handoff brief's `worktree:` row - and is passed as the top-level dispatch `cwd`, except per-patch spec reviews use [Spec-review snapshots](#spec-review-snapshots). If no worktree path exists, stop and invoke `/skill:using-git-worktrees` first - implementation never lands directly on `main`. The process cwd is the primary checkout; nothing here changes it.
42
+ - The worktree path is known - from the `using-git-worktrees` Step 4 report in this session or the handoff brief's `worktree:` row - and is passed as the top-level dispatch `cwd`. If no worktree path exists, stop and invoke `/skill:using-git-worktrees` first - implementation never lands directly on `main`. The process cwd is the primary checkout; nothing here changes it.
41
43
  - Approved plan or clear task scope
42
44
  - `plan_tracker` list initialized at writing-plans handoff with the full wave-ordered task list. Consume and preserve it on continuation; only direct recovery with no tracker initializes the full plan list once, before dispatch, and never over an existing list.
43
45
 
44
- Call `plan_check({ planPath })` for the manifest; stop on FAIL; for `manifest-size`, emit a stop note asking for plan reduction. Consume each task's `files`, `tests`, `leg`, `mode`, heading and explicit `orchestrator`. Pass isolated implementers only their own task's `tests` as `SCOPED_TEST_COMMANDS`, or `none` when empty. Give in-place implementers, the integrated test gate and code reviews the wave union of `tests`. Preserve each array element as one command without splitting or joining command strings. Children read Tests metadata themselves.
45
-
46
- On a spec-defect citation, pause the fix loop and take the delegated amendment route for [amending an approved spec](../brainstorming/SKILL.md#amending-an-approved-spec) with amend permission on the `**Amend-grant:**` line decoded by the existing surface. Keep code-vs-spec mismatch in SR; an unreadable spec anchor blocks instead of falling back to task-only review.
47
-
48
- ## Fix-Loop Rounds
49
-
50
- Apply one rule to both review loops - spec-compliance and code-quality.
51
-
52
- **Re-review dispatch rule:** every re-review task includes the previous report path under the marker `## Previous review report (re-review trigger)`, plus the trajectory block from the reviewer's prompt template. The marker's presence is what obligates the reviewer to emit the `TRAJECTORY:` line. Consume `trajectory.verdict`, `maxSeverity` and `findingCount` from structured JSON; let the child read findings. Include the delta defined in [Fix delta](#fix-delta) in every SR/CR re-review.
53
-
54
- **Fix fan-out.** When a fix round is fanned out per `/skill:requesting-code-review` Fix rounds, use the precondition and dispatch shape owned by `/skill:dispatching-parallel-agents` "Fix fan-out"; the fan-out counts as **one** fix against this budget, its scoped test gate is the consuming task/wave's `SCOPED_TEST_COMMANDS`, and one re-review of the integrated delta follows.
55
-
56
- **Behaviour-change reroute.** When the triggering CR structured result has `behaviourChange: true`, the fix round's re-review is SR first, then CR. Include `## Fix delta` on this SR-first behavior-change repair. Dispatch SR against the fix diff and the task's spec anchors as a first review (no `## Previous review report` marker, so no `TRAJECTORY:` line; SR carries anchored task paths and no test commands), but its ordinal continues the task's SR-loop count - a task whose SR loop ended at review 2 gets review 3 here, and an issue-bearing rerouted SR after review 4 escalates. Issues follow the normal sequence: fix, then SR re-review forwarding this SR's report path. CR round numbering is unchanged. `behaviourChange: false` re-reviews with CR only. Treat a missing or malformed required `behaviourChange` field as a failed attempt under [When a Subagent Fails](#when-a-subagent-fails); retain accepted siblings and never default to `no`. Use structured touchedTasks for affected owners; absent owners on a multi-task repair means all dispatched tasks. Target the SR re-review at the task(s) whose files the fix touched; after integration, dispatch it against the current implementation worktree, not a pre-integration snapshot.
57
-
58
- Scope every fix re-dispatch (implementer) and code-review re-review through the Prerequisites test-scope rule; spec-reviewer re-reviews carry anchored paths, no commands - SR never executes.
59
-
60
- **The sequence.** Each review that finds issues is a decision point: read structured `trajectory` before dispatching anything (review 1 has no line - on issues, dispatch fix 1). Any clean review ends the loop. For code review, *issue-bearing* means verdict `FIX_FIRST` and *clean* means verdict `SHIP`, whatever Minors the report lists; spec review keeps its gaps/acceptance meaning. `REJECT` is neither: stop and report per `stop-note.md`; the loop never enters.
61
-
62
- 1. **Review 1** (first review - no sentinel). Issues -> dispatch fix 1.
63
- 2. **Review 2** (re-review). Issues -> if `STAGNANT`, escalate now - no fix 2. Otherwise dispatch fix 2.
64
- 3. **Review 3** (re-review). Issues -> if the line reads `CONVERGING` and does not contain `max severity Critical` (spec reviews: `CONVERGING` alone), run the convergence exception: dispatch fix 3, then review 4. Any other outcome - `STAGNANT`, `DIVERGING`, a missing or malformed line, `max severity Critical` - escalate. Do not re-dispatch just to obtain the line.
65
- 4. **Review 4** (re-review, only after the exception). Issues -> escalate, whatever the verdict. The exception fires at most once per loop; verdicts never chain into a second grant.
66
-
67
- Every dispatched fix is verified by a re-review before escalation or task progression - the loop only ever exits on a clean review or an escalation.
68
-
69
- Read [reference/fix-loop.md](./reference/fix-loop.md) now for escalation and funded-round dispatch rules.
70
-
71
- **Worked examples:**
46
+ Call `plan_check({ planPath })` for the manifest; stop on FAIL; for `manifest-size`, emit a stop note asking for plan reduction. Consume each task's `files`, `tests`, `leg`, `mode`, heading and explicit `orchestrator`. Pass isolated implementers only their own task's `tests` as `SCOPED_TEST_COMMANDS`, or `none` when empty. Give in-place implementers, the integrated test gate and wave reviews the wave union of `tests`. Preserve each array element as one command without splitting or joining command strings. Children read Tests metadata themselves.
72
47
 
73
- - Review-2 verdict `TRAJECTORY: STAGNANT (repeat of: unchecked error path in parser)` -> escalate now, before fix 2 - earlier than the ordinary budget.
74
- - Review-3 verdict `TRAJECTORY: CONVERGING (3 -> 1, max severity Moderate)` -> dispatch fix 3; if review 4 still finds issues, escalate.
75
- - Review-3 verdict `TRAJECTORY: CONVERGING (3 -> 2, max severity Critical)` or `TRAJECTORY: DIVERGING` or no `TRAJECTORY:` line -> escalate.
48
+ On a spec-defect citation, pause the fix loop and take the delegated amendment route for [amending an approved spec](../brainstorming/SKILL.md#amending-an-approved-spec) with amend permission on the `**Amend-grant:**` line decoded by the existing surface. Keep code-vs-spec mismatch in wave review; an unreadable spec anchor blocks instead of falling back to task-only review.
76
49
 
77
50
  ## Fix delta
78
51
 
79
- Include a `## Fix delta` block in every SR/CR re-review payload: the recorded tree-before and tree-after object IDs between the tree recorded at the prior review's dispatch and the tree recorded at this re-review's dispatch. Record each tree with the shell block below; keep the printed SHA keyed by task for SR or wave for CR. Run it in the spec-review snapshot for pre-integration reviews, or in the branch checkout for integrated reviews (`FD_ROOT`). Tree objects share the repository's object store; require the reviewer child to run `git -C "$FD_ROOT" diff --binary <tree-before> <tree-after>` to produce/read the delta; the parent uses only `diff --stat` to detect empty changes. Worker commits and staging state do not affect it; never substitute a SHA range or working-tree diff.
52
+ Include a `## Fix delta` block in every wave re-review payload: the recorded tree-before and tree-after object IDs between the tree recorded at the prior review's dispatch and the tree recorded at this re-review's dispatch. Record each tree with the shell block below; keep the printed SHA keyed by wave. Run it in the integrated branch checkout (`FD_ROOT`). Tree objects share the repository's object store; require the reviewer child to run `git -C "$FD_ROOT" diff --binary <tree-before> <tree-after>` to produce/read the delta; the parent uses only `diff --stat` to detect empty changes. Worker commits and staging state do not affect it; never substitute a SHA range or working-tree diff.
80
53
 
81
54
  Substitute a shell-quoted checkout path for `{{CHECKOUT}}` and run the entire block. Stop review dispatch on a nonzero exit and report the shell error. The block reads the live index, writes only a scratch index and tree object, and preserves checkout status.
82
55
 
@@ -91,7 +64,7 @@ rm -f "$FD_INDEX"
91
64
  exit "$FD_STATUS"
92
65
  ```
93
66
 
94
- Omit the delta for whole-diff re-reviews. During implement, missing prior review-tree transcript lines take Recovery's stop-note path; never reconstruct dynamic state from reports. On an empty delta (including ignored-only repairs), dispatch no re-review: count a failed attempt under [When a Subagent Fails](#when-a-subagent-fails), resend the prior report path with "your fix changed no tracked file", and stop after the existing two-attempt limit.
67
+ Omit the delta for whole-diff re-reviews. During implement, missing prior review-tree transcript lines take Recovery's stop-note path; never reconstruct dynamic state from reports. On an empty delta (including ignored-only repairs), dispatch no re-review: count a failed attempt under [When a Subagent Fails](#when-a-subagent-fails), resend the prior report path with "your fix changed no tracked file", and follow the transition table for escalation and funding.
95
68
 
96
69
  ## Implementer Status
97
70
 
@@ -99,10 +72,10 @@ Every implementer dispatch returns one of:
99
72
 
100
73
  | Status | Meaning | Orchestrator action |
101
74
  |---|---|---|
102
- | `DONE` | Implemented + tests pass + self-reviewed; work present in the worker's tree; the wave commit is step 7 | Proceed to spec review |
75
+ | `DONE` | Implemented + tests pass + self-reviewed; work present in the worker's tree; the wave commit follows SHIP | Proceed to integration and gate |
103
76
  | `DONE_WITH_CONCERNS` | Implemented + tests pass, but flagged a deviation or risk | Read concerns. If acceptable, proceed. If not, dispatch fix subagent. |
104
- | `NEEDS_CONTEXT` | Implementer needs information you have | For a spec-defect citation, take the amendment route below first. Resolve fact asks per [lookup handling](./stop-note.md). For decisions under amend permission, follow [Implementer-failure stops](reference/fix-loop.md#implementer-failure-stops); otherwise answer and re-dispatch or escalate to the user. |
105
- | `BLOCKED` | Cannot proceed (missing dependency, spec contradicts code, environment broken) | For a spec-defect citation, take the amendment route below first. Resolve fact asks per [lookup handling](./stop-note.md). For decisions under amend permission, follow [Implementer-failure stops](reference/fix-loop.md#implementer-failure-stops); otherwise diagnose and re-dispatch or escalate to the user. |
77
+ | `NEEDS_CONTEXT` | Implementer needs information you have | For a spec-defect citation, take the amendment route below first. Resolve fact asks per [lookup handling](./stop-note.md). For decisions under amend permission, follow [takeable-decision ladder](#escalation-and-funding); otherwise answer and re-dispatch or escalate to the user. |
78
+ | `BLOCKED` | Cannot proceed (missing dependency, spec contradicts code, environment broken) | For a spec-defect citation, take the amendment route below first. Resolve fact asks per [lookup handling](./stop-note.md). For decisions under amend permission, follow [takeable-decision ladder](#escalation-and-funding); otherwise diagnose and re-dispatch or escalate to the user. |
106
79
 
107
80
  Classify each question: treat a question whose candidate answers are each edits to the spec, plan, or an approved rule as an amendment batch per [amendment-surface.md](../brainstorming/reference/amendment-surface.md), never a decision. Treat a drafted AC row text correction backed by quoted implementer evidence (test, assertion, or code line) as an amend through the delegated amendment route; record it in the granted `amend:` audit body. Stop for redraws: ticket rows, row add/remove, reviewer-only or taste objections, problem changes, or component boundary changes. Execute the delegated amendment reference above before other routing, preserving Standing grants decoding, recommended-choice application without reviewer, menu or confirmation turns under amend permission, and the same-turn plan-writer apply, parent `plan_check`, tracker update, printed amendment and single `amend:` commit; without permission retain the surface's menu and escalation/redraw routing. For remaining questions, delegate artifact location, value or existence as a fact ask; treat scope and option choices as decisions, and another-round approval as a decision only with no funded round left.
108
81
 
@@ -113,20 +86,20 @@ Implementer prompt templates must instruct subagents to return one of these stat
113
86
  - Omit `model:` so the operator's `subagents.agentOverrides.<agent>.model` pin applies, or else the child inherits the main loop.
114
87
  - Pass `model:` only a runtime-resolved `gauntlet_setting` value (`closureReview.model`, `escalationLoop.implModel`, `specCouncil.members[]`, `specCouncil.chair`) or a model the user named for that dispatch.
115
88
  - Read the main loop's own string from `$PI_PROVIDER`/`$PI_MODEL` with the bash tool only when a skill must bypass a persona's frontmatter `thinking` pin for cost or must pass an explicit fallback after a configured model is unreachable.
116
- - Omit `model:` when `closureReview.model` or `specCouncil.chair` is `undefined`; pass an `implModel` string verbatim, and stop with a note when `implModel` is `undefined` (Fix-Loop Rounds).
89
+ - Omit `model:` when `closureReview.model` or `specCouncil.chair` is `undefined`; pass an `implModel` string verbatim, and stop with a note when `implModel` is `undefined` (The Wave Loop).
117
90
  - Apply suffix edits such as `:low` only to a runtime-resolved string, never to a name the skill wrote; never write a provider or model name, tier tasks by cost, or swap a pinned model for a cheaper or stronger one.
118
91
 
119
92
  ## Leg routing
120
93
 
121
94
  Delegate `## Legs` reads in the home spec through [the leg contract](../brainstorming/reference/legs.md). Consume admitted task `leg` through `plan_check`; absent means home. Repair `leg-unknown` in the plan, never membership. Keep the existing flat tracker and task indices.
122
95
 
123
- Require leg-homogeneous waves. Split a mixed wave into consecutive single-leg waves preserving dependencies before dispatch. Select its owning worktree before capturing `WAVE_BASE_SHA`; use that root for isolation, dispatch `cwd`, `git -C`, snapshots, integration, scoped tests, in-place repair and wave commit. In the following recipes, substitute that root for every implementation worktree placeholder. Keep authoritative spec reads at the absolute home spec path, including companion SR snapshots.
96
+ Require leg-homogeneous waves. Split a mixed wave into consecutive single-leg waves preserving dependencies before dispatch. Select its owning worktree before capturing `WAVE_BASE_SHA`; use that root for isolation, dispatch `cwd`, `git -C`, snapshots, integration, scoped tests, in-place repair and wave commit. In the following recipes, substitute that root for every implementation worktree placeholder. Keep authoritative spec reads at the absolute home spec path.
124
97
 
125
- Carry `Leg:` and combined spec/task `Rules:` as additive task context to every implementer, spec-reviewer and code-reviewer, including repairs and re-reviews; require reading those files before acting. Resolve rules from the owning checkout, not home. Keep dispatch and acceptance shapes unchanged.
98
+ Carry `Leg:` and combined spec/task `Rules:` as additive task context to every implementer, wave-reviewer and conformance-reviewer, including repairs and re-reviews, as `Leg: <leg>; Rules: <task Rules> + <leg> Rules from home ## Legs, resolved in the owning checkout`; require reading those files before acting. Resolve rules from the owning checkout, not home; keep `Spec:` the absolute home path. Keep dispatch and acceptance shapes unchanged.
126
99
 
127
100
  ## Dispatch
128
101
 
129
- Use `dispatching-parallel-agents` for isolation and serial patch integration. Use the dispatch-contract one-step chain for every repair, CR and SR re-review, including escalated and funded rounds. Carry anchors, prior report path and scoped command arrays; never paste task or report contents. Resolve models only through the Model rules above. Keep verification conformance as its own dispatch under After All Tasks.
102
+ Use `dispatching-parallel-agents` for isolation and serial patch integration. Use the dispatch-contract one-step chain for every repair and wave re-review, including escalated and funded rounds. Carry anchors, prior report path and scoped command arrays; never paste task or report contents. Resolve models only through the Model rules above. Keep verification conformance as its own dispatch under After All Tasks.
130
103
 
131
104
  ## The Wave Loop
132
105
 
@@ -142,23 +115,88 @@ Run every plan task through this loop in a wave of N >= 1 tasks. Run waves in se
142
115
  - **Lifecycle per task:** `pending → in_progress (wave fan-out) → complete (wave commit)`; keep `in_progress` through exhausted integration or repair attempts pending the human's decision (see [When a Subagent Fails](#when-a-subagent-fails)); use `failed` only for a human-decided terminal failure; `skipped` when the plan drops it as not applicable (terminal, counted done). A rejected `update` names the earlier pending tasks and the legal fixes - record those tasks' true state, never `clear` or re-`init` to move on.
143
116
  - **Widget caveat (known, deliberately unfixed).** The persistent `plan_tracker` widget's icon strip (`○ → ✓`) and `(c/total)` count reflect every task, but its trailing *name* shows only the **first** `in_progress` task. Use the icon strip and the `status` action for the full in-flight view; a richer multi-task widget is a separate extension change, out of scope (YAGNI).
144
117
 
145
- For an `in-place` wave, dispatch one `implementer` with `cwd` the branch checkout and no `worktree: true`; skip step 4 integration and step 7's `reset --soft` fold, retain the test gate, SR against the branch checkout, and CR, and record the next wave's `WAVE_BASE_SHA` after completion. Repair every SR gap (including initial `NEEDS_REWORK` / `OUT_OF_SCOPE_CHANGES`), stopped chain, test-gate failure, and CR finding with a plain in-place `implementer` in the branch checkout; record Fix-delta trees from that checkout, never use the snapshot/patch-replacement path, and after the gates accept, commit any remaining changes as one new descendant commit on the branch before marking indices `complete`, without amending or running `reset --soft` across the recorded rework base.
118
+ 1. **Independence check.** Assert pairwise-disjoint manifest `files`: Test/Test is allowed, Test/Create, Test/Modify and Modify/Modify overlap. Split overlaps into singleton waves. Trust the plan for runtime-resource disjointness; capture `WAVE_BASE_SHA` with `git -C <worktree> rev-parse HEAD`, print `wave <w> base <sha>` and hold it.
119
+ 2. **Dispatch.** One one-step chain whose single `parallel` step contains only implementers, one item per task: `subagent({ async: false, context: "fresh", cwd: <worktree>, chain: [{ parallel: [{ agent: "implementer", as: "impl_<n>", outputSchema: IMPLEMENTER_STATUS_SCHEMA, output: "<REPORT_DIR>/wave<w>-task<n>.md", outputMode: "file-only", task: ... }], worktree: true, concurrency: 4, stopOn: { path: "/status", in: ["BLOCKED", "NEEDS_CONTEXT", "DONE_WITH_CONCERNS"] } }] })`. Use step `stopOn` to expose `## Outputs` structured JSON in the tool-result text; top-level `tasks` has no item schema and is not used. For manifest `"mode":"in-place"`: `cwd` the branch checkout, no `worktree:`, the wave union as `SCOPED_TEST_COMMANDS`. Payload is `planPath`, task anchor, spec path, `Leg:` with additive `Rules:` per [Leg routing](#leg-routing), `SCOPED_TEST_COMMANDS` (the task's own `tests` for isolated waves), status protocol. Dispatch no reviewer step after the implementers.
120
+ 3. **Read and integrate.** Read each child's structured output and report under the bound above; print `wave <w> task <n> <status> report <path> patch <path>`. Isolated waves: `DONE` / `DONE_WITH_CONCERNS` with a patch -> `git -C <worktree> apply --index <patch>` in plan index order, print `wave <w> integrated task <n>`; an initial patch that fails to apply prints `wave <w> task <n> apply failed`, leaves every already-integrated sibling staged, and stops with a stop note listing which tasks are integrated and which failed - no automatic rebuild (the human may ask for one, which runs the rebuild recipe below). In-place waves: nothing to apply; the checkout already carries the work. `BLOCKED` / `NEEDS_CONTEXT` -> the takeable-decision ladder below.
121
+ 4. **Test gate.** Run each manifest test for the wave union separately, logs to `gate-<i>.log`; print `wave <w> gate <i> exit <code>`. A red gate enters step 6 as a gate repair for every task whose `files` the failing test belongs to (the manifest's `tests` owner), before any review; the review in step 5 runs only on a green gate.
122
+ 5. **Review.** One `wave-reviewer` dispatch per wave, doc-only waves included (`context: "fresh"`, `async: false`, read-only, one-step carrier with `WAVE_VERDICT_SCHEMA` and `stopOn: { path: "/verdict", in: ["FIX_FIRST", "REJECT"] }`), `cwd` the integrated tree after `git -C <worktree> add -A`, with `planPath`, the wave's task `anchors`, `Spec:` (absolute home spec), `Leg:` with additive `Rules:` per [Leg routing](#leg-routing), `BASE_SHA: <WAVE_BASE_SHA>`, `HEAD_SHA: WORKTREE`, and the wave union as `SCOPED_TEST_COMMANDS` (`none` for a doc-only wave, so the reviewer runs nothing and applies the clause table and documentation checks only). Record the review tree per `## Fix delta`; print `wave <w> review <k> verdict <value> report <path> tree <sha>`. `SHIP` -> step 7; `FIX_FIRST` -> step 6; `REJECT` -> hard stop with a stop note.
123
+ 6. **Repair round.** Attribute each finding to a task: the task whose manifest `files` contain the finding's file, else the tasks in the structured `touchedTasks`; a finding with neither a file inside any wave task's `files` nor a `touchedTasks` owner stops with `Recommendation: spec/plan amendment` through [delegated amendments](./reference/implement-amendments.md) - findings are never dropped from a repair payload. For each attributed task, dispatch one `implementer` on the current tree with the findings block or gate log as its task text, the prior report path under `## Previous review report`, the task's anchors, and `SCOPED_TEST_COMMANDS` (isolated: the task's own `tests`; in-place: the wave union), through the one-step carrier with no `context: "fresh"` override and no prior-patch path:
124
+ - *Isolated waves* use the repair-base recipe below: a committed snapshot of the current integrated tree (every integrated patch, every applied repair delta, added files included), so the dispatch root is clean and pi-cohort's exported patch is exactly the repair delta. The snapshot carries the current tree forward; it is not the rebuild below and discards nothing. Dispatch with `cwd: <RP_TREE>`, `worktree: true`; the delta is the `Artifacts:` patch at `<Artifacts dir>/worktree-diffs/step-0/task-0-implementer.patch`. Apply it to the integrated tree with `git -C <worktree> apply --index <delta>`; print `wave <w> repair <k> task <n> <status> report <path> delta <path> applied <yes|no>`; then `git -C <worktree> worktree remove --force <RP_TREE>`.
125
+ - *In-place waves* dispatch with `cwd` the branch checkout and no `worktree:`; the child edits the checkout directly; apply no patch and run no snapshot recipe; print the same line with `delta none applied n/a`.
126
+
127
+ After the round: `git -C <worktree> add -A`; `git -C <worktree> diff --stat` against the recorded pre-repair tree decides emptiness; re-run the test gate for the touched tasks' `tests`; on green, one `wave-reviewer` re-review with the marker `## Previous review report (re-review trigger)`, the prior report path, the `## Fix delta` tree pair, the same `BASE_SHA` / `HEAD_SHA: WORKTREE`. Transitions follow the table below.
128
+ 7. **Commit.** Only when the gate is green and the latest `wave-reviewer` verdict is `SHIP`: isolated waves `git -C <worktree> reset --soft "$WAVE_BASE_SHA" && git -C <worktree> add -A && git -C <worktree> commit -m <message>`; in-place waves commit a descendant commit without amending or `reset --soft`. Then mark every index of the original wave `complete` together; execute manifest `orchestrator` instructions at the completed-wave boundary.
129
+
130
+ `WAVE_BASE_SHA` is fixed across repair rounds, so every re-review diffs against the same root the first review saw.
131
+
132
+ **Repair-base recipe** - a committed snapshot of the current integrated tree, not a rebuild (isolated waves; substitute shell-quoted literals; run the whole block, stop on nonzero exit and retain `RP_DIR` for diagnosis):
133
+
134
+ <!-- repair-base-shell -->
135
+ ```bash
136
+ RP_ROOT={{WORKTREE}}
137
+ RP_BASE={{BASE_SHA}}
138
+ RP_DIR=$(mktemp -d) || exit 1
139
+ RP_TREE="$RP_DIR/tree"
140
+ git -C "$RP_ROOT" add -A || exit 1
141
+ git -C "$RP_ROOT" diff --binary --cached "$RP_BASE" > "$RP_DIR/integrated.patch" || exit 1
142
+ git -C "$RP_ROOT" worktree add --detach "$RP_TREE" "$RP_BASE" || exit 1
143
+ if [ -s "$RP_DIR/integrated.patch" ]; then git -C "$RP_TREE" apply --index "$RP_DIR/integrated.patch" || exit 1; fi
144
+ git -C "$RP_TREE" -c user.name=gauntlet -c user.email=gauntlet@local commit -q --allow-empty -m "wave integrated snapshot" || exit 1
145
+ printf 'repair-base: %s %s\n' "$RP_TREE" "$(git -C "$RP_TREE" rev-parse HEAD)"
146
+ ```
147
+
148
+ The redirected `diff --binary --cached` writes a file and loads nothing into the orchestrator's context; the orchestrator never reads `integrated.patch`.
149
+
150
+ **Transition table.** One per-task counter `failed[n]` starts at 0 when the wave enters step 3; `escalated[n]` and `converged[n]` are once-per-wave flags.
151
+
152
+ | Event | Counts for task n | Next operation |
153
+ |---|---|---|
154
+ | Red gate at step 4 or after a repair (any implementer status, including `DONE`) | +1 for each task owning a failing test | repair from the gate log; no review until green |
155
+ | Dispatch error, missing structured output after diagnosis says `repair`, or `BLOCKED` / `NEEDS_CONTEXT` answered by the ladder | +1 | re-dispatch the identical payload with the answer appended under `## Answer to your BLOCKED question` into the existing repair tree (the registered `RP_TREE` when one exists, otherwise the owning checkout); never remove, re-snapshot or rebuild that tree - the snapshot recipe and `worktree remove` run only when a repair round starts fresh or after a delta apply failure |
156
+ | Repair delta or in-place repair leaves `diff --stat` empty (`DONE` with an unchanged tree) | +1 | no re-review of the unchanged tree; next repair resends the prior report path with "your fix changed no tracked file" |
157
+ | Repair delta fails `git apply --index` | +1 | rebuild |
158
+ | Review 1 `FIX_FIRST` (no `TRAJECTORY:` line) | +1 for each attributed task | repair |
159
+ | Re-review `FIX_FIRST`, `TRAJECTORY: CONVERGING` or `DIVERGING` | +1 for each attributed task | repair while `failed[n] < 2`; else escalation |
160
+ | Re-review `FIX_FIRST`, `TRAJECTORY: STAGNANT`, or a missing/malformed line | sets `failed[n] = 2` for each attributed task | escalation now (ordinary rounds), no convergence exception; never re-dispatch the review merely to obtain the line; stop immediately on a funded re-review |
161
+ | `failed[n] == 2` reached by a `CONVERGING` re-review whose line lacks `max severity Critical`, `converged[n]` unset | sets `converged[n]` | one extra ordinary repair, then re-review; a further `FIX_FIRST` escalates whatever the trajectory |
162
+ | `failed[n] == 2` (or `> 2` after the convergence exception), `escalated[n]` unset | sets `escalated[n]` | escalated round with `model: <implModel>` |
163
+ | Escalated round fails (dispatch error, non-`DONE`, red gate, empty delta, or attributed `FIX_FIRST`) | spent | funded round while the task's ledger has one left, else stop note |
164
+ | Funded round fails the same way | spends one | next funded round while one remains, else stop note; `STAGNANT` stops regardless |
165
+ | Gate green and review or re-review `SHIP` | - | step 7 |
166
+ | `REJECT`, `anchorUnreadable` on a reviewer, or the round cap: more than `4 + N` re-reviews in one wave (`N` = the largest funded grant among the wave's tasks, 0 without a token) | - | hard stop with the stop note |
167
+
168
+ Execution escalation to `implModel` is available whenever `failed[n]` reaches 2, independently of any `**Amend-grant:**` value; funding only adds rounds after the escalated round. Follow this table after two failed attempts, without requiring amend permission.
169
+
170
+ ### Rebuild
146
171
 
147
- **Per-wave loop:**
172
+ A repair delta that fails `git apply --index` prints `rebuild: task <n> - delta apply failed` and counts one failed attempt. Then, in the integrated tree: partition the task's manifest paths - every `Create` path (including a new test file declared as both `Create` and `Test`) is removed (`git -C <worktree> rm -q -f --ignore-unmatch -- <paths>`), and the remaining `Modify` / `Test` paths, deduplicated and excluding every `Create` path, are restored from the wave base (`git -C <worktree> restore --source="$WAVE_BASE_SHA" --staged --worktree -- <paths>`); sibling paths are untouched (step 1 guarantees disjointness). Run the repair-base recipe on that tree, so the snapshot holds the base plus every accepted sibling and nothing of task n; dispatch one `implementer` from `<RP_TREE>` with `worktree: true` and the task's original payload (this dispatch is the next attempt on `failed[n]`'s counter - the escalated round when the counter has reached 2); apply its `Artifacts:` patch to the integrated tree with `git apply --index` (a failure here is a hard stop, not a second rebuild). The rebuilt task rejoins its original wave: re-run the gate for the wave union, one `wave-reviewer` re-review with the marker and the prior report path, and step 7 commits the whole wave once and completes all of its indices together. The human may ask for a rebuild at any stop, which runs this same recipe; nothing else triggers one. `BLOCKED` / `NEEDS_CONTEXT` on a repair never rebuilds or re-snapshots: the ladder answers, then the identical payload is re-dispatched into the existing repair tree with the answer appended.
148
173
 
149
- 1. **Independence check.** Consume the manifest tasks' `files` arrays; assert pairwise-disjoint (mechanical, mirroring `wave-file-disjointness`: `Test`/`Test` on one path is not overlap, `Test` vs another task's `Create`/`Modify` is, `Modify`/`Modify` is). Runtime-resource disjointness (DB/schema, port, fixture, external service, shared temp path) is not machine-checkable here - trust the plan's wave grouping, which `writing-plans`' D5 contract guarantees. Either kind of overlap → the wave is mis-grouped; split it into one-task waves and note it.
150
- 2. **Start, then dispatch.** Record and print `wave <w> base <sha>` from `WAVE_BASE_SHA` captured with `git -C <worktree> rev-parse HEAD` before dispatch; keep it fixed through the wave's commit. Mark every wave index `in_progress` in increasing index order. Run the once-per-phase preflight below before dispatching exactly one initial chain (including one-task waves).
151
- 3. **Read the result once.** Consume statuses, verdicts, and artifact paths from structured JSON as specified below. All implementers `DONE` and all verdicts `COMPLIANT` -> step 4. Any other outcome -> [Chain stopped or failed](#chain-stopped-or-failed). The ticket's `FAIL` means a spec gap (`NEEDS_REWORK`), not a structured verdict or an SR `stopOn` condition.
152
- 4. **Integrate.** Run `git -C <worktree> apply --index <patch-path>` for each accepted task's patch sequentially. This stages additions as well as tracked changes for review. On an apply failure, drop that task from the wave; finish steps 5-7 for the survivors, then re-dispatch the dropped task as a one-task wave from the new committed HEAD. With zero surviving patches, skip steps 5-7 and retry the failed task from the unchanged clean HEAD under [When a Subagent Fails](#when-a-subagent-fails)'s two-attempt limit; dispatch no empty review or commit. Keep its tracker index `in_progress` until its own wave commits.
153
- 5. **Test gate.** Run each element of the manifest tests union separately on the integrated tree as `(cd "<worktree>" && <command>) >"<REPORT_DIR>/gate-<i>.log" 2>&1`; retain its exit status. Keep full verification in verify. On failure, dispatch one one-step in-place `implementer` in the branch checkout with the failed-output paths, the owning task's anchors, and the wave's `SCOPED_TEST_COMMANDS`, under [When a Subagent Fails](#when-a-subagent-fails), then rerun the scoped gate. After the repaired tree passes, stage repair deliverables with `git -C <worktree> add -A` and dispatch spec review for every affected task against the integrated checkout before the initial CR; prior SR acceptance does not cover the repair. Pass each affected task's planPath, anchors and absolute home spec path; record its review tree per [Fix delta](#fix-delta). Resolve SR findings through [Fix-Loop Rounds](#fix-loop-rounds), with repairs in place and the scoped gate rerun. Never dispatch a nested wave from this dirty checkout: children cannot see integrated siblings from the old HEAD.
154
- 6. **Quality review.** CR binds to the wave: exactly one **initial** code-review dispatch per code-touching wave, over the integrated wave diff - never per task within a wave, never batched across waves. Subsequent dispatches within the wave are re-reviews triggered only by findings, per Fix-Loop Rounds. Pass the wave's `SCOPED_TEST_COMMANDS`, `BASE_SHA: <WAVE_BASE_SHA>`, and `HEAD_SHA: WORKTREE` per `code-quality-reviewer-prompt.md`; the review reads the staged and unstaged integrated diff, not a commit range. On findings, fix and re-review per `/skill:requesting-code-review` and [Fix-Loop Rounds](#fix-loop-rounds). Dispatch repairs as plain in-place workers in the branch checkout, never nested waves from the dirty checkout. Carry the report path and no commit or staging instruction in the repair payload. Before every CR dispatch and every SR/CR re-review, run `git -C <worktree> add -A` so all deliverables appear in the whole diff; record the review tree per [Fix delta](#fix-delta). Preserve `WAVE_BASE_SHA` and `HEAD_SHA: WORKTREE` through every re-review and escalated in-place repair. Skip CR for doc-only waves (SR-only per the commit precondition below).
155
- 7. **Commit and complete the wave.** After CR accepts (SR alone for doc-only waves), fold worker commits and all remaining changes into one durable wave commit: `git -C <worktree> reset --soft "$WAVE_BASE_SHA" && git -C <worktree> add -A && git -C <worktree> commit -m <message>`. Then mark the wave's existing indices `complete`. Execute each explicit manifest `orchestrator` instruction once at this completed-wave boundary before the next dispatch. Limit actions to `plan_tracker`, `phase_tracker`, `gauntlet_setting`, named git operations, observed-value forwarding or delegated amendments. Persist measured values only from structured output through delegated amendments. Emit a stop note quoting unknown action text. Ignore ordinary primary-directed task prose. Stop on an empty commit instead of completing tasks. Leave a clean tree so the next wave's children see the integrated work.
174
+ ### Escalation and funding
156
175
 
157
- **Two-stage review is preserved:** spec review per task (pre-integration, dispatched `spec-reviewer` - not inline), quality review per wave (post-integration). A wave commit requires one spec-review verdict per accepted task, plus one code-review verdict on the integrated diff for waves that touch code. A doc-only wave (every task's `Files:` block documentation-only, per `writing-plans`' Wave Grouping) is SR-only - the CR gate does not apply.
176
+ - **Execution escalation.** When the transition table reaches the escalated round for task n, print `escalated round for task <n> after 2 failed attempts`, call `gauntlet_setting({ key: "escalationLoop" })`, and dispatch one `implementer` with `model: <implModel>`, `async: false`, on the current tree (repair-base snapshot for isolated waves, branch checkout for in-place) with the same payload as the failed round; no `context: "fresh"`, no prior-patch path. `implModel` undefined or the settings tool unavailable -> stop note. Once per task per wave; spends independently of funding. The escalated round runs the ordinary test gate and `wave-reviewer` re-review.
177
+ - **Funded rounds.** Delegate current grant read and Value decoding through [Standing grants](../brainstorming/reference/amendment-surface.md#standing-grants); one per-task ledger from zero; `funded round <k> of <N> for task <n>` before each funded dispatch; each funded dispatch repeats the escalated payload (`model: <implModel>`, same tree, same anchors) and spends one including failures; `STAGNANT` on a funded re-review stops immediately; `budget: <spent> of <N> spent` in stop notes after `Problem:` and `Searched:` lines; resume recovers spent only from `funded round` transcript lines, otherwise exhausted with `(not recovered on resume)`. Funding never supplies a missing `implModel`.
178
+ - **Takeable decision.** `BLOCKED` / `NEEDS_CONTEXT` with attempts remaining: compare the whitespace-normalized `file:line` or failing command plus assertion against decisions already auto-taken on this task (`Recommendation: none - evidence repeats task <n>` and stop on a repeat); in-task repair counts as an ordinary attempt under the two-attempt limit; spec/plan rule edits route through [amendment aftermath](../brainstorming/reference/amendment-surface.md#5-apply-aftermath-commit) under the grant; `fix-first` enters `/skill:shape-ticket`; everything else emits the stop note ending in `Recommendation: <option> - <why>` and waits. Print `took recommendation: <option> for task <n>` when taken.
179
+ - **Hard stops:** malformed grants, missing `implModel`, unavailable settings tools, dirty-tree or commit-boundary returns, empty-commit stagnation, the round cap in the table, funded re-review `STAGNANT`, `REJECT`, an initial-patch or rebuild-patch apply failure, an oversized compact report, redraws.
158
180
 
159
- **Dependent context across waves:** wave N+1 tasks branch from a HEAD containing wave N, so they see the code; still forward wave N's status lines and report paths into wave N+1 prompts.
181
+ The `TRAJECTORY:` block and `stop-note.md` grammar bind to the single `wave-reviewer` line.
160
182
 
161
- **Caveat:** each task must be independently runnable and verifiable in a fresh worktree - no reliance on uncommitted local state. `pi-cohort` symlinks `node_modules`; repos needing other per-worktree setup must account for it.
183
+
184
+ ### Initial dispatch carrier
185
+
186
+ Run the preflight once per implement phase, before the first dispatch. Use owning checkout `cwd`; omit `worktree: true` for manifest `"mode":"in-place"` and pass that wave's tests union.
187
+
188
+ ```ts
189
+ subagent({ async: false, context: "fresh", cwd: "<owning checkout>",
190
+ chain: [{ parallel: [
191
+ { agent: "implementer", as: "impl_1", outputSchema: IMPLEMENTER_STATUS_SCHEMA,
192
+ output: "<REPORT_DIR>/wave<w>-task1.md", outputMode: "file-only",
193
+ task: "planPath: <absolute plan>; anchor: ### Task N:; Spec: <absolute home spec>; Leg: <owning leg>; Rules: <combined task/leg Rules>; SCOPED_TEST_COMMANDS: <task manifest tests or none>. pi-cohort saves your final report; do not write it yourself." }
194
+ ], worktree: true, concurrency: 4,
195
+ stopOn: { path: "/status", in: ["BLOCKED", "NEEDS_CONTEXT", "DONE_WITH_CONCERNS"] } }]
196
+ })
197
+ ```
198
+
199
+ Keep context/async/cwd invocation-level; worktree/concurrency/stopOn step-level; as/output/outputMode/outputSchema/task item-level. Never use top-level `tasks`. Consume fenced structured JSON in `## Outputs` / `## Stop` from result text, not details or saved prose verdicts. Obtain patches from `Artifacts:` at `<Artifacts dir>/worktree-diffs/step-0/task-<i>-implementer.patch` (zero-based wave position). Keep known report paths. Require accepted statuses and a patch before initial isolated integration; count empty repair deltas through the transition table.
162
200
 
163
201
  Run this guard once per implement phase before the first wave. Stop on any error before dispatch; read the peer floor from the installed gauntlet package, not the consumer repository.
164
202
 
@@ -205,43 +243,12 @@ PREFLIGHT_STATUS=$?
205
243
  [[ "$PREFLIGHT_STATUS" == 0 ]] || exit "$PREFLIGHT_STATUS"
206
244
  ```
207
245
 
208
- Pass the implementation worktree's absolute path as top-level `cwd`. Per-task `cwd` outranks step and run `cwd`; only the SR tasks override it. Rule and rationale for editing dispatches: `dispatching-parallel-agents` "pi-cohort Integration".
209
-
210
- ```bash
211
- REPORT_DIR=$(mktemp -d)
212
- ```
213
-
214
- ```ts
215
- subagent({
216
- async: false, context: "fresh", cwd: "<abs worktree path>",
217
- chain: [
218
- { parallel: [
219
- { agent: "implementer", as: "impl_1", outputSchema: IMPLEMENTER_STATUS_SCHEMA,
220
- output: "<REPORT_DIR>/wave<w>-task1.md", outputMode: "file-only",
221
- task: "planPath: <absolute plan>; anchor: ### Task N:; Spec: <absolute home spec>; SCOPED_TEST_COMMANDS: <this task's manifest tests; none when empty>. pi-cohort saves your final report to the output path; do not write that file yourself, and it is not a concern about owned files." },
222
- // one item per task in plan index order
223
- ], worktree: true, concurrency: 4,
224
- stopOn: { path: "/status", in: ["BLOCKED", "NEEDS_CONTEXT", "DONE_WITH_CONCERNS"] } },
225
- { parallel: [
226
- { agent: "spec-reviewer", as: "sr_1", cwd: "{outputs.impl_1.treePath}",
227
- output: "<REPORT_DIR>/wave<w>-sr1.md", outputMode: "file-only", outputSchema: SPEC_VERDICT_SCHEMA,
228
- acceptance: { level: "none", reason: "the parent takes each SR verdict from the chain's ## Outputs structured JSON; review trees are staged by design" },
229
- task: "planPath: <absolute plan>; anchor: ### Task N:; Spec: <absolute home spec>. Patch: {outputs.impl_1.patchPath}; implementer report: <REPORT_DIR>/wave<w>-task1.md. Read the report and anchored task yourself; review the paired materialized tree, never run tests." },
230
- // one paired item per task
231
- ], concurrency: 4 },
232
- ],
233
- })
234
- ```
235
246
 
236
- Keep `context`, `async` and `cwd` invocation-level; `worktree`, `concurrency`, `stopOn` step-level; `as`, `output`, `outputMode`, `outputSchema`, task cwd and acceptance item-level. For manifest `"mode":"in-place"`, use the branch checkout and omit `worktree: true`; pass the wave union as `SCOPED_TEST_COMMANDS` and skip patch integration and reset-soft folding. Give the SR step no worktree or stopOn. Keep snapshot-backed spec reviews and code review free of acceptance overrides. Read the dispatch-contract schemas now before using the recipe.
237
-
238
- Read the tool-result text, not `details`: take statuses and verdicts from fenced `structured` JSON in `## Outputs` and `## Stop`, never from output reports or `Output saved to:` pointers. Preserve SR enums `COMPLIANT`, `NEEDS_REWORK`, `OUT_OF_SCOPE_CHANGES`. Read `Artifacts:` patch locations at `<Artifacts dir>/worktree-diffs/step-0/task-<i>-implementer.patch` (zero-based wave position); keep known output report paths. After each observed result print `wave <w> task <n> <status|verdict> <value> report <path> patch <path>`; omit no observations and invent no verdict or patch. Print `wave <w> review <k> tree <path>` at each materialized review-tree capture. Use paths for routing only.
247
+ Create `REPORT_DIR` with `mktemp -d`. Forward predecessor status and report paths across dependent waves; never paste task text.
239
248
 
240
249
  ### Chain stopped or failed
241
250
 
242
- Retain accepted patches and structured verdicts; never rerun accepted siblings and never repeat the initial wave chain. Inspect failed tasks even alongside `## Stop`: a matched stop precedes sibling-error checking. A required output missing or rejected is a failed task; siblings remain valid. Route anchorUnreadable through the two-attempt failure rule. `REJECT` stops. A completed chain with SR gaps repairs only the affected tasks.
243
-
244
- When `## Outputs` is missing, or a task's structured JSON is absent, delegate artifact diagnosis with this sequential exception. Give the child `Artifacts:`, all known saved output paths and session-artifact locations, matched by run/task identity. The diagnosis child alone reads `<runId>_implementer_<index>_output.md` under session subagent-artifacts and source-defined failed-reviewer filenames; never use empty parallel-0 directories. Save its own report as well.
251
+ Retain accepted siblings; never repeat the initial chain or rerun accepted tasks. Inspect failed tasks alongside `## Stop`; a matched stop precedes sibling-error checking. Missing/rejected required output fails only that task. When Outputs or structured JSON is missing, delegate identity-matched artifact diagnosis once:
245
252
 
246
253
  ```ts
247
254
  subagent({ async: false, context: "fresh", cwd: "<owning checkout>",
@@ -251,41 +258,37 @@ subagent({ async: false, context: "fresh", cwd: "<owning checkout>",
251
258
  })
252
259
  ```
253
260
 
254
- Omit agent on this sequential step; use no parallel item. Route from the diagnosis JSON and existing status matrix with bounded retries; missing/ambiguous artifacts or delegated failure stop with the visible diagnostic, not recursive diagnosis. Retain all accepted siblings. Dispatch only accepted patches without a verdict through one-step SR fan-out against snapshots. A missing/empty accepted patch takes When a Subagent Fails, not an unchanged review.
255
-
256
- For a pre-integration SR gap, reconstruct its original patch snapshot at WAVE_BASE_SHA and capture tree-before. Dispatch only the affected implementer through a one-step carrier, with isolated worktree for an ordinary wave and previous report path plus prior artifact patch. Give isolated spec-gap redispatch only its own task's `tests` as `SCOPED_TEST_COMMANDS`, or `none` when empty. Materialize its replacement patch in a fresh detached WAVE_BASE_SHA snapshot and capture tree-after. Stop and retain setup evidence on snapshot/tree failure. Re-review through a one-step SR carrier with the saved report path under `## Previous review report (re-review trigger)`, trajectory block and `## Fix delta` tree pair. Replace only that patch after acceptance. For in-place waves, keep every repair and SR in the branch checkout, without nested worktrees or patch replacement.
261
+ Omit agent on this sequential step; use no parallel item. Let the child alone inspect identity-matched session failure artifacts, not empty parallel-0 directories. Route diagnosis JSON through the transition table. Missing/ambiguous artifacts or delegated failure stop; never recursively diagnose. An implementer anchor failure takes the failed-attempt path; reviewer anchorUnreadable hard-stops.
257
262
 
258
263
  ### Recovery
259
264
 
260
- Recover static data with `plan_check({ planPath })` and `plan_tracker({ action: "status" })`. Recover dynamic state only from the transcript templates above and `funded round <k> of <N> for task <n>`. For an `in_progress` wave with missing transcript lines, emit a stop note naming the wave and missing facts. Treat presence of all transcript line categories as not sufficient evidence to dispatch: a funded-round line records spending before dispatch, not its outcome. On a missing terminal funded-worker outcome or repair state, stop naming those facts and retain observed spending. Continue only when terminal worker/review observations and recorded tree object IDs establish the next operation; otherwise stop. Never infer integration, redispatch interrupted workers, or reset spending. Preserve WAVE_BASE_SHA, prior reports, review trees, verdicts and funded counts from observed lines.
261
-
262
- ## Spec-review snapshots
263
-
264
- Materialize each accepted patch for every pre-integration review not run by the chain: accepted siblings after errors/stops, replacement patches on re-review. Keep the implementation worktree unchanged; pi-cohort removes its worker checkouts before returning patches.
265
-
266
- Substitute shell-quoted literals for the implementation worktree, the recorded `WAVE_BASE_SHA`, and the absolute patch path. Run this block once per patch:
267
-
268
- <!-- spec-review-snapshot-shell -->
269
- ```bash
270
- SR_ROOT={{WORKTREE}}
271
- SR_BASE={{BASE_SHA}}
272
- SR_PATCH={{PATCH_PATH}}
273
- SR_DIR=$(mktemp -d) || exit 1
274
- SR_TREE="$SR_DIR/tree"
275
- git -C "$SR_ROOT" worktree add --detach "$SR_TREE" "$SR_BASE" || exit 1
276
- git -C "$SR_TREE" apply --index "$SR_PATCH" || exit 1
277
- printf 'snapshot: %s\n' "$SR_TREE"
265
+ Recover static state only with `plan_check({ planPath })` and tracker status. Recover dynamic state only from the observations below. Stop for an in_progress wave without its base, repair applied status or terminal outcome. Continue after a repair only with a terminal review after `applied yes` or a green gate after the last repair. Old tree-only review lines do not authorize continuation. Keep original base, report paths, tree IDs and funding spending; never infer integration or redispatch interrupted workers. Recover funded spent only from `funded round` observations; absent history means exhausted, not reset. A funded observation records spending before dispatch, not a terminal outcome.
266
+
267
+ ```text
268
+ wave <w> base <sha>
269
+ wave <w> task <n> <status> report <path> patch <path>
270
+ wave <w> integrated task <n>
271
+ wave <w> task <n> apply failed
272
+ wave <w> gate <i> exit <code>
273
+ wave <w> review <k> verdict <value> report <path> tree <sha>
274
+ wave <w> repair <k> task <n> <status> report <path> delta <path> applied <yes|no>
275
+ rebuild: task <n> - delta apply failed
276
+ escalated round for task <n> after 2 failed attempts
277
+ funded round <k> of <N> for task <n>
278
+ repair-base: <path> <sha>
278
279
  ```
279
280
 
280
- Record its review tree per [Fix delta](#fix-delta) before every parent-dispatched SR, keyed by task. Use the printed snapshot path as that spec-review task's `cwd` and whole-file read root. Keep the authoritative spec's absolute path in the implementation worktree. Pass the patch path; the snapshot contains this task's changed and added files, with deleted files absent. Read deleted files from `WAVE_BASE_SHA` when the review needs their prior contents. Dispatch read-only, with no `worktree` flag. On snapshot setup or tree-capture failure, or a missing snapshot path, stop dispatch and retain the failed snapshot directory and shell output for diagnosis; dispatch no review and perform no snapshot cleanup. Save each snapshot-backed review's terminal report to its `output:` path, consume its structured terminal result, then remove that review's snapshot with `git -C <implementation-worktree> worktree remove --force <snapshot-path>`. Keep every snapshot used as a reviewer `cwd` until that terminal report is saved; recording its tree never authorizes early cleanup. Remove a reconstruction used only to record tree-before after capturing its tree, since no reviewer runs there. Recreate from the replacement patch for each pre-integration re-review; on a failed recreate, stop dispatch and retain that snapshot directory and shell output, like any setup failure. Post-integration SR reviews the implementation worktree directly.
281
+ For in-place repairs print `delta none applied n/a`. Print each observation immediately after the operation returns; invent no path, result or SHA.
281
282
 
282
283
  ## When a Subagent Fails
283
284
 
284
285
  **You are the orchestrator. You do NOT write code.**
285
286
 
286
- 1. **Attempt 1:** dispatch a NEW fix subagent with error-output paths, the original task anchors, and specific instructions about what went wrong.
287
- 2. **Attempt 2:** if attempt 1 also fails, dispatch one more with a simplified scope or different approach.
288
- 3. **After 2 failed attempts:** under amend permission follow [Implementer-failure stops](reference/fix-loop.md#implementer-failure-stops) for one escalated attempt; otherwise STOP and report. Keep `in_progress` pending the human decision; completion requires the wave commit.
287
+ Use the transition table as the only attempt counter; count each failed operation once.
288
+
289
+ 1. **Attempt 1:** dispatch a NEW fix subagent on the same tree with error-output paths, the original task anchors, and specific instructions about what went wrong.
290
+ 2. **Attempt 2:** if attempt 1 also fails, dispatch one more on the same tree with a simplified scope or different approach.
291
+ 3. after 2 failed attempts the transition table's escalated round runs; STOP only when that round and any funded round are spent. Keep `in_progress` pending the human decision; completion requires the wave commit.
289
292
 
290
293
  **NEVER:**
291
294
 
@@ -300,7 +303,7 @@ For a coordinated run, execute verification and the following reviews for every
300
303
 
301
304
  0. Call `phase_tracker({ action: "start", phase: "verify" })`. (The `implement` phase was started at execution start and auto-completes from `plan_tracker` once all tasks are done; this flow runs its own verify gate instead of `/skill:verification-before-completion`, so it must mark verify itself.)
302
305
  1. **Parent full verification.** Run the complete plan-header `**Verification:**` command set foreground in the worktree via `(cd "<worktree>" && <command>)`: tests plus every declared lint, type, format, and build check. A failure must be repaired and the full set rerun successfully before the next step. Before dispatching a verification repair, reopen (`in_progress`) every existing plan-task index whose `Files:` ownership includes its touched files; leave unowned cross-cutting repair work in the verification report. Those indices stay `in_progress` through the successful full rerun **and** step 2's whole-diff review accepting the repair - that acceptance is their completion point, not the passing rerun. Commit any verification-produced tracked changes; use the resulting `HEAD_SHA` in the review task and include the commands/results in its existing `DESCRIPTION`.
303
- 2. **Whole-diff code review.** Only after passing full verification, dispatch one foreground whole-diff `code-reviewer` per `/skill:requesting-code-review` against that committed HEAD, with `SCOPED_TEST_COMMANDS: none`; the reviewer does not repeat the full suite. Act on the verdict per `/skill:requesting-code-review` Fix rounds; carry the final `SHIP` report's Minor finding lines verbatim into the closure block's `whole-diff minors:` section (`verification-before-completion/reference/conformance-check.md` "Closure / conformance"), or `whole-diff minors: none`. Before dispatching a review repair, reopen (`in_progress`) every existing plan-task index whose `Files:` ownership includes its touched files; leave unowned cross-cutting repair work in the review report. Mark each reopened index `complete` only once the repair is re-verified and the re-review accepts it - this is the same completion point step 1's reopened indices wait for, not an extra gate, and the gate order stays full verification -> whole-diff CR -> conformance. Any repair invalidates prior full verification, so rerun the full set successfully before the next gate.
306
+ 2. **Whole-diff code review.** Only after passing full verification, dispatch one foreground whole-diff `wave-reviewer` per `/skill:requesting-code-review` against that committed HEAD, with `SCOPED_TEST_COMMANDS: none`; the reviewer does not repeat the full suite. Act on the verdict per `/skill:requesting-code-review` Fix rounds; carry the final `SHIP` report's Minor finding lines verbatim into the closure block's `whole-diff minors:` section (`verification-before-completion/reference/conformance-check.md` "Closure / conformance"), or `whole-diff minors: none`. Before dispatching a review repair, reopen (`in_progress`) every existing plan-task index whose `Files:` ownership includes its touched files; leave unowned cross-cutting repair work in the review report. Mark each reopened index `complete` only once the repair is re-verified and the re-review accepts it - this is the same completion point step 1's reopened indices wait for, not an extra gate, and the gate order stays full verification -> whole-diff CR -> conformance. Any repair invalidates prior full verification, so rerun the full set successfully before the next gate.
304
307
  3. **Close the loop - conformance check.** The review in step 2 is plan-vs-code (single-step); it inherits any requirement the plan already dropped.
305
308
 
306
309
  **Happy-path run:** When the plan header carries a `**Happy path:**` line or the diff selects a row, `read` `reference/happy-path-run.md` at its absolute path beside this skill and follow its instructions. On an unreadable reference, stop with a blocking error; never reconstruct the runner.
@@ -314,11 +317,11 @@ For a coordinated run, execute verification and the following reviews for every
314
317
  - Writing code yourself instead of dispatching.
315
318
  - Pausing between tasks for anything other than `NEEDS_CONTEXT`, `BLOCKED`, a fix-loop escalation, a workflow warning, a redraw, or an amend with no standing grant.
316
319
  - Dispatching parallel implementers on overlapping files, on a shared mutable runtime resource, or without `worktree: true`.
317
- - Pasting task text, spec excerpts, or report contents into a dispatch, or opening the plan, spec, a report, or a source file in the primary
318
- - Dispatching `code-reviewer` before every in-scope spec-review verdict is ✅, or per task inside a wave.
319
- - Moving to the next task with either review still showing issues, or skipping the `Implementer Status` parse.
320
+ - Pasting task text, spec excerpts, or report contents into a dispatch, or opening plan/spec/source files in the primary or reading a report beyond its bound
321
+ - Dispatching wave review before a green gate, or per task inside a wave.
322
+ - Moving to the next task with the wave verdict still showing blocking issues, or skipping the `Implementer Status` parse.
320
323
  - Repeating the initial wave chain after a stop or error instead of retaining accepted siblings and using one-step repair/re-review carriers.
321
- - Dispatching fix 3 without a reviewer-emitted `CONVERGING` verdict, or continuing past `STAGNANT` instead of escalating (or, on a funded re-review, stopping).
324
+ - Dispatching a third ordinary repair without a reviewer-emitted `CONVERGING` verdict, or continuing past `STAGNANT` instead of escalating (or, on a funded re-review, stopping).
322
325
  - Running the full verification entrypoint, or any test command outside `SCOPED_TEST_COMMANDS`, during the implement phase.
323
326
  - Dispatching a repair before reopening the plan-task indices that own its files, whole-diff CR before parent verification passes, or conformance before the CR result is accepted.
324
327
  - Polling, joining, or relaunching an unexpectedly asynchronous dispatch, or starting on main without explicit user consent.