|
|
|
@@ -40,16 +40,9 @@ Each project has one session, named "A <key> loop-claude", where <key> is the ch
|
|
|
|
|
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), named by its hash. <chunk> is the hash of the transcript's first
|
|
|
|
|
line with a timestamp, the same for every cycle of a chunk. Beside the copy, <sha256>.outcomes.md
|
|
|
|
|
holds the verdict, with the transcript passage the judge rested it on, any passage it quoted to
|
|
|
|
|
show an escalation trigger fired, and the judge's rung; each answer the judge quoted, with the
|
|
|
|
|
question it answers and any passage it quoted to show an escalation trigger fired; each judge
|
|
|
|
|
reply the loop rejected, with the reason and the reply as json; and why the loop stopped. Each of these opens with its UTC time. Claude Code keeps a folder per
|
|
|
|
|
session beside its transcript, holding the subagents' transcripts among other files; that folder,
|
|
|
|
|
and every other file named after the session except the transcript, are copied into
|
|
|
|
|
<chunk>/session/. A file there is replaced only by a version that grew from it. A file Claude Code
|
|
|
|
|
rewrote lands beside its copy as <name>.<hash of its content>.
|
|
|
|
|
~/.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.
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
@@ -57,6 +50,8 @@ the session /talk opens and the judge on another rung; a project without an entr
|
|
|
|
|
run, is asked for one. LOOP_CLAUDE_JUDGE_MODEL overrides it for the judge, LOOP_CLAUDE_WORKER_MODEL
|
|
|
|
|
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
|
|
|
|
@@ -67,11 +62,18 @@ no tag names a version, the earliest release. Otherwise no item routes the chunk
|
|
|
|
|
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. The
|
|
|
|
|
item's E + I picks the reviewers' rung, stepping up from the cheapest rung by REVIEW_STEPS there,
|
|
|
|
|
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 worker's first prompt names the rung and the item, and asks the
|
|
|
|
|
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
|
|
|
|
@@ -83,7 +85,11 @@ each unfinished verdict says this again, since a step-up may have moved the work
|
|
|
|
|
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 judge reports the highest L and the
|
|
|
|
|
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
|
|
|
|
@@ -95,7 +101,11 @@ with such a quote steps the rung as it comes in, before the human is asked or th
|
|
|
|
|
(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. Each finished or unfinished verdict, interrupt,
|
|
|
|
|
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
|
|
|
|
@@ -104,6 +114,8 @@ below the one its item's L picks, is dropped, and the chunk is routed afresh fro
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
@@ -111,6 +123,8 @@ put when the worker steps up. A model is listed once judge-replay found its chea
|
|
|
|
|
every verdict the reference judge reproduced. Any other model's judge runs at the effort its
|
|
|
|
|
settings give.
|
|
|
|
|
|
|
|
|
|
Routing 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
|
|
|
|
|