Answer prose round 1: 0 🔴, 16 🟡 (0 misread); name the offline deciders and runs, and fix the help, the decision and the docstrings

This commit is contained in:
2026-11-17 10:22:54 +01:00
parent 155a65117c
commit 5f098aa315
6 changed files with 82 additions and 56 deletions
+17 -9
View File
@@ -32,15 +32,22 @@ replays/judge-replay-<model>-<UTC stamp>/ under ~/.claude/loop-claude-transcript
A run's .jsonl file starts with a line holding claude's arguments, working directory, prompt, exit code and
stderr, then holds claude's stream-json output; result.md holds the report.
With --offline it calls no judge. It reads every archived verdict of the model's projects, not a sample, and
replays what code could decide of its kind from the worker's final message: a "?" rule, a decision table and
a classifier trained on the archive (judge_replay/offline.py). It prints, for each, how many verdicts it
decided and how many interrupts it missed, on held-out folds and on the latest fifth.
Like the loop, it tries a judge three times running before it counts the reply as failed. A
verdict whose project, transcript or archived judge run cannot be read replays as failed too. Exit 1, saying why, on
bad arguments, an unreadable archive or models file, no archived verdict of the model's projects,
or a usage limit.
With --offline it doesn't call a judge, so the runs, retries and usage limit above don't apply. It reads every
archived verdict of the model's projects, not a sample. It counts how many of them each of three code
deciders decides from the worker's final message, and how many archived interrupts it decides as another
kind, which are its missed interrupts: a "?" rule, a decision table, and a classifier trained on the archive
(judge_replay/offline.py). The rule and the table run on the whole archive; the table's rows were read from
it, so its run isn't a held-out test. The classifier runs on held-out folds, each tested by a model trained on
the other folds, and on the latest fifth of the verdicts, tested by a model trained on the earlier four
fifths. The report is kept in replays/judge-replay-<model>-offline-<UTC stamp>/result.md. A verdict whose
transcript cannot be read is skipped, and the report counts the skipped. Exit 1, saying why, on bad
arguments, an unreadable archive or models file, no archived verdict of the model's projects, or none with a
transcript that can be read.
"""
import pathlib
import sys
@@ -51,7 +58,7 @@ from transcript_archive.read import archived_outcomes
from rung_replay.archive import archiving, print_report, replay_folder
from rung_replay.command import arguments_or_exit, down_from, failed, limited_exit, projects_on
from loop_claude.cycle.judge import Brief, judge_archived, judge_once
from judge_replay.offline import final_message, METHODS, offline_report, Sample
from judge_replay.offline import final_message, LEARNERS, offline_report, RULES, Sample
from judge_replay.replay import Case, case_from, Kind, report, reproduced, sample, verdict_kind
from transcript_archive.project_key import checkout_of
from loop_effects.effects import Effects
@@ -68,7 +75,7 @@ from claude_code.transcript import read_transcript
from loop_claude.verdicts import Verdict
TOOL = "judge-replay"
USAGE = f"{TOOL} <model> [--offline], a model on the routing ladder"
USAGE = f"{TOOL} <model> [--offline]; <model> is a model on the routing ladder"
OFFLINE = "--offline"
PER_KIND = 15
# The effort settings.json gave every judge before loop-claude routed it; the archived verdicts came from it.
@@ -104,16 +111,17 @@ def main(argv: list[str], env: typing.Mapping[str, str], home: pathlib.Path, eff
def offline(model: str, argv: list[str], cases: list[Case], root: pathlib.Path, effects: Effects) -> int:
"""Replays the verdicts of cases offline, oldest first, and keeps the report in the archive as a judge replay does."""
samples = []
samples, skipped = [], 0
for found in sorted(cases, key=lambda found: (found.at, found.root, str(found.transcript))):
entries = read_transcript(str(found.transcript))
if isinstance(entries, Failure):
skipped += 1
print(f"{TOOL}: skipped a verdict: {entries.reason}", file=sys.stderr)
else:
samples.append(Sample(found.archived_kind, final_message(entries)))
if not samples:
return failed(TOOL, "no archived verdict has a transcript that can be read")
print_report(replay_folder(root, TOOL, argv, effects.now()), offline_report(model, samples, METHODS))
print_report(replay_folder(root, TOOL, argv, effects.now()), offline_report(model, samples, RULES, LEARNERS, skipped=skipped))
return 0