diff --git a/CHANGELOG.md b/CHANGELOG.md index 292c4938..8bf23ab0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- loop-claude now asks each worker to name the items its chunk takes on a line of its own, as in `Chunk items: 12 (L 3, E + I 5), 14 (L 2, E + I 4)`, and scores them from `todo.md` on the default branch: that line, not the judge, now sets the rung an extra item lifts the worker and its reviewers to, and the items loop-inbox lists. The judge still reports escalations and whether a release is ready to cut. +- loop-claude now asks each worker to name the items its chunk takes on one line, as in `Chunk items: 12 (L 3, E + I 5), 14 (L 2, E + I 4)`, and scores them from `todo.md` on the default branch. That line, not the judge, now sets the items loop-inbox lists, and how far an item beyond the one the chunk was routed on lifts the worker, its reviewers and the judge. The judge still reports escalations and whether a release is ready to cut. - `~/.claude` holds no `AGENTS.md` any more, so each session in your projects starts about 3,600 tokens smaller, and a session in `~/code/claude-config` loads its `CLAUDE.md` once instead of twice. - A project's `AGENTS.md` may group decision titles into project principles, and each new decision is checked against them: a principle covers it, it breaks one, or it suggests a new one for you to approve. - The prose reviewer now holds prose to the negation rule: write `doesn't cost anything`, never `costs nothing`, after any verb or its preposition. diff --git a/README.md b/README.md index 83b9e17d..562b2fab 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Claude Code configuration -My personal `~/.claude`, version controlled: `CLAUDE.md` and `rules/` for instructions, the words under `CLAUDE.md` → "Vocabulary"; `.claude/rules/` for the rules that load in this repo alone; `agents/` and `skills/`; `principles/` and `skills/larv-review/standards/` for what the reviewer agents hold projects to; `docs/` for decisions and the comprehension history; `settings.json` for the harness and `.claude/settings.json` for the harness inside this repo; `CHANGELOG.md` and `todo.md`; the tools in `bin/`; `workflow-bench/`, the scripts and prompts of the 2026-09-30 bench of larv-review; `reviewer-merge-trials/`, the 2026-11-09 trials of merging reviewers, with their method, results and scripts; `judge-field-trials/`, the 2026-11-11 trials of which facts code could read in loop-claude's judge's place, with their results and scripts; and `presentation/`, a page that explains this setup to newcomers, with the script that prints it to PDF. +My personal `~/.claude`, version controlled: `CLAUDE.md` and `rules/` for instructions, the words under `CLAUDE.md` → "Vocabulary"; `.claude/rules/` for the rules that load in this repo alone; `agents/` and `skills/`; `principles/` and `skills/larv-review/standards/` for what the reviewer agents hold projects to; `docs/` for decisions and the comprehension history; `settings.json` for the harness and `.claude/settings.json` for the harness inside this repo; `CHANGELOG.md` and `todo.md`; the tools in `bin/`; `workflow-bench/`, the scripts and prompts of the 2026-09-30 bench of larv-review; `reviewer-merge-trials/`, the 2026-11-09 trials of merging reviewers, with their method, results and scripts; `judge-field-trials/`, the 2026-11-11 trials of which facts code could read in place of loop-claude's judge, with their results and scripts; and `presentation/`, a page that explains this setup to newcomers, with the script that prints it to PDF. ## Goals diff --git a/bin/loop_claude/cycle/chunk_items.py b/bin/loop_claude/cycle/chunk_items.py index 8604602c..939bb138 100644 --- a/bin/loop_claude/cycle/chunk_items.py +++ b/bin/loop_claude/cycle/chunk_items.py @@ -9,16 +9,16 @@ from loop_claude.verdicts import TakenIn # The label opening the line; prompts.NAME_THE_ITEMS asks the worker for it. CHUNK_ITEMS = "Chunk items:" -# A line the worker opens with the label, after any list or quote marker; what follows names the items. +# A line the worker opens with the label, after any `-` or `>` marker or a backtick; what follows names the items. LINE = re.compile(rf"[\s>`-]*{re.escape(CHUNK_ITEMS)}(.*)") # What the worker says of an item in parentheses, such as its L and E + I. SAID_OF_AN_ITEM = re.compile(r"\([^)]*\)") -# One entry of the line, which commas or "and" separate: an item's ID, which may open with "item" or "#". +# An entry of the line, the text between commas or "and": an item's ID, after an optional "item" or "#". ITEM_ID = re.compile(r"\s*(?:item\s+)?#?(\d+)", re.IGNORECASE) def taken_in(entries: list[Entry], todo: str | Failure) -> TakenIn: - """The items named, with the highest L and E + I todo.md, as the cycle read it, scores among them. An item todo.md doesn't hold, or a todo.md that can't be read, counts at no level, so the route holds.""" + """The items named, with the highest L and the highest E + I that todo.md, as read when the cycle started, gives any of them. An item todo.md doesn't hold, or a todo.md that can't be read, adds no level, so the route holds.""" ids = named(entries) found = items(todo) if isinstance(todo, str) else todo scored = [item for item in found if item.id in ids] if isinstance(found, list) else [] diff --git a/bin/loop_claude/cycle/judge.py b/bin/loop_claude/cycle/judge.py index aec3687c..fd6343d3 100644 --- a/bin/loop_claude/cycle/judge.py +++ b/bin/loop_claude/cycle/judge.py @@ -192,7 +192,7 @@ def quotes_checked(verdict: Verdict, grounds: Grounds) -> Verdict | Failure: | a quoted answer | grounds.quotable | the question goes to the human as an interrupt, which keeps the escalation the answer carried | answer_checked | | the escalation | grounds.shown and grounds.after_mark | the escalation is dropped, so the worker's rung holds | escalation_mark.checked | - Only a misquoted evidence fails. A Failure for any other would exit an unattended loop, so each changes the verdict instead. The checks below follow the table's order; escalation_mark.checked sits beside the mark it moves. + Only a misquoted evidence fails. A Failure for any other would exit an unattended loop, so each changes the verdict instead. """ if not grounded(verdict.evidence, grounds.shown): return misquoted_evidence(verdict) diff --git a/bin/loop_claude/cycle/prompts.py b/bin/loop_claude/cycle/prompts.py index cdb3da4b..8d6a1b9f 100644 --- a/bin/loop_claude/cycle/prompts.py +++ b/bin/loop_claude/cycle/prompts.py @@ -22,8 +22,8 @@ THE_SECURITY_PASS = "the security pass's subagent" # Workers only, not CLAUDE.md, which reviewers load too: a reviewer under a like rule missed findings. READING_RULE = "Read in small pieces: never read more than 80 lines of a file at once, nor take a tool output over 3,000 characters into your context." -# chunk_items reads the latest such line; the bench picked the label (docs/decisions.md → `routing: loop-claude reads the items a chunk takes`). -NAME_THE_ITEMS = f"Name each todo.md item this chunk takes on a line of its own, as in `{CHUNK_ITEMS} 297 (L 3, E + I 5), 298 (L 3, E + I 7)`, and write that line again whenever the set changes." +# chunk_items reads the latest such line; three fresh readers picked the label (docs/decisions.md → `routing: loop-claude reads the items a chunk takes`). +NAME_THE_ITEMS = f"Name every todo.md item this chunk takes on one line, as in `{CHUNK_ITEMS} 297 (L 3, E + I 5), 298 (L 3, E + I 7)`, and write the whole line again whenever the set changes." AFTER_CODE_HEALTH = 'which rank after code health (~/.claude/CLAUDE.md → "Shared goal") unless README.md voids it' @@ -99,7 +99,7 @@ def shared_launches(choice: ReviewChoice, route: Route, project: Rung) -> list[s def taken_in_launches(choice: ReviewChoice) -> list[str]: - """The sentence naming the reviewers' rung each higher E + I picks, so the worker reviews an item it takes in on that rung in the same run, since loop-claude reads a taken-in item's E + I only as the cycle ends, and loop-claude routes on it from the next cycle. None where no higher E + I picks a higher rung. + """The sentence naming the reviewers' rung each higher E + I picks, so the worker reviews an item it takes in on that rung in the same run, since loop-claude reads a taken-in item's E + I only as the cycle ends, and routes on it from the next cycle. None where no higher E + I picks a higher rung. For a worker on Opus 5.5 at medium, on an Opus 5.5 project, routed by an item of E + I 6, it reads: `Where an item you take into the chunk has an E + I of 7 or more, launch each reviewer with the Agent tool set to `model opus, effort max` from 7 and `model fable, effort max` from 8.` """ @@ -162,7 +162,7 @@ def resumed(unfinished_evidence: str, route: Route, project: Rung | None) -> str """Names the worker's rung, so it learns whether its request for a higher rung went through, and the project's again, since a step-up between cycles may have taken the worker above it.""" on = f" loop-claude runs you on {route.rung}." if project else "" ruled = f" A judge ruled the chunk unfinished, quoting this passage of your transcript as the work remaining:\n\n{quoted(unfinished_evidence)}\n\n" if unfinished_evidence else " " - return f"Continue the task; the previous run ended before the chunk was finished.{ruled}The chunk is finished once it is merged, or nothing remains that you could do on your own. Even then, it is finished only once {ANSWERS_RECORDED}.{on}{rungs_held(route, project)}" + return f"Continue the task; the previous run ended before the chunk was finished.{ruled}The chunk is finished once it is merged, or nothing remains that you could do on your own. Even then, it is finished only once {ANSWERS_RECORDED}. {NAME_THE_ITEMS}{on}{rungs_held(route, project)}" def rung_sentences(route: Route, project: Rung | None) -> list[str]: diff --git a/bin/loop_claude/cycle/run.py b/bin/loop_claude/cycle/run.py index 1f567667..283bc47a 100644 --- a/bin/loop_claude/cycle/run.py +++ b/bin/loop_claude/cycle/run.py @@ -43,7 +43,7 @@ class Cycle: root: str route: Route session: Session - # Lists in loop-inbox the items the chunk takes, given the IDs a ruling found the worker names. + # Lists in loop-inbox the items the chunk takes, given the IDs on the worker's latest `Chunk items:` line. show_taken_in: typing.Callable[[tuple[int, ...]], None] task: str # todo.md on the default branch as the cycle starts, which scores the items the worker names. @@ -147,7 +147,7 @@ def worker_start(cycle: Cycle, answered: QuotedAnswer | TypedAnswer | None, step def rule(cycle: Cycle, transcript_path: str, quoted_answers: int) -> Ruled | Stop: - """The judge's ruling, which code then stamps with the items the worker names, unless it is finished. An interrupt or a quoted answer is archived as it is ruled, on the route the worker ran on until then, and then any step-up it makes, so the figures charge each stretch of work to its own rung.""" + """The judge's ruling. Unless it is Finished, code stamps it with the items the worker names on its latest `Chunk items:` line. An interrupt or a quoted answer is archived as it is ruled, on the route the worker ran on until then, and then any step-up it makes, so the figures charge each stretch of work to its own rung.""" entries = read_transcript(transcript_path) if isinstance(entries, Failure): return Stop(1, entries.reason) diff --git a/bin/loop_claude/loop/chunk_start.py b/bin/loop_claude/loop/chunk_start.py index 64d8143c..b97a2978 100644 --- a/bin/loop_claude/loop/chunk_start.py +++ b/bin/loop_claude/loop/chunk_start.py @@ -7,7 +7,7 @@ from git_cli.git_repo import default_ref, file_at from loop_effects.effects import Effects, say from failure import Failure from loop_claude.routing import first_route, kept, routed_item -from release_plan.todo_table import Item +from release_plan.todo_table import Item, items from transcript_archive.read import latest_worker from loop_claude.loop.this_loop import Loop from loop_claude.cycle import prompts @@ -26,9 +26,12 @@ def shown_items(loop: Loop, todo: str | Failure, routed: int) -> typing.Callable def fetched_todo(loop: Loop) -> str | Failure: - """todo.md on the default branch, as last fetched, which lists and scores the items a chunk takes. fetched_plan reads it too, but also the release tag, CHANGELOG.md and each todo.md since the tag, which neither needs.""" + """todo.md on the default branch, as last fetched, which lists and scores the items a chunk takes. fetched_plan reads it too, but also the release tag, CHANGELOG.md and each todo.md since the tag, which listing and scoring the items don't need. Where it can't be read or scored, it says why.""" ref = default_ref(loop.root, ORIGIN_TIMEOUT, run=loop.effects.git) - return ref if isinstance(ref, Failure) else file_at(ref, "todo.md", loop.root, loop.effects.git) + todo = ref if isinstance(ref, Failure) else file_at(ref, "todo.md", loop.root, loop.effects.git) + if isinstance(scored := items(todo) if isinstance(todo, str) else todo, Failure): + say(f"the items the worker names lift no rung: {scored.reason}", loop.effects) + return todo def routed(route: Route | None, project: Rung | None, model: str, archived: typing.Callable[[], Route | None], item: typing.Callable[[], Item | None]) -> Route: diff --git a/bin/loop_claude/loop/close.py b/bin/loop_claude/loop/close.py index 559e4e20..9348e049 100644 --- a/bin/loop_claude/loop/close.py +++ b/bin/loop_claude/loop/close.py @@ -39,7 +39,7 @@ def reached_limit(loop_run: LoopRun) -> Stop | None: def after_verdict(loop_run: LoopRun, project: Rung | None, concluded: Concluded) -> LoopRun: - """The loop run the next cycle starts from. A finished chunk drops its route, its run of unfinished verdicts and the items it took in. An unfinished one takes the route routing.next_route makes of the route its cycle ended on, which an interrupt's or a quoted answer's escalation may have raised; the evidence the judge gave for the verdict and the items it found taken in; and counts the verdict.""" + """The loop run the next cycle starts from. A finished chunk drops its route, its run of unfinished verdicts and the items it took in. An unfinished one takes the route routing.next_route makes of the route its cycle ended on, which an interrupt's or a quoted answer's escalation may have raised; the evidence the judge gave for the verdict, and the items the worker names on its latest `Chunk items:` line; and counts the verdict.""" verdict = concluded.verdict if isinstance(verdict, Finished): return dataclasses.replace(loop_run, route=None, unfinished_evidence="", unfinished_run=0, items_taken_in=()) diff --git a/bin/loop_claude/loop/usage.py b/bin/loop_claude/loop/usage.py index a7e428c2..79c4266c 100644 --- a/bin/loop_claude/loop/usage.py +++ b/bin/loop_claude/loop/usage.py @@ -67,9 +67,10 @@ the worker and the session /talk opens; with both set, nothing is asked. Where the project's model is on the routing ladder (bin/model_routing/ladder.py), the worker and the session /talk opens run on the rung that the chunk's todo.md item picks, and the judge of some models on another; a chunk no item routes runs on the project's model. The worker's prompts name the -rungs it launches its reviews on. The worker's rung steps up as a chunk stays unfinished, or when -the judge finds in the transcript an escalation trigger that fired and the worker asked for a higher -rung. The rules are in bin/loop_claude/routing.py and bin/model_routing/ladder.py, the choice of +rungs it launches its reviews on. The worker's rung steps up as a chunk stays unfinished, when the +worker names on its `Chunk items:` line an item that picks a higher rung, or when the judge finds +in the transcript an escalation trigger that fired and the worker asked for a higher rung. The +rules are in bin/loop_claude/routing.py and bin/model_routing/ladder.py, the choice of each review's rung in bin/model_routing/review_choice.py, and the prompts' wording in bin/loop_claude/cycle/prompts.py. Each verdict, interrupt, quoted answer, stop and step-up in the archive ends with a Worker: line, the route as JSON (Route.worker_line in diff --git a/bin/loop_claude/test_black_box.py b/bin/loop_claude/test_black_box.py index 12c44078..d6552d40 100644 --- a/bin/loop_claude/test_black_box.py +++ b/bin/loop_claude/test_black_box.py @@ -449,7 +449,7 @@ class Cycles(unittest.TestCase): ]) self.assertEqual({(argument(call, "--model"), argument(call, "--effort")) for call in run.calls if call["role"] == "judge"}, {("judge-model", None)}) self.assertIn("loop-claude runs you on claude-sonnet-5-5 at high effort, routed by item 4's L of 2.", argument(workers[0], "-p")) - self.assertIn("Name each todo.md item this chunk takes on a line of its own, as in `Chunk items: 297 (L 3, E + I 5), 298 (L 3, E + I 7)`, and write that line again whenever the set changes.", argument(workers[0], "-p")) + self.assertIn("on one line, as in `Chunk items: ", argument(workers[0], "-p")) outcomes = sorted(verdict.removeprefix(f"Task: {TASK}\n\n") for verdict in checkout.archived().values()) self.assertIn(' Verdict: unfinished\n\nEvidence:\n> three\n\nJudge: judge-model\nWorker: {"model": "claude-opus-5-5", "effort": "medium", "item": 4, "likelihood": 2, "escape_and_impact": 3}\n\n Stepped up\n\nWorker: {"model": "claude-opus-5-5", "effort": "high", "item": 4, "likelihood": 2, "escape_and_impact": 3}\n', outcomes) self.assertIn(' Verdict: finished\n\nEvidence:\n> four\n\nJudge: judge-model\nWorker: {"model": "claude-opus-5-5", "effort": "high", "item": 4, "likelihood": 2, "escape_and_impact": 3}\n', outcomes) diff --git a/bin/loop_claude/test_loop_claude.py b/bin/loop_claude/test_loop_claude.py index 4321128c..e1bf08ec 100644 --- a/bin/loop_claude/test_loop_claude.py +++ b/bin/loop_claude/test_loop_claude.py @@ -5,6 +5,7 @@ import io import json import os import pathlib +import re import shutil import stat import subprocess @@ -1182,6 +1183,14 @@ class RouteSources(unittest.TestCase): self.assertIsNone(chunk_start.plan_item(plan, FakeEffects().effects())) self.assertTrue(stderr.getvalue().startswith(f"{STAMP} {said}"), stderr.getvalue()) + def test_says_why_the_items_the_worker_names_lift_no_rung(self): + fetched = ["origin\n", "origin/main\n", "", "todo.md\n"] + for git, said in ((fetched + [TODO.replace("| 4 | 2 | 3 |", "| x | 2 | 3 |")], "the items the worker names lift no rung: item 3's L 'x' is not a whole number from 1 to 4\n"), ([Failure("no git")], "the items the worker names lift no rung: no git\n"), (fetched + [TODO], "")): + with self.subTest(said=said): + with contextlib.redirect_stderr(io.StringIO()) as stderr: + chunk_start.fetched_todo(a_loop(FakeEffects(git=git).effects())) + self.assertEqual(stderr.getvalue(), f"{STAMP} {said}" if said else "") + def test_resumes_on_the_archived_route_and_says_why_it_routes_afresh(self): with tempfile.TemporaryDirectory() as home: opened = session.session_named("A proj loop-claude", pathlib.Path(home, "projects")) @@ -1402,7 +1411,7 @@ class WorkerArgs(unittest.TestCase): opus = Rung("claude-opus-5-5", "medium") above = prompts.fresh("Do it.", "## Goals", Route(Rung("claude-opus-5-5", "high"), 3, 4, 4), opus, self.FACTS) stepped_up = prompts.resumed("", Route(Rung("claude-opus-5-5", "high"), 3, 3, 4), opus) - self.assertIn(f"{prompts.ANSWERS_RECORDED}. loop-claude runs you on claude-opus-5-5 at high effort.{self.SEATS}{self.SCAN} Where an item you take into the chunk has an E + I of 6 or more, launch each reviewer with the Agent tool set to `model opus, effort xhigh` from 6, `model opus, effort max` from 7 and `model fable, effort max` from 8.{self.MARKDOWN} When an escalation trigger", stepped_up) + self.assertIn(f"{prompts.ANSWERS_RECORDED}. {prompts.NAME_THE_ITEMS} loop-claude runs you on claude-opus-5-5 at high effort.{self.SEATS}{self.SCAN} Where an item you take into the chunk has an E + I of 6 or more, launch each reviewer with the Agent tool set to `model opus, effort xhigh` from 6, `model opus, effort max` from 7 and `model fable, effort max` from 8.{self.MARKDOWN} When an escalation trigger", stepped_up) self.assertNotIn("the project's", prompts.resumed("", Route(opus, 3, 3, 4), opus)) self.assertNotIn("runs you on", prompts.resumed("", Route(Rung("m")), None)) self.assertIn(f"item 3's L of 4.{self.SEATS}{self.SCAN} Where an item you take into the chunk has an E + I of 6 or more, launch each reviewer with the Agent tool set to `model opus, effort xhigh` from 6, `model opus, effort max` from 7 and `model fable, effort max` from 8.{self.MARKDOWN} When an escalation trigger", above) @@ -1582,6 +1591,14 @@ class ChunkItems(unittest.TestCase): self.assertEqual(chunk_items.named([earlier, latest]), (297, 298, 12)) self.assertEqual(chunk_items.named([latest, earlier]), (297,)) self.assertEqual(chunk_items.named([earlier, said("Chunk items: none")]), ()) + self.assertEqual(chunk_items.named([said("Chunk items: 297 and 298 (L 3, E + I 7)")]), (297, 298)) + + def test_reads_the_example_line_the_prompt_gives_the_worker(self): + example = re.search(r"`(Chunk items:[^`]*)`", prompts.NAME_THE_ITEMS)[1] + self.assertEqual(chunk_items.named([said(example)]), (297, 298)) + + def test_every_prompt_that_starts_or_resumes_a_chunk_asks_for_the_line(self): + self.assertIn("on one line, as in `Chunk items: ", prompts.resumed("", Route(Rung("m")), None)) def test_reads_only_a_line_the_worker_opens_with_the_label_in_its_own_text(self): prompt = entries.LoopPrompt(text="Chunk items: 297 (L 3, E + I 5)") diff --git a/bin/loop_claude/verdicts.py b/bin/loop_claude/verdicts.py index f0ba9ff2..8c49e368 100644 --- a/bin/loop_claude/verdicts.py +++ b/bin/loop_claude/verdicts.py @@ -1,10 +1,10 @@ -"""The verdicts cycle.judge.verdict_from builds from the judge's reply, which the cycle then stamps with the items the chunk takes. They sit outside cycle/, since routing reads them and cycle imports routing.""" +"""The verdicts cycle.judge.verdict_from builds from the judge's reply; cycle.run.rule then stamps every verdict but Finished with the items the chunk takes. They sit outside cycle/, since routing reads them and cycle imports routing.""" import dataclasses @dataclasses.dataclass(frozen=True) class TakenIn: - """The todo.md items the worker names on its latest `Chunk items:` line, which cycle.chunk_items reads, the item the chunk was routed on among them where the worker names it.""" + """The todo.md items the worker names on its latest `Chunk items:` line, as cycle.chunk_items reads them. The item the chunk was routed on counts only where the worker names it.""" # Their IDs; loop-inbox lists them. items: tuple[int, ...] = () # The highest L among them, 0 for none: an escalation steps up from the rung that L picks, and an unfinished verdict also raises the worker to it. diff --git a/bin/loop_state/running_loops.py b/bin/loop_state/running_loops.py index f192c58d..169f0198 100644 --- a/bin/loop_state/running_loops.py +++ b/bin/loop_state/running_loops.py @@ -2,8 +2,8 @@ A running loop holds its session's lock (session_lock.py) in Paths.waiting for its whole run. Beside the lock it keeps .running, which holds the loop's checkout and each item its chunk takes, by ID and by its tagline on the default -branch as last fetched. The items are the one the chunk was routed on, then those the judge's latest ruling found the -worker took in, each listed once. loop-inbox lists a loop, and its question (waiting/), only while the loop holds its +branch as last fetched. The items are the one the chunk was routed on, then those the worker names on its latest +`Chunk items:` line, each listed once. loop-inbox lists a loop, and its question (waiting/), only while the loop holds its lock. So a killed loop drops off the list, though its files stay until loop-inbox removes them: .running through drop_ended_loops here, and the question through waiting.listing.drop_ended. """ diff --git a/bin/repo_checks/test_trials_imports.py b/bin/repo_checks/test_trials_imports.py index 0364ffb5..2204a5e4 100644 --- a/bin/repo_checks/test_trials_imports.py +++ b/bin/repo_checks/test_trials_imports.py @@ -10,7 +10,7 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from repo_checks import ROOT # The trials folders whose scripts import from bin/. -TRIALS = [ROOT / "reviewer-merge-trials", ROOT / "judge-field-trials"] +TRIALS = [ROOT / "judge-field-trials", ROOT / "reviewer-merge-trials"] def bin_imports(source: str) -> list[tuple[str, str | None]]: diff --git a/docs/decisions.md b/docs/decisions.md index 7aa710e9..c14811b1 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -27,8 +27,8 @@ Each project principle states one rule that the decisions below apply; their ent - routing: a worker delegates a task only where it needs just the task's conclusion, and each subagent runs on the rung its task's L picks from the project's rung, never below the project's rung when it files or scores todo.md items - routing: a worker hands a task one rung up on each escalation trigger, up to two rungs above the rung its item picks unless the human agrees, and opens the subagent's prompt with the trigger so the routing figures count it - routing: a worker whose run ends asking for a higher rung, citing an escalation trigger the judge finds in the transcript, steps one rung up as the judge interrupts or quotes an answer, or next cycle, up to two rungs above the rung its item picks -- routing: loop-claude reads the items a chunk takes from the worker's latest `Chunk items:` line and scores them by `todo.md` as the default branch held it when the cycle started; the judge still reports the escalation and whether a release is ready to cut -- routing: the worker changes rung only as a chunk starts, after every second unfinished verdict, or when it names a chunk item that picks a higher rung or cites an escalation trigger the judge finds +- routing: loop-claude reads the items a chunk takes from the worker's latest `Chunk items:` line and scores them by `todo.md` as the default branch held it when the cycle started; the judge reports the escalation and whether a release is ready to cut +- routing: the worker changes rung only as a chunk starts, after every second unfinished verdict, when it names a chunk item that picks a higher rung, or when it cites an escalation trigger the judge finds - tests: each test earns its keep as the technical principles' test bullet says, and the worker takes a test's expected values from its item, never from the code - the repo may name bender, bender-infra and ai-sandbox - todo.md: one table of items, scored by the formula it states, held to its bar and ranked by `bin/rank_todo.py`, which ranks each blocker above the items it blocks; each achieve goal weighs by its position, code health first and four times as heavy while the comprehension panel's overall is under 7.0 or unmeasured, then README.md's goals, and a maintain goal weighs 0.5 per point of the confidence an item's test, gate leg or probe adds to it; the table's order is the plan's only order @@ -172,7 +172,7 @@ Valid while cache reads cost a twentieth of input and Claude Code's compaction k - loop-inbox runs the claude command the loop wrote, `bypassPermissions` included, so that claude runs in the same sandbox as the loop. Since loop-inbox runs a command read from a file, the folder is private to the user. - Files, read by polling, need no daemon and only the standard library, and a loop with no loop-inbox running is answered on its terminal as before. - loop-inbox lists a question only while its loop holds the session's lock file with flock, and removes a question whose lock is free. The loop holds the lock for its whole run. The kernel frees the lock however the loop ends, killed included. A process id could not tell a running loop from a killed one: on 2026-10-29 this machine's kernel handed out its 32,768 ids again every 30 to 75 minutes, so a killed loop's question came back whenever another process got its id. The lock file stays once the loop ends, one per project: removing it while another process has it open could let loop-inbox lock a file no loop holds. PR #396. -- A loop also lists itself as running, with the items its chunk takes, in `.running`, under the same lock: one lock tells loop-inbox both that the loop runs and that its question stands. The items are those the worker names on its latest `Chunk items:` line (`routing: loop-claude reads the items a chunk takes`). +- A loop also lists itself as running, with the items its chunk takes, in `.running`, under the same lock: one lock tells loop-inbox both that the loop runs and that its question stands. The items are the one the chunk was routed on, then those the worker names on its latest `Chunk items:` line (`routing: loop-claude reads the items a chunk takes`). A bench of three readers seated as the README's audience picked the name `loop-inbox`, 3–0. @@ -356,7 +356,7 @@ Only chunks run below the project's rung can prove that a cheaper worker holds q While the worker runs above the project's rung, loop-claude's prompt has it launch the comprehension seats and the security pass's subagent on the project's rung too. So the seats score every chunk on one rung, and the security pass spends no more than the project chose. The prompt after each unfinished verdict repeats this, since a step-up may have taken the worker above the project's rung. The other reviewers never run below the worker's rung while it runs above the project's: a worker climbs because its chunk proved harder than its score said, which is when a cheaper reviewer is the bigger risk. A reviewer or seat that rules the work below standard may rerun one rung up: `review: a reviewer or comprehension seat that rules the work below standard`. -On 2026-10-16 lilleman routed the reviewers on their item's E + I as well, on either side of the project's rung, which may lift them above both the worker's rung and the project's: how far a defect would escape, and what it would break, set how hard review must look (goal 1.1). loop-claude names that rung in the worker's prompt. It hands the E + I to the worker's claude beside the project's rung and the worker's, so rule-hook works out each review's rung as the prompt does and holds each launch to it. A low E + I never steps a reviewer below the project's rung: only a replay lowers a pass, as `routing: a review pass runs below the project's rung only on a rung that a replay of its rounds shows finding every 🔴 and 🟡 the project's rung finds…` records. An item the worker takes in beyond the routed one counts too, since its E + I scores its defects as the routed item's scores theirs. The worker's prompt names the reviewers' rung each higher E + I picks, so the worker reviews a taken-in item on it in the same run. The judge reports the highest E + I the worker states for a taken-in item. From the next cycle loop-claude routes on that E + I, and archives it with the route so a rerun keeps it. +On 2026-10-16 lilleman routed the reviewers on their item's E + I as well, on either side of the project's rung, which may lift them above both the worker's rung and the project's: how far a defect would escape, and what it would break, set how hard review must look (goal 1.1). loop-claude names that rung in the worker's prompt. It hands the E + I to the worker's claude beside the project's rung and the worker's, so rule-hook works out each review's rung as the prompt does and holds each launch to it. A low E + I never steps a reviewer below the project's rung: only a replay lowers a pass, as `routing: a review pass runs below the project's rung only on a rung that a replay of its rounds shows finding every 🔴 and 🟡 the project's rung finds…` records. An item the worker takes in beyond the routed one counts too, since its E + I scores its defects as the routed item's scores theirs. The worker's prompt names the reviewers' rung each higher E + I picks, so the worker reviews a taken-in item on it in the same run. loop-claude scores each item the worker names on its `Chunk items:` line by `todo.md` (`routing: loop-claude reads the items a chunk takes`), routes on their highest E + I from the next cycle, and archives it with the route so a rerun keeps it. Valid until the trial on real chunks shows whether a worker below the project's rung holds quality. @@ -422,13 +422,13 @@ The cost of a cheaper worker shows as extra review rounds and unfinished verdict Since 2026-10-16 the reviewers may run above the worker's rung, on the one the highest E + I among their chunk's items picks, so chunks whose worker ran on a lower rung may take more rounds from stronger reviewers, and a call could blame the worker's rung for them; `todo.md` item 171 groups the rounds by the reviewers' rung too. Valid while loop-claude's archive holds every finished chunk's review rounds and unfinished verdicts. -## routing: loop-claude reads the items a chunk takes from the worker's latest `Chunk items:` line and scores them by `todo.md` as the default branch held it when the cycle started; the judge still reports the escalation and whether a release is ready to cut +## routing: loop-claude reads the items a chunk takes from the worker's latest `Chunk items:` line and scores them by `todo.md` as the default branch held it when the cycle started; the judge reports the escalation and whether a release is ready to cut -2026-11-11, claude. Serves goal 1.4 and code health. The judge's reply held three facts beside its verdict: the items the worker took into the chunk, with their highest L and E + I; whether a release was ready to cut; and any escalation the worker asked for. Routing lifts the worker's, the reviewers' and the judge's rungs by the items' levels. Code now reads the items: each fresh prompt asks the worker for a line opening `Chunk items:`, `bin/loop_claude/cycle/chunk_items.py` reads the latest such line in the worker's own text, and `release_plan.todo_table` scores the items. So the judge doesn't score anything, its reply is smaller, and one module scores every item. +2026-11-11, claude. Serves goal 1.4 and code health. The judge's reply held three facts beside its verdict: the items the worker took into the chunk, with their highest L and E + I; whether a release was ready to cut; and any escalation the worker asked for. Routing lifts the worker's, the reviewers' and the judge's rungs by the items' levels. Code now reads the items: each chunk's first prompt, and each prompt resuming it, asks the worker for a line opening `Chunk items:`, `bin/loop_claude/cycle/chunk_items.py` reads the latest such line in the worker's own text, and `release_plan.todo_table` scores the items. So the judge's reply is smaller, and every L and E + I that routing reads comes from `todo.md`, through one module. -The judge field trials (`judge-field-trials/`) read each fact by code over the 709 archived cases. Code was wrong in each of the 39 cases where it and the judge disagreed on an escalation, and read a release ready to cut in 3 of the 31 interrupts that asked about a cut, so the judge keeps both. Workers stated an item with its L and E + I in 413 cases, but also stated items they filed, finished or only mentioned, so code reads a line of its own. Three fresh readers picked its label `Chunk items:`, 3 to 0, because it says the items are the chunk's. +The judge field trials (`judge-field-trials/`) read each fact by code over the 709 archived cases. Code was wrong in each of the 39 cases where it and the judge disagreed on an escalation, and read a release ready to cut in 3 of the 31 interrupts that asked about a cut, so the judge keeps both. Workers stated an item with its L and E + I in 413 cases, but also stated items they filed, finished or only mentioned, so the worker writes the items on a line that holds only them, which code reads. Three fresh readers picked its label `Chunk items:`, 3 to 0, because it says the items are the chunk's. -An item the chunk re-scores on its branch routes on its planned levels until the branch merges; where the new L picks a higher rung, the worker cites escalation trigger 1, which the judge still finds. A worker that writes no line takes in no item, so the route holds. Rerun `judge-field-trials/release_ready.py` when the way `chunk-preflight` detects a release review changes. +An item the chunk re-scores on its branch routes on its planned levels until the branch merges; where the new L picks a higher rung, the worker cites escalation trigger 1, which the judge finds. Where the worker writes no line, loop-claude counts no item as taken in, so the route holds. Rerun `judge-field-trials/release_ready.py` when the way `chunk-preflight` detects a release review changes. Valid while workers write the line when asked, and while `todo.md` on the default branch scores each item a chunk takes. @@ -464,11 +464,11 @@ A project's rung is its model's cheapest rung, which for Opus 5.5 is its default Valid while the index ranks these models, and while no newer model joins the catalog. -## routing: the worker changes rung only as a chunk starts, after every second unfinished verdict, or when it names a chunk item that picks a higher rung or cites an escalation trigger the judge finds +## routing: the worker changes rung only as a chunk starts, after every second unfinished verdict, when it names a chunk item that picks a higher rung, or when it cites an escalation trigger the judge finds 2026-10-14, lilleman. Serves goal 1.4. -Because a model switch inside a session discards its prompt cache, the worker changes rung only as the chunk starts, after every second unfinished verdict, when the worker names an item on its `Chunk items:` line whose L picks a higher rung (`routing: loop-claude reads the items a chunk takes`), or when the judge finds the escalation trigger a worker cites in asking for a higher rung (`routing: a worker whose run ends asking for a higher rung`). loop-claude routes on the first row of the next release in `todo.md`'s table that does not wait: an item waits while it is marked `question` or a blocker of it is still in the table. Since `todo.md` holds no order but its table's (`todo.md: one table`), that row is the item the worker takes. An item the worker takes in beyond that row lifts the worker's rung once the cycle that names it ends. +Because a model switch inside a session discards its prompt cache, the worker changes rung only as the chunk starts, after every second unfinished verdict, when the worker names an item on its `Chunk items:` line whose L picks a higher rung (`routing: loop-claude reads the items a chunk takes`), or when the judge finds the escalation trigger a worker cites in asking for a higher rung (`routing: a worker whose run ends asking for a higher rung`). loop-claude routes on the first row of the next release in `todo.md`'s table that does not wait: an item waits while it is marked `question` or a blocker of it is still in the table. Since `todo.md` holds no order but its table's (`todo.md: one table`), that row is the item the worker takes. An item the worker takes in beyond that row lifts the worker's rung once the cycle in which the worker names it ends. Valid while a model switch inside a session discards its prompt cache. diff --git a/judge-field-trials/README.md b/judge-field-trials/README.md index d405fe4c..5251912d 100644 --- a/judge-field-trials/README.md +++ b/judge-field-trials/README.md @@ -2,27 +2,26 @@ These trials ask one question: which of the facts loop-claude's judge reports could code read instead? The judge is the headless claude that rules on each worker run; its reply named the items the chunk took, whether a release was ready to cut, and any escalation the worker asked for. -They ran on 2026-11-11, over the 709 archived cases. `docs/decisions.md` → `routing: loop-claude reads the items a chunk takes` records what was decided from them. +They ran on 2026-11-11, over the 709 cases archived by then. `docs/decisions.md` → `routing: loop-claude reads the items a chunk takes` records what was decided from them. ## Terms - **Case:** an outcomes file in `~/.claude/loop-claude-transcripts/`, its first verdict, and the transcript the judge read for it. -- **Final message:** the worker's text after the last prompt loop-claude or the human gave it. +- **Final message:** the last text the worker wrote after the last prompt loop-claude or the human gave it. ## Results | Field | What code tried | Result | |---|---|---| -| Escalation | "higher rung", "rung up" or "one rung above" in the final message | Code is wrong in each of the 39 disagreements: 37 where only code finds a request, 2 where only the judge does. Code matched a worker asking the human's yes at the top rung and a review report quoting "rerun one rung up", and missed requests made before the final message. The judge keeps the field. | -| Release ready to cut | The plan as the default branch and tags stood at the verdict, read by `release_plan.release_standing` | Of 240 interrupts, 31 ask about a cut, and code reads ReadyToCut for 3. Two misses are code's: in two projects a release review had merged without the `Release review of ` commit that code looks for. The rest asked under older rules or after the cut. The judge keeps the field, and `todo.md` holds the fix. | -| Items the chunk takes | An item stated with its L and E + I anywhere in the worker's text | 413 of 709 cases state one, 77 of them more than one, and workers also state items they file, finish or only mention. Code needs a line of its own, which no archived transcript holds, so it can't be measured here. | +| Escalation | "higher rung", "rung up" or "one rung above" in the final message | Code is wrong in each of the 39 disagreements: 37 where only code finds a request, 2 where only the judge does. Code matched a worker asking for the human's yes at the top rung and a review report quoting "rerun one rung up", and missed requests made before the final message. The judge keeps the field. | +| Release ready to cut | The plan as the default branch and tags stood at the verdict, read by `release_plan.release_standing` | Of 240 interrupts, 31 ask about a cut, and code reads ReadyToCut for 3. Two misses are code's: in two projects a release review had merged without the `Release review of ` commit that code looks for. The rest asked under older rules or after the cut. The judge keeps the field, and a `todo.md` item files the fix. | +| Items the chunk takes | An item stated with its L and E + I anywhere in the worker's text | 413 of 709 cases state one, 77 of them more than one, and workers also state items they file, finish or only mention. Code reads the items from a line that holds only them, which workers write only since loop-claude asks for it, so the archive can't measure it. | ## Running -Each script reads the archive on this machine and prints its counts last; run it from the checkout's root, as in `python3 judge-field-trials/escalations.py`. +Each script reads the archive on this machine through `cases.py` and prints its counts last; run it from the checkout's root, as in `python3 judge-field-trials/escalations.py`. The lines above the counts quote transcripts and name projects, so they stay on this machine. -- `cases.py` loads the cases, for the other three. - `escalations.py` prints each escalation disagreement with the words around it. - `release_ready.py` prints each interrupt's question beside whether code reads the release ready to cut. - `items.py` prints a few cases stating more than one item. diff --git a/todo.md b/todo.md index 9600eb2d..be892c48 100644 --- a/todo.md +++ b/todo.md @@ -6,7 +6,7 @@ `Bar = 0.1` -`Next ID = 324` +`Next ID = 325` ## Items @@ -61,6 +61,7 @@ | 201 | 0.9.0 | | owner | **Save the human's tmux setups and restore them after a reboot, so work is up and running again quickly.** | 3 | 2 | 1 | 4 | 4 | 1.5 by 4 | 1.3 | | 267 | 0.9.0 | | | **Keep waiting when an interrupt gets an empty answer, at the terminal or in the claude opened for it, in place of stopping the loop.** | 2 | 1 | 3 | 4 | 2 | 1.5 by 3 | 1.3 | | 4 | 0.9.0 | | | **Name each chunk's archive folder by the chunk's start time, so `/` lists chunks in the order they ran.** | 3 | 2 | 3 | 6 | 3 | 1.1 by 3 | 1.3 | +| 324 | 0.9.0 | | | **Count in the routing figures the finished chunks whose worker wrote no `Chunk items:` line.** | 2 | 2 | 1 | 3 | 3 | 1.1 by 2, 1.4 by 1 | 1.2 | | 187 | 0.9.0 | | | **Count the tokens a worker spends reading reviewers' reports, so goal 1.4's signal shows whether report files lowered what a review costs the worker's context.** | 2 | 2 | 1 | 3 | 3 | 1.4 by 3 | 1.2 | | 266 | 0.9.0 | | | **Move the chunks archived under the key `home/lilleman/.claude` to the key `claude-config`, so the routing figures and `score-outcomes` count this repo's chunks as one project.** | 3 | 2 | 2 | 5 | 3 | 1.4 by 3 | 1.2 | | 181 | 0.9.0 | | principle | **Have the test of a quoted answer's step-up assert the stepped rung's facts as literals, not through `prompts.rungs_held`.** | 1 | 1 | 1 | 1 | 1 | 1.1 by 2 | 1.0 | @@ -68,7 +69,6 @@ | 194 | 0.9.0 | | | **Make `test_waits_out_a_usage_limit_which_ends_a_run_of_failures` expect a usage-limit wait independent of the wall-clock time that passes during the run.** | 1 | 1 | 1 | 1 | 1 | 1.1 by 2 | 1.0 | | 265 | 0.9.0 | | | **Archive each wait that costs a chunk wall time, for a usage limit, low memory, a failed worker start or a heavy slot, with its start and end stamps, so goal 1.5's hours split waiting from work.** | 3 | 2 | 2 | 5 | 4 | 1.5 by 3 | 1.0 | | 169 | 0.9.0 | | | **Have rule-hook's `todo-rank-check` catch a `todo.md` that the same Bash call edits and then commits.** | 3 | 1 | 3 | 5 | 3 | 1.1 by 2 | 0.8 | -| 174 | 0.9.0 | | | **In a chunk no item routed, ask the worker to name each todo.md item it takes, with its L and E + I, so loop-claude can route on an item it takes in.** | 1 | 2 | 3 | 4 | 1 | 1.1 by 1 | 0.5 | | 197 | 0.9.0 | | | **Let the human edit what they type at loop-claude's terminal questions with the arrow keys, so Left moves the cursor in place of printing `^[[D`.** | 2 | 2 | 3 | 5 | 2 | 1.5 by 1 | 0.4 | | 1 | 0.10.0 | | question | **Say in README → Install how the transcript archive is backed up, once bender-infra backs up ai-sandbox's data volume.** | 1 | 2 | 1 | 2 | 1 | | 0.0 | @@ -154,7 +154,7 @@ Decide once `agreement` has its 10 commits scored twice. Keep four seats on any ### 299. Replay the archived judge verdicts through code rules and a classifier trained locally on the archive, and file an item for each verdict kind one of them decides with no missed interrupt. -The judge's verdict kind, its escalation and whether a release is ready to cut are what an LLM still decides (`docs/decisions.md` → `routing: loop-claude reads the items a chunk takes …`); this item replays the verdict kind. No single rule found so far separates interrupts: a "?" in the worker's final message appears in 48 interrupts and misses 66. A smaller LLM already failed the replay (`docs/decisions.md` → `routing: on a model judge-replay covered, …`: Sonnet returned another kind on 3 interrupts, Haiku missed 7). Untested are combined code rules, a decision table, and a small classifier trained and run on this machine on the archived verdicts (372 finished, 234 interrupt, 42 unfinished, 20 quoted). Run each offline, nothing sent to an outside service (goal 4), and count disagreements by kind; the bar is zero missed interrupts. A hosted decision model is out of scope, since it would send transcripts to an outside service. +The judge's LLM still decides three things: the verdict kind, the escalation it quotes, and whether a release is ready to cut (`docs/decisions.md` → `routing: loop-claude reads the items a chunk takes …`). This item replays the verdict kind. No single rule found so far separates interrupts: a "?" in the worker's final message appears in 48 interrupts and misses 66. A smaller LLM already failed the replay (`docs/decisions.md` → `routing: on a model judge-replay covered, …`: Sonnet returned another kind on 3 interrupts, Haiku missed 7). Untested are combined code rules, a decision table, and a small classifier trained and run on this machine on the archived verdicts (372 finished, 234 interrupt, 42 unfinished, 20 quoted). Run each offline, nothing sent to an outside service (goal 4), and count disagreements by kind; the bar is zero missed interrupts. A hosted decision model is out of scope, since it would send transcripts to an outside service. ### 311. Hand each worker's claude a Bash output ceiling that saves longer output to a file, and refuse a Read of a session transcript under `~/.claude/projects`. @@ -313,7 +313,7 @@ Seats launch as `general-purpose`, so they hide inside that type: $301.24 of the ### 323. Count a release review as landed once its pull request has merged, whatever its commits are titled. -`release_reviewed` in `bin/release_plan/release_standing.py` counts a release review only by a commit titled `Release review of ` on the default branch. In a replay of 240 archived interrupts (`judge-field-trials/`), 31 asked about a cut, and the plan's standing at the time read ReadyToCut for only 3 of them. In two projects whose release review had merged, the default branch held no such commit, so `chunk-preflight` and routing read ReviewDue, and the next loop would run the release review again. `skills/larv-review/SKILL.md` opens the review's branch with an empty commit of that title, but a worker may skip it, and a rebase or squash merge, which `chunk-pr` uses where the forge allows no merge commit, may drop it. Detect the review by something every merge method keeps, and check the fix against both projects' histories. Until then the judge keeps `release_ready` (docs/decisions.md → `routing: loop-claude reads the items a chunk takes …`). +`release_reviewed` in `bin/release_plan/release_standing.py` counts a release review only by a commit titled `Release review of ` on the default branch. In a replay of archived interrupts (`judge-field-trials/`), in two projects whose release review had merged, the default branch held no such commit, so `chunk-preflight` and routing read ReviewDue, and the next loop would run the release review again. `skills/larv-review/SKILL.md` opens the review's branch with an empty commit of that title, but a worker may skip it, and a rebase or squash merge, which `chunk-pr` uses where the forge allows no merge commit, may drop it. Detect the review by something every merge method keeps, and check the fix against both projects' histories. Until then the judge keeps `release_ready` (docs/decisions.md → `routing: loop-claude reads the items a chunk takes …`). ### 149. Fill each release by priority up to a capacity it states, in place of the bar, and move what does not fit to a later release. @@ -389,6 +389,10 @@ Weigh the widely used tmux-resurrect and tmux-continuum plugins against a script Today the folder is the SHA-256 of the transcript's first timestamped line, which tells the human nothing; that line carries the start time. Drop the fallback to the first line, which every chunk of a project shares, and give the tests' fake transcripts ISO timestamps. `bin/reading-cost` takes a chunk's id from the folder's first 12 characters and skips a chunk whose id `docs/reading-cost.md` holds, so give it a way to match a figure written under the old name. +### 324. Count in the routing figures the finished chunks whose worker wrote no `Chunk items:` line. + +`docs/decisions.md` → `routing: loop-claude reads the items a chunk takes …` holds only while workers write the line when asked, and nothing counts a chunk whose worker skipped it. There loop-claude scores no item beyond the one the chunk was routed on, so the route holds, and loop-inbox lists only that item. Count in `bin/routing_figures/`, beside the chunks counted, those whose worker's transcript holds no such line, so the human sees when the decision's premise stops holding. + ### 187. Count the tokens a worker spends reading reviewers' reports, so goal 1.4's signal shows whether report files lowered what a review costs the worker's context. Before PR #310, reports reached the worker as the Agent call's result, a median 19k tokens per chunk (2026-10-08, 68 archived transcripts). Now a reviewer returns its verdict and one line per finding, and the worker reads a 🔴 or 🟡 finding's entry from the report file. `reading-cost` counts only tracked files (`bin/reading_cost/measure.py`), and `routing-figures` counts only the Agent call's result (`bin/routing_figures/chunk.py`), so neither sees the report reads. Found by the architecture review of PR #310. @@ -417,10 +421,6 @@ No record holds these waits today. An outcomes file holds verdicts, stops, step- The hook judges a call before it runs, and `changed` in `bin/rule_hook/todo_check.py` compares `todo.md` with the index and HEAD as they stand then. A call that edits `todo.md` and commits it, such as a heredoc script followed by `git commit`, passes unchecked: PR #296's commit 149108e did, and the override marker it carried was never logged. larv-review's gate still runs `rank_todo.py --check`, so an unranked plan stops at merge rather than at commit. A git pre-commit hook would see the staged file. -### 174. In a chunk no item routed, ask the worker to name each todo.md item it takes, with its L and E + I, so loop-claude can route on an item it takes in. - -The principles pass of PR #301 found that only `routed_by` in `bin/loop_claude/cycle/prompts.py` asks the worker to name each item it takes with its L and E + I, and `fresh` uses it only where an item routed the chunk. In an unrouted chunk the judge has no levels to report, so neither the taken-in L nor the taken-in E + I lifts the worker or the judge. - ### 197. Let the human edit what they type at loop-claude's terminal questions with the arrow keys, so Left moves the cursor in place of printing `^[[D`. `bin/loop_effects/effects.py` hands loop-claude Python's builtin `input`, and nothing under `bin/` imports `readline`, so the terminal gets no line editing: fixing a typo means erasing back to it. loop-claude asks two questions at its terminal. `effects.input` reads the pick of the project's model, in `project/model_choice.py`'s `ask_for_model`. `effects.input_or` reads the interrupt's answer, in `cycle/interrupt.py`'s `first_answer`, straight from stdin, since it also watches loop-inbox. Importing `readline` in `effects.py` gives `input` line editing, at two costs; `input_or` would also need to read through `input` while it watches. It moves the prompt from stderr to stdout, while the question above it stays on stderr. `test_black_box.py` waits for the prompt on stderr. `readline`'s bracketed paste takes a pasted block whole, so an answer can hold several lines. `prompts.typed_answer` ends the answer at its first blank line, so the judge would read the rest of such a paste as loop-claude's words. The product-owner review of PR #308 raised the interrupt's case. lilleman, 2026-10-18: "Not super-important, but a bit irritating."