From 9fea1d8286c006298abedfea62f2e2f2ff5d42fa Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 4 Nov 2026 23:35:35 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20prose=20round=201:=200=20=F0=9F=94=B4,?= =?UTF-8?q?=209=20=F0=9F=9F=A1=20(0=20misread);=20split=20the=20interrupt?= =?UTF-8?q?=20entry,=20unstack=20the=20decisions'=20lists,=20say=20why=20C?= =?UTF-8?q?ycle's=20fields=20and=20the=20package's=20modules=20stay=20at?= =?UTF-8?q?=20one=20level,=20name=20the=20import=20cycle,=20and=20say=20ho?= =?UTF-8?q?w=20the=20judge's=20quotes=20are=20checked?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 2 +- bin/loop_claude/__init__.py | 2 +- bin/loop_claude/cycle/judge.py | 6 +++--- bin/loop_claude/cycle/run.py | 5 ++++- bin/loop_claude/effects.py | 2 +- bin/loop_claude/loop/main.py | 5 ++--- bin/loop_claude/running_loops.py | 2 +- docs/decisions.md | 4 ++-- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index f8f551e0..dfa8e594 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -122,7 +122,7 @@ Claude Code reads this section by its heading when it compacts a conversation. K - **chunk** — the unit of work, shipped as one PR; "Working loop" says what it holds. - **cycle** — in `loop-claude`, worker runs and the judge's verdict on each, until the chunk closes or is left for the next cycle. In between, the human answers any interrupt, or the worker resumes with an answer the judge quoted from `README.md` or the judge's records. - **gate** — the merge gate: the checks a PR passes before it merges. -- **interrupt** — `loop-claude` asking the human, on its terminal and in `loop-inbox`, for a decision that is theirs. They type a one-line answer in either, or `/talk` to open the worker's session with `claude --resume` where they typed it; a release ready to cut opens that session at once, and a routing call opens claude in the setup's development clone, `~/code/claude-config`, both on loop-claude's terminal. +- **interrupt** — `loop-claude` asking the human, on its terminal and in `loop-inbox`, for a decision that is theirs. They type a one-line answer in either, or `/talk` to open the worker's session with `claude --resume` where they typed it. A release ready to cut opens that session at once, on loop-claude's terminal. A routing call opens claude on that terminal too, in `~/code/claude-config`, the checkout where this setup is developed. - **judge** — the headless claude that reads a worker's transcript each cycle and decides whether to interrupt and whether the chunk is finished. - **judge's records** — the files the judge reads beside the README's premises: the project's `AGENTS.md` and `docs/decisions.md`, then the human's `~/.claude/CLAUDE.md` and the `.md` files in `~/.claude/rules/` and `~/.claude/skills/larv-review/standards/`. - **paired ruling** — the seats vote whether the project reads better, the same or worse at the branch's head than at the base, the commit `larv-review ruling-base` prints; `larv-review --help` says how the votes make the ruling. diff --git a/bin/loop_claude/__init__.py b/bin/loop_claude/__init__.py index 758986a2..c0189264 100644 --- a/bin/loop_claude/__init__.py +++ b/bin/loop_claude/__init__.py @@ -1,4 +1,4 @@ """loop-claude: headless claude cycles, judged, that interrupt the human only for a decision that is theirs (loop/main.py's help). -Its packages hold one concern each: cycle/ runs a cycle, loop/ runs the cycles, project/ reads a checkout's files, and waiting/ shows a question to loop-inbox. The modules at this level are those more than one of them imports, and loop-inbox imports several. A reader finds each by its name, so they stay at one level: docs/decisions.md → `principles: about seven things per level, …`. +Its packages hold one concern each: cycle/ runs a cycle, loop/ runs the cycles, project/ reads a checkout's files, and waiting/ shows a question to loop-inbox. Each module at this level is imported by more than one package, and loop-inbox imports several. A reader finds a module by its name, so the modules stay at one level. docs/decisions.md → `principles: about seven things per level, …` allows that. """ diff --git a/bin/loop_claude/cycle/judge.py b/bin/loop_claude/cycle/judge.py index a2e1566f..810d3521 100644 --- a/bin/loop_claude/cycle/judge.py +++ b/bin/loop_claude/cycle/judge.py @@ -97,7 +97,7 @@ class Rejected(Failure): class Grounds(typing.NamedTuple): - """The texts quotes_checked holds the judge's quotes to, word for word, since stitched fragments can say what their source does not.""" + """The texts quotes_checked checks the judge's quotes against. A quote must appear in its text as written, since a quote reworded or stitched together can say what its source does not; only the evidence may join passages with an ellipsis, each passage in order.""" # The transcript as the judge saw it. shown: str # The worker's own lines after the escalation mark, as escalation_mark.since_step renders them. @@ -192,7 +192,7 @@ def cost_of(reply: dict) -> float: def quotes_checked(verdict: Verdict, grounds: Grounds) -> Verdict | Failure: - """The verdict with each quote it makes held to the text that must hold it, word for word: + """The verdict with each of its quotes checked against the text it must appear in, as written: | Quote | Must be in | Where it isn't | |---|---|---| @@ -200,7 +200,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 | | the escalation | grounds.shown and grounds.since_step | the escalation is dropped, so the worker's rung holds, as escalation_mark.checked says | - Only a misquoted evidence fails: the other two misquotes would otherwise exit an unattended loop. + Only a misquoted evidence fails. A Failure for either of the other two would exit an unattended loop, so each changes the verdict instead. """ if not grounded(verdict.evidence, grounds.shown): return Failure(f"the judge quoted {verdict.evidence!r}, which is not in the transcript" + (f", for the question: {verdict.question}" if isinstance(verdict, Interrupt | QuotedAnswer) else "")) diff --git a/bin/loop_claude/cycle/run.py b/bin/loop_claude/cycle/run.py index cead4a1a..1575d57b 100644 --- a/bin/loop_claude/cycle/run.py +++ b/bin/loop_claude/cycle/run.py @@ -24,7 +24,10 @@ from model_routing import worker_rungs @dataclasses.dataclass(frozen=True) class Cycle: - """What a cycle runs on, which no step changes but the route. Each step reads the few fields it needs by name, so they stay at one level: docs/decisions.md → `principles: about seven things per level, …`, more where a reader finds them by name.""" + """What a cycle runs on. run_cycle replaces the route on a ruling's step-up; nothing changes the other fields. + + Each step reads the few fields it needs by name, so the fields stay at one level. docs/decisions.md → `principles: about seven things per level, …` allows more than seven where a reader finds them by name. + """ effects: Effects # What chunk-preflight found, or why it could not run, for a fresh worker's prompt; empty when the session was open as the cycle began. facts: str diff --git a/bin/loop_claude/effects.py b/bin/loop_claude/effects.py index 649930fe..df00fefc 100644 --- a/bin/loop_claude/effects.py +++ b/bin/loop_claude/effects.py @@ -1,4 +1,4 @@ -"""The effects loop-claude reaches the world through: its terminal, clock, processes and git. loop-inbox runs on them too (bin/loop_inbox/main.py), so a change here, such as to how input reads a line, changes both tools.""" +"""The effects loop-claude reaches the world through, such as its terminal, clock, processes, git and the machine's memory. loop-inbox runs on them too, so a change here, such as to how input reads a line, changes both tools.""" import dataclasses import os import select diff --git a/bin/loop_claude/loop/main.py b/bin/loop_claude/loop/main.py index 4c10ba1b..5012758c 100644 --- a/bin/loop_claude/loop/main.py +++ b/bin/loop_claude/loop/main.py @@ -80,9 +80,8 @@ loop to close one measures every finished chunk there, with no model run, and wr routing-figures.md at the archive's root (bin/routing_figures/measure.py). Each call the figures make for a routing change, unless raised before, is an interrupt: claude, on the project's model, on the terminal in the setup's development clone, ~/code/claude-config, asked to put the calls to -the human; loop-inbox lists it too. Once -that claude ends, the calls are listed in routing-calls-raised.md beside the figures, and not -raised again. Off a terminal, the calls are said on stderr, the loop goes on, and they are raised +the human; loop-inbox lists it too. Once that claude ends, the calls are listed in +routing-calls-raised.md beside the figures, and not raised again. Off a terminal, the calls are said on stderr, the loop goes on, and they are raised again at the next measurement. A change to bin/loop-claude or any bin/**/*.py takes effect at the next cycle boundary, once diff --git a/bin/loop_claude/running_loops.py b/bin/loop_claude/running_loops.py index ef9e52fa..602f245f 100644 --- a/bin/loop_claude/running_loops.py +++ b/bin/loop_claude/running_loops.py @@ -7,7 +7,7 @@ worker took in, each listed once. loop-inbox lists a loop, and its question (wai 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. -These files, waiting/ and session_lock.py are loop-claude's state, which loop-inbox reads. They stay in loop_claude/: they run on its effects and hand_over.py, so a package of their own would import loop_claude back. +This module, waiting/ and session_lock.py hold loop-claude's state, which loop-inbox reads. They stay in loop_claude/ because they import its effects.py and hand_over.py: a package of their own would import loop_claude, and loop_claude would import it, a cycle. """ import contextlib import dataclasses diff --git a/docs/decisions.md b/docs/decisions.md index 87220a71..25b94db2 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -294,7 +294,7 @@ On 2026-10-16 lilleman routed the reviewers on their item's E + I as well, on ei Valid until the trial on real chunks shows whether a worker below the project's rung holds quality. -2026-10-29, lilleman. Serves goals 1.4 and 1.5. A branch that changes only Markdown no agent follows reviews on the project's rung, whatever its items' E + I. E + I scores an item before its chunk starts, by the change the item asks for, so one project's item, filed to build a control on a CI runner, kept its E + I of 7 when the chunk found no control the repo could build and shipped a README paragraph: five reviewers read prose on Opus 5.5 at xhigh. rule-hook's `reviewer-rung` reads the branch's files, committed or not, against the default branch as last fetched. Markdown an agent follows, `CLAUDE.md`, `AGENTS.md`, the bench's `workflow-bench/*-prompt.md` and files under `agents/`, `principles/`, `rules/` or `skills/`, counts as config; on 2026-11-04 lilleman added the bench's prompts, which an agent follows like a skill. `bin/review_passes.py` holds the lists, and the worker's prompt renders them. Valid while a README or docs defect costs a reader no more than review on the project's rung lets through. +2026-10-29, lilleman. Serves goals 1.4 and 1.5. A branch that changes only Markdown no agent follows reviews on the project's rung, whatever its items' E + I. E + I scores an item before its chunk starts, by the change the item asks for, so one project's item, filed to build a control on a CI runner, kept its E + I of 7 when the chunk found no control the repo could build and shipped a README paragraph: five reviewers read prose on Opus 5.5 at xhigh. rule-hook's `reviewer-rung` reads the branch's files, committed or not, against the default branch as last fetched. Markdown an agent follows counts as config: `CLAUDE.md`, `AGENTS.md`, `workflow-bench/*-prompt.md` and files under `agents/`, `principles/`, `rules/` or `skills/`. On 2026-11-04 lilleman added the workflow bench's prompts, which an agent follows like a skill. `bin/review_passes.py` holds the lists, and the worker's prompt renders them. Valid while a README or docs defect costs a reader no more than review on the project's rung lets through. ## 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, and only where the E + I steps no review up and the worker runs no higher than the project's rung, then even below the worker's; no pass has such a rung @@ -302,7 +302,7 @@ Valid until the trial on real chunks shows whether a worker below the project's `bin/review-replay ` replays a pass's archived rounds on the code each reviewed. It replays them first on the project's rung, then on each rung below it, highest first, down to the ladder's lowest. It stops at the first rung that misses a finding the project's rung found again. A rung qualifies only where it and each rung above it find every such 🔴 and 🟡. -A qualifying rung applies only where the chunk's E + I steps no review up and the worker runs no higher than the project's rung; there the pass runs on that rung, even below the worker's. Otherwise the pass runs where every other pass does: the replay compared reviews on the project's rung only, never reviews on a rung an E + I stepped up, nor of a chunk whose worker climbed above the project's rung. No code lowers a pass while no rung qualifies: on 2026-11-04 lilleman had the release review of 0.6.0 delete that code, which no chunk could reach. The chunk that first qualifies a rung, `todo.md` item 196's, adds it back in `bin/model_routing/`, with the rung by pass and project model, and names the lowered pass in the worker's prompt and in rule-hook's `reviewer-rung`. +A qualifying rung applies only where the chunk's E + I steps no review up and the worker runs no higher than the project's rung; there the pass runs on that rung, even below the worker's. Otherwise the pass runs where every other pass does: the replay compared reviews on the project's rung only, never reviews on a rung an E + I stepped up, nor of a chunk whose worker climbed above the project's rung. No code lowers a pass while no rung qualifies: on 2026-11-04 lilleman had the release review of 0.6.0 delete that code, which no chunk could reach. The chunk that first qualifies a rung, `todo.md` item 196's, writes that code again in `bin/model_routing/`. It records the qualifying rung for each pass and project model, and names the lowered pass in the worker's prompt and in rule-hook's `reviewer-rung`. The runs, each on the latest 10 rounds of Opus 5.5 projects that hold a 🔴 or 🟡: