From 9d653771766d79989a9ea84ee445c1cf22264dbe Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 15 Oct 2026 00:03:41 +0200 Subject: [PATCH] =?UTF-8?q?Answer=20prose=20round=201:=200=20=F0=9F=94=B4,?= =?UTF-8?q?=206=20=F0=9F=9F=A1;=20state=20where=20seats=20and=20the=20secu?= =?UTF-8?q?rity=20pass=20run=20above=20the=20project's=20rung,=20and=20cla?= =?UTF-8?q?rify=20the=20routing=20decision,=20help=20and=20changelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 2 +- CHANGELOG.md | 2 +- bin/loop_claude/cycle/prompts.py | 2 +- bin/loop_claude/loop/main.py | 23 ++++++++++++----------- bin/loop_claude/routing.py | 4 ++-- docs/decisions.md | 6 ++++-- todo.md | 6 +++--- 7 files changed, 24 insertions(+), 21 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index d2180090..0a42931b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,7 +33,7 @@ Decisions live in `docs/decisions.md`: - worker: a chunk's worker writes the simplest change that solves its item, test first wherever a test can check the change, and reads a technical principle only where the item, a finding or its own record names it; larv-review's reviewers hold the change to the principles and to the standards in `skills/larv-review/standards/` - review: stability and product-owner report only a defect, a broken requirement of the plan or the goals, a breach of a technical principle, or for stability a hard place the change touches; each architect finding names a later change the PR makes harder; prose runs only on a chunk that changes prose - review: the stability pass mutation-tests the lines a chunk changes, in place of measuring test coverage -- routing: one ladder of (model, effort) rungs, ordered by the Artificial Analysis Intelligence Index with Fable 5.1 at max on top; a task's R + C picks a rung by fixed bands, counted from the cheapest rung of the project's model, and a chunk's worker below that rung keeps its reviewers on it +- routing: one ladder of (model, effort) rungs, ordered by the Artificial Analysis Intelligence Index with Fable 5.1 at max on top; a task's R + C picks a rung by fixed bands, counted from the cheapest rung of the project's model, and a chunk's worker may run below that rung, launching its reviewers on that rung ## Working rules diff --git a/CHANGELOG.md b/CHANGELOG.md index 9dfe8b1a..6821397f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- `loop-claude` routes each chunk's worker on a ladder of model and effort rungs, from Haiku 5.5 at low effort to Fable 5.1 at max, when the project's model is on it. As a chunk starts, the R + C of `todo.md`'s top item in the next release picks the rung: 11–12 one rung above the project's model, which for Opus 5.5 is Opus 5.5 at high effort, and so on up to four rungs. An item of R + C 10 or less runs the worker at or below the project's model's cheapest rung, which for Opus 5.5 is medium effort, below the xhigh `settings.json` sets; R + C 6 or less runs it on Haiku 5.5, and 7–8 on Sonnet 5.5 at high. While the worker runs below that rung, it launches every reviewer, comprehension seat and security pass, the full scan included, in a subagent on that rung. It steps up one rung after every second unfinished verdict on a chunk, and to a higher rung when it takes in an item of higher R + C. Each cycle's header, and each finished or unfinished verdict, stop and step-up in the archive, name the worker's rung; a rerun resumes an open chunk on the latest rung archived for it. `docs/decisions.md` → `routing:` gives the ladder, its source and the bands. Expect a chunk on an easy item to cost much less than under xhigh, and perhaps to take more review rounds, and one on an item of R + C 15 or more to cost more. +- `loop-claude` routes each chunk's worker on a ladder of model and effort rungs, from Haiku 5.5 at low effort to Fable 5.1 at max, when the project's model is on it. As a chunk starts, the R + C of `todo.md`'s top item in the next release picks the rung: 11–12 picks one rung above the project's rung, so Opus 5.5 at high for an Opus 5.5 project, and so on up to four rungs. An item of R + C 10 or less runs the worker at or below the project's model's cheapest rung, which for Opus 5.5 is medium effort, below the xhigh `settings.json` sets. While the worker runs below the project's model's cheapest rung, it launches every reviewer, comprehension seat and security pass, the full scan included, in a subagent on that rung. It steps up one rung after every second unfinished verdict on a chunk, and to a higher rung when it takes in an item of higher R + C. Each cycle's header, and each finished or unfinished verdict, stop and step-up in the archive, name the worker's rung; a rerun resumes an open chunk on the latest rung archived for it. `docs/decisions.md` → `routing:` gives the ladder, its source and the bands. Expect a chunk on an easy item to cost much less than under xhigh, and perhaps to take more review rounds, and one on an item of R + C 15 or more to cost more. - A session reads `todo.md` up to `## Details`, and the details of only the items its chunk takes. It reads a `docs/decisions.md` entry only where the entry's title leaves open what it needs. Both rules are in `CLAUDE.md`, so they hold from a session's start. The decisions rule replaces one in `rules/decisions.md`, which loads only once a session has opened `docs/decisions.md` or `AGENTS.md`. A chunk's opening line now counts the unreleased changes instead of listing them. Expect fewer tokens read before a chunk's first commit. - larv-review's stability and product-owner reviewers report only a defect, a requirement of the plan or the goals that the change breaks, a breach of a technical principle, or for stability a hard place the change touches; the stability reviewer leaves the style of comments to the prose reviewer, which now also reads help and error text. Each architect finding names a concrete later change the PR makes harder, and one that names none is dropped. The prose pass runs only on a chunk that changes prose a reader reads, such as docs, comments, help text or `todo.md`, and skips a code-only chunk. Expect fewer findings and fewer review rounds. - Every `todo.md` item carries a C score, how hard the change is to get right, from 1 to 10, in a column after S. C stays out of the score. `rank_todo.py` fails on an items table without the column, and the rule hook then blocks committing that `todo.md`. Before the next commit that changes a project's `todo.md`, add the column and score every item's C, as `rank_todo.py --help` shows. diff --git a/bin/loop_claude/cycle/prompts.py b/bin/loop_claude/cycle/prompts.py index 90424775..6287115d 100644 --- a/bin/loop_claude/cycle/prompts.py +++ b/bin/loop_claude/cycle/prompts.py @@ -24,7 +24,7 @@ def routed_by(route: Route, anchor: Rung | None) -> str: said = f"loop-claude runs you on {route.rung}, routed by item {route.item}'s R + C of {route.risk_and_complexity}. Name each todo.md item this chunk takes, with its R + C, whether or not it is item {route.item}." if anchor is None or highest(route.rung, anchor) == route.rung: return said - # The Agent tool takes a model's family name, such as opus, and runs that family's latest model, which each ladder rung names. + # The Agent tool takes a family name, such as opus, and runs that family's latest model; each rung names its family's latest, so the two match. return f"{said} Your rung is below the project's, {anchor}: launch each reviewer, each comprehension seat and the security pass's subagent with the Agent tool's model `{anchor.model.split('-')[1]}` and effort `{anchor.effort}`, and run a full scan only from such a subagent, since the scan's agents run on the model that starts them." diff --git a/bin/loop_claude/loop/main.py b/bin/loop_claude/loop/main.py index 50cf5519..ea9fe014 100644 --- a/bin/loop_claude/loop/main.py +++ b/bin/loop_claude/loop/main.py @@ -36,7 +36,8 @@ the transcript, are copied into /session/. A file there is replaced only grew from it. A file Claude Code rewrote lands beside its copy as .. Every claude loop-claude starts runs the project's model, saved per in -~/.claude/loop-claude-models.json and read each cycle; a project without an entry, as on its first +~/.claude/loop-claude-models.json and read each cycle, unless routing, below, puts the worker and +the interrupt on another rung; a project without an entry, as on its first run, is asked for one. LOOP_CLAUDE_JUDGE_MODEL overrides it for the judge, LOOP_CLAUDE_WORKER_MODEL for the worker and the interrupt; with both set, nothing is asked. @@ -46,15 +47,15 @@ todo.md's top item in the next release, skipping an item marked question, picks counts from the model's cheapest rung, and an R + C of 8 or less picks a rung below it; without such an item, or with a C missing, the chunk runs on the model's cheapest rung. The worker's first prompt names the rung and the item, and asks the worker to name each item the chunk takes, with its -R + C. Below the model's cheapest rung, it also has the worker run each reviewer, each -comprehension seat and the security passes in subagents on that cheapest rung. The judge reports -the highest R + C the worker states, and the next cycle steps up to the rung that R + C picks, -never down. Every second unfinished verdict on a chunk steps it up one rung. Each finished or -unfinished verdict, stop and step-up in the archive names the worker's rung, with the item and -R + C that routed the chunk; a rerun resumes an open chunk on the latest rung named there, and -counts its unfinished verdicts afresh. A rung no longer on the ladder, or -below the one its item's R + C picks, is dropped, and the chunk is routed afresh from todo.md. A todo.md or -an archive that cannot be read or parsed is said on stderr, and the chunk is routed without it. +R + C. When that rung is below the model's cheapest, the prompt also has the worker launch each +reviewer, each comprehension seat and the security pass in subagents on the cheapest rung. The +judge reports the highest R + C the worker states, and the next cycle steps up to the rung that +R + C picks, never down. Every second unfinished verdict on a chunk steps it up one rung. Each +finished or unfinished verdict, stop and step-up in the archive names the worker's rung, with the +item and R + C that routed the chunk; a rerun resumes an open chunk on the latest rung named there, +and counts its unfinished verdicts afresh. A rung no longer on the ladder, or below the one its +item's R + C picks, is dropped, and the chunk is routed afresh from todo.md. A todo.md or an +archive that cannot be read or parsed is said on stderr, and the chunk is routed without it. A change to bin/loop-claude or any bin/**/*.py takes effect at the next cycle boundary, once loop-claude --help succeeds: the loop reloads into the edited script. @@ -164,7 +165,7 @@ def run_loop(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launc def routed(loop_run: LoopRun, anchor: Rung | None, archived: typing.Callable[[], Route | None], item: typing.Callable[[], Item | None]) -> LoopRun: - """The loop run with its chunk's route, none off the ladder. A chunk keeps its route, or on a rerun the one its archive last names, + """The loop run with its chunk's route, or None when the project's model is off the ladder. A chunk keeps its route, or on a rerun the one its archive last names, while that is at or above the rung its item's R + C picks from anchor, the project's rung; else the plan item routes it afresh.""" if anchor is None: return dataclasses.replace(loop_run, route=None) diff --git a/bin/loop_claude/routing.py b/bin/loop_claude/routing.py index 99cd5173..1064532f 100644 --- a/bin/loop_claude/routing.py +++ b/bin/loop_claude/routing.py @@ -52,13 +52,13 @@ def first_route(anchor: Rung, item: Item | None) -> Route: def kept(route: Route, anchor: Rung) -> bool: - """Whether a route carries on from anchor, the project's rung: its rung is on the ladder at or above the one its item's R + C picks from anchor.""" + """Whether a chunk keeps route: its rung is on the ladder at or above the rung its item's R + C picks from anchor, the project's rung, or anchor itself when no item routed it.""" return highest(route.rung, picked(anchor, route.risk_and_complexity) if route.item else anchor) == route.rung def stepped(anchor: Rung, route: Route, bundled: int) -> Route: """The route after one more unfinished verdict; bundled is the highest R + C the judge saw the worker take into the chunk, 0 for none.""" - # A rung an edit took off the ladder counts as the project's. + # An archived rung since removed from LADDER restarts from the project's rung. rung = route.rung if route.rung in LADDER else anchor rung = highest(rung, picked(anchor, bundled)) if bundled else rung if route.unfinished + 1 >= UNFINISHED_PER_STEP: diff --git a/docs/decisions.md b/docs/decisions.md index a6d04df5..dc988fbc 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -170,13 +170,15 @@ The run has no time cap. Limiting it to the changed lines already bounds it by t Valid while a mutation run on a chunk's changed lines stays cheap beside the review itself. -## routing: one ladder of (model, effort) rungs, ordered by the Artificial Analysis Intelligence Index with Fable 5.1 at max on top; a task's R + C picks a rung by fixed bands, counted from the cheapest rung of the project's model, and a chunk's worker below that rung keeps its reviewers on it +## routing: one ladder of (model, effort) rungs, ordered by the Artificial Analysis Intelligence Index with Fable 5.1 at max on top; a task's R + C picks a rung by fixed bands, counted from the cheapest rung of the project's model, and a chunk's worker may run below that rung, launching its reviewers on that rung 2026-10-14, lilleman. Serves goal 1.4, and goal 1.3: one ladder, the same in every project, read by loop-claude now, and by larv-review and the worker once items 90 and 92 land. `bin/model_routing/ladder.py` holds the rungs and the bands. The rungs, least competent first: Haiku 5.5 at low, medium, high, xhigh and max; Sonnet 5.5 at high; Opus 5.5 at medium, high, xhigh and max; Fable 5.1 at max. The order and the cut come from the Artificial Analysis Intelligence Index (https://artificialanalysis.ai/leaderboards/models, read 2026-10-14), which scores each model at each effort and gives a cost per task. A rung stays only where no cheaper rung scores as high, so a step up always buys more score (goal 1.4). That cut drops Sonnet 5.5 at low, medium, xhigh and max, Opus 5.5 at low, and every Fable 5.1 rung, and every tie in the index falls among the dropped rungs. lilleman put Fable 5.1 at max back on top: the index scores it under Opus 5.5 at high, but Anthropic's model catalog names Fable the most capable model, and for the hardest tasks lilleman wants the highest quality at any price. -A chunk's worker runs on the rung its item picks, below the project's rung too. Proof that a cheaper worker holds quality (goal 1.1) has to come from chunks run below it, so on 2026-10-14 lilleman chose a trial on real chunks over a replay of past ones, which spends on work nothing ships (goal 1.4). Quality stays held at the review: while the worker runs below the project's rung, loop-claude's prompt has it launch each reviewer, each comprehension seat and the security pass's subagent on the project's rung, through the Agent tool's model and effort, and run a full scan only from such a subagent: the `claude-security` plugin's researchers and verifiers inherit the model that starts them. A subagent that cannot run the scan leaves it unavailable, so larv-review runs `/security-review` in its place. The cost of a cheaper worker shows as extra review rounds and unfinished verdicts, which `todo.md` item 94 measures, interrupting lilleman when a rung takes more of either than the rung above. A project's rung is its model's cheapest rung, which for Opus 5.5 is its default effort, medium. lilleman chose medium knowing `settings.json` runs Opus 5.5 at xhigh, so a routed worker runs below the effort an interactive session takes. A model off the ladder routes nothing: claude runs it at the effort its settings give. R + C steps a task from the project's rung: 2–4 three rungs down, 5–6 two down, 7–8 one down, 9–10 none, 11–12 one up, 13–14 two up, 15–16 three up, 17 and above four up. A step past either end stops there. The bands spread the R + C that `todo.md`'s items held on 2026-10-14, 2 to 12, across the rungs, so most tasks step down. S never moves a rung, so a huge task with low R and C runs cheap. The comprehension panel and the security pass stay on the project's model. `score-outcomes` had too few finished chunks to ground the bands; `todo.md` item 94 measures the routes' outcomes, and a change to the ladder or the bands is lilleman's. +A chunk's worker runs on the rung its item picks, below the project's rung too. Only chunks run below the project's rung can prove that a cheaper worker holds quality (goal 1.1). So on 2026-10-14 lilleman chose a trial on real chunks: a replay of past chunks spends on work nothing ships (goal 1.4). Review holds quality meanwhile. While the worker runs below the project's rung, loop-claude's prompt has it launch each reviewer, each comprehension seat and the security pass's subagent on the project's rung, through the Agent tool's model and effort. It runs a full scan only from such a subagent, because the `claude-security` plugin's researchers and verifiers inherit the model that starts them. A subagent that cannot run the scan leaves it unavailable, so larv-review runs `/security-review` in its place. The cost of a cheaper worker shows as extra review rounds and unfinished verdicts, which `todo.md` item 94 is to measure, interrupting lilleman when a rung takes more of either than the rung above. A project's rung is its model's cheapest rung, which for Opus 5.5 is its default effort, medium. lilleman chose medium knowing `settings.json` runs Opus 5.5 at xhigh, so a routed worker runs below the effort an interactive session takes. + +A model off the ladder routes nothing: claude runs it at the effort its settings give. R + C steps a task from the project's rung: 2–4 three rungs down, 5–6 two down, 7–8 one down, 9–10 none, 11–12 one up, 13–14 two up, 15–16 three up, 17 and above four up. A step past either end stops there. The bands spread the R + C that `todo.md`'s items held on 2026-10-14, 2 to 12, across the rungs, so most tasks step down. S never moves a rung, so a huge task with low R and C runs cheap. While the worker runs above the project's rung, the comprehension seats and the security pass inherit its rung; `todo.md` item 138 keeps them on the project's rung. `score-outcomes` had too few finished chunks to ground the bands, and a change to the ladder or the bands is lilleman's. The worker changes rung only as the chunk starts, after every second unfinished verdict, or when the judge reports a taken-in item whose R + C picks a higher rung, because a model switch inside a session discards its prompt cache. loop-claude routes on the first row of the next release in `todo.md`'s table that waits on no question. It reads neither an order the plan states in prose nor the task, so a chunk may start on another item's rung: a higher one costs money, and a lower one holds until the judge reports the item the worker took in, after the first cycle. `todo.md` item 136 ends this, routing on the item the worker says it takes. diff --git a/todo.md b/todo.md index e55acfe9..90162821 100644 --- a/todo.md +++ b/todo.md @@ -30,7 +30,7 @@ Release 0.2.0 takes items 125, 114 and 124 first, whatever their scores: Shape i | 90 | 0.1.0 | | **Route each reviewer by the chunk's R + C, once a replay of past chunks shows the routed reviewer finds the 🔴 and 🟡 findings on record.** | 4 | 5 | 8 | 6 | 7 | 1.4 | 20.2 | | 92 | 0.1.0 | | **Have the worker route each subagent by its task's R + C, and delegate a task only when the worker needs just its conclusion.** | 2 | 2 | 5 | 5 | 6 | 1.4 | 19.0 | | 89 | 0.1.0 | | **Run the judge on the rung its chunk's R + C picks, once a replay of archived transcripts shows it returns the verdicts on record.** | 3 | 4 | 7 | 5 | 6 | 1.4 | 17.5 | -| 138 | 0.1.0 | | **Keep the comprehension seats and the security pass on the project's rung while a chunk's worker runs above it, as `docs/decisions.md` → `routing:` says they stay.** | 2 | 2 | 3 | 4 | 5 | 1.1 | 15.4 | +| 138 | 0.1.0 | decision | **Keep the comprehension seats and the security pass on the project's rung while a chunk's worker runs above it.** | 2 | 2 | 3 | 4 | 5 | 1.1 | 15.4 | | 136 | 0.1.0 | decision | **Route a chunk on the item its worker says it takes, in place of the next release's first row.** | 2 | 3 | 4 | 4 | 5 | 1.4 | 14.8 | | 105 | 0.2.0 | decision | **Compare review rounds per pass and reading cost for the five chunks before and after the `worker:` decision moved the principles out of the worker's context, and file an item if either rose.** | 1 | 2 | 3 | 5 | 6 | 1.4 | 20.0 | | 112 | 0.2.0 | | **Count an item as shipped only where its chunk built it, so an item a chunk dropped from the plan gets no outcome.** | 2 | 3 | 5 | 5 | 6 | 1.1 | 19.1 | @@ -105,13 +105,13 @@ State in `CLAUDE.md` when the worker delegates: a search or read that spans many loop-claude starts the judge itself (`bin/loop_claude/cycle/judge.py`), so it routes without any skill change. Replay the judge on archived cycles at the candidate rung, and switch only when its interrupts and verdicts match those on record. -### 138. Keep the comprehension seats and the security pass on the project's rung while a chunk's worker runs above it, as `docs/decisions.md` → `routing:` says they stay. +### 138. Keep the comprehension seats and the security pass on the project's rung while a chunk's worker runs above it. `bin/loop_claude/cycle/prompts.py`'s `routed_by` names the project's rung only while the worker runs below it, so from Opus 5.5 at high up to Fable 5.1 at max the seats and the `/security-review` subagent inherit the worker's rung, and the seats' scores vary with each item's R + C. The other reviewers may stay on the worker's higher rung; item 90 routes them. ### 136. Route a chunk on the item its worker says it takes, in place of the next release's first row. -loop-claude routes on the first row of the next release, while the worker takes the item the plan's prose orders first, or a prerequisite, as the chunk that shipped 88 took it over the first row. A first row of higher R + C pays for a dearer rung all chunk; one of lower R + C holds until the judge reports the item taken in. The judge reports the item the worker takes only after the first cycle, so routing the first cycle right needs the item before the worker starts. +loop-claude routes on the first row of the next release, while the worker takes the item the plan's prose orders first, or a prerequisite, as the chunk that shipped item 88, a prerequisite, took item 88 in place of the first row. A first row of higher R + C pays for a dearer rung all chunk; one of lower R + C holds until the judge reports the item taken in. The judge reports the item the worker takes only after the first cycle, so routing the first cycle right needs the item before the worker starts. ### 105. Compare review rounds per pass and reading cost for the five chunks before and after the `worker:` decision moved the principles out of the worker's context, and file an item if either rose.