diff --git a/CHANGELOG.md b/CHANGELOG.md index c0226523..19590ca0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- A session or subagent below the project's rung, the cheapest rung of the project's model, no longer scores or reshapes `todo.md`: it drafts each new item and each change to a filed item, and before its next commit one subagent on the project's rung applies and scores the drafts and sets their release. It may still remove finished items. `rules/todo-items.md` states the rule. `CLAUDE.md` launches a subagent that files or scores items on the rung the new `subagent-rung --plan ` prints, never below the project's rung. Expect one extra subagent in a chunk that files items while its worker runs below the project's rung. +- A session or subagent below the project's rung, the cheapest rung of the project's model, no longer scores or reshapes `todo.md`: it drafts each new item and each change to a filed item, and before its next commit one subagent on the project's rung applies and scores the drafts and sets their release. It may still remove finished items. `rules/todo-items.md` states the rule. `CLAUDE.md` launches a subagent that files or scores items on the rung the new `subagent-rung --plan ` prints, never below the project's rung, and `loop-claude`'s prompt to a worker below that rung names the command. Expect one extra subagent in a chunk that files items while its worker runs below the project's rung. - `loop-claude` runs the judge of an Opus 5.5 project on the rung the chunk's `todo.md` item picks, never below Opus 5.5 at medium effort, the project's rung. Before, the judge ran at the effort `settings.json` sets, xhigh. A replay of 39 archived verdicts found every cheaper rung missing verdicts. The judge keeps its rung when the worker steps up or takes in another item, and runs on the project's rung when no item routed the chunk. A project on another model keeps its judge at its settings' effort. Each verdict in the archive now names the judge's rung on a `Judge:` line. The new `bin/judge-replay ` replays the judge on archived verdicts and prints the cheapest rung that returns them. Expect the judge to cost less on items of R + C 12 or less, and more on items of R + C 15 or more. - Every 20 cycles across all projects, `loop-claude` measures every finished chunk in its archive, with no model run, and writes the figures to `routing-figures.md` at the archive's root: tokens by project, subagent type, rung and tool, and, for each chunk a `todo.md` item routed, grouped by the rung it started on: its review rounds past each pass's first, its unfinished verdicts and its subagents' rungs. It interrupts you, with `claude` on the project's model on the terminal in `~/.claude`, when chunks routed onto a rung took more review rounds or unfinished verdicts than chunks routed onto the next rung up, each rung with 5 chunks or more, or when 5 or more subagents of one type wrote reports longer than the tool results they read. Each call is raised once, then listed in `routing-calls-raised.md` beside the figures; the next chunk of this repo files a `todo.md` item for it. Off a terminal, the calls are said on stderr and the loop goes on. They are raised at the next measurement on a terminal. After a routing change, a `- Reset` line in that file makes the figures count only chunks finished after it, and lets its calls be raised again. Expect a pause of about ten seconds at each measurement. - A session delegates a task to a subagent only when it needs just the task's conclusion, such as a search across many files, and keeps edits in its own thread. It scores the task's R and C as for a `todo.md` item, and launches the subagent on the model and effort that the new `bin/subagent-rung ` picks from the project's model, such as `model sonnet, effort high`. `CLAUDE.md` states the rule. Expect searches to run on cheaper models, and less of each session's context to fill with search output. diff --git a/bin/loop_claude/cycle/prompts.py b/bin/loop_claude/cycle/prompts.py index 74adca76..fe39438e 100644 --- a/bin/loop_claude/cycle/prompts.py +++ b/bin/loop_claude/cycle/prompts.py @@ -31,7 +31,9 @@ def off_the_projects_rung(route: Route, anchor: Rung | None) -> str: # Below the project's rung, the reviewers stay on it to hold quality; above it, the seats score every chunk on one rung, and the security pass spends no more than the project chose. below = highest(route.rung, anchor) == anchor launched = "each reviewer, each comprehension seat and the security pass's subagent" if below else "each comprehension seat and the security pass's subagent" - return f" Your rung is {'below' if below else 'above'} the project's, {anchor}: launch {launched} with the Agent tool set to {anchor.agent_args()}. Run a full scan only from such a subagent, since the scan's agents run on the model that starts them." + # A plan subagent's rung climbs with its task's R + C, so the prompt names the command, not a rung: rules/todo-items.md. + planning = " Launch each subagent that files or scores todo.md items on the rung `subagent-rung --plan ` prints." if below else "" + return f" Your rung is {'below' if below else 'above'} the project's, {anchor}: launch {launched} with the Agent tool set to {anchor.agent_args()}. Run a full scan only from such a subagent, since the scan's agents run on the model that starts them.{planning}" def resumed(unfinished_evidence: str, route: Route, anchor: Rung | None) -> str: diff --git a/bin/loop_claude/test_loop_claude.py b/bin/loop_claude/test_loop_claude.py index 187ce021..9912f7c1 100644 --- a/bin/loop_claude/test_loop_claude.py +++ b/bin/loop_claude/test_loop_claude.py @@ -646,7 +646,7 @@ class WorkerArgs(unittest.TestCase): def test_keeps_reviewers_on_the_projects_rung_while_the_worker_runs_below_it(self): opus = Rung("claude-opus-5-5", "medium") below = prompts.fresh("Do it.", "## Goals", Route(Rung("claude-sonnet-5-5", "high"), 3, 5), opus) - self.assertIn("whether or not it is item 3. Your rung is below the project's, claude-opus-5-5 at medium effort: launch each reviewer, each comprehension seat and the security pass's subagent with the Agent tool set to model opus, effort medium. Run a full scan only from such a subagent, since the scan's agents run on the model that starts them.\n\n", below) + self.assertIn("whether or not it is item 3. Your rung is below the project's, claude-opus-5-5 at medium effort: launch each reviewer, each comprehension seat and the security pass's subagent with the Agent tool set to model opus, effort medium. Run a full scan only from such a subagent, since the scan's agents run on the model that starts them. Launch each subagent that files or scores todo.md items on the rung `subagent-rung --plan ` prints.\n\n", below) self.assertNotIn("the project's", prompts.fresh("Do it.", "## Goals", Route(opus, 3, 9), opus)) def test_keeps_seats_and_the_security_pass_on_the_projects_rung_while_the_worker_runs_above_it(self): diff --git a/docs/decisions.md b/docs/decisions.md index 81ab70a1..e876a259 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -118,7 +118,7 @@ 2026-10-15, lilleman. Serves goal 1.1: a cheaper rung writes worse scores, and a wrong score routes a chunk onto the wrong rung, ranks the plan wrong and drops an item under the bar that should stay. The project's rung is the cheapest rung of the project's model, as in `routing: one ladder`. Below it, a session or subagent may not score an item, move it between releases, split a milestone, delete an item under the bar, or rewrite a filed item. It drafts each new item, and each change to a filed item, such as a refresh a rule asks for, and one subagent on the project's rung applies and scores the drafts together before the next commit, so one launch covers a chunk's drafts (goal 1.4). A security finding gets that subagent at once, since it is filed the moment it is found. Removing a finished item closes work and plans none, so any rung does it. Scoring a delegated task's R + C runs on any rung too: a launch on the project's rung to score each delegation would cost more than the cheaper task saves (goal 1.4). -Two places carry the rule: `rules/todo-items.md` states it and loads with `todo.md`, and `CLAUDE.md`'s delegation rule launches the scoring subagent on the rung `bin/subagent-rung --plan` prints. That rung is the one the task's R + C picks, never below the project's, so a hard scoring task still climbs; `floored` in `bin/model_routing/ladder.py` computes it, as it does the judge's rung. loop-claude's prompt names no rung for this subagent, though the plan item asked it to: a second, fixed rung there would disagree with `--plan` on a scoring task of R + C 11 or more, and the prompt already tells a worker it runs below the project's rung, which brings the rule into play. Valid while a worker may run below the project's rung. +Three places carry the rule. `rules/todo-items.md` states it and loads with `todo.md`. `CLAUDE.md`'s delegation rule launches the scoring subagent on the rung `bin/subagent-rung --plan` prints: the one the task's R + C picks, never below the project's, so a hard scoring task still climbs. `floored` in `bin/model_routing/ladder.py` computes that rung, as it does the judge's. `bin/loop_claude/cycle/prompts.py`'s `off_the_projects_rung` names the same command to a worker below the project's rung, never a fixed rung, which would disagree with `--plan` on a scoring task of R + C 11 or more. Valid while a worker may run below the project's rung. ## settings.json: Claude Code runs in auto mode with the dangerous-mode prompt skipped