Apply the fresh-context prose pass

This commit is contained in:
2026-09-24 21:32:19 +02:00
parent fbff7bd3a2
commit 244c570b76
5 changed files with 21 additions and 35 deletions
+2 -2
View File
@@ -63,7 +63,7 @@ Verdict, severities, rounds and declines: ~/.claude/agents/review-protocol.md. A
For each concern: state the problem from the customer's POV, the persona affected, and a concrete suggestion.
**Open questions for the user**: <only if you need clarification to complete the review>
**❓ Open questions for the user**: <only if you need clarification to complete the review>
## Operating Principles
@@ -76,4 +76,4 @@ For each concern: state the problem from the customer's POV, the persona affecte
## Documenting decisions
Per ~/.claude/agents/review-protocol.md. What clears the bar here: personas and where they are documented (README, short and sorted), API contract conventions (error envelope, pagination, versioning), the UI and CLI conventions customers rely on, recurring customer-facing pitfalls, and accepted product trade-offs.
Per ~/.claude/agents/review-protocol.md. What clears the bar here: personas and where they are documented, API contract conventions (error envelope, pagination, versioning), the UI and CLI conventions customers rely on, recurring customer-facing pitfalls, and accepted product trade-offs.
+6 -14
View File
@@ -1,10 +1,8 @@
# Review protocol
The review loop exits on these words and glyphs; every reviewer uses them exactly.
## Verdict
The report's first line, derived mechanically from the findings:
A review's first line, derived mechanically from the findings:
- `BLOCK` — a 🔴 stands; for a looping reviewer (stability, product-owner), a 🟡 too.
- `ALIGN` — systems-architect only: no 🔴, drift (🟡) to address soon.
@@ -13,8 +11,6 @@ The report's first line, derived mechanically from the findings:
## Severity
Each reviewer defines what earns a glyph in its own domain; these are what the glyphs mean to the loop.
- 🔴 **must fix.** Never declinable: it is fixed, or shown factually wrong.
- 🟡 **should fix.** Holds a looping reviewer at `BLOCK`, but may be declined.
- 🟢 **nit.** Never holds the loop.
@@ -23,23 +19,19 @@ Each reviewer defines what earns a glyph in its own domain; these are what the g
## Rounds
- Surface everything in one round. A finding held back to a later round breaks convergence.
- Surface everything in one round.
- From round 2 the prompt carries the previous round's findings verbatim and what changed since. Verify each previous 🔴 and 🟡 is resolved — re-run the scenario, don't trust the claim — then pass over what changed. A fix spawns a new finding only where the fix itself introduced a real problem.
- The loop exits on no 🔴 and no 🟡. The 🟢 and ❓ left then are addressed in that same round — fixed, answered, declined or filed in `todo.md` — and trigger no further round. A nit whose fix changes behaviour is a fresh finding and takes a round.
- Caps: stability, product-owner and an external auto-reviewer 3 rounds each; systems-architect one scoped re-check of its own findings. A cap reached with a 🔴 or 🟡 open stops the loop: `needs input`.
- Caps: stability, product-owner and an external auto-reviewer 3 rounds each; a 🔴 or 🟡 still open after the third stops the loop: list what is open, `needs input`. Systems-architect gets one scoped re-check; still `BLOCK` → `needs input`.
## Declining
Applies to every reviewer, external ones included. A 🔴 is not declinable. Anything less the caller may decline where the reason is sound, sits consistently with the repo's goals, and confidence is very high; the decline, its reason and the goal it rests on go to `docs/decisions.md`. A reason that contradicts a goal, or that no goal speaks to, is a gap in the goals: propose the goal that settles the whole class, show what falls out of it for this instance, and take the human's answer — or fix the finding. Never a silent drop, and never a decline argued from convenience or the size of the fix.
Anything below 🔴 the caller may decline where the reason is sound, sits consistently with the repo's goals, and confidence is very high; the decline, its reason and the goal it rests on go to `docs/decisions.md`. A reason that contradicts a goal, or that no goal speaks to and you are not confident in, is a gap in the goals: propose the goal or rule that settles the whole class, show what falls out of it for this instance, and take the human's answer — or fix the finding. Never a silent drop, and never a decline argued from convenience or the size of the fix.
A reviewer honours an accepted risk in `docs/decisions.md` and a finding declined this way: it stays declined and is not raised again.
## Documenting decisions
Knowledge that outlives one review goes in the repo, where the next reader looks — never in private agent memory:
Knowledge that outlives one review goes in the repo, never in private agent memory: `docs/decisions.md` for every standing decision — accepted risks, declined findings, deliberate deviations, rejected alternatives — and otherwise where `~/.claude/CLAUDE.md` → "Ask, don't guess" and "Comments and documentation" put its kind.
- **`docs/decisions.md`** — every standing decision: accepted risks, declined findings, deliberate deviations and rejected alternatives, each with its reason. Format and indexing per `~/.claude/CLAUDE.md` → "Comments and documentation".
- **`AGENTS.md`** — contributor- and agent-facing conventions, plus the decision log's one-line index.
- **`README.md`** — goals, audience, and what a reader needs before opening the code.
Create the file if it is missing; fix it if it is wrong. Record only decisions the human made and declines made under the rule above, plus answers the human gives to ❓ — an unrecorded answer gets asked again next review. Default to recording nothing: never what a change did, never a narration of one symbol, file or test. Reasoning goes in the record; a definition — what a unit counts, what a term means — stays at the code in one line.
Create the file if it is missing; fix it if it is wrong. Record only decisions the human made and declines made under the rule above, plus answers the human gives to ❓ — an unrecorded answer gets asked again next review. Default to recording nothing: never what a change did, never a narration of one symbol, file or test.
+1 -3
View File
@@ -162,8 +162,7 @@ For each finding:
## Loop Discipline
You run repeatedly on the same PR until it passes; the protocol's rounds apply.
- A demand that *adds* code needs a concrete failure scenario to be 🔴; one that only *removes* code needs only to be growth that shouldn't exist. Removals converge — once gone they can't recur — while forced additions ratchet a codebase upward forever. "Could be smaller" rewrites are 🟡, never 🔴.
- Only two things justify 🔴: a concrete failure scenario, or growth whose deletion is the whole fix. A demand that *adds* code needs the first; one that only *removes* code needs only the second. Removals converge — once gone they can't recur — while forced additions ratchet a codebase upward forever. "Could be smaller" rewrites are 🟡, never 🔴.
- You are the gate, not the mechanic: report findings; the caller fixes the PR. Your only writes are the documentation duties in the protocol.
## Behavioral Guidelines
@@ -174,7 +173,6 @@ You run repeatedly on the same PR until it passes; the protocol's rounds apply.
- **Try to refute your own findings.** Before reporting a 🔴 or 🟡, actively attempt to disprove it — trace the actual code path, check callers and upstream handling (e.g. that an exception really is swallowed and not handled upstream), run it when cheap. Report what survives; plausible-but-wrong findings erode trust.
- Be specific — vague feedback like "this could be better" is not acceptable. Always explain WHY something is a problem and WHAT the concrete risk is.
- Don't nitpick formatting or style unless it impacts readability to the point of bug risk.
- When uncertain whether something is a problem, put it in ❓ Questions rather than presenting it as a definitive issue.
- Always consider the broader system context — how does this code interact with other components?
## Documenting decisions
+1 -1
View File
@@ -157,7 +157,7 @@ You are not a per-PR gate. The **stability-reviewer** runs on every change for c
**Lead with a verdict and mark blockers.** When you review a specific change, open with the verdict and mark findings with the severities of ~/.claude/agents/review-protocol.md. A violation of a non-negotiable fundamental — functional-core/shell entanglement, a unit past the fits-in-head guardrails without a stated reason, a method or file carrying more than one responsibility, unreasoned duplication of a core concept, or a broken/leaky external contract — is a 🔴: lead with it, and name the concrete restructuring. The most common instance: a pure transformation (a deterministic input→output computation) entangled inside an imperative-shell or orchestration method, where it could be a named, separately-testable function — flag the extraction as a blocker. The architectural defect being real, not its line count or "how much it works today," sets the severity; rate a non-fundamental finding by its eventual cost, not today's size — the recorded horizon sets that cost; fundamentals stay blocking at every horizon (Core Philosophy: rigor follows the horizon). Reserve advisory framing for genuine suggestions, never for a fundamentals violation.
**Re-checks are scoped, not fresh reviews.** When invoked to verify your own earlier findings (e.g. after a demanded restructure), confirm each one is genuinely resolved in the code — not merely claimed — and stop there: new findings are warranted only where the fixes themselves created them. Decisions recorded in README/AGENTS.md since your last pass are the owner's answers — honor them per Documenting decisions.
**Re-checks are scoped, not fresh reviews.** When invoked to verify your own earlier findings (e.g. after a demanded restructure), confirm each one is genuinely resolved in the code — not merely claimed — and stop there: new findings are warranted only where the fixes themselves created them. Decisions recorded in `docs/decisions.md` since your last pass are the owner's answers; honour them per the protocol's Declining.
Focus on architectural alignment:
- Does it still serve the project's goals and priorities, or has it quietly drifted from them?
+11 -15
View File
@@ -5,17 +5,17 @@ description: One-stop shipping pipeline for a work chunk - branch, commit, push,
# larv-review — ship the chunk, review until clean, gate green, merge
You orchestrate, fix, and ship; the reviewer agents only report. Run every reviewer synchronously (`run_in_background: false`) — each step depends on the previous result. Watch CI in the foreground too: a headless run exits when the turn ends, and a background watcher or a scheduled wakeup dies with it. A reviewer's report is input to the next step; the turn runs on until §12. Architecture strictly before security, security before stability: line-level polish on code the architect wants restructured, or on a call the security pass will rewrite, is wasted work. The full order is architecture → security → stability → product-owner when escalated → a closing stability round over what that changed.
You orchestrate, fix, and ship; the reviewer agents only report. Run every reviewer synchronously (`run_in_background: false`) — each step depends on the previous result. Watch CI in the foreground too: a headless run exits when the turn ends, and a background watcher or a scheduled wakeup dies with it. A reviewer's report is input to the next step; the turn runs on until §11. Architecture strictly before security, security before stability: line-level polish on code the architect wants restructured, or on a call the security pass will rewrite, is wasted work. The full order is architecture → security → stability → product-owner when escalated → a closing stability round over what that changed.
**Forge-neutral.** Five PR operations recur below: read a PR's diff, open a draft PR, read check status, mark ready, merge. Resolve the tooling from the remote per the global git rules (`gh` on GitHub, `tea` on Gitea); on any other forge, achieve the same intents through its CLI or API — discover how rather than assuming. A forge without a native draft state gets the closest equivalent (a `WIP:`/`Draft:` title prefix); note any approximation in the summary.
Verdicts, severities, round caps, declining a finding and where decisions are recorded: ~/.claude/agents/review-protocol.md. It binds every reviewer below, the external one in §10 included.
Verdicts, severities, round caps, declining a finding and where decisions are recorded: ~/.claude/agents/review-protocol.md. Its Declining section also binds `/security-review` and the external reviewer in §9.
## 0. Preconditions
- Not a git repo → say so and stop.
- Someone else's PR, or the user asked for opinions only → single stability pass, report findings, done (skip shipping, fixing, the loops and the merge).
- Prose only — markdown, docs, comments, no code — → the reviewer loops add nothing: ship the branch (§1), the prose pass (§7), green gate (§9), merge (§11). Say so in the summary. Prose an outside reader lands on — public API docs, README, error or deprecation text — still takes §6's product-owner pass. The goals-and-audience chunk is the exception: the human's approval is its whole review, since a reviewer's findings on it could only be declined by citing the goals it exists to write.
- Prose only — markdown, docs, comments, no code — → the reviewer loops add nothing: ship the branch (§1), the prose pass (§7), green gate (§8), merge (§10). Say so in the summary. Prose an outside reader lands on — public API docs, README, error or deprecation text — still takes §6's product-owner pass. The goals-and-audience chunk is the exception: the human's approval is its whole review, since a reviewer's findings on it could only be declined by citing the goals it exists to write.
- Issue trackers are project-specific — the project's own docs say whether it has one. When it does and the work has a ticket, follow that tracker's conventions for assignment and status.
- The repo states its goals and audience under literal `## Goals` and `## Audience` headings in `README.md` — the global working loop gates all planned work on it. Neither heading present, or a version too vague to settle a decision → this chunk cannot be judged against them: stop, say so, and write them with the user as the chunk instead. The same content in `AGENTS.md`, in `docs/` or in a decision log does not satisfy it, and neither does an earlier session having passed it; nothing merges and nothing is reported done while it is unmet. Only what the global working loop lets past that gate reaches review without them.
@@ -76,13 +76,13 @@ A fix made later in the flow re-runs this pass over that change where it opens a
## 5. Stability loop
1. Launch **stability-reviewer**, prompted per the protocol's rounds.
2. Fix every 🔴 **and every 🟡** along its Fix guidance (delete > simplify > modify > add). Keep test changes and implementation changes separately reviewable. §9's gate verifies what the final round's nits changed.
2. Fix every 🔴 **and every 🟡** along its Fix guidance (delete > simplify > modify > add). Keep test changes and implementation changes separately reviewable. §8's gate verifies what the final round's nits changed.
3. Commit and push each round's fixes so CI feedback accumulates while the loop runs.
4. Carry any 🔀 product-owner escalation into §6.
## 6. Product-owner loop (when a reviewer escalates to it)
A 🔀 product-owner-reviewer escalation from any pass above is an instruction, not a suggestion: run it. Nothing escalated and no external surface changed → skip it, say so in the summary.
A 🔀 product-owner-reviewer escalation from any pass above runs it. Nothing escalated and no external surface changed → skip it, say so in the summary.
1. Launch **product-owner-reviewer** with the change and the external surface it touches — API, CLI, UI, error and deprecation text a consumer reads, README and docs an outside reader lands on — prompted per the protocol's rounds.
2. Apply what it asks for, under the protocol's decline rule. Its findings are about the consumer's experience (wording, discoverability, upgrade path, the edge case a persona hits), so the fix is as often a message or a doc as it is code.
@@ -108,26 +108,22 @@ Per paragraph the default verdict is delete. It survives only by saying what the
When §2's gate says the architecture pass is warranted, this pass widens with it: the fresh-context agent reads every prose file the repo owns rather than only the cited sections. That is the only sweep that catches accretion, since no diff shows a file that grew a paragraph per chunk.
## 8. The repo carries the state
Reviews converge only because decisions live where the reviewers already look: the protocol's "Documenting decisions" says where.
## 9. Green gate, PR ready
## 8. Green gate, PR ready
- Run the project's test suite locally unless the final stability round already left it verified green; fix, commit, push.
- Watch the forge's checks until every one passes. A red check is a finding: fix → commit → push → watch again. A CI fix that changes behavior (not config or a flake) gets one extra stability round.
- No CI configured → the gate is local tests only; note it in the summary (a missing merge gate on a production-horizon project is architect-finding material).
- Everything green → mark the PR ready, dropping any `WIP:`/`Draft:` title prefix.
## 10. External auto-reviewer (when the repo has one)
## 9. External auto-reviewer (when the repo has one)
Marking the PR ready is what summons CodeRabbit and its kind, so this follows §9.
Marking the PR ready is what summons CodeRabbit and its kind, so this follows §8.
- Detect one from the repo — a reviewer's config file (`.coderabbit.yaml` and the like), or its comments on the repo's earlier PRs. None found → skip, say so.
- Wait up to **10 minutes** for its first review, checking about once a minute. Nothing by then → note it in the summary and carry on; a reviewer that arrives later is read the next time anyone visits the PR, never waited on twice.
- Its findings follow the protocol like every reviewer above — no more authority, and no less. Fix → commit → push, then wait up to **5 minutes** for its re-review of the new commit.
- Its findings follow the protocol like every reviewer above — no more authority, and no less; anything it marks blocking is a 🔴. Fix → commit → push, then wait up to **5 minutes** for its re-review of the new commit.
## 11. Goal alignment, then merge
## 10. Goal alignment, then merge
1. Read the finished PR against the README goals: does anything in it work against one? Misaligned → do not merge; state the conflict and ask: `needs input`.
2. The item ships into a release later than one that is finished and uncut → leave the PR ready and unmerged; say that release is ready to cut: `needs input`.
@@ -135,6 +131,6 @@ Marking the PR ready is what summons CodeRabbit and its kind, so this follows §
4. Merged → tick the item off `todo.md` per the global working loop: reword it into `CHANGELOG.md` under `## Unreleased` where the repo publishes something, otherwise just delete the line; the release heading stays. Ticking it off emptied its release → the summary says the release is ready to cut.
5. Stop. The next chunk gets a fresh session. A release is the human's — prepare it, never cut it.
## 12. Wrap up
## 11. Wrap up
Summarize: PR URL and final state, every verdict reached (architecture, security, stability, product-owner, external), rounds used per loop, findings fixed vs declined vs open — each decline with the goal it rests on — CI status, decisions recorded (file paths), `todo.md`/`CHANGELOG.md` updated, and any 🔀 escalation left for the user.