Replay archived stability rounds on the rungs below the project's, on the code each reviewed

This commit is contained in:
2026-10-15 20:05:29 +02:00
parent f705fa626f
commit 9fa570a0f5
4 changed files with 16 additions and 15 deletions
+2 -13
View File
@@ -34,7 +34,7 @@ from judge_replay.replay import Case, case_from, Kind, replayed, report, sample,
from project_key import checkout_of
from loop_claude.effects import Effects
from failure import Failure
from loop_claude.cycle.retry import FAILURES_RUNNING, Limited
from loop_claude.cycle.retry import first_reply, Limited
from loop_claude.cycle.judge import judge_once, Verdict
from model_routing.ladder import LADDER, picked, position, project_rung, Rung
from loop_claude.project.model_choice import read_models_file
@@ -117,16 +117,5 @@ def rule(case: Case, rung: Rung, claude_dir: pathlib.Path, effects: Effects) ->
return verdict_kind(Failure(records.reason))
if isinstance(entries, Failure):
return verdict_kind(entries)
verdict = first_reply(lambda: judge_once(case.root, case.task, premises, records, render(entries), rung, effects))
verdict: Verdict | Failure | Limited = first_reply(lambda: judge_once(case.root, case.task, premises, records, render(entries), rung, effects))
return verdict if isinstance(verdict, Limited) else verdict_kind(verdict)
def first_reply(attempt: typing.Callable[[], Verdict | Failure | Limited]) -> Verdict | Failure | Limited:
"""The first reply that is no Failure, or the last of FAILURES_RUNNING failures.
It counts failures as the loop's retried does, but neither waits between attempts nor waits out a usage limit, which ends the replay.
"""
for _ in range(FAILURES_RUNNING - 1):
if not isinstance(verdict := attempt(), Failure):
return verdict
return attempt()