Keep configs in ~/.config/build-release/ and tool state in ~/.local/state/build-release/, under XDG_* where set
CI / tests (pull_request) Successful in 6m34s
CI / tests (pull_request) Successful in 6m34s
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
usage: judge-replay <model> [--offline]
|
||||
|
||||
<model> is a project model on the routing ladder this setup ships, such as claude-opus-5-5. The tool replays the
|
||||
verdicts archived for the projects that ~/.claude/loop-claude-models.json runs on it: the latest
|
||||
verdicts archived for the projects that ~/.config/build-release/models.json runs on it: the latest
|
||||
15 of each kind, finished, unfinished, interrupt and quoted answer. Where the archive kept the judge's own
|
||||
prompt (docs/decisions.md → `build-release: the archive keeps the raw transcript and each judge run, …`), the
|
||||
replay hands the judge that prompt, which holds what the judge read then. For a verdict from before the
|
||||
@@ -28,7 +28,7 @@ keeps the judge to its own model's rungs; a rung above them that misses no inter
|
||||
evidence to let the judge climb onto it.
|
||||
|
||||
It keeps each run and the report it prints in build-release's archive, in
|
||||
replays/judge-replay-<model>-<UTC stamp>/ under ~/.claude/loop-claude-transcripts or $BUILD_RELEASE_TRANSCRIPTS.
|
||||
replays/judge-replay-<model>-<UTC stamp>/ under ~/.local/state/build-release/transcripts or $BUILD_RELEASE_TRANSCRIPTS.
|
||||
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.
|
||||
|
||||
@@ -93,7 +93,7 @@ def main(argv: list[str], env: typing.Mapping[str, str], home: pathlib.Path, eff
|
||||
project = arguments_or_exit(TOOL, argv, __doc__, USAGE, lambda argv: model_argument(ladder, [arg for arg in argv if arg != OFFLINE]))
|
||||
if isinstance(project, int):
|
||||
return project
|
||||
cases = archived_cases(project.rung.model, archive_root(home, env), home)
|
||||
cases = archived_cases(project.rung.model, archive_root(home, env), home, env)
|
||||
if isinstance(cases, Failure):
|
||||
return failed(TOOL, cases.reason)
|
||||
if not cases:
|
||||
@@ -105,7 +105,7 @@ def main(argv: list[str], env: typing.Mapping[str, str], home: pathlib.Path, eff
|
||||
effects = archiving(effects, folder, say)
|
||||
reference = Rung(project.rung.model, REFERENCE_EFFORT)
|
||||
# The candidates stop at the lowest rung a worker routes to: no route uses a rung below it for the judge.
|
||||
replay = replayed(cases, reference, down_from(ladder, project.rung, project.lowest_worker_rung()), lambda found, rung: rule(found, rung, home, effects), reproduced, "verdicts", say, AT_ONCE, climbs(project, reference))
|
||||
replay = replayed(cases, reference, down_from(ladder, project.rung, project.lowest_worker_rung()), lambda found, rung: rule(found, rung, home, env, effects), reproduced, "verdicts", say, AT_ONCE, climbs(project, reference))
|
||||
if isinstance(replay, Limited):
|
||||
return limited_exit(TOOL, replay)
|
||||
print_report(folder, report(project.rung.model, reference, cases, replay))
|
||||
@@ -138,8 +138,8 @@ def climbs(project: ProjectRung, reference: Rung) -> list[Rung]:
|
||||
return sorted({project.review_floor(score) for score in REVIEW_STEPS} - {project.rung, reference}, key=project.ladder.position)
|
||||
|
||||
|
||||
def archived_cases(model: str, root: pathlib.Path, home: pathlib.Path) -> list[Case] | Failure:
|
||||
projects = projects_on(model, home)
|
||||
def archived_cases(model: str, root: pathlib.Path, home: pathlib.Path, env: typing.Mapping[str, str]) -> list[Case] | Failure:
|
||||
projects = projects_on(model, home, env)
|
||||
if isinstance(projects, Failure):
|
||||
return projects
|
||||
listed = archived_outcomes(root)
|
||||
@@ -155,7 +155,7 @@ def archived_cases(model: str, root: pathlib.Path, home: pathlib.Path) -> list[C
|
||||
return found
|
||||
|
||||
|
||||
def rule(case: Case, rung: Rung, home: pathlib.Path, effects: Effects) -> Kind | Limited:
|
||||
def rule(case: Case, rung: Rung, home: pathlib.Path, env: typing.Mapping[str, str], effects: Effects) -> Kind | Limited:
|
||||
entries = read_transcript(str(case.transcript))
|
||||
if isinstance(entries, Failure):
|
||||
return verdict_kind(entries)
|
||||
@@ -168,7 +168,7 @@ def rule(case: Case, rung: Rung, home: pathlib.Path, effects: Effects) -> Kind |
|
||||
return verdict_kind(grounds)
|
||||
verdict: Verdict | Failure | Limited = first_reply(lambda: judge_archived(case.root, kept.prompt, grounds, len(entries), rung, BUILD_RELEASE, effects))
|
||||
return verdict if isinstance(verdict, Limited) else verdict_kind(verdict)
|
||||
premises, records = read_premises(case.root, home), read_records(case.root, home, home / CLAUDE_HOME)
|
||||
premises, records = read_premises(case.root, home, env), read_records(case.root, home, env, home / CLAUDE_HOME)
|
||||
if isinstance(premises, Failure):
|
||||
return verdict_kind(premises)
|
||||
if isinstance(records, Failure):
|
||||
|
||||
Reference in New Issue
Block a user