pi-gauntlet 7.43.0 → 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 +11 -0
  2. package/README.md +2 -2
  3. package/agents/plan-writer.md +4 -4
  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 +10 -2
  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 +4 -2
  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
@@ -1,45 +0,0 @@
1
- # Escalated fix rounds
2
-
3
- Use the dispatch-contract one-step carrier for escalated and funded implementers and every review, with output/file-only/schema and a status/verdict stopOn. Consume structured results only. Serialize a fix with missing parallelSafe; absent touchedTasks on a multi-task repair means all dispatched tasks. Escalate a re-review missing trajectory instead of requesting the line again.
4
-
5
- **Escalate** = one escalated round; stop only on failure. Call `gauntlet_setting({ key: "escalationLoop" })` (unavailable -> stop and report). `implModel` undefined -> stop note. Otherwise re-dispatch that fix - same payload and isolation knobs (`cwd`, `worktree`, `SCOPED_TEST_COMMANDS`, status protocol, prior patch, spec anchors) plus the prior report path under `## Previous review report (re-review trigger)` - overriding only `model: <implModel>`, `context: "fresh"`, `async: false`; one implementer, no fan-out. Run the normal fix-round review gate (SR then CR on `Behaviour-change: yes`, else the triggering reviewer with the re-review marker). All clean -> proceed; the escalated patch supersedes the prior one at integrate. A non-`DONE` status or a dispatch error -> stop note per `stop-note.md`. A review with issues -> a funded round while one remains for the task (below), otherwise stop note; no other second dispatch. Once per loop; independent of the convergence exception. No `plan_tracker` write during escalation - keep the task `in_progress` until the wave commit or, on a stop, the human decides.
6
-
7
- ## Funded rounds
8
-
9
- Delegate a current `**Amend-grant:**` read and grant decoding through the answer/evidence one-step carrier using **Value decoding** in [Standing grants](../../brainstorming/reference/amendment-surface.md#standing-grants) before each funded dispatch. Funding is independent of ordinary fixes and the escalated round; it never supplies a missing `implModel`, another escalation grant, verify credits, or `grant_fix_rounds`. Keep the review-3 convergence exception once per loop; never re-arm it through funding.
10
-
11
- Start one per-task ledger at zero when each task first enters Fix-Loop Rounds. Carry it across SR, behavior-change reroutes, the SR-to-CR transition, and wave repairs re-entering SR; use no wave-level allowance. Determine touched owners using the SR targeting rule (tasks whose files the fix touches). For a multi-task CR repair, spend once from every touched task; a touched exhausted owner stops the wave with that task's stop note before dispatch.
12
-
13
- Before every funded dispatch, print `funded round <k> of <N> for task <n>` for each touched task. Apply mid-loop grants prospectively, with spent starting at zero: rounds before the token was written neither count against nor toward it. Repeat the escalated payload and isolation exactly: configured `model: <implModel>` from `escalationLoop`, `context: "fresh"`, `async: false`, one implementer, no fan-out, same `cwd`/`worktree`, planPath and task anchors, prior patch path, spec path, status protocol, `SCOPED_TEST_COMMANDS`, and saved prior report path under `## Previous review report (re-review trigger)`. Run the same tests and same review gate: SR then CR on `Behaviour-change: yes`, otherwise the triggering reviewer with the re-review marker, trajectory block and Fix delta. Every dispatched round spends one, including failures.
14
-
15
- | Funded outcome | Action |
16
- |---|---|
17
- | Errors and non-`DONE` | Count as spent and stop with the task's stop note. |
18
- | Any funded re-review reports `STAGNANT` | Stop immediately regardless of funding remaining. |
19
- | Issue-bearing re-review with rounds left | Dispatch the next funded round. |
20
- | Issue-bearing re-review after N rounds | Stop with the exhausted task's stop note. |
21
- | All reviews clean | Continue through the wave gate and commit before task completion. |
22
-
23
- Emit the task's stop note for the funded-stop outcomes above (including `STAGNANT`) and an escalated-round failure with no funded round left. While a budget token exists, include `budget: <spent> of <N> spent` in every stop note after `Problem:` and any `Searched:` lines and before the file finding, including pre-escalation stops, missing `implModel`, and exhausted fact lookups at spent zero; use the `(not recovered on resume)` suffix below when recovery fails, and omit the line without a token. Treat this line as the only round-history exception to `stop-note.md`'s no-round-history rule.
24
-
25
- On resume, keep header restoration unchanged; recover each task's spent count only from its `funded round <k> of <N>` transcript lines. Without recoverable lines, treat funding as exhausted; stop the next issue-bearing re-review with `budget: <N> of <N> spent (not recovered on resume)`. Treat a newly written budget token as the human refund, never a resume reset. Use no new spent carrier or handoff/resume grammar.
26
-
27
- ## Implementer-failure stops
28
-
29
- Decode grants through [Value decoding](../../brainstorming/reference/amendment-surface.md#standing-grants); absent/`none`/budget-only: retain the ordinary two-attempt stop. Follow [stop-note.md](../stop-note.md) for lookups/status; preserve review/funding rules above.
30
-
31
- 1. **Hard stops**: stop first for malformed grants, missing `implModel`, unavailable settings tools, dirty-tree/commit-boundary returns, empty-commit stagnation, cap, funded re-review `STAGNANT`, `REJECT`, and [redraws](../SKILL.md#implementer-status).
32
- 2. **Takeable decision**: route only `BLOCKED`/`NEEDS_CONTEXT` decisions with attempts remaining below. Compare whitespace-normalized `file:line` finding or failing command plus assertion already auto-resolved on this task -> `Recommendation: none - evidence repeats task <n>`; stop.
33
- 3. **Execution escalation**: after two failed attempts, escalate before routing `Recommendation:`; call `gauntlet_setting({ key: "escalationLoop" })`; `implModel` undefined stops with the existing note. Print `escalated round for task <n> after 2 failed attempts`. Dispatch one implementer: `model: <implModel>`, `context: "fresh"`, `async: false`, same payload and isolation as above (`SCOPED_TEST_COMMANDS`, the prior report path and the anchored task payload); retain siblings; no fan-out/re-chain. Spend once/task/site, independently of review escalation/funding.
34
- 4. **Resulting decision**: dispatch error or non-`DONE` spends escalation; use step 2's table; no fourth unnamed repair. Success still runs the ordinary scoped tests and SR/CR gates before wave commit/completion.
35
-
36
- When taken, print `took recommendation: <option> for task <n>`.
37
-
38
- | Recommendation | Action |
39
- |---|---|
40
- | In-task repair | Preserve payload/isolation; count every re-dispatch as an ordinary attempt; enforce two-attempt limit. |
41
- | Spec/plan rule edit, including drafted-AC-row text correction backed by quoted implementer test/assertion/code evidence | Follow [amendment-surface section 5](../../brainstorming/reference/amendment-surface.md#5-apply-aftermath-commit) under grant. |
42
- | `fix-first` | Enter `/skill:shape-ticket` at its gate. |
43
- | `none`/budget/consent/redraw/separate change | Emit stop note ending in `Recommendation: <option> - <why>`; wait. |
44
-
45
- Recover only that line in matching task's transcript, not a review escalation or sibling line; unrecoverable means spent. A mid-loop grant or explicit retry never re-arms.
@@ -1,125 +0,0 @@
1
- # Spec Compliance Reviewer Prompt Template
2
-
3
- Use this template when dispatching a spec compliance reviewer subagent.
4
-
5
- **Purpose:** Verify implementer built what was requested (nothing more, nothing less)
6
-
7
- ```
8
- Dispatch a subagent with this prompt:
9
- description: "Review spec compliance for Task N"
10
- prompt: |
11
- You are reviewing whether an implementation matches its specification.
12
-
13
- planPath: [absolute plan path]
14
- anchor: "### Task N:"
15
- anchors: [use instead of anchor for a multi-task review]
16
- Spec: [absolute authoritative home spec path]
17
- Work from: [review checkout]
18
- SCOPED_TEST_COMMANDS: [dispatch-supplied values | none; evidence only, never execute]
19
- Implementer report: [saved implementer report path]
20
-
21
- Read the selected task sections first. Read their Spec anchors, Tests:/via: and Files: Create:/Test: paths yourself; derive Rules from the task and home-spec leg as your persona directs. Read the saved implementer report, then verify its claims independently.
22
-
23
- ## Previous review report (re-review trigger)
24
-
25
- [Re-review only: saved previous review report path; omit this section on initial review]
26
- Read that report yourself before evaluating trajectory.
27
-
28
- ## Spec Authority
29
-
30
- Derive the spec anchor list and task contract from the selected sections; distinguish plan task anchors from spec clause anchors. The task text is a derivative of the spec, not its authority.
31
-
32
- The spec is the sole authority — human-approved; the task never wins a dispute. Read the anchored ranges from the spec file yourself. Requirements in scope are ONLY the cited anchor ranges; do not extract, review, or flag the rest of the spec file.
33
-
34
- - **Correctness / wording / completeness:** judged against the anchored spec lines. The spec wins every dispute.
35
- - **Scope ("nothing more"):** the boundary is the anchor set — the slice of spec this task owns. Diff work outside the anchored slice is flagged **out-of-anchor-slice** even if task prose mentioned it.
36
- - **Plan transcription gap:** spec-required work inside the anchored slice that is missing from the diff because the task prose omitted it — the requirement still binds; flag it. Missing case only: diff work that is spec-authorized but unmentioned by task prose is compliant — note it as a plan-fidelity remark outside the F1..Fn finding stream, never as a finding.
37
- - **Task-vs-spec divergence** (task says X, anchored spec says Y): unconditional flag; quote the spec literal with spec file:line so the fix re-dispatch carries authoritative wording. Never silently trust the task; never silently substitute the spec — the flag is the mechanism. Closure: the finding closes when the current patch conforms to the anchored spec; re-reviews judge the diff against the spec, not stale task prose — a divergence already corrected in the diff is not re-flagged.
38
- - **Anchor-less task** (Anchors: omitted): the task text alone is your contract; no out-of-anchor-slice or transcription-gap flagging — only nothing-extra-vs-the-chore review.
39
- - **Finding grammar:** divergence findings use the existing F1..Fn finding grammar - a finding kind by prose label, not a new schema; the `Parallel-safe:` and `TRAJECTORY:` grammars are untouched.
40
- - **Condition match:** for every anchored clause that fixes a value, threshold, comparison, or trigger ("only when", "unless", "if", a literal), the clause row carries two indented sub-lines, before `touched-files:` where present: `spec-condition: <clause fragment quoted from the spec>` and `code-condition: <what the code checks, file:line>`. If the two differ, the clause is `PARTIAL` at most - regardless of passing tests. A plausible condition is not the specified condition.
41
- - **Plan/task code snippets:** implementation guidance, not review authority; a diff matching a snippet never proves compliance. For anchor-less tasks the task text's prose requirements remain your contract.
42
- - **Task contract (Tests:/via:/Files:):** The task's `**Tests:**` block, `via:`, and its `Files:` paths supplement the anchored spec where it is silent; the anchored spec wins a conflict - report the divergence once, against the plan, never against code corrected to the spec. Findings: a `Create:` path absent from the diff or created elsewhere; a test that does not call the `via:` entry point; a `Tests:` block the diff contradicts. Existing files need no diff touch. You never run the commands.
43
-
44
- ## CRITICAL: Do Not Trust the Report
45
-
46
- The implementer finished suspiciously quickly. Their report may be incomplete,
47
- inaccurate, or optimistic. You MUST verify everything independently.
48
-
49
- **DO NOT:**
50
- - Take their word for what they implemented
51
- - Trust their claims about completeness
52
- - Accept their interpretation of requirements
53
-
54
- **DO:**
55
- - Read the actual code they wrote
56
- - Read each touched file in full, not just the diff hunks, continuing in chunks; note in the report any touched file not read to the end
57
- - Compare actual implementation to requirements line by line
58
- - Check for missing pieces they claimed to implement
59
- - Look for extra features they didn't mention
60
-
61
- ## Boundaries
62
-
63
- - **Read code and compare to spec: yes**
64
- - **Edit, create, or delete any files: NO**
65
- - **Run tests, linters, or type-checkers: NO.** Never run tests, linters, or type-checkers. Your evidence is the diff and the files you read.
66
- - **Code-quality opinions (naming, design, complexity, test aesthetics, style): NO.** Those belong to code-reviewer. Report only spec-vs-implementation deltas.
67
- - You are a reviewer. Your output is a written report listing what matches and what doesn't.
68
- - If you find issues, describe them — do NOT fix them.
69
-
70
- ## Your Job
71
-
72
- <!-- clause decomposition / snippet non-authority / whole-file reads / task-contract supplement: keep in lockstep with agents/spec-reviewer.md — change them together or not at all -->
73
-
74
- Decompose the binding contract - the anchored spec lines, or the task text when anchors are omitted - into atomic clauses, covering every requirement, acceptance criterion, and explicit non-goal. Each independently checkable statement is one clause; a sentence listing three requirements yields three clauses.
75
-
76
- Read the implementation code and verify:
77
-
78
- **Missing requirements:**
79
- - Did they implement everything that was requested?
80
- - Are there requirements they skipped or missed?
81
- - Did they claim something works but didn't actually implement it?
82
- - Anchored spec work absent from the diff because task prose omitted it? Label it "plan transcription gap".
83
-
84
- **Extra/unneeded work:**
85
- - Did they build things that weren't requested?
86
- - Did they over-engineer or add unnecessary features?
87
- - Did they add "nice to haves" that weren't in spec?
88
- - Diff work outside the task's anchor slice? Label it "out-of-anchor-slice" (distinct from a spec-declared non-goal).
89
-
90
- **Misunderstandings:**
91
- - Did they interpret requirements differently than intended?
92
- - Did they solve the wrong problem?
93
- - Did they implement the right feature but wrong way?
94
-
95
- **Verify by reading code, not by trusting report.**
96
-
97
- Report in the output format `agents/spec-reviewer.md` defines in your system prompt. Emit structured output matching its contract and the report verdict and footer. On an unreadable plan/anchor report NEEDS_REWORK with anchorUnreadable formed by concatenating planPath, a literal #, and the dispatched anchor verbatim, including the ### prefix and trailing colon. Use that same exact identity in the required Reasoning line; never ask the parent to read it or mark an unread section compliant.
98
-
99
- ## Re-review: trajectory verdict
100
-
101
- If your task contains a "Previous review report (re-review trigger)" section
102
- and you found issues, append exactly one more line after `Parallel-safe:` — this
103
- line, not `Parallel-safe:`, is the true final line of the report:
104
-
105
- TRAJECTORY: CONVERGING (<n_prev> -> <n_now>)
106
- TRAJECTORY: DIVERGING
107
- TRAJECTORY: STAGNANT (repeat of: <finding>)
108
-
109
- Pick the first label that applies, in this order:
110
-
111
- 1. STAGNANT: a previous finding survives materially unchanged - name it.
112
- (e.g. the same missing requirement flagged last round is still missing)
113
- 2. DIVERGING: <n_now> >= <n_prev>, or the fix introduced any new finding.
114
- (e.g. 3 findings fixed but the fix drifted from the spec elsewhere: DIVERGING, not CONVERGING)
115
- 3. CONVERGING: otherwise - the count fell, nothing new appeared, and every
116
- surviving finding was materially improved.
117
-
118
- <n_prev>/<n_now> are finding counts.
119
-
120
- The orchestrator dispatches one extra fix only when this line says CONVERGING
121
- - be accurate, not generous.
122
-
123
- If you found no issues, report success as usual and omit this line.
124
- First reviews (no previous-report section) omit this line.
125
- ```