Run the judge on the rung its chunk's item picks, never below the project's, as the replay found every cheaper rung missing verdicts

This commit is contained in:
2026-10-15 08:23:20 +02:00
parent 30f60c570d
commit 069b3814b9
12 changed files with 44 additions and 21 deletions
+7 -5
View File
@@ -36,8 +36,8 @@ the transcript, are copied into <chunk>/session/. A file there is replaced only
grew from it. A file Claude Code rewrote lands beside its copy as <name>.<hash of its content>.
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 and
the interrupt on another rung; a project without an entry, as on its first
~/.claude/loop-claude-models.json and read each cycle, unless routing, below, puts the worker,
the interrupt and the judge on another rung; a project without an entry, as on its first
run, is asked for one. LOOP_CLAUDE_JUDGE_MODEL overrides it for the judge, LOOP_CLAUDE_WORKER_MODEL
for the worker and the interrupt; with both set, nothing is asked.
@@ -47,7 +47,9 @@ todo.md's top item in the next release, skipping an item marked question, picks
counts from the model's cheapest rung, and an R + C of 8 or less picks a rung below it; without
such an item, or with a C missing, the chunk runs on the model's cheapest rung. The worker's first
prompt names the rung and the item, and asks the worker to name each item the chunk takes, with its
R + C. When that rung is below the model's cheapest, the prompt also has the worker launch each
R + C. The judge runs on the rung that item's R + C picks from the judge's model, never below that
model's cheapest rung, whatever rung the worker steps to; without such an item, on the cheapest
rung. When the worker's rung is below the model's cheapest, the prompt also has the worker launch each
reviewer, each comprehension seat and the security pass in subagents on the cheapest rung. When it
is above, the prompt has the worker launch only each comprehension seat and the security pass on
the cheapest rung. The prompt after each unfinished verdict
@@ -125,7 +127,7 @@ from loop_claude.loop.reload import decode_handed, exec_if_edited, fingerprint,
from loop_claude.effects import Effects
from failure import Failure
from loop_claude.cycle.judge import Finished, Unfinished
from loop_claude.routing import first_route, kept, routed_item, stepped
from loop_claude.routing import first_route, judge_rung, kept, routed_item, stepped
from loop_claude.project.model_choice import get_or_ask_models
from todo_table import Item
from transcript_archive.read import latest_worker
@@ -177,7 +179,7 @@ def run_loop(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launc
loop_run = routed(loop_run, anchor, lambda: archived_route(archive_folder, session), lambda: plan_item(root))
route = loop_run.route or Route(Rung(models.worker))
print(f"\n=== cycle {loop_run.cycle_number}, worker on {route.rung} ===", flush=True)
verdict = run_cycle(Cycle(anchor=anchor, effects=effects, judge_rung=Rung(models.judge), paths=paths, premises=premises, project_archive=archive_folder, records=records, root=loop_run.root, route=route, session=session, task=loop_run.task, unfinished_evidence=loop_run.unfinished_evidence))
verdict = run_cycle(Cycle(anchor=anchor, effects=effects, judge_rung=judge_rung(models.judge, route), paths=paths, premises=premises, project_archive=archive_folder, records=records, root=loop_run.root, route=route, session=session, task=loop_run.task, unfinished_evidence=loop_run.unfinished_evidence))
if isinstance(verdict, Stop):
return verdict
before, loop_run = loop_run.route, after_verdict(loop_run, anchor, verdict)