Answer prose round 1: 0 🔴, 4 🟡; fix this_chunks's and segments's cases, move the decision's validity to its first paragraph, name ladder.py and reflow the help, trim the README sentence
This commit is contained in:
@@ -39,10 +39,10 @@ facts itself.
|
||||
Each project has one session, named "A <key> loop-claude", where <key> is the checkout's path
|
||||
relative to ~/code, or to / outside it. The session is deleted when its chunk finishes. At every
|
||||
interrupt, and as every cycle ends, Ctrl-C and a failure included, the session's transcript is
|
||||
copied to $LOOP_CLAUDE_TRANSCRIPTS/<key>/<chunk>/<sha256>.jsonl (default
|
||||
~/.claude/loop-claude-transcripts), with an outcomes file beside it: the verdict, any answer the
|
||||
judge quoted, each judge reply the loop rejected, and why the loop stopped. The layout, and when a
|
||||
copy is replaced, are in bin/transcript_archive/__init__.py.
|
||||
copied into a folder per chunk under $LOOP_CLAUDE_TRANSCRIPTS/<key> (default root
|
||||
~/.claude/loop-claude-transcripts), named by its hash, with an outcomes file beside it: the task,
|
||||
then each verdict, quoted answer, rejected judge reply, step-up and stop, each opened by its UTC
|
||||
time. The layout, and when a copy is replaced, are in bin/transcript_archive/__init__.py.
|
||||
|
||||
Every claude loop-claude starts runs the project's model, saved per <key> in
|
||||
~/.claude/loop-claude-models.json and read each cycle, unless routing, below, puts the worker,
|
||||
@@ -52,94 +52,94 @@ for the worker and the session /talk opens; with both set, nothing is asked.
|
||||
|
||||
Routing: the worker's rung
|
||||
|
||||
Where that model is on the routing ladder (bin/model_routing/ladder.py), the worker and the
|
||||
session /talk opens run on one of the ladder's rungs: a model at an effort. As a chunk starts, it is routed
|
||||
on the item chunk-preflight names, read from todo.md on the default branch as the preflight just
|
||||
fetched it (chunk_pick.chunk_item). That item is the earliest release's top item that does not wait,
|
||||
but only where that release is the next one: the earliest after the newest vX.Y.Z tag that todo.md
|
||||
has named at that tag or since, skipping a release its ## Renamed section marks renamed, or, where
|
||||
no tag names a version, the earliest release. Otherwise no item routes the chunk. An item waits
|
||||
while it is marked question, or while an item that blocks it is still in the table. The item's L
|
||||
picks the worker's rung, stepping from the model's cheapest rung by WORKER_STEPS in
|
||||
Where the project's model is on the routing ladder (bin/model_routing/ladder.py), the worker and the
|
||||
session /talk opens run on one of the ladder's rungs: a model at an effort. As a chunk starts, it is
|
||||
routed on the item chunk-preflight names, read from todo.md on the default branch as the preflight
|
||||
just fetched it (chunk_pick.chunk_item). That item is the earliest release's top item that does not
|
||||
wait, but only where that release is the next one: the earliest after the newest vX.Y.Z tag that
|
||||
todo.md has named at that tag or since, skipping a release its ## Renamed section marks renamed, or,
|
||||
where no tag names a version, the earliest release. Otherwise no item routes the chunk. An item
|
||||
waits while it is marked question, or while an item that blocks it is still in the table. The item's
|
||||
L picks the worker's rung, stepping from the model's cheapest rung by WORKER_STEPS in
|
||||
bin/model_routing/ladder.py, below it for a low L; without such an item, or with its L, E or I
|
||||
unscored, the chunk runs on the model's cheapest rung.
|
||||
|
||||
Routing: the reviewers' rung
|
||||
|
||||
The item's E + I picks the reviewers' rung, stepping up from the cheapest rung by REVIEW_STEPS there,
|
||||
never below the worker's rung. Where it steps none and the worker runs no higher than the cheapest
|
||||
rung, a pass REPLAYED there names runs on the rung it names, the lowest a review-replay run found
|
||||
finding what the cheapest rung finds, even below the worker's.
|
||||
The routed item's E + I picks the reviewers' rung, stepping up from the cheapest rung by
|
||||
REVIEW_STEPS in bin/model_routing/ladder.py, never below the worker's rung. Where it steps none and
|
||||
the worker runs no higher than the cheapest rung, a pass REPLAYED in that file names runs on the
|
||||
rung it names, the lowest a review-replay run found finding what the cheapest rung finds, even below
|
||||
the worker's.
|
||||
|
||||
Routing: what the worker's prompts say
|
||||
|
||||
The worker's first prompt names the rung and the item, and asks the
|
||||
worker to name each item the chunk takes, with its L and E + I, and to count the item's size again
|
||||
once it has read the code (prompts.recount). The prompt names the rung of each review that runs on
|
||||
a rung other than the worker's: the reviewers' rung or the replay's for each pass's reviewer, and
|
||||
the cheapest rung for each comprehension seat and the security pass. It also names the reviewers' rung
|
||||
each higher E + I picks, so the worker reviews an item it takes in on that rung in the same run.
|
||||
When the worker runs below the cheapest rung, the prompt has it launch each subagent that files or
|
||||
scores todo.md items on the rung subagent-rung --plan prints. The prompt after
|
||||
each unfinished verdict says this again, since a step-up may have moved the worker. A reviewer or
|
||||
seat that rules the work below standard may ask to rerun one rung up; each prompt names that rung.
|
||||
loop-claude hands the worker's claude its own rung, the project's and the reviews' E + I, in
|
||||
LOOP_CLAUDE_WORKER_RUNG, LOOP_CLAUDE_PROJECT_RUNG and LOOP_CLAUDE_ESCAPE_AND_IMPACT, and rule-hook
|
||||
refuses a review launched below the rung those pick for it.
|
||||
The worker's first prompt names the rung and the item, and asks the worker to name each item the
|
||||
chunk takes, with its L and E + I, and to count the item's size again once it has read the code
|
||||
(prompts.recount). The prompt names the rung of each review that runs on a rung other than the
|
||||
worker's: the reviewers' rung or the replay's for each pass's reviewer, and the cheapest rung for
|
||||
each comprehension seat and the security pass. It also names the reviewers' rung each higher E + I
|
||||
picks, so the worker reviews an item it takes in on that rung in the same run. When the worker runs
|
||||
below the cheapest rung, the prompt has it launch each subagent that files or scores todo.md items
|
||||
on the rung subagent-rung --plan prints. The prompt after each unfinished verdict says this again,
|
||||
since a step-up may have moved the worker. A reviewer or seat that rules the work below standard may
|
||||
ask to rerun one rung up; each prompt names that rung. loop-claude hands the worker's claude its own
|
||||
rung, the project's and the reviews' E + I, in LOOP_CLAUDE_WORKER_RUNG, LOOP_CLAUDE_PROJECT_RUNG and
|
||||
LOOP_CLAUDE_ESCAPE_AND_IMPACT, and rule-hook refuses a review launched below the rung those pick for
|
||||
it.
|
||||
|
||||
Routing: step-ups
|
||||
|
||||
The judge reports the highest L and the
|
||||
highest E + I the worker states for an item it takes in. The next cycle steps the worker up to the
|
||||
rung that L picks, never down, and the reviewers to the rung picked by the higher of two: that
|
||||
E + I, or the routed item's (Route.reviewed_on in bin/model_routing/route.py). A level off its
|
||||
scale counts as none. Every second unfinished verdict on a chunk steps it up one rung
|
||||
(routing.stepped). So does an unfinished verdict on a worker that ended its run asking for a
|
||||
higher rung, once the judge quotes the transcript showing that the escalation trigger it named
|
||||
fired (~/.claude/CLAUDE.md → "Working with the codebase" lists them). An interrupt or a quoted answer
|
||||
with such a quote steps the rung as it comes in, before the human is asked or the worker resumes
|
||||
(routing.stepped_by_ruling). Each such step marks how many transcript entries the session held,
|
||||
and from then on the judge must quote the worker's own lines after that mark, where it reads a
|
||||
[step] line. Each step on an escalation stops two rungs above the rung the chunk's item picks, and the worker's prompts
|
||||
offer it only while the worker is below that limit.
|
||||
The judge reports the highest L and the highest E + I the worker states for an item it takes in. The
|
||||
next cycle steps the worker up to the rung that L picks, never down, and the reviewers to the rung
|
||||
picked by the higher of two: that E + I, or the routed item's (Route.reviewed_on in
|
||||
bin/model_routing/route.py). A level off its scale counts as none. Every second unfinished verdict
|
||||
on a chunk steps it up one rung (routing.stepped). So does an unfinished verdict on a worker that
|
||||
ended its run asking for a higher rung, once the judge quotes the transcript showing that the
|
||||
escalation trigger it named fired (~/.claude/CLAUDE.md → "Working with the codebase" lists them). An
|
||||
interrupt or a quoted answer with such a quote steps the rung as it comes in, before the human is
|
||||
asked or the worker resumes (routing.stepped_by_ruling). Each such step marks how many transcript
|
||||
entries the session held, and from then on the judge must quote the worker's own lines after that
|
||||
mark, where it reads a [step] line. Each step on an escalation stops two rungs above the rung the
|
||||
chunk's item picks, and the worker's prompts offer it only while the worker is below that limit.
|
||||
|
||||
Routing: the archive and reruns
|
||||
|
||||
Each finished or unfinished verdict, interrupt,
|
||||
quoted answer, stop and step-up in the archive names the worker's rung, with the item, L and E + I
|
||||
that routed the chunk, any taken-in E + I that picks a higher review rung (archived as a step-up
|
||||
too), and the mark. A rerun resumes an open chunk on the latest
|
||||
route named there, and counts its unfinished verdicts afresh. A rung no longer on the ladder, or
|
||||
below the one its item's L picks, is dropped, and the chunk is routed afresh from todo.md. So is a
|
||||
chunk whose archived line names an R + C, as loop-claude wrote before it routed on L. A todo.md or
|
||||
Each finished or unfinished verdict, interrupt, quoted answer, stop and step-up in the archive names
|
||||
the worker's rung, with the item, L and E + I that routed the chunk, any taken-in E + I that picks a
|
||||
higher review rung (archived as a step-up too), and the mark. A rerun resumes an open chunk on the
|
||||
latest route named there, and counts its unfinished verdicts afresh. A rung no longer on the ladder,
|
||||
or below the one its item's L picks, is dropped, and the chunk is routed afresh from todo.md. So is
|
||||
a chunk whose archived line names an R + C, as loop-claude wrote before it routed on L. A todo.md or
|
||||
an archive that cannot be read or parsed is said on stderr, and the chunk is routed without it.
|
||||
|
||||
Judge rung
|
||||
Routing: the judge's rung
|
||||
|
||||
The judge of a model listed in JUDGE_REPLAYED (bin/loop_claude/routing.py) runs on the rung that
|
||||
the reviewers' E + I (Route.reviewed_on) picks for a review from that model. It never runs below the
|
||||
The judge of a model listed in JUDGE_REPLAYED (bin/loop_claude/routing.py) runs on the rung that the
|
||||
reviewers' E + I (Route.reviewed_on) picks for a review from that model. It never runs below the
|
||||
model's cheapest rung, and runs on it when no item routed the chunk or was taken in. Its rung stays
|
||||
put when the worker steps up. A model is listed once judge-replay found its cheapest rung returning
|
||||
every verdict the reference judge reproduced. Any other model's judge runs at the effort its
|
||||
settings give.
|
||||
|
||||
Routing figures
|
||||
Routing: the figures
|
||||
|
||||
Counting the cycles a verdict closed across all projects in the archive, the first loop to close
|
||||
one 20 or more cycles after the last measurement measures every finished chunk there, with no model
|
||||
run: tokens by project, subagent type, rung and the tool whose results they took in, 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 writes them to routing-figures.md at the archive's root. They call for a
|
||||
routing change 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 the reports of 5 or
|
||||
more subagents of one type were longer than the tool results they read. Each call not raised before
|
||||
is an interrupt: claude, on the project's model, on the terminal in ~/.claude, asked to put the
|
||||
calls to the human. 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 line `- <UTC time> Reset` in
|
||||
routing-calls-raised.md restarts both: the figures count only chunks that finished after it, and a
|
||||
call raised before it may be raised again. A chunk that cannot be read is skipped and named in the
|
||||
figures; figures that cannot be measured or written are said on stderr, and the loop goes on.
|
||||
Counting the cycles a verdict closed across all projects in the archive, the first loop to close one
|
||||
20 or more cycles after the last measurement measures every finished chunk there, with no model run:
|
||||
tokens by project, subagent type, rung and the tool whose results they took in, 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 writes them to routing-figures.md at the
|
||||
archive's root. They call for a routing change 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 the reports of 5 or more subagents of one type were longer than the tool results they
|
||||
read. Each call not raised before is an interrupt: claude, on the project's model, on the terminal
|
||||
in ~/.claude, asked to put the calls to the human. 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 line
|
||||
`- <UTC time> Reset` in routing-calls-raised.md restarts both: the figures count only chunks that
|
||||
finished after it, and a call raised before it may be raised again. A chunk that cannot be read is skipped and
|
||||
named in the figures; figures that cannot be measured or written are said on stderr, and the loop
|
||||
goes on.
|
||||
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user