diff --git a/AGENTS.md b/AGENTS.md index 07ebf5e6..508e1a6c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -29,3 +29,5 @@ Decisions live in `docs/decisions.md`: - workflow changes: a change merges only once three planned benches rule it better - chunk: as large as one purpose allows - loop-claude: a cycle's states cover only its progress, and a returned `Stop` ends the cycle +- review: `/security-review` is the security pass of record +- review: the premises chunk's whole review is the human's approval diff --git a/agents/principles-auditor.md b/agents/principles-auditor.md index f64b27b5..1fc96d1f 100644 --- a/agents/principles-auditor.md +++ b/agents/principles-auditor.md @@ -6,7 +6,7 @@ tools: Read, Grep, Glob You check one yardstick against the whole project, never a diff, in every round: every principle in the file you are handed, or every goal under the project's `README.md` → `## Goals`. -Verdict, severities, rounds and declines: ~/.claude/skills/larv-review/review-findings.md. Read the yardstick, `README.md`, `docs/decisions.md` and `todo.md` first, then all of the project's code, config, tests and CI. +Verdict, severities and rounds: ~/.claude/skills/larv-review/review-findings.md. Read the yardstick, `README.md`, `docs/decisions.md` and `todo.md` first, then all of the project's code, config, tests and CI. - Per principle or goal: every place the project departs from it, with file:line, the defect in one sentence and its concrete consequence. Then one line: followed, mostly, not followed, or does not apply and why. - A departure a `todo.md` item plans away is named with that item, not raised. diff --git a/agents/product-owner-reviewer.md b/agents/product-owner-reviewer.md index 739acafc..c20dc83c 100644 --- a/agents/product-owner-reviewer.md +++ b/agents/product-owner-reviewer.md @@ -45,7 +45,7 @@ Before anything else, **read the shared principles** at `~/.claude/principles/`. ## Your Output Format -Verdict, severities, rounds and declines: ~/.claude/skills/larv-review/review-findings.md. After the verdict: +Verdict, severities and rounds: ~/.claude/skills/larv-review/review-findings.md. After the verdict: **Surface affected**: diff --git a/agents/prose-reviewer.md b/agents/prose-reviewer.md index 9496453b..a8008698 100644 --- a/agents/prose-reviewer.md +++ b/agents/prose-reviewer.md @@ -6,7 +6,7 @@ tools: Read, Grep, Glob You read the prose as someone who did not write it: you see only what it says, never what the author meant. -The bar: `~/.claude/CLAUDE.md` → "Prose" and "Comments and documentation". Read both each time — they change. Verdict, severities, rounds and declines: ~/.claude/skills/larv-review/review-findings.md. +The bar: `~/.claude/CLAUDE.md` → "Prose" and "Comments and documentation". Read both each time — they change. Verdict, severities and rounds: ~/.claude/skills/larv-review/review-findings.md. ## Checks, in priority order diff --git a/agents/stability-reviewer.md b/agents/stability-reviewer.md index e0f82235..555fd386 100644 --- a/agents/stability-reviewer.md +++ b/agents/stability-reviewer.md @@ -128,7 +128,7 @@ Every PR gets at least this sweep. ## Output Format -Verdict, severities, rounds and declines: ~/.claude/skills/larv-review/review-findings.md. After the verdict, a short **Coverage & Verification** block: what you ran (tests, static analysis — and their results), what you could not verify and why, and any files that got a lighter pass — never let silence imply coverage. Then the findings, most severe first, each with: +Verdict, severities and rounds: ~/.claude/skills/larv-review/review-findings.md. After the verdict, a short **Coverage & Verification** block: what you ran (tests, static analysis — and their results), what you could not verify and why, and any files that got a lighter pass — never let silence imply coverage. Then the findings, most severe first, each with: - **Location**: File and line/function - **Issue**: Clear description of the problem - **Risk**: What could go wrong in production diff --git a/docs/decisions.md b/docs/decisions.md index 117c42ba..6e427cae 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -82,7 +82,7 @@ ## review: an ask no user answers leaves the PR unmerged -2026-09-30, claude. Serves goal 4: the round cap, a BLOCK's restructure, Stage 0's questions and a goal conflict are the human's call, and an unmerged PR is what brings it to them; merging would make the call for them. Where an option reviews more — run the pass, fix under the floor, fix a finding no goal lets the run decline — the run takes it; a ❓ or a prose fix changing a goal or a decision is filed in `todo.md`, which reaches the human without holding the chunk. Valid while a human reads every unmerged PR an unattended run leaves. +2026-09-30, claude. Serves goal 4: the round cap, a BLOCK's restructure, Stage 0's questions and a goal conflict are the human's call, and an unmerged PR is what brings it to them; merging would make the call for them. Where an option reviews more — run the pass, fix under the floor, fix a finding no goal lets the run decline — the run takes it; a ❓, or a fix changing a goal or a decision, is filed in `todo.md`, which reaches the human without holding the chunk. Valid while a human reads every unmerged PR an unattended run leaves. ## review: the architecture pass audits every principle and goal over the whole project, and a release's last chunk fires it @@ -107,3 +107,11 @@ ## loop-claude: a cycle's states cover only its progress, and a returned `Stop` ends the cycle 2026-10-01, larv-review. Applies "Always use explicit state machines". A `Stop` ends the process, so no later state could act on it. A `Stopped` state would add an event and a transition that nothing reads. Valid until a cycle must act after a `Stop`, as `todo.md`'s "Archive the transcript as each cycle ends" would. + +## review: `/security-review` is the security pass of record + +2026-09-20, lilleman. Serves goal 4.1. Its value is a tuned exclusion list and a ≥0.8 confidence floor, which a hand-written reviewer would reproduce worse. Valid while `/security-review` ships both. + +## review: the premises chunk's whole review is the human's approval + +2026-09-20, lilleman. Serves goal 4.1. A reviewer's finding on that chunk could only be declined by citing the goals the chunk exists to write. Valid while every decline must name a goal or a technical principle. diff --git a/skills/larv-review/SKILL.md b/skills/larv-review/SKILL.md index 6740e154..0e694e45 100644 --- a/skills/larv-review/SKILL.md +++ b/skills/larv-review/SKILL.md @@ -9,7 +9,7 @@ You orchestrate, fix, and ship; reviewers only report. Run every reviewer synchr **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 `~/.claude/CLAUDE.md` → "Git, commits, and PRs"; 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. -Words: `~/.claude/CLAUDE.md` → "Vocabulary". Findings, for every reviewer: ~/.claude/skills/larv-review/review-findings.md. +Words: `~/.claude/CLAUDE.md` → "Vocabulary". What a reviewer reports: ~/.claude/skills/larv-review/review-findings.md; how you resolve it: §3 → "Findings". **An ask** holds only what it asks about; the rest runs on while it waits. No user reachable (a headless run) → finish the rest, then leave the PR unmerged with the question and your recommendation in the summary, unless the ask's rule names another branch. @@ -17,7 +17,7 @@ Words: `~/.claude/CLAUDE.md` → "Vocabulary". Findings, for every reviewer: ~/. - Not a git repo → say so and stop. - Someone else's PR, or the user asked for opinions only → one stability run, report its findings, done. -- **Premises first**, per `~/.claude/CLAUDE.md` → "Working loop". Missing → this chunk cannot be judged: stop, say so, and write them with the user as the chunk instead. That chunk's whole review is the human's approval, since a reviewer's findings on it could only be declined by citing the goals it exists to write; a later change to a goal is reviewed like any chunk. +- **Premises first**, per `~/.claude/CLAUDE.md` → "Working loop". Missing → this chunk cannot be judged: stop, say so, and write them with the user as the chunk instead. That chunk's whole review is the human's approval; a later change to a goal is reviewed like any chunk. - 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. ## 2. Ship the branch (idempotent — skip whatever already exists) @@ -28,14 +28,14 @@ Follow `~/.claude/CLAUDE.md` → "Git, commits, and PRs". Never commit to the de | Pass | Reviewer | Trigger | |------|----------|----------------------------------------| -| Architecture, then the principles audit and the comprehension floor | systems-architect, then principles-auditor and the `comprehension-panel` scoring run | carries an architectural decision: a new, restructured or moved component, module, service or boundary; a new dependency or first use of an infrastructure pattern (queue, cron, cache, websocket, …); a new or changed external contract (routes, request/response shapes, events, webhooks, published file formats); a schema change beyond an additive column; the chunk shipping its release's last item | +| Architecture, then the principles audit and the comprehension floor | systems-architect, then principles-auditor and the `comprehension-panel` scoring run | carries an architectural decision: a new, restructured or moved component, module, service or boundary; a new dependency or first use of an infrastructure pattern (queue, cron, cache, websocket, …); a new or changed external contract (routes, request/response shapes, events, webhooks, published file formats, CLI flags and exit codes); a schema change beyond an additive column; the chunk shipping its release's last item | | Security | `/security-review` | changes code or config; a fix, only where it opens an untrusted-input boundary or touches authn/authz, secrets or crypto | | Full security scan | the `claude-security` plugin (`/claude-security` → "Scan changes") | touches authn/authz, secrets or crypto, opens an untrusted-input boundary, or adds an external surface | | Stability | stability-reviewer | changes code, config or tests; a fix, only where it changes behaviour: what the code or its tests do | | Product-owner | product-owner-reviewer | changes an external surface: API, CLI, UI, error or deprecation text a consumer reads, README and docs an outside reader lands on | | Prose | prose-reviewer | every chunk; a fix, where it touches prose | -A comment is prose, not code. Passes run in this order: line-level polish on code the architect wants restructured, or on a call the security pass will rewrite, is wasted work. A 🔀 escalation runs the named pass once the current pass is done. +A comment is prose, not code. Passes run in this order: line-level polish on code the architect wants restructured, or on a call the security pass will rewrite, is wasted work. **Record, then ask** — for the architecture pass and the full scan: @@ -50,7 +50,7 @@ A comment is prose, not code. Passes run in this order: line-level polish on cod 2. The architecture pass's round is the architect (unless skipped), the principles audit and the scoring run, so a fix to any of their findings reruns the whole round. 3. The external auto-reviewer (§4) is a pass of its own, each review it posts a round. 4. From round 2, prompt an agent under `~/.claude/agents/` with the previous round's findings verbatim and what changed since. -5. A pass is done on no 🔴 and no 🟡. The round that finishes it addresses each 🟢 and ❓ left: fixed, answered, declined or filed in `todo.md`. A ❓ only the user can answer is asked; no user reachable → filed. +5. A pass is done when its latest round leaves no 🔴 or 🟡 standing: none was reported, or each was shown factually wrong, declined or filed per "Findings". Resolve that round's 🟢s and ❓s per "Findings" too. 6. A pass takes at most three rounds per chunk. Instead of a fourth, list what is open and ask the user. For the auto-reviewer, ask before the push that would summon its fourth, and hold the fixes unpushed until the answer. 7. A yes grants that pass one more round, after which the ask repeats; a no leaves the PR unmerged. @@ -59,6 +59,16 @@ A comment is prose, not code. Passes run in this order: line-level polish on cod 1. A fix is a change no pass has seen, a 🟢's or ❓'s included. 2. A round's fixes re-enter together: run, in table order, each pass whose trigger they fire, a done pass included, and each pass whose 🔴 or 🟡 they answer; a pass at its cap gets "Round cap" rule 6's ask instead. Then §4. +**Findings.** + +1. A finding outside the chunk's change is filed in `todo.md`, under a release, whatever its pass or severity. A verified security HIGH is handled per "Security". +2. A fix that would change a goal, or a decision the repo held before the chunk began, is asked; no user reachable → filed, the goal or decision left as is. +3. A 🔴 is fixed, or shown factually wrong, with what disproved it recorded in `docs/decisions.md`. Never declined. +4. A 🟡 is fixed, shown factually wrong like a 🔴, or declined. Decline one only where the reason is sound, consistent with the goals and the technical principles, and confidence is very high; the decline, its reason and the goal or technical principle it rests on go to `docs/decisions.md`. A reason neither speaks to is a gap in the goals: fix the finding, or ask per `~/.claude/CLAUDE.md` → "Working loop", "Ask, don't guess"; no user reachable → fix. Never drop one silently, and never decline one for convenience or the size of the fix. +5. A 🟢 or ❓ is fixed, answered, declined in the summary with its reason, or filed. Answer one where the code, a test or a record settles it, and quote what in the summary. A ❓ only the user can answer is asked; no user reachable → filed. +6. A 🔀 runs the named pass once the current pass is done. +7. Other reviewers map onto this scale: `/security-review`'s HIGH is 🔴, MEDIUM 🟡, LOW 🟢; what a forge's auto-reviewer marks blocking is 🔴. A finding of theirs repeating one declined or filed does not stand. + ### Architecture Launch systems-architect: review the system as a whole entered through this change; the decision log carries previously accepted decisions to honor, the README the goals and Stage 0 artifacts. @@ -66,13 +76,13 @@ Launch systems-architect: review the system as a whole entered through this chan - **Stage 0 questions returned**: relay them to the user, record the answers in the README, re-run once. - **BLOCK** → confirm with the user first when the restructure materially reshapes their PR; until confirmed, no later pass runs. -Then the principles audit: one principles-auditor per file in `~/.claude/principles/` and one for the README's goals, each over the whole project in every round. A finding outside the chunk is filed in `todo.md`; a 🔴 on a decision is asked, since the decision is the user's. +Then the principles audit: one principles-auditor per file in `~/.claude/principles/` and one for the README's goals, each over the whole project in every round. Then the comprehension floor: the `comprehension-panel` skill's scoring run (`~/.claude/skills/comprehension-panel/SKILL.md` → "The scoring run") over the whole project, not the diff. With any dimension or the overall below 7.0 the chunk does not merge: fix the places the seats name under the capping dimension, or take the user's explicit decision to ship under the floor, record it in `docs/decisions.md` with the scores, and file the places in `todo.md`. No user reachable → fix. At the floor or above, the scores are still a ratchet — a later chunk may not lower any — and the four dimension scores and the overall go in the summary so the next run can see the direction of travel. ### Security -`/security-review` over the branch diff is the pass of record: its value is a tuned exclusion list and a ≥0.8 confidence floor, which a hand-written reviewer would reproduce worse. +`/security-review` over the branch diff is the pass of record. A verified HIGH inside this chunk's blast radius is fixed here, outside it on its own branch and PR with this chunk waiting behind it. Say which. @@ -86,7 +96,7 @@ Launch the reviewer with the change — product-owner-reviewer also with the ext ### Prose -Launch prose-reviewer with what the diff touched and every section this review cited — a reviewer's finding, your decline or the implementer's decision quoted it — each with the code it governs, and say whether the architecture pass ran. Its fixes land in this chunk, except one changing a goal or a decision: that is asked; no user reachable → filed in `todo.md`, the prose left as is; a split or index bigger than the chunk is a `todo.md` item naming the section and what the hunt costs. +Launch prose-reviewer with what the diff touched and every section this review cited — a reviewer's finding, your decline or the implementer's decision quoted it — each with the code it governs, and say whether the architecture pass ran. Fix what the chunk touched. A finding on a cited section the chunk did not touch, or on any other prose file, is outside the chunk. A split or index bigger than the chunk is filed as a `todo.md` item naming the section and how long a reader searches it. ## 4. Gate diff --git a/skills/larv-review/review-findings.md b/skills/larv-review/review-findings.md index ab25e09c..f0e135d5 100644 --- a/skills/larv-review/review-findings.md +++ b/skills/larv-review/review-findings.md @@ -2,22 +2,15 @@ Words: `~/.claude/CLAUDE.md` → "Vocabulary". -A reviewer reads and reports; it edits nothing. Read `docs/decisions.md` and `todo.md` first: a finding declined in the one or filed in the other is not raised again, unless the decline works against a goal or a technical principle and names no `todo.md` item ending it. +A reviewer reads and reports; it edits nothing. Read `docs/decisions.md` and `todo.md` first: a finding declined or disproved in `docs/decisions.md`, or filed in `todo.md`, is not raised again, unless the decline works against a goal or a technical principle and names no `todo.md` item ending it. ## Severity -- 🔴 **must fix** — a goal, a principle or correctness broken. Fixed; outside the chunk, filed in `todo.md`; or shown factually wrong, with what disproved it recorded in `docs/decisions.md`. Never declined. -- 🟡 **should fix** — worse than it needs to be. Fixed, declined, or — outside the chunk — filed in `todo.md`. -- 🟢 **nit** — fixed, answered, declined in the summary with its reason, or filed in `todo.md`. +- 🔴 **must fix** — a goal, a principle or correctness broken. +- 🟡 **should fix** — worse than it needs to be. +- 🟢 **nit**. - ❓ **question** for the author: a finding you could not confirm goes here, not above. -- 🔀 **escalation** — names the reviewer whose concern it is (`product-owner-reviewer`, `systems-architect` or `/security-review`) and why, in one line. The orchestrator runs it. - -A 🟢 or ❓ is answered where the code, a test or a record settles it: the summary quotes what. - -Other reviewers map onto this scale, and a finding of theirs repeating one declined or filed does not stand: - -- `/security-review`: HIGH is 🔴, MEDIUM 🟡, LOW 🟢. -- A forge's auto-reviewer: what it marks blocking is 🔴. +- 🔀 **escalation** — names the reviewer whose concern it is (`product-owner-reviewer`, `systems-architect` or `/security-review`) and why, in one line. ## Verdict @@ -31,7 +24,3 @@ A review's first line, derived from the findings: - Handed no earlier findings: surface everything. - Handed an earlier round's findings: verify each 🔴 and 🟡 is resolved — re-run the scenario, never trust the claim — then review what changed. A fix raises a new finding only where the fix itself introduced a real problem. - -## Declining - -A 🟡 may be declined where the reason is sound, consistent with the goals and the technical principles, and confidence is very high. The decline, its reason and the goal or technical principle it rests on go to `docs/decisions.md`. A reason neither speaks to is a gap in the goals: fix the finding, or ask per `~/.claude/CLAUDE.md` → "Working loop", "Ask, don't guess", which also says where the user's reply to a ❓ lands; no user reachable → fix. Never a silent drop, and never a decline argued from convenience or the size of the fix. diff --git a/todo.md b/todo.md index 307bce44..652a5f63 100644 --- a/todo.md +++ b/todo.md @@ -8,7 +8,6 @@ The rebuild's design sketches, the blind judges' verdicts on them and what to ta The panels on `rebuild` at 8585257 and on PR #182 named these under Self-sufficiency and Locality, the two dimensions under the floor. Scores: `docs/decisions.md` → "comprehension floor". -- **Give larv-review §3's rules one home per rule.** Every seat of the 2026-10-01 panel needed `SKILL.md`, `review-findings.md` and `CLAUDE.md` open to apply one rule of "Round cap" or "Re-entry". Goal 4.1. - **Name `loop_claude`'s modules and words by what each holds.** The 2026-10-01 panel misread `formats.py` (it holds every Claude Code shape, `mark_trusted` and `models_in` included), `steps.py`, `outcome.py` and `human_needed.py`. "Project", "transcripts", "verdict" and "model" each name two or three things. Goal 4.1. - **State in `reload.py` why a loop reloads its own script, and tie each exit-1 clause of `--help` to the `Stop` that produces it.** Two seats found the reload's purpose nowhere in the code, and one could keep the exit contract true only by grepping every `Stop(1`. Name what a reload could not read, and its likely cause, in both `--help` and the reload's error: "loop run" is defined nowhere a reader looks. Goal 4.1. @@ -20,13 +19,9 @@ The panels on `rebuild` at 8585257 and on PR #182 named these under Self-suffici - **Give principles-auditor and prose-reviewer a way to list the project's files.** In the 2026-09-30 audit run their `tools: Read, Grep, Glob` gave them only Read. Each read the files that imports and `.gitignore` named, and listed the files it could not reach. Goal 4.1. - **Move what `loop-claude` writes out of `~/.claude.json`, and ask the human about each write that must stay.** Claude Code owns that file and writes it. `trust` reads it, changes it and writes it back, so a write that lands in between is lost. Goal 4.1. - **Make the small changes filed against the review's rules.** Goals 4.1 and 4.4. - - larv-review §3: name CLI flags and exit codes among the external contracts that fire the architecture pass, or record that they do not. The product-owner row names the CLI; the architecture row does not. - - `review-findings.md`: give a 🟡 shown factually wrong the 🔴's way out. Today it can only be fixed, declined on a goal, or filed. - Make the contributor a standing member of every project's audience. A project drops them only where its `## Audience` says maintainability does not matter. State that in `CLAUDE.md`'s goals-and-audience rule, and have larv-review's comprehension floor name the contributor as the reader it serves. The floor then gates every chunk while the contributor stands, and a project that drops them skips it. - - Have larv-review's prose pass fix only what the chunk touched, and file the rest per `CLAUDE.md` → "Working loop". Today its fixes land "in this chunk", including cited sections and the sweep that runs with the architecture pass. In the 2026-09-30 bench, rebuild's costliest runs sprawled outside the chunk: one deleted README facts, and one took 13 rounds on the mypy case where main took 6–7 for the same fixes. Source: `~/code/claude-handoffs/claude-config/2026-09-30/bench/comparison.md`. - **Clean up the rules, skills, agents, plan and decision log.** Goal 4.1. - `docs/decisions.md`: give the comprehension-floor and vocabulary entries a premise that has not expired. Both say "Valid until the next scoring run", and every run since has passed it. Put the floor's rule first and its runs' scores in a table. - - larv-review: move its reasons for `/security-review` and for the premises chunk's review into `docs/decisions.md`. They are rejected alternatives, which the decision log holds. - `comprehension-panel`: cut the run history and the restated description. They carry nothing the instructions need. - `systems-architect.md`: cut the "one home" line, and break Reasonability Review's steps 4 and 5 into shorter points each. - **Sort `bin/`'s imports on their first binding, and say in `principles/technical-principles.md` → "Deterministic order" how case sorts and which groups Python has.** Today they sort by path, so moving a module reorders unchanged lines. The principle's "host packages" names no Python group. Goal 4.1.