State larv-review's re-entry rules once

This commit was merged in pull request #21.
This commit is contained in:
2026-09-24 23:21:36 +02:00
parent dbb228ad3b
commit 8301e387e1
6 changed files with 20 additions and 8 deletions
+13 -6
View File
@@ -11,6 +11,17 @@ You orchestrate, fix, and ship; the reviewer agents only report. Run every revie
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.
## Re-entry
A fix made in any pass is a change the passes before it never saw. It re-enters:
- §3 only where it fires a §2 signal of its own (a new dependency, a new module, a moved boundary).
- §4 only where it opens a new untrusted-input boundary or touches authn/authz, secrets or crypto.
- §5 wherever a later step names it (§6.5, §8), prompted with the fix's scope and why it changed.
- §6 where it changed an external surface or a reviewer escalated 🔀 to it, as at first entry.
A re-entry is a new loop with its own round cap.
## 0. Preconditions
- Not a git repo → say so and stop.
@@ -56,8 +67,6 @@ Launch **systems-architect**: review the system as a whole entered through this
- **ALIGN** → apply what is cheap now; ask the user about the rest — each item becomes a fix, a ticket, or a documented decision, never a silent drop.
- **APPROVE** / **APPROVE WITH NITS** → proceed; nits per the protocol's rounds.
It does not re-run for what the loops below change: nothing a security, stability or consumer-experience fix decides is architectural. A fix that fires a §2 signal of its own — a new dependency, a new module, a moved boundary — goes through §2's trigger again and runs the pass once more.
## 4. Security pass (whenever the chunk changed anything but test code)
Run the built-in **`/security-review`** skill over the branch diff. It is the pass of record here: its value is a tuned exclusion list and a ≥0.8 confidence floor, which a hand-written reviewer would reproduce worse.
@@ -67,8 +76,6 @@ Run the built-in **`/security-review`** skill over the branch diff. It is the pa
- **LOW** → treat as a 🟢.
- A **MEDIUM or LOW** outside this chunk's scope → a `todo.md` item at the top under `## Security`, naming the exposure and the path it reaches, per `~/.claude/CLAUDE.md` → "Todo items". Say whether it is in this chunk's blast radius; filing it is not fixing it.
A fix made later in the flow re-runs this pass over that change where it opens a new untrusted-input boundary, or touches authn/authz, secrets or crypto.
**Escalate to a full scan** — the `claude-security` plugin (`/claude-security` → "Scan changes"), first-party and agent-verified — when the change touches authn/authz, secrets or crypto, a new untrusted-input boundary, or a new external surface. Same shape of judgment as §2's trigger: a signal with no record behind it, and a user reachable, is an ask. The plugin is not enabled by default; unavailable → say so in the summary rather than substituting a hand-rolled pass.
**Do not over-read a clean result.** This pass is single-repo and static: it does not trace authorization across services, does not run the application, and deliberately excludes dependency CVEs in third-party libraries — Renovate/Dependabot owns those, per `~/.claude/CLAUDE.md` → "Working with the codebase". Never point an automated reviewer or scan at an untrusted fork's PR content; a PR body is untrusted input to it (CVE-2025-59536, CVE-2026-21852).
@@ -88,7 +95,7 @@ A 🔀 product-owner-reviewer escalation from any pass above runs it. Nothing es
2. Apply what it asks for, under the protocol's Declining section. 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.
3. Commit and push each round; it exits and caps per the protocol.
4. Approved having changed nothing → you are done here; there is nothing to re-verify.
5. Otherwise close with one **stability-reviewer** round over what this loop changed, prompted with that scope and why it changed. 🔴 or 🟡 → back into §5 for those findings, then this step again. Architecture (§3) and security (§4) do not re-run for the consumer-experience change itself; a fix made here that fires a signal of its own — a new dependency, a moved boundary, a new untrusted input — goes through their triggers as any other change would.
5. Otherwise re-enter §5 over what this loop changed.
## 7. Prose pass (every chunk)
@@ -109,7 +116,7 @@ When §2's trigger says the architecture pass is warranted, this pass widens wit
## 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.
- 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) re-enters §5.
- 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.