Answer prose round 1: 0 🔴, 7 🟡; give the judge its own help paragraph and decision entry, record that the replay tried each judge once, reword item 90's question, and file item 140 to split the rest of routing
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""Replay loop-claude's judge on archived verdicts, to find the cheapest rung that returns them: docs/decisions.md → `routing:`.
|
||||
"""Replay loop-claude's judge on archived verdicts, to find the cheapest rung that returns them: docs/decisions.md → `routing: on a model judge-replay covered`.
|
||||
|
||||
usage: judge-replay <model>
|
||||
|
||||
@@ -8,14 +8,15 @@ verdicts archived for the projects that ~/.claude/loop-claude-models.json runs o
|
||||
archive is what the judge read for the verdict beside it, so the replay hands the judge that copy,
|
||||
with the task, premises and records each project holds now.
|
||||
|
||||
It first replays every verdict on the reference judge: the model at xhigh effort, where the judge
|
||||
ran before it was routed. A verdict the reference judge returns another kind on rests on the
|
||||
records and judge rules of its day, so no rung is held to it. It then replays the rest on each rung
|
||||
from the one the lowest R + C picks up to the model's cheapest rung, cheapest first, and stops at
|
||||
the first rung that returns all of them. It prints each verdict a rung missed, and the cheapest
|
||||
It first replays every verdict on the reference judge: the model at xhigh effort, the rung the
|
||||
judge ran on before loop-claude routed it. A verdict the reference judge returns another kind on
|
||||
may rest on records or judge rules that have changed since; either way no rung is held to it. It
|
||||
then replays the rest on each candidate rung, cheapest first: from the rung the lowest R + C picks
|
||||
up to the model's cheapest rung. It stops at the first rung that returns all of them. It prints
|
||||
each verdict the reference judge did not reproduce, each verdict a rung missed, and the cheapest
|
||||
rung that missed none. A rung it names is the evidence to add the model to JUDGE_REPLAYED in
|
||||
bin/loop_claude/routing.py, which routes that model's judge, and to record the run in
|
||||
docs/decisions.md → `routing:`.
|
||||
docs/decisions.md → `routing: on a model judge-replay covered`.
|
||||
|
||||
Like the loop, it tries a judge three times running before it counts the reply as failed. A
|
||||
verdict whose project or transcript cannot be read replays as failed too. Exit 1, saying why, on
|
||||
@@ -45,7 +46,7 @@ from loop_claude.stop import Stop
|
||||
PER_KIND = 15
|
||||
# The effort settings.json gave every judge before loop-claude routed it; the archived verdicts came from it.
|
||||
REFERENCE_EFFORT = "xhigh"
|
||||
# claude runs at a time; each judge reads up to JUDGE_PROMPT_CHARS.
|
||||
# Judges replayed at once.
|
||||
AT_ONCE = 4
|
||||
LOWEST_R_PLUS_C = 2
|
||||
USAGE = "usage: judge-replay <model>, a model on the routing ladder"
|
||||
@@ -64,7 +65,7 @@ def main(argv: list[str], env: typing.Mapping[str, str], home: pathlib.Path, eff
|
||||
print(f"judge-replay: {cases.reason}", file=sys.stderr)
|
||||
return 1
|
||||
if not cases:
|
||||
print(f"judge-replay: no archived verdicts of projects on {argv[0]} in {archive_root(home, env)}; run loop-claude on one first", file=sys.stderr)
|
||||
print(f"judge-replay: no archived verdicts of projects on {argv[0]} in {archive_root(home, env)}; run loop-claude on a project on that model first", file=sys.stderr)
|
||||
return 1
|
||||
cases = sample(cases, PER_KIND)
|
||||
reference = Rung(argv[0], REFERENCE_EFFORT)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Which archived verdicts to replay, the cheapest rung that returns them, and the report: docs/decisions.md → `routing:`."""
|
||||
"""Which archived verdicts to replay, the cheapest rung that returns them, and the report: docs/decisions.md → `routing: on a model judge-replay covered`."""
|
||||
import collections
|
||||
import dataclasses
|
||||
import pathlib
|
||||
@@ -42,7 +42,7 @@ class Replay:
|
||||
def case_from(root: str, outcomes: str, transcript: pathlib.Path) -> Case | None:
|
||||
"""The first verdict an outcomes file holds: the judge ruled on the transcript copy beside it as the copy stands. None when it holds none.
|
||||
|
||||
A quoted answer past the cycle's cap is archived as the interrupt it became, so the reference judge's quoted answer sets it aside, holding no rung to it.
|
||||
A fourth quoted answer in a cycle is archived as an interrupt. The reference judge replays it as a quoted answer, so it lands among the unreproduced verdicts and no rung is held to it.
|
||||
"""
|
||||
task, verdict = task_of(outcomes), first_verdict(outcomes)
|
||||
if task is None or verdict is None:
|
||||
@@ -78,10 +78,7 @@ def verdict_kind(verdict: Verdict | Failure) -> Kind:
|
||||
|
||||
|
||||
def replayed(cases: list[Case], reference: Rung, candidates: list[Rung], rule_all: typing.Callable[[list[Case], Rung], list[Kind] | Limited]) -> Replay | Limited:
|
||||
"""Replays the cases on the reference rung, then only those it reproduces on each candidate, cheapest first, until one returns every verdict.
|
||||
|
||||
A verdict the reference judge does not reproduce rests on the records and judge rules of its day, so no rung is held to it.
|
||||
"""
|
||||
"""Replays the cases on the reference rung, then only those it reproduces on each candidate, cheapest first, until one returns every verdict."""
|
||||
ruled = rule_all(cases, reference)
|
||||
if isinstance(ruled, Limited):
|
||||
return ruled
|
||||
@@ -111,7 +108,8 @@ def report(model: str, reference: Rung, cases: list[Case], replay: Replay) -> st
|
||||
if not replay.tried:
|
||||
lines.append("No rung tried: the reference judge reproduced no verdict to hold one to.")
|
||||
else:
|
||||
lines.append(f"Cheapest rung that returns every verdict the reference judge reproduces: {replay.cheapest or 'none up to the project rung'}")
|
||||
cheapest = replay.cheapest or "none up to the project's rung"
|
||||
lines.append(f"Cheapest rung that returns every verdict the reference judge reproduces: {cheapest}")
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ class Report(unittest.TestCase):
|
||||
])
|
||||
missed_all = report("claude-opus-5-5", REFERENCE, cases, Replay([], [Tried(CHEAP, [(cases[1], FINISHED)])], None)).splitlines()
|
||||
self.assertEqual(missed_all[1], "The reference judge, claude-opus-5-5 at xhigh effort, reproduced 2.")
|
||||
self.assertEqual(missed_all[-1], "Cheapest rung that returns every verdict the reference judge reproduces: none up to the project rung")
|
||||
self.assertEqual(missed_all[-1], "Cheapest rung that returns every verdict the reference judge reproduces: none up to the project's rung")
|
||||
self.assertEqual(report("claude-opus-5-5", REFERENCE, cases, Replay([(cases[0], UNFINISHED), (cases[1], FINISHED)], [], None)).splitlines()[-1], "No rung tried: the reference judge reproduced no verdict to hold one to.")
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ class Main(unittest.TestCase):
|
||||
code, out, _ = self.run_main(["claude-opus-5-5"], lambda rung, interrupted: self.verdict(interrupted and rung == REFERENCE, f"said {INTERRUPTED if interrupted else FINISHED}"))
|
||||
self.assertEqual(code, 0)
|
||||
self.assertEqual(self.calls[-1][:2], ("claude-opus-5-5", "medium"))
|
||||
self.assertTrue(out.endswith(": none up to the project rung\n"))
|
||||
self.assertTrue(out.endswith(": none up to the project's rung\n"))
|
||||
|
||||
def test_replays_a_verdict_whose_transcript_is_gone_as_failed(self):
|
||||
(self.home / ".claude" / "loop-claude-transcripts" / "proj" / "c1" / "t0.jsonl").unlink()
|
||||
|
||||
Reference in New Issue
Block a user