Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2556fdace9 | |||
| 6817b074bd | |||
| 46436f2ee0 | |||
| e1e99645be | |||
| 45fd66d3ab | |||
| 66b9651d68 | |||
| 7a7dc4b75d | |||
| 39a8a57b76 | |||
| 58517a0c54 | |||
| c61997f7b7 | |||
| 75c9c2718a | |||
| 1a60de25ab | |||
| 304a2ea988 | |||
| 79f6334c7f | |||
| 4ab5b629ea | |||
| afcd6801a1 | |||
| 46803b7e81 | |||
| 042f48a0f4 | |||
| e0634e52bb | |||
| 595e2f8c4b | |||
| 70cb7bd1be | |||
| c1f08668b7 |
@@ -144,11 +144,15 @@
|
||||
!skills/larv-review/standards/
|
||||
!skills/larv-review/standards/*.md
|
||||
!workflow-bench/
|
||||
!workflow-bench/advisor-judge-prompt.md
|
||||
!workflow-bench/advisor-run-prompt.md
|
||||
!workflow-bench/advisor_bench.py
|
||||
!workflow-bench/bench.py
|
||||
!workflow-bench/compare-prompt.md
|
||||
!workflow-bench/compare.py
|
||||
!workflow-bench/review_git.py
|
||||
!workflow-bench/run-prompt.md
|
||||
!workflow-bench/setup.cfg
|
||||
!workflow-bench/test_advisor_bench.py
|
||||
!workflow-bench/test_bench.py
|
||||
!workflow-bench/test_review_git.py
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Add `workflow-bench/advisor_bench.py`, a bench of the advisor tool on six archived L 1 and L 2 chunks. Sonnet 5.5 alone passed all six, as Opus 5.5 at medium did, for 41% less, and its advisor ran in one of six runs, so workers stay without it.
|
||||
- loop-claude's judge on an Opus 5.5 project now runs on Opus 5.5 at xhigh in every chunk, never at medium: in replays medium sometimes closed a chunk whose worker had asked a question the README or records answer, where xhigh quoted the answer. The judge never runs on Fable 5.2 either, since each Fable 5.2 rung replayed missed an interrupt. `judge-replay` now also replays each rung above the project's that a review climbs to, and reports what each misses.
|
||||
|
||||
## 0.8.0
|
||||
|
||||
- The routing ladder now tops out at Fable 5.2, ordered by the Artificial Analysis Intelligence Index read 2026-11-11: Sonnet 5.5 at high, Opus 5.5 at medium, Fable 5.2 at low and medium, Opus 5.5 at xhigh, Fable 5.2 at high and max. On an Opus 5.5 project, L 4 workers, E + I 5 reviews and a worker's first escalation now run on Fable 5.2 at low, where they ran on Opus 5.5 at high; E + I 6 reviews on Fable 5.2 at medium, where they ran on Opus 5.5 at xhigh; E + I 7 on Opus 5.5 at xhigh, where they ran on Opus 5.5 at max; and E + I 8 on Fable 5.2 at high, where they ran on Fable 5.1 at max. On a Sonnet 5.5 project, E + I 6, 7 and 8 reviews now run on Fable 5.2 at low, Fable 5.2 at medium and Opus 5.5 at xhigh, where they ran on Opus 5.5 at high, xhigh and max. The judge climbs with the reviews. A Fable 5.2 project starts on Fable 5.2 at low. Update `~/.claude` while no loop is mid-chunk: a chunk that stepped up to Opus 5.5 at high or max, or Fable 5.1 at max, finds its rung gone and restarts on its item's rung.
|
||||
- loop-claude now sends you a Mattermost DM from a bot for each question it asks, each release ready to cut, each routing call and each stop but Ctrl-C, where `~/.claude/.env` names the server, the bot's token and your username. `bin/mattermost-dm` sends one by hand; `mattermost-dm --help` names the keys. A DM that fails is one line on loop-claude's terminal, and the loop goes on.
|
||||
- larv-review's worker now runs the project's tests and static analysis, and checks the docs for each name its change touches, before each stability round, and hands stability-reviewer the commit that passed; the reviewer doesn't run them again on it.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Claude Code configuration
|
||||
|
||||
My personal `~/.claude`, version controlled: `CLAUDE.md` and `rules/` for instructions, the words under `CLAUDE.md` → "Vocabulary"; `.claude/rules/` for the rules that load in this repo alone; `agents/` and `skills/`; `principles/` and `skills/larv-review/standards/` for what the reviewer agents hold projects to; `docs/` for decisions and the comprehension history; `settings.json` for the harness and `.claude/settings.json` for the harness inside this repo; `CHANGELOG.md` and `todo.md`; the tools in `bin/`; `workflow-bench/`, the scripts and prompts of the 2026-09-30 bench of larv-review; `reviewer-merge-trials/`, the 2026-11-09 trials of merging reviewers, with their method, results and scripts; `judge-field-trials/`, the 2026-11-11 trials of which facts code could read in place of loop-claude's judge, with their results and scripts; and `presentation/`, a page that explains this setup to newcomers, with the script that prints it to PDF.
|
||||
My personal `~/.claude`, version controlled: `CLAUDE.md` and `rules/` for instructions, the words under `CLAUDE.md` → "Vocabulary"; `.claude/rules/` for the rules that load in this repo alone; `agents/` and `skills/`; `principles/` and `skills/larv-review/standards/` for what the reviewer agents hold projects to; `docs/` for decisions and the comprehension history; `settings.json` for the harness and `.claude/settings.json` for the harness inside this repo; `CHANGELOG.md` and `todo.md`; the tools in `bin/`; `workflow-bench/`, the scripts and prompts of the 2026-09-30 bench of larv-review and of the 2026-11-12 bench of the advisor tool; `reviewer-merge-trials/`, the 2026-11-09 trials of merging reviewers, with their method, results and scripts; `judge-field-trials/`, the 2026-11-11 trials of which facts code could read in place of loop-claude's judge, with their results and scripts; and `presentation/`, a page that explains this setup to newcomers, with the script that prints it to PDF.
|
||||
|
||||
## Goals
|
||||
|
||||
@@ -101,7 +101,7 @@ Install puts only `loop-claude` and `loop-inbox` on `PATH`; call the others by t
|
||||
- `chunk-preflight` finds the mechanical facts a chunk starts from, and with `--worktree` makes its worktree; `loop-claude` runs it with `--worktree` before it routes each chunk, and `chunk-preflight --help` lists the facts.
|
||||
- `command-patterns [<version>]` prints a table of the shell command patterns a release's archived chunks ran, such as `tea pr create`, for an audit of the release; `command-patterns --help` states its columns.
|
||||
- `deploy-release [--cut] [<checkout>]` moves `~/.claude`, or the checkout named, to the newest release, as Update says; with `--cut`, run in the development clone, it first cuts the next release, as Release says.
|
||||
- `judge-replay <model>` replays loop-claude's judge on archived verdicts of the projects run on the model, and prints the lowest rung that, like each rung above it, returns them; `judge-replay --help` states the replay.
|
||||
- `judge-replay <model>` replays loop-claude's judge on archived verdicts of the projects run on the model, and prints what each rung a review climbs to misses, and the lowest rung below them that, like each candidate above it, returns them; `judge-replay --help` states the replay.
|
||||
- `larv-review <command>` holds larv-review's mechanical rules: the chunk's review folder, the paired ruling's base and vote count, each pass's round count, the scoring run's trigger; the comprehension history's format, its latest places and its count of how often seats agree; and each reviewer's prompt header. `larv-review --help` states them.
|
||||
- `loop-claude <task>` runs a project's next chunk cycle after cycle; `loop-claude --help` states its contract.
|
||||
- `loop-inbox` shows the interrupts of every loop-claude on the machine, oldest first, takes each one's answer, `/talk` included, and lists every running loop with the `todo.md` items its chunk takes; `loop-inbox --help` states how.
|
||||
|
||||
@@ -11,12 +11,18 @@ with the task, premises and records each project holds now.
|
||||
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, highest first: from the model's cheapest rung down
|
||||
to the lowest rung a worker routes to. It stops at the first rung that misses one. It prints each
|
||||
verdict the reference judge did not reproduce, each verdict a rung missed, and the lowest rung
|
||||
that, like each rung above it, 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: on a model judge-replay covered`.
|
||||
then replays the rest on each rung above the model's cheapest that a chunk's E + I raises a
|
||||
review to, except the reference judge's rung. Then it replays them on each candidate rung,
|
||||
highest first: from the model's cheapest rung down to the lowest rung a worker routes to. It stops
|
||||
at the first candidate that misses one. It prints each verdict the reference judge did not
|
||||
reproduce, each verdict a rung missed, and the lowest candidate that, like each candidate above
|
||||
it, missed none.
|
||||
|
||||
Record each run in docs/decisions.md → `routing: on a model judge-replay covered`. Where the
|
||||
model's cheapest rung misses no interrupt, the run is the evidence to add the model to
|
||||
JUDGE_REPLAYED in bin/loop_claude/routing.py, which routes that model's judge. judge_rung there
|
||||
keeps the judge to its own model's rungs; a rung above them that misses no interrupt is the
|
||||
evidence to let the judge climb onto it.
|
||||
|
||||
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
|
||||
@@ -36,7 +42,7 @@ from loop_effects.effects import Effects
|
||||
from failure import Failure
|
||||
from rung_replay.search import first_reply, replayed
|
||||
from claude_code.reply import Limited
|
||||
from model_routing.ladder import lowest_worker_rung, project_rung, Rung
|
||||
from model_routing.ladder import lowest_worker_rung, position, project_rung, review_floor, REVIEW_STEPS, Rung
|
||||
from loop_claude.project.premises import read_premises
|
||||
from loop_claude.project.records import read_records
|
||||
from claude_code.transcript import read_transcript
|
||||
@@ -61,7 +67,7 @@ def main(argv: list[str], env: typing.Mapping[str, str], home: pathlib.Path, eff
|
||||
cases = sample(cases, PER_KIND)
|
||||
reference = Rung(project.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(project, lowest_worker_rung(project)), lambda found, rung: rule(found, rung, home / ".claude", effects), reproduced, "verdicts")
|
||||
replay = replayed(cases, reference, down_from(project, lowest_worker_rung(project)), lambda found, rung: rule(found, rung, home / ".claude", effects), reproduced, "verdicts", climbs(project, reference))
|
||||
if isinstance(replay, Limited):
|
||||
return limited_exit(TOOL, replay)
|
||||
print(report(project.model, reference, cases, replay))
|
||||
@@ -73,6 +79,11 @@ def model_argument(argv: list[str]) -> Rung | None:
|
||||
return project_rung(argv[0]) if len(argv) == 1 else None
|
||||
|
||||
|
||||
def climbs(project: Rung, reference: Rung) -> list[Rung]:
|
||||
"""The rungs above the project's rung that an E + I raises a review to, except the reference's, lowest first."""
|
||||
return sorted({review_floor(project, score) for score in REVIEW_STEPS} - {project, reference}, key=position)
|
||||
|
||||
|
||||
def archived_cases(model: str, root: pathlib.Path, home: pathlib.Path) -> list[Case] | Failure:
|
||||
projects = projects_on(model, home)
|
||||
if isinstance(projects, Failure):
|
||||
|
||||
@@ -75,13 +75,15 @@ def report(model: str, reference: Rung, cases: list[Case], replay: Replay[Case,
|
||||
f"The reference judge, {reference}, reproduced {len(cases) - len(unreproduced)}{'. It returned another kind on:' if unreproduced else '.'}",
|
||||
*missed_lines(unreproduced),
|
||||
]
|
||||
for climb in replay.climbed:
|
||||
lines += [f"{climb.rung}, a rung a review climbs to, missed {len(climb.missed)}{':' if climb.missed else '.'}", *missed_lines([(miss.case, miss.reply) for miss in climb.missed])]
|
||||
for tried in replay.tried:
|
||||
lines += [f"{tried.rung} missed {len(tried.missed)}{':' if tried.missed else '.'}", *missed_lines([(miss.case, miss.reply) for miss in tried.missed])]
|
||||
if not replay.tried:
|
||||
lines.append("No rung tried: the reference judge reproduced no verdict to hold one to.")
|
||||
else:
|
||||
lowest = replay.lowest or "none, the project's rung misses one"
|
||||
lines.append(f"Lowest rung that, like each rung above it, returns every verdict the reference judge reproduces: {lowest}")
|
||||
lines.append(f"Lowest candidate that, like each candidate above it, returns every verdict the reference judge reproduces: {lowest}")
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
|
||||
@@ -77,13 +77,22 @@ class Report(unittest.TestCase):
|
||||
"claude-sonnet-5-5 at high effort missed 0.",
|
||||
"claude-haiku-5-5 at xhigh effort missed 1:",
|
||||
" /code/p 2026-10-14T10:00:01Z: archived Verdict: interrupt, replayed Verdict: finished",
|
||||
"Lowest rung that, like each rung above it, returns every verdict the reference judge reproduces: claude-sonnet-5-5 at high effort",
|
||||
"Lowest candidate that, like each candidate above it, returns every verdict the reference judge reproduces: claude-sonnet-5-5 at high effort",
|
||||
])
|
||||
missed_all = report("claude-opus-5-5", REFERENCE, cases, Replay([FINISHED, INTERRUPTED], [Tried(MIDDLE, [Miss(cases[1], INTERRUPTED, 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], "Lowest rung that, like each rung above it, returns every verdict the reference judge reproduces: none, the project's rung misses one")
|
||||
self.assertEqual(missed_all[-1], "Lowest candidate that, like each candidate above it, returns every verdict the reference judge reproduces: none, the project's rung misses one")
|
||||
self.assertEqual(report("claude-opus-5-5", REFERENCE, cases, Replay([UNFINISHED, FINISHED], [], None)).splitlines()[-1], "No rung tried: the reference judge reproduced no verdict to hold one to.")
|
||||
|
||||
def test_names_each_miss_of_each_rung_the_judge_climbs_to_before_the_search_down(self):
|
||||
cases = [case("2026-10-14T10:00:00Z", FINISHED), case("2026-10-14T10:00:01Z", INTERRUPTED)]
|
||||
climbs = [Tried(Rung("claude-fable-5-2", "low"), [Miss(cases[1], INTERRUPTED, FINISHED)]), Tried(Rung("claude-fable-5-2", "high"), [])]
|
||||
self.assertEqual(report("claude-opus-5-5", REFERENCE, cases, Replay([FINISHED, INTERRUPTED], [Tried(MIDDLE, [])], MIDDLE, climbs)).splitlines()[2:5], [
|
||||
"claude-fable-5-2 at low effort, a rung a review climbs to, missed 1:",
|
||||
" /code/p 2026-10-14T10:00:01Z: archived Verdict: interrupt, replayed Verdict: finished",
|
||||
"claude-fable-5-2 at high effort, a rung a review climbs to, missed 0.",
|
||||
])
|
||||
|
||||
|
||||
def unused(*_):
|
||||
raise AssertionError("not called")
|
||||
@@ -126,16 +135,21 @@ class Main(unittest.TestCase):
|
||||
output = {"answer": "", "escalation": "", "evidence": evidence, "finished": not interrupt, "interrupt": interrupt, "question": "Which?" if interrupt else "", "answered_before": "", "left_open": "", "release_ready": False}
|
||||
return {"type": "result", "structured_output": output}
|
||||
|
||||
def test_replays_the_models_projects_on_the_reference_then_from_the_projects_rung_down_and_prints_the_lowest_that_returns_all(self):
|
||||
# Sonnet misses the interrupt; Opus returns both.
|
||||
def test_replays_the_models_projects_on_the_reference_then_on_each_rung_the_judge_climbs_to_then_from_the_projects_rung_down_and_prints_the_lowest_that_returns_all(self):
|
||||
# Sonnet and Fable at medium miss the interrupt; Opus returns both.
|
||||
def reply(rung, interrupted):
|
||||
return self.verdict(interrupted and rung.model != "claude-sonnet-5-5", f"said {INTERRUPTED if interrupted else FINISHED}")
|
||||
return self.verdict(interrupted and rung not in (MIDDLE, Rung("claude-fable-5-2", "medium")), f"said {INTERRUPTED if interrupted else FINISHED}")
|
||||
|
||||
code, out, err = self.run_main(["claude-opus-5-5"], reply)
|
||||
self.assertEqual(code, 0, err)
|
||||
self.assertEqual({cwd for _, _, cwd in self.calls}, {str(self.home / "code" / "proj")})
|
||||
self.assertEqual([(model, effort) for model, effort, _ in self.calls[::2]], [("claude-opus-5-5", "xhigh"), ("claude-opus-5-5", "medium"), ("claude-sonnet-5-5", "high")])
|
||||
self.assertEqual([(model, effort) for model, effort, _ in self.calls[::2]], [
|
||||
("claude-opus-5-5", "xhigh"),
|
||||
("claude-fable-5-2", "low"), ("claude-fable-5-2", "medium"), ("claude-fable-5-2", "high"),
|
||||
("claude-opus-5-5", "medium"), ("claude-sonnet-5-5", "high"),
|
||||
])
|
||||
self.assertIn("The reference judge, claude-opus-5-5 at xhigh effort, reproduced 2.", out)
|
||||
self.assertIn("claude-fable-5-2 at low effort, a rung a review climbs to, missed 0.\nclaude-fable-5-2 at medium effort, a rung a review climbs to, missed 1:", out)
|
||||
self.assertTrue(out.endswith("returns every verdict the reference judge reproduces: claude-opus-5-5 at medium effort\n"))
|
||||
for said in ("The task the worker was given:\nDo it.", "1. Ship.", "From ~/.claude/CLAUDE.md:\nBe kind."):
|
||||
with self.subTest(said=said):
|
||||
@@ -162,7 +176,8 @@ class Main(unittest.TestCase):
|
||||
def test_stops_at_the_projects_rung_and_names_none_when_it_misses(self):
|
||||
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({(model, effort) for model, effort, _ in self.calls[2:]}, {("claude-opus-5-5", "medium")})
|
||||
# The reference and the three rungs a review climbs to each replay both verdicts first.
|
||||
self.assertEqual({(model, effort) for model, effort, _ in self.calls[8:]}, {("claude-opus-5-5", "medium")})
|
||||
self.assertTrue(out.endswith(": none, the project's rung misses one\n"))
|
||||
|
||||
def test_replays_a_verdict_whose_transcript_is_gone_as_failed(self):
|
||||
|
||||
@@ -100,7 +100,7 @@ def archived(project_archive: pathlib.Path, transcript_path: str, task: str, out
|
||||
|
||||
def judge_of(cycle: Cycle) -> Rung:
|
||||
"""The judge's rung, which the archive names beside each verdict."""
|
||||
return judge_rung(cycle.judge_model, cycle.route)
|
||||
return judge_rung(cycle.judge_model)
|
||||
|
||||
|
||||
def step(cycle: Cycle, state: Active) -> Event | Stop:
|
||||
|
||||
@@ -10,7 +10,7 @@ The worker, and the session /talk opens, run on a Route (model_routing/route.py)
|
||||
import dataclasses
|
||||
|
||||
from release_plan.release_standing import chunk_item, LastCut, Next
|
||||
from model_routing.ladder import climbed, highest, LADDER, position, project_rung, review_floor, Rung, stepped_up, worker_rung
|
||||
from model_routing.ladder import climbed, highest, LADDER, position, project_rung, Rung, stepped_up, worker_rung
|
||||
from loop_claude import escalation_mark
|
||||
from failure import Failure
|
||||
from loop_claude.verdicts import Interrupt, QuotedAnswer, Unfinished
|
||||
@@ -20,7 +20,7 @@ from model_routing.route import Route
|
||||
UNFINISHED_PER_STEP = 2
|
||||
# How many rungs above item_rung an escalation trigger takes the worker or a task without the human's yes, as escalation_cap counts them.
|
||||
ESCALATION_CAP = 2
|
||||
# The models `judge-replay` found returning, on their cheapest rung, every verdict the reference judge reproduced: docs/decisions.md → `routing: on a model judge-replay covered`.
|
||||
# The models whose cheapest rung, in a `judge-replay` run, returned every interrupt the reference judge reproduced: docs/decisions.md → `routing: on a model judge-replay covered`.
|
||||
JUDGE_REPLAYED = ("claude-opus-5-5",)
|
||||
|
||||
|
||||
@@ -137,12 +137,8 @@ def one_rung_up(route: Route, rung: Rung, escalated_at: int) -> Route:
|
||||
return dataclasses.replace(route, rung=stepped_up(rung), unfinished=0, escalated_at=escalated_at)
|
||||
|
||||
|
||||
def judge_rung(judge_model: str, route: Route) -> Rung:
|
||||
"""The rung the route's reviewed_on E + I picks for a review, counted from the judge model's cheapest rung and never below it, whatever rung the worker stepped to.
|
||||
|
||||
A model off the ladder, or not in JUDGE_REPLAYED, gets no effort flag, so claude runs it at the effort its settings give.
|
||||
"""
|
||||
cheapest = project_rung(judge_model)
|
||||
if cheapest is None or judge_model not in JUDGE_REPLAYED:
|
||||
def judge_rung(judge_model: str) -> Rung:
|
||||
"""The highest of the judge model's own rungs: docs/decisions.md → `routing: on a model judge-replay covered`. A model off the ladder, or not in JUDGE_REPLAYED, gets no effort flag, so claude runs it at the effort its settings give."""
|
||||
if project_rung(judge_model) is None or judge_model not in JUDGE_REPLAYED:
|
||||
return Rung(judge_model)
|
||||
return review_floor(cheapest, route.reviewed_on())
|
||||
return highest(*(rung for rung in LADDER if rung.model == judge_model))
|
||||
|
||||
@@ -137,7 +137,7 @@ PREMISES = "# Project\n\n## Goals\n\n1. Work.\n\n## Audience\n\nMe.\n"
|
||||
TODO = "## Items\n\n| ID | Release | Exempt | Item | L | E | I | R | S | Moves | Score |\n|---|---|---|---|---|---|---|---|---|---|---|\n| 4 | 0.1.0 | | **Do it.** | 4 | 2 | 3 | 7 | 2 | 1 by 9 | 25 |\n"
|
||||
# Item 4's L of 2 steps one rung down.
|
||||
CHEAP = TODO.replace("| 4 | 2 | 3 | 7 |", "| 2 | 1 | 2 | 3 |")
|
||||
# Item 9 follows CHEAP's item 4, and a worker routed by item 4 may take it in: at L 4 it picks a higher rung for the worker, and at E + I 6 for the judge and the reviewers. At E + I 3, or at L 2, it picks the rung item 4 picks.
|
||||
# Item 9 follows CHEAP's item 4, and a worker routed by item 4 may take it in: at L 4 it picks a higher rung for the worker, and at E + I 6 for the reviewers. At E + I 3, or at L 2, it picks the rung item 4 picks.
|
||||
TAKEN_IN_AT_L_4 = CHEAP + "| 9 | 0.1.0 | | **Do more.** | 4 | 1 | 2 | 5 | 2 | 1 by 9 | 20 |\n"
|
||||
TAKEN_IN_AT_E_PLUS_I_6 = CHEAP + "| 9 | 0.1.0 | | **Do more.** | 2 | 3 | 3 | 6 | 2 | 1 by 9 | 20 |\n"
|
||||
|
||||
@@ -528,7 +528,7 @@ class Cycles(unittest.TestCase):
|
||||
self.assertNotIn("at max effort", "".join(outcomes))
|
||||
self.assertIn('Verdict: interrupt\n\nA or B?\n\nEvidence:\n> Shall I use A or B?\n\nEscalation:\n> Stability round 2: a 🔴.\n\nJudge: judge-model\nWorker: {"model": "claude-fable-5-2", "effort": "low", "item": 4, "likelihood": 4, "escape_and_impact": 5}\n\n<UTC> Stepped up\n\nWorker: {"model": "claude-fable-5-2", "effort": "medium", "item": 4, "likelihood": 4, "escape_and_impact": 5, "escalated_at": 4}\n', "".join(outcomes))
|
||||
|
||||
def test_runs_a_cheap_items_worker_below_the_projects_rung_with_its_reviewers_and_judge_on_it(self):
|
||||
def test_runs_a_cheap_items_worker_below_the_projects_rung_with_its_reviewers_on_it_and_its_judge_on_the_models_highest(self):
|
||||
checkout = Checkout(self)
|
||||
checkout.env["LOOP_CLAUDE_WORKER_MODEL"] = checkout.env["LOOP_CLAUDE_JUDGE_MODEL"] = "claude-opus-5-5"
|
||||
checkout.commit_plan(CHEAP)
|
||||
@@ -537,11 +537,11 @@ class Cycles(unittest.TestCase):
|
||||
first = next(call for call in run.calls if call["role"] == "worker")
|
||||
self.assertEqual((argument(first, "--model"), argument(first, "--effort")), ("claude-sonnet-5-5", "high"))
|
||||
ruling = next(call for call in run.calls if call["role"] == "judge")
|
||||
self.assertEqual((argument(ruling, "--model"), argument(ruling, "--effort")), ("claude-opus-5-5", "medium"))
|
||||
self.assertIn('Judge: claude-opus-5-5 at medium effort\nWorker: {"model": "claude-sonnet-5-5", "effort": "high", ', "".join(checkout.archived().values()))
|
||||
self.assertEqual((argument(ruling, "--model"), argument(ruling, "--effort")), ("claude-opus-5-5", "xhigh"))
|
||||
self.assertIn('Judge: claude-opus-5-5 at xhigh effort\nWorker: {"model": "claude-sonnet-5-5", "effort": "high", ', "".join(checkout.archived().values()))
|
||||
self.assertIn("Launch each reviewer, each comprehension seat and the security pass's subagent with the Agent tool set to model opus, effort medium, the project's rung.", argument(first, "-p"))
|
||||
|
||||
def test_routes_the_judge_and_the_reviewers_on_the_highest_e_plus_i_the_worker_takes_in(self):
|
||||
def test_routes_the_reviewers_on_the_highest_e_plus_i_the_worker_takes_in_and_keeps_the_judge_on_the_models_highest(self):
|
||||
checkout = Checkout(self)
|
||||
checkout.env["LOOP_CLAUDE_WORKER_MODEL"] = checkout.env["LOOP_CLAUDE_JUDGE_MODEL"] = "claude-opus-5-5"
|
||||
checkout.commit_plan(TAKEN_IN_AT_E_PLUS_I_6)
|
||||
@@ -551,13 +551,13 @@ class Cycles(unittest.TestCase):
|
||||
worker(say="next chunk"),
|
||||
])
|
||||
self.assertEqual(run.code, 130)
|
||||
self.assertEqual([(argument(call, "--model"), argument(call, "--effort")) for call in run.calls if call["role"] == "judge"], [("claude-opus-5-5", "medium"), ("claude-fable-5-2", "medium"), ("claude-opus-5-5", "medium")])
|
||||
self.assertEqual([(argument(call, "--model"), argument(call, "--effort")) for call in run.calls if call["role"] == "judge"], [("claude-opus-5-5", "xhigh")] * 3)
|
||||
workers = [call for call in run.calls if call["role"] == "worker"]
|
||||
self.assertEqual({argument(call, "--effort") for call in workers}, {"high"})
|
||||
self.assertIn("Launch each reviewer with the Agent tool set to model fable, effort medium, the rung picked by an item of E + I 6 taken into the chunk.", argument(workers[1], "-p"))
|
||||
outcomes = "".join(checkout.archived().values())
|
||||
self.assertIn('<UTC> Stepped up\n\nWorker: {"model": "claude-sonnet-5-5", "effort": "high", "item": 4, "likelihood": 2, "escape_and_impact": 3, "escape_and_impact_taken_in": 6}\n', outcomes)
|
||||
self.assertIn('Judge: claude-fable-5-2 at medium effort\nWorker: {"model": "claude-sonnet-5-5", "effort": "high", "item": 4, "likelihood": 2, "escape_and_impact": 3, "escape_and_impact_taken_in": 6}\n', outcomes)
|
||||
self.assertIn('Judge: claude-opus-5-5 at xhigh effort\nWorker: {"model": "claude-sonnet-5-5", "effort": "high", "item": 4, "likelihood": 2, "escape_and_impact": 3, "escape_and_impact_taken_in": 6}\n', outcomes)
|
||||
|
||||
def test_a_rerun_resumes_an_open_chunk_on_the_rung_it_last_ran(self):
|
||||
checkout = Checkout(self)
|
||||
|
||||
@@ -1133,18 +1133,11 @@ class Routing(unittest.TestCase):
|
||||
self.assertEqual(routing.next_route(self.OPUS, Route(Rung("claude-opus-5-5", "low")), unfinished()).rung, self.OPUS)
|
||||
self.assertEqual(routing.next_route(self.OPUS, Route(Rung("claude-opus-5-5", "low")), unfinished(2)).rung, self.OPUS)
|
||||
|
||||
def test_runs_the_judge_on_the_rung_its_chunks_items_e_plus_i_picks_never_below_the_projects(self):
|
||||
self.assertEqual(routing.judge_rung("claude-opus-5-5", Route(self.OPUS, 3, 3, 5)), self.ONE_UP)
|
||||
self.assertEqual(routing.judge_rung("claude-opus-5-5", Route(self.TWO_UP, 3, 4, 5)), self.ONE_UP)
|
||||
self.assertEqual(routing.judge_rung("claude-opus-5-5", Route(self.SONNET, 3, 2, 7)), self.THREE_UP)
|
||||
self.assertEqual(routing.judge_rung("claude-opus-5-5", Route(Rung("claude-haiku-5-5", "max"), 3, 1, 3)), self.OPUS)
|
||||
self.assertEqual(routing.judge_rung("claude-opus-5-5", Route(self.ONE_UP)), self.OPUS)
|
||||
self.assertEqual(routing.judge_rung("judge-model", Route(self.ONE_UP, 3, 4, 5)), Rung("judge-model"))
|
||||
self.assertEqual(routing.judge_rung("claude-sonnet-5-5", Route(self.ONE_UP, 3, 4, 5)), Rung("claude-sonnet-5-5"))
|
||||
|
||||
def test_runs_the_judge_on_the_rung_the_highest_e_plus_i_taken_in_picks(self):
|
||||
self.assertEqual(routing.judge_rung("claude-opus-5-5", Route(self.OPUS, 3, 3, 4, escape_and_impact_taken_in=6)), self.TWO_UP)
|
||||
self.assertEqual(routing.judge_rung("claude-opus-5-5", Route(self.OPUS, escape_and_impact_taken_in=5)), self.ONE_UP)
|
||||
def test_runs_the_judge_of_a_replayed_model_on_its_models_highest_rung(self):
|
||||
self.assertEqual(routing.judge_rung("claude-opus-5-5"), self.THREE_UP)
|
||||
# A model off the ladder, or not replayed, gets no effort flag.
|
||||
self.assertEqual(routing.judge_rung("judge-model"), Rung("judge-model"))
|
||||
self.assertEqual(routing.judge_rung("claude-sonnet-5-5"), Rung("claude-sonnet-5-5"))
|
||||
|
||||
def test_refuses_a_route_whose_item_has_levels_off_their_scales_or_levels_without_an_item(self):
|
||||
for item, likelihood, escape_and_impact in ((3, 0, 5), (3, 5, 5), (3, 4, 1), (3, 4, 9), (0, 4, 5), (0, 4, 0), (0, 0, 5)):
|
||||
|
||||
@@ -9,7 +9,7 @@ class TakenIn:
|
||||
items: tuple[int, ...] = ()
|
||||
# The highest L among them, 0 for none: an escalation steps up from the rung that L picks, and an unfinished verdict also raises the worker to it.
|
||||
highest_likelihood: int = 0
|
||||
# The highest E + I among them, 0 for none: after an unfinished verdict, it routes the next cycle's judge and reviewers.
|
||||
# The highest E + I among them, 0 for none: after an unfinished verdict, it routes the next cycle's reviewers.
|
||||
highest_escape_and_impact: int = 0
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ def levels_fit(item: int, likelihood: int, escape_and_impact: int, escape_and_im
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Route:
|
||||
"""A chunk's worker rung and the plan item that picked it, 0 for none. The item's L picked the worker's rung; reviewed_on, the higher of its E + I and the highest E + I the worker took in, picks the reviewers' and the judge's. A route holds only levels that levels_fit, so no rung is picked from a level off its scale.
|
||||
"""A chunk's worker rung and the plan item that picked it, 0 for none. The item's L picked the worker's rung; reviewed_on, the higher of its E + I and the highest E + I the worker took in, picks the reviewers'. A route holds only levels that levels_fit, so no rung is picked from a level off its scale.
|
||||
|
||||
unfinished counts the unfinished verdicts towards the next one-rung step; a reload hands it over with the rung.
|
||||
"""
|
||||
@@ -63,7 +63,7 @@ class Route:
|
||||
return dataclasses.replace(self, escape_and_impact_taken_in=escape_and_impact) if REVIEW_STEPS.get(escape_and_impact, 0) > REVIEW_STEPS.get(self.reviewed_on(), 0) else self
|
||||
|
||||
def reviewed_on(self) -> int:
|
||||
"""The E + I that picks the reviewers' and the judge's rung: the routed item's or the highest taken in, whichever is higher; 0 for neither."""
|
||||
"""The E + I that picks the reviewers' rung: the routed item's or the highest taken in, whichever is higher; 0 for neither."""
|
||||
return max(self.escape_and_impact, self.escape_and_impact_taken_in)
|
||||
|
||||
def worker_line(self) -> WorkerLine:
|
||||
|
||||
+41
-15
@@ -35,10 +35,11 @@ class Tried(typing.Generic[Case, Aim, Answer]):
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Replay(typing.Generic[Case, Aim, Answer]):
|
||||
"""on_reference holds the reference's reply on each case; tried, each candidate tried, highest first; lowest, the lowest rung that, like each candidate above it, missed nothing, or None."""
|
||||
"""on_reference holds the reference's reply on each case; tried, each candidate tried, highest first; lowest, the lowest candidate that, like each candidate above it, didn't miss anything, or None; climbed, each climb tried, in the order given."""
|
||||
on_reference: list[Answer]
|
||||
tried: list[Tried[Case, Aim, Answer]]
|
||||
lowest: Rung | None
|
||||
climbed: list[Tried[Case, Aim, Answer]] = dataclasses.field(default_factory=list)
|
||||
|
||||
|
||||
def replayed(
|
||||
@@ -48,31 +49,56 @@ def replayed(
|
||||
replay_one: typing.Callable[[Case, Rung], Answer | Limited],
|
||||
reproduced: typing.Callable[[Case, Answer], list[Aim]],
|
||||
what: str,
|
||||
climbs: typing.Sequence[Rung] = (),
|
||||
) -> Replay[Case, Aim, Answer] | Limited:
|
||||
"""Replays the cases on the reference rung, then each candidate, highest first, on the cases where the reference reproduced anything, until one misses an item it reproduced.
|
||||
"""Replays the cases on the reference rung, then on each climb and each candidate, on the cases where the reference reproduced anything.
|
||||
|
||||
Going down, every rung at or above the one named was tried and missed nothing, so the result needs no assumption that a higher rung does at least as well; and a miss high up spares the cheaper rungs their replays.
|
||||
A climb is a rung above the candidates, such as one a chunk's E + I raises a review to. The rungs a route picks there don't follow from one another, so each climb is tried whatever another misses.
|
||||
|
||||
The candidates are tried highest first, until one misses an item the reference reproduced. Going down, every candidate at or above the one named was tried and didn't miss anything, so the result needs no assumption that a higher rung does at least as well; and a miss high up spares the cheaper rungs their replays.
|
||||
"""
|
||||
on_reference = replayed_on(cases, reference, replay_one, what)
|
||||
if isinstance(on_reference, Limited):
|
||||
return on_reference
|
||||
held = [(case, aim) for case, reply in zip(cases, on_reference) if (aim := reproduced(case, reply))]
|
||||
# With nothing to hold a rung to, no rung would miss anything.
|
||||
if not held:
|
||||
return Replay(on_reference, [], None)
|
||||
climbed: list[Tried[Case, Aim, Answer]] = []
|
||||
for rung in climbs:
|
||||
climb = tried_on(held, rung, replay_one, reproduced, what)
|
||||
if isinstance(climb, Limited):
|
||||
return climb
|
||||
climbed.append(climb)
|
||||
tried: list[Tried[Case, Aim, Answer]] = []
|
||||
lowest = None
|
||||
# With nothing to hold a rung to, every rung would miss nothing.
|
||||
for rung in candidates if held else []:
|
||||
replies = replayed_on([case for case, _ in held], rung, replay_one, what)
|
||||
if isinstance(replies, Limited):
|
||||
return replies
|
||||
misses: list[Miss[Case, Aim, Answer]] = []
|
||||
for (case, aim), reply in zip(held, replies):
|
||||
got = reproduced(case, reply)
|
||||
misses += [Miss(case, item, reply) for item in aim if item not in got]
|
||||
tried.append(Tried(rung, misses))
|
||||
if misses:
|
||||
for rung in candidates:
|
||||
candidate = tried_on(held, rung, replay_one, reproduced, what)
|
||||
if isinstance(candidate, Limited):
|
||||
return candidate
|
||||
tried.append(candidate)
|
||||
if candidate.missed:
|
||||
break
|
||||
lowest = rung
|
||||
return Replay(on_reference, tried, lowest)
|
||||
return Replay(on_reference, tried, lowest, climbed)
|
||||
|
||||
|
||||
def tried_on(
|
||||
held: list[tuple[Case, list[Aim]]],
|
||||
rung: Rung,
|
||||
replay_one: typing.Callable[[Case, Rung], Answer | Limited],
|
||||
reproduced: typing.Callable[[Case, Answer], list[Aim]],
|
||||
what: str,
|
||||
) -> Tried[Case, Aim, Answer] | Limited:
|
||||
"""rung and each item, of those the reference reproduced in the held cases, that its replies missed."""
|
||||
replies = replayed_on([case for case, _ in held], rung, replay_one, what)
|
||||
if isinstance(replies, Limited):
|
||||
return replies
|
||||
misses: list[Miss[Case, Aim, Answer]] = []
|
||||
for (case, aim), reply in zip(held, replies):
|
||||
got = reproduced(case, reply)
|
||||
misses += [Miss(case, item, reply) for item in aim if item not in got]
|
||||
return Tried(rung, misses)
|
||||
|
||||
|
||||
def replayed_on(cases: list[Case], rung: Rung, replay_one: typing.Callable[[Case, Rung], Answer | Limited], what: str) -> list[Answer] | Limited:
|
||||
|
||||
@@ -18,7 +18,7 @@ CHEAP = Rung("claude-haiku-5-5", "max")
|
||||
LOWER = Rung("claude-haiku-5-5", "xhigh")
|
||||
|
||||
|
||||
def search(cases, candidates, replies):
|
||||
def search(cases, candidates, replies, climbs=()):
|
||||
"""replayed on cases named by strings, where replies[rung][case] is the set of items a rung reproduces in the case."""
|
||||
asked = []
|
||||
|
||||
@@ -28,7 +28,7 @@ def search(cases, candidates, replies):
|
||||
return reply if isinstance(reply, Limited) else reply[case]
|
||||
|
||||
with contextlib.redirect_stderr(io.StringIO()):
|
||||
return replayed(cases, REFERENCE, candidates, replay_one, lambda _, reply: sorted(reply), "cases"), asked
|
||||
return replayed(cases, REFERENCE, candidates, replay_one, lambda _, reply: sorted(reply), "cases", climbs), asked
|
||||
|
||||
|
||||
class Replayed(unittest.TestCase):
|
||||
@@ -46,8 +46,17 @@ class Replayed(unittest.TestCase):
|
||||
replies = {REFERENCE: {"a": {0}, "b": {0}}, MIDDLE: {"a": set(), "b": {0}}}
|
||||
self.assertEqual(search(["a", "b"], [MIDDLE], replies)[0], Replay([{0}, {0}], [Tried(MIDDLE, [Miss("a", 0, set())])], None))
|
||||
|
||||
def test_holds_each_climb_to_what_the_reference_reproduced_whatever_another_climb_misses(self):
|
||||
high, higher = Rung("claude-fable-5-2", "low"), Rung("claude-fable-5-2", "high")
|
||||
replies = {REFERENCE: {"a": {0}, "b": set()}, high: {"a": set()}, higher: {"a": {0}}, MIDDLE: {"a": {0}}}
|
||||
replay, asked = search(["a", "b"], [MIDDLE], replies, [high, higher])
|
||||
self.assertEqual(replay, Replay([{0}, set()], [Tried(MIDDLE, [])], MIDDLE, [Tried(high, [Miss("a", 0, set())]), Tried(higher, [])]))
|
||||
self.assertNotIn(("b", high), asked)
|
||||
self.assertEqual(search(["a"], [MIDDLE], {REFERENCE: {"a": set()}}, [high]), (Replay([set()], [], None, []), [("a", REFERENCE)]))
|
||||
|
||||
def test_stops_at_a_usage_limit(self):
|
||||
limit = Limited(None, "limit")
|
||||
self.assertEqual(search(["a"], [MIDDLE], {REFERENCE: {"a": {0}}, MIDDLE: {"a": {0}}, CHEAP: limit}, [CHEAP])[0], limit)
|
||||
self.assertEqual(search(["a"], [MIDDLE], {REFERENCE: limit})[0], limit)
|
||||
self.assertEqual(search(["a"], [MIDDLE, CHEAP], {REFERENCE: {"a": {0}}, MIDDLE: limit})[0], limit)
|
||||
|
||||
|
||||
+23
-5
@@ -416,6 +416,20 @@ loop-claude's prompt names the rungs a trigger opens, so the worker computes no
|
||||
|
||||
Valid while the ladder orders its rungs by competence.
|
||||
|
||||
## routing: a worker runs without the advisor tool
|
||||
|
||||
2026-11-12, lilleman, settled by the bench below. Serves goal 1.4: a switch that raises cost without raising quality is no saving. Valid while the ladder's L 1 and L 2 workers run on Sonnet 5.5 and the advisor would be Opus 5.5.
|
||||
|
||||
`claude -p` calls the advisor. A probe with `--advisor claude-opus-5-5` made one call: it read the whole conversation, 20,187 uncached input tokens, and cost $0.093 beside the worker's $0.036. `workflow-bench/advisor_bench.py` ran six archived chunks of this repo (todo items 290, 251 and 218 at L 1, and 289, 229 and 214 at L 2) once on each of three arms: Sonnet 5.5 at high with the advisor, Sonnet 5.5 at high alone, and Opus 5.5 at medium. A judge on Opus 5.5 at medium, blind to the arm, ruled each run's change against the change that shipped, with the tests of the packages either change touches.
|
||||
|
||||
| Arm | Passes | Mean cost | Mean seconds | Runs with an advisor call |
|
||||
|---|---|---|---|---|
|
||||
| Sonnet 5.5 with the advisor | 6 of 6 | $0.37 | 286 | 1 of 6 |
|
||||
| Sonnet 5.5 alone | 6 of 6 | $0.27 | 151 | 0 of 6 |
|
||||
| Opus 5.5 at medium | 6 of 6 | $0.46 | 197 | 0 of 6 |
|
||||
|
||||
Every arm passed every case, so the bench found no quality gap for an advisor to close, and Sonnet alone cost 41% less than Opus at medium. The advisor's one call, in item 214's run, cost $0.72 of that run's $1.24, against $0.41 for Sonnet alone. Anthropic's reported gain (https://claude.com/blog/the-advisor-strategy) came on SWE-bench Multilingual, a harder set than L 1 and L 2 chunks. The bench ran each arm once per case, and its judge is of the worker's own model family, so it shows a direction only. It tested L 1 and L 2 items alone. Workers on items above L 2 run without the advisor too, since nothing shows it pays there, until a bench of such items does.
|
||||
|
||||
## routing: a worker whose run ends asking for a higher rung, citing an escalation trigger the judge finds in the transcript, steps one rung up as the judge interrupts or quotes an answer, or next cycle, up to two rungs above the rung its item picks
|
||||
|
||||
2026-10-15, lilleman asked for it. Serves goals 1.1 and 1.4: when the hard part is the rest of the chunk, handing it to subagents piece by piece leaves the worker, which reads and checks each of their diffs, on a rung that proved too low. The worker climbs only once its run records a trigger.
|
||||
@@ -442,7 +456,7 @@ Since 2026-10-16 the reviewers may run above the worker's rung, on the one the h
|
||||
|
||||
## routing: loop-claude reads the items a chunk takes from the worker's latest `Chunk items:` line and scores them by `todo.md` as the default branch held it when the cycle started; the judge reports the escalation and whether a release is ready to cut
|
||||
|
||||
2026-11-11, claude. Serves goal 1.4 and code health. The judge's reply held three facts beside its verdict: the items the worker took into the chunk, with their highest L and E + I; whether a release was ready to cut; and any escalation the worker asked for. Routing lifts the worker's, the reviewers' and the judge's rungs by the items' levels. Code now reads the items: each chunk's first prompt, and each prompt resuming it, asks the worker for a line opening `Chunk items:`, `bin/loop_claude/cycle/chunk_items.py` reads the latest such line in the worker's own text, and `release_plan.todo_table` scores the items. So the judge's reply is smaller, and every L and E + I that routing reads comes from `todo.md`, through one module.
|
||||
2026-11-11, claude. Serves goal 1.4 and code health. The judge's reply held three facts beside its verdict: the items the worker took into the chunk, with their highest L and E + I; whether a release was ready to cut; and any escalation the worker asked for. Routing lifts the worker's and the reviewers' rungs by the items' levels. Code now reads the items: each chunk's first prompt, and each prompt resuming it, asks the worker for a line opening `Chunk items:`, `bin/loop_claude/cycle/chunk_items.py` reads the latest such line in the worker's own text, and `release_plan.todo_table` scores the items. So the judge's reply is smaller, and every L and E + I that routing reads comes from `todo.md`, through one module.
|
||||
|
||||
The judge field trials (`judge-field-trials/`) read each fact by code over the 709 archived cases. Code was wrong in each of the 39 cases where it and the judge disagreed on an escalation, and read a release ready to cut in 3 of the 31 interrupts that asked about a cut, so the judge keeps both. Workers stated an item with its L and E + I in 413 cases, but also stated items they filed, finished or only mentioned, so the worker writes the items on a line that holds only them, which code reads. Three fresh readers picked its label `Chunk items:`, 3 to 0, because it says the items are the chunk's.
|
||||
|
||||
@@ -450,15 +464,19 @@ An item the chunk re-scores on its branch routes on its planned levels until the
|
||||
|
||||
Valid while workers write the line when asked, and while `todo.md` on the default branch scores each item a chunk takes.
|
||||
|
||||
## routing: on a model judge-replay covered, the judge runs on the rung a review would get from the highest E + I among its chunk's items, never below the project's rung
|
||||
## routing: on a model judge-replay covered, the judge runs on its model's highest rung
|
||||
|
||||
2026-10-15, lilleman's plan, settled by the replay below. Serves goals 1.2 and 1.4, under the ladder and steps of `routing: one ladder`.
|
||||
2026-10-15, lilleman's plan, settled by the replays below. Serves goals 1.1, 1.2 and 1.4, under the ladder and steps of `routing: one ladder`.
|
||||
|
||||
On a model listed in `JUDGE_REPLAYED` in `bin/loop_claude/routing.py`, the judge runs on the rung a review would get from the highest E + I among its chunk's items: the routed item and those the worker takes in. It never runs below the project's rung, and keeps its rung when the worker steps up. Without an item, it runs on the project's rung. Each archived verdict names the judge's rung on a `Judge:` line.
|
||||
On a model listed in `JUDGE_REPLAYED` in `bin/loop_claude/routing.py`, the judge runs on its model's highest rung, whatever the chunk's items score: on an Opus 5.5 project, Opus 5.5 at xhigh. It keeps its rung when the worker steps up. Each archived verdict names the judge's rung on a `Judge:` line.
|
||||
|
||||
On 2026-10-15, `bin/judge-replay claude-opus-5-5` replayed the latest 15 archived verdicts of each kind from the Opus 5.5 projects, 39 in all. The reference judge, Opus 5.5 at the xhigh effort `settings.json` gave every judge before, reproduced 31 of them. The other 8 may rest on records or judge rules that have changed since; either way no rung is held to them. On the 31, Haiku 5.5 missed 7 at xhigh and 8 at max. That run tried each judge once. 4 of Haiku's misses, 1 at xhigh and 3 at max, misquoted the transcript, which the loop and `judge-replay` now retry; without them it missed 6 and 5. Sonnet 5.5 at high returned another kind on 3 interrupts, and Opus 5.5 at medium missed none. A missed interrupt lets the worker settle a decision that is lilleman's (goal 1.2), so the judge never runs below the project's rung.
|
||||
|
||||
Only Opus 5.5 was replayed, so the judge of a project on another model keeps the effort its settings give until `judge-replay` covers that model (goal 1.1). Every routed chunk on record had an item of R + C 9, so the replay could not show that the project's rung suffices for harder items, and the judge climbs with the routed item. Since 2026-10-16, lilleman's call, it climbs with the item's E + I, as a review does: the judge checks the worker's decisions as the reviewers check its code, and a decision the judge lets through reaches lilleman, as a defect that review lets through reaches the users (goal 1.2). It runs above the project's rung only on an E + I of 5 or more (goal 1.4). It counts a taken-in item from the next cycle on.
|
||||
Only Opus 5.5 was replayed, so the judge of a project on another model keeps the effort its settings give until `judge-replay` covers that model (goal 1.1). From 2026-10-16 to 2026-11-12 the judge ran at medium below an E + I of 5 and at xhigh from 5, climbing with the highest E + I among the routed item and those the worker took in, as a review does: lilleman's call, since the judge checks the worker's decisions as the reviewers check its code, and a decision it lets through reaches lilleman, as a defect that review lets through reaches the users (goal 1.2).
|
||||
|
||||
On 2026-11-12, `bin/judge-replay claude-opus-5-5` replayed 60 verdicts, 15 of each kind, and also tried each rung above the project's that a review climbs to by E + I. The reference judge reproduced 46. On those 46, Fable 5.2 missed 2 interrupts and 6 other verdicts at low, 1 interrupt and 4 others at medium, and 1 interrupt and 2 others at high. Every Fable 5.2 rung it tried misses an interrupt, so the judge keeps to its own model's rungs (goal 1.2). That rule also keeps it off Fable 5.2 at max, which no replay tried. Opus 5.5 at medium missed no interrupt, but returned another kind on 4 quoted answers, 3 of them as finished.
|
||||
|
||||
2026-11-12, claude, raising the judge's floor to xhigh, settled by the reruns below. Serves goal 1.1, at a cost to goal 1.4. Today's records still hold each of the 4 archived quotes, so no case drops out. For fejkdata the quote, `Split a milestone into items in todo.md before starting it`, doesn't plainly answer whether a split changes what release 0.5.0 holds, which is lilleman's choice. That case stays, since xhigh quotes it in 3 of 3 replays. Each case was replayed on today's records and the archived transcript copy. Opus 5.5 at medium returned the quoted answer 7 times in 20: adf-codec 4 of 5 (the fifth as finished), claude-config 3 of 5 (2 finished), plainpages 0 of 5 (5 finished) and fejkdata 0 of 5 (5 unfinished). At xhigh it returned it 9 times in 12: adf-codec 1 of 3 (2 interrupts), claude-config 3 of 3, plainpages 2 of 3 (1 finished) and fejkdata 3 of 3. So the misses persist at medium, and xhigh returns the quote more than twice as often. A quoted answer returned as finished closes a chunk whose worker was asking a question, a quality miss (goal 1.1). xhigh costs more per judge run (goal 1.4); the `Judge cost:` lines of three of the four cases, run at medium, read 0.57 to 0.79. xhigh is not free of misses: it returned a quoted answer as finished once, and as an interrupt twice, which only asks lilleman more.
|
||||
|
||||
Valid while the archived verdicts show what a judge should return, and until a new model joins the ladder: replay then.
|
||||
|
||||
|
||||
@@ -1664,3 +1664,64 @@ Read most (opens and searches):
|
||||
- `agents/product-owner-reviewer.md` 1
|
||||
- `agents/systems-architect.md` 1
|
||||
- `bin/mutate-changes` 1
|
||||
|
||||
## Reading cost, chunk 171d7158e8ce, finished 2026-11-12T00:16:54Z
|
||||
|
||||
42878 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `docs/decisions.md` 2
|
||||
- `todo.md` 2
|
||||
- `bin/model_routing/ladder.py` 1
|
||||
|
||||
## Reading cost, chunk bb58cf91ab1f, finished 2026-11-12T01:03:54Z
|
||||
|
||||
162283 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `todo.md` 12
|
||||
- `README.md` 7
|
||||
- `docs/decisions.md` 7
|
||||
- `bin/judge_replay/test_judge_replay.py` 4
|
||||
- `bin/loop_claude/routing.py` 4
|
||||
- `bin/judge_replay/replay.py` 3
|
||||
- `bin/loop_claude/test_loop_claude.py` 3
|
||||
- `bin/model_routing/ladder.py` 3
|
||||
- `bin/rung_replay/search.py` 3
|
||||
- `CHANGELOG.md` 2
|
||||
|
||||
## Reading cost, chunk 0ded0c4aa0a1, finished 2026-11-12T01:14:37Z
|
||||
|
||||
180267 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `todo.md` 16
|
||||
- `skills/larv-review/SKILL.md` 10
|
||||
- `bin/command_patterns/tally.py` 5
|
||||
- `README.md` 4
|
||||
- `bin/command_patterns/main.py` 4
|
||||
- `skills/comprehension-panel/seat-prompts.md` 4
|
||||
- `bin/chunk_pr/main.py` 3
|
||||
- `skills/comprehension-panel/SKILL.md` 3
|
||||
- `agents/stability-reviewer.md` 2
|
||||
- `CHANGELOG.md` 1
|
||||
|
||||
## Reading cost, chunk 8640ba15252f, finished 2026-11-12T02:12:06Z
|
||||
|
||||
82406 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `docs/decisions.md` 7
|
||||
- `bin/loop_claude/routing.py` 4
|
||||
- `CLAUDE.md` 3
|
||||
- `README.md` 3
|
||||
- `bin/loop_claude/test_black_box.py` 3
|
||||
- `CHANGELOG.md` 2
|
||||
- `bin/judge_replay/main.py` 2
|
||||
- `bin/loop_claude/test_loop_claude.py` 2
|
||||
- `bin/model_routing/route.py` 2
|
||||
- `todo.md` 2
|
||||
|
||||
@@ -6,71 +6,74 @@
|
||||
|
||||
`Bar = 0.1`
|
||||
|
||||
`Next ID = 332`
|
||||
`Next ID = 339`
|
||||
|
||||
## Items
|
||||
|
||||
| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| 331 | 0.8.0 | | question | **Reword four decisions to expire when the rungs their replays tested change, not whenever a model joins the ladder.** | 1 | 1 | 1 | 1 | 2 | 1.4 by 2 | 0.9 |
|
||||
| 330 | 0.8.0 | | | **Replay the judge on each Fable 5.2 rung an Opus 5.5 project's E + I climbs it to, and keep it off any rung that misses an interrupt.** | 3 | 3 | 2 | 6 | 3 | 1.2 by 4, 1.1 by 3 | 2.9 |
|
||||
| 320 | 0.8.0 | | | **Bench a worker below the project's rung with the advisor tool against the same worker alone and the project's rung, and file the switch if it wins.** | 2 | 2 | 2 | 4 | 3 | 1.4 by 3, 1.1 by 2 | 2.0 |
|
||||
| 315 | 0.8.0 | | | **Start each reviewer under `agents/` without `CLAUDE.md`, and hand it the vocabulary, the prose rules and the project's decision titles.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 6 | 2.0 |
|
||||
| 312 | 0.8.0 | | | **Research the tooling agents read, search and run commands with, and file an item for each tool that cuts tokens a replay shows keep quality.** | 1 | 2 | 1 | 2 | 3 | 1.4 by 3, 1.5 by 2 | 2.0 |
|
||||
| 325 | 0.8.0 | | | **Give this repo's test suite one command that runs it as README → Test says, prints the failing tests and pytest's summary line, and saves the whole log to a file whose path it prints.** | 3 | 2 | 2 | 5 | 3 | 1.4 by 3, 1.5 by 2 | 2.0 |
|
||||
| 305 | 0.8.0 | | | **Record with each archived verdict the claude-config commit that ran it, the raw tokens each model spent by kind, and each choice of the worker's that the human reversed, so a change to the setup can be judged before and after.** | 3 | 2 | 3 | 6 | 5 | 1.4 by 4, 1.2 by 3 | 1.8 |
|
||||
| 318 | 0.8.0 | | | **Let `review-replay` qualify a rung whose recall is no lower than the project's rung's own replay, and replay Opus 5.5 at low effort on the prose pass.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 5 | 1.7 |
|
||||
| 308 | 0.8.0 | | | **Skip a stability round 2 whose every must-fix finding named a surviving mutant or a failing test, both of which the worker now checks before review.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 3, 1.5 by 2 | 1.6 |
|
||||
| 295 | 0.8.0 | | | **Have `chunk-pr merge` wait for the forge's required checks itself, and give workers one command that waits for a background log or report file.** | 2 | 2 | 3 | 5 | 3 | 1.4 by 2, 1.5 by 2 | 1.6 |
|
||||
| 319 | 0.8.0 | | | **Start a fresh session with a brief of the chunk when a rung step changes the worker's model, in place of resuming the old session.** | 3 | 2 | 3 | 6 | 4 | 1.1 by 2, 1.4 by 2 | 1.4 |
|
||||
| 309 | 0.8.0 | | | **Run a scoring run's second pass on one head with two seats in place of four, once `larv-review agreement` shows the seats agree with each other more than a run agrees with its rerun.** | 2 | 2 | 2 | 4 | 2 | 1.4 by 3 | 1.3 |
|
||||
| 299 | 0.8.0 | | | **Replay the archived judge verdicts through code rules and a classifier trained locally on the archive, and file an item for each verdict kind one of them decides with no missed interrupt.** | 2 | 2 | 2 | 4 | 3 | 1.4 by 3 | 1.2 |
|
||||
| 311 | 0.8.0 | | | **Hand each worker's claude a Bash output ceiling that saves longer output to a file, and refuse a Read of a session transcript under `~/.claude/projects`.** | 2 | 2 | 3 | 5 | 3 | 1.4 by 3 | 1.2 |
|
||||
| 316 | 0.8.0 | | | **Launch comprehension seats as an agent type of their own under `agents/`, without `CLAUDE.md` and the skill and agent listings a general-purpose subagent carries.** | 2 | 2 | 2 | 4 | 3 | 1.4 by 3 | 1.2 |
|
||||
| 310 | 0.8.0 | | | **Compact a waiting worker's session shortly before its prompt cache expires, only when the human has not answered an interrupt by then.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 3 | 1.0 |
|
||||
| 298 | 0.8.0 | | | **Send the judge only the decision entries and the transcript tail a verdict needs, and keep the cut only where `judge-replay` changes no verdict kind.** | 3 | 3 | 3 | 7 | 4 | 1.4 by 2, 1.5 by 1 | 1.0 |
|
||||
| 326 | 0.8.0 | | | **Let `chunk-pr ready` take the pull request's final title and set it as it marks the pull request ready.** | 2 | 1 | 3 | 4 | 2 | 1.4 by 1, 1.5 by 1 | 0.9 |
|
||||
| 327 | 0.8.0 | | | **Have `larv-review` print a round commit's title prefix, counted from the round's report, and have rule-hook refuse a round title whose counts differ from it.** | 3 | 2 | 3 | 6 | 4 | 1.1 by 1, 1.4 by 1 | 0.7 |
|
||||
| 303 | 0.9.0 | | defect | **Archive each judge run's prompt and json reply beside the verdict it gave, so judge cost, replays and backups cover the judge as they cover the worker.** | 2 | 2 | 3 | 5 | 3 | 1.4 by 3, 3 by 2 | 4.8 |
|
||||
| 304 | 0.9.0 | 303 | defect | **Archive each review-replay and judge-replay run's transcript beside its result, so a replay that decided a rung can be checked and re-priced later.** | 2 | 2 | 2 | 4 | 3 | 1.4 by 2, 3 by 2 | 4.4 |
|
||||
| 306 | 0.9.0 | | | **Set a strategy that keeps loop-claude's archive and larv-review's review folders backed up and small over the years, compressing older entries without losing any.** | 3 | 2 | 4 | 7 | 5 | 3 by 5 | 3.9 |
|
||||
| 302 | 0.9.0 | | | **Call a scoring run for an item whose tagline makes the comprehension floor its target, and not for one that only names the floor, such as in a quoted decision title.** | 2 | 2 | 3 | 5 | 3 | code health by 2 | 3.6 |
|
||||
| 287 | 0.9.0 | | | **Move the forge helpers `Forge`, `forge_of`, `runner`, `open_pull`, `merged_pull`, `pull_at` and `gitea` into one module that `chunk_preflight`, `chunk_pr`, `deploy_release` and `larv_review` all import from, so no tool imports another tool's internals for them.** | 3 | 1 | 3 | 5 | 5 | code health by 3 | 3.4 |
|
||||
| 328 | 0.9.0 | | owner | **Script each step that 0.8.0's chunks repeated by hand and a program can compute, filing one item per step, and file this audit again for the next release.** | 1 | 2 | 1 | 2 | 2 | 1.4 by 3, 1.5 by 3 | 2.6 |
|
||||
| 288 | 0.9.0 | | | **Point the two reading-cost decisions at code health and goal 1.4's counter-signal, in place of the goal 1.1 they cite.** | 1 | 2 | 1 | 2 | 1 | code health by 1, 1.4 by 1 | 2.6 |
|
||||
| 77 | 0.9.0 | | | **Teach `bin/metric-bench` Go and TypeScript, rerun it once two projects' comprehension histories name places, and bring into review only a metric that tracks the panel.** | 4 | 2 | 1 | 5 | 6 | 1.1 by 7, 1.4 by 7 | 2.4 |
|
||||
| 321 | 0.9.0 | 318 | | **Evaluate the review passes that run on a rung item 318 qualified, against the chunks before them, and revert any pass whose findings or later fixes worsened.** | 1 | 2 | 1 | 2 | 2 | 1.1 by 3, 1.4 by 2 | 2.3 |
|
||||
| 273 | 0.9.0 | | decision | **Re-tune the E + I steps of `REVIEW_STEPS` for 6 to 8 once 10 finished chunks have scored an E + I of 6 or more, from how well E + I orders their review rounds and 🔴 findings.** | 1 | 2 | 2 | 3 | 2 | 1.1 by 2, 1.4 by 3 | 2.3 |
|
||||
| 268 | 0.9.0 | | | **End a run whose release is ready to cut with a notice on loop-claude's terminal, in place of an interrupt that waits for an answer.** | 2 | 2 | 3 | 5 | 3 | 1 by 5 | 2.2 |
|
||||
| 171 | 0.9.0 | | decision | **Group the routing figures' review rounds by the reviewers' rung as well as the worker's, so a call blames a rung only for rounds its own reviews raised.** | 3 | 2 | 2 | 5 | 4 | 1.2 by 3, 1.4 by 3 | 2.0 |
|
||||
| 300 | 0.9.0 | | owner | **Restructure the places the comprehension seats found hardest to follow, so the project reads at 7.0 or above on every dimension, Locality first: today the comprehension floor run at 52da15e scored Locality 6.00, Shape 6.25, Self-sufficiency 6.38 and Overall 6.38.** | 4 | 2 | 3 | 7 | 8 | code health by 8 | 2.0 |
|
||||
| 264 | 0.9.0 | | | **Report the comprehension seats and the escalated subagents as subagent types of their own in `routing-figures.md`, with their dollars.** | 2 | 2 | 1 | 3 | 3 | 1.4 by 5 | 2.0 |
|
||||
| 323 | 0.9.0 | | | **Count a release review as landed once its pull request has merged, whatever its commits are titled.** | 3 | 2 | 3 | 6 | 3 | 1.4 by 3, 1.5 by 2 | 2.0 |
|
||||
| 149 | 0.9.0 | | decision | **Fill each release by priority up to a capacity it states, in place of the bar, and move what does not fit to a later release.** | 4 | 2 | 3 | 7 | 5 | 1.1 by 7 | 1.8 |
|
||||
| 165 | 0.9.0 | | | **Make this repo's tests assert the facts a prompt or help text carries in place of its sentences, and drop the tests that scan source or assert a constant.** | 3 | 2 | 1 | 4 | 5 | 1.1 by 4, 1.4 by 3 | 1.8 |
|
||||
| 151 | 0.9.0 | | decision | **Keep 10 to 20 settled decisions per project as its goals' test set, and rerun them after a goal changes.** | 3 | 2 | 2 | 5 | 5 | 1.2 by 7 | 1.8 |
|
||||
| 68 | 0.9.0 | | principle | **Test `workflow-bench/compare.py`'s blinding and `bench.py`'s run plan.** | 2 | 1 | 1 | 2 | 4 | 1.1 by 5 | 1.8 |
|
||||
| 102 | 0.9.0 | | | **Give loop-claude's retry delay, and the file it reads the machine's memory from, environment overrides, so the black-box test stops replacing `time.sleep` and `machine_load.memory.MEMINFO` through `sitecustomize`.** | 1 | 1 | 2 | 2 | 3 | 1.1 by 4 | 1.7 |
|
||||
| 135 | 0.9.0 | | | **Fingerprint only the modules loop-claude imports, so editing another tool's code no longer reloads a running loop.** | 2 | 2 | 3 | 5 | 3 | 1.1 by 4 | 1.7 |
|
||||
| 5 | 0.9.0 | | decision | **Key a project on its checkout's full path, and refuse to start while another session uses that key.** | 4 | 2 | 3 | 7 | 5 | 1.1 by 6 | 1.6 |
|
||||
| 291 | 0.9.0 | | owner | **Let `principles/technical-principles.md` → "Sane defaults" allow a library whose README goals ask that it work with no config to default the clock and randomness in its public constructor, where a documented option overrides each.** | 1 | 2 | 3 | 4 | 1 | 1.2 by 3 | 1.4 |
|
||||
| 156 | 0.9.0 | | decision | **Drop `rank_todo.py`'s ranking of an old-shape table once no project under `~/code` holds one.** | 2 | 1 | 3 | 4 | 4 | 1.1 by 4 | 1.4 |
|
||||
| 196 | 0.9.0 | | decision | **Replay the architecture, principles, overrides and product-owner passes with `review-replay` on Opus 5.5 projects, record each run in the review-replay routing decision, and, where a run qualifies a rung, add back the code that lowers a pass to it.** | 2 | 2 | 3 | 5 | 2 | 1.4 by 3 | 1.3 |
|
||||
| 260 | 0.9.0 | | decision | **Compare the first 20 chunks whose worker got the reading rule with the 20 before them, on review rounds past each pass's first, unfinished verdicts, 🔴, 🟡 and misread findings, dollars and hours per chunk, and drop the rule where any rose.** | 1 | 2 | 1 | 2 | 2 | 1.4 by 3 | 1.3 |
|
||||
| 51 | 0.9.0 | | principle | **Hand loop-claude's terminal output to an injected effect, so no storage or retry function prints.** | 2 | 1 | 3 | 4 | 5 | 1.1 by 5 | 1.3 |
|
||||
| 201 | 0.9.0 | | owner | **Save the human's tmux setups and restore them after a reboot, so work is up and running again quickly.** | 3 | 2 | 1 | 4 | 4 | 1.5 by 4 | 1.3 |
|
||||
| 267 | 0.9.0 | | | **Keep waiting when an interrupt gets an empty answer, at the terminal or in the claude opened for it, in place of stopping the loop.** | 2 | 1 | 3 | 4 | 2 | 1.5 by 3 | 1.3 |
|
||||
| 4 | 0.9.0 | | | **Name each chunk's archive folder by the chunk's start time, so `<key>/` lists chunks in the order they ran.** | 3 | 2 | 3 | 6 | 3 | 1.1 by 3 | 1.3 |
|
||||
| 324 | 0.9.0 | | | **Count in the routing figures the finished chunks whose worker wrote no `Chunk items:` line.** | 2 | 2 | 1 | 3 | 3 | 1.1 by 2, 1.4 by 1 | 1.2 |
|
||||
| 187 | 0.9.0 | | | **Count the tokens a worker spends reading reviewers' reports, so goal 1.4's signal shows whether report files lowered what a review costs the worker's context.** | 2 | 2 | 1 | 3 | 3 | 1.4 by 3 | 1.2 |
|
||||
| 266 | 0.9.0 | | | **Move the chunks archived under the key `home/lilleman/.claude` to the key `claude-config`, so the routing figures and `score-outcomes` count this repo's chunks as one project.** | 3 | 2 | 2 | 5 | 3 | 1.4 by 3 | 1.2 |
|
||||
| 181 | 0.9.0 | | principle | **Have the test of a quoted answer's step-up assert the stepped rung's facts as literals, not through `prompts.rungs_held`.** | 1 | 1 | 1 | 1 | 1 | 1.1 by 2 | 1.0 |
|
||||
| 193 | 0.9.0 | | | **Narrow `readme_goals`'s mark to `Mark` by a typed lookup in place of `typing.cast`, so a mark added to the regex but not the lookup fails at run time, and one added to the lookup but not `Mark` fails mypy.** | 1 | 1 | 3 | 3 | 1 | 1.1 by 2 | 1.0 |
|
||||
| 194 | 0.9.0 | | | **Make `test_waits_out_a_usage_limit_which_ends_a_run_of_failures` expect a usage-limit wait independent of the wall-clock time that passes during the run.** | 1 | 1 | 1 | 1 | 1 | 1.1 by 2 | 1.0 |
|
||||
| 265 | 0.9.0 | | | **Archive each wait that costs a chunk wall time, for a usage limit, low memory, a failed worker start or a heavy slot, with its start and end stamps, so goal 1.5's hours split waiting from work.** | 3 | 2 | 2 | 5 | 4 | 1.5 by 3 | 1.0 |
|
||||
| 169 | 0.9.0 | | | **Have rule-hook's `todo-rank-check` catch a `todo.md` that the same Bash call edits and then commits.** | 3 | 1 | 3 | 5 | 3 | 1.1 by 2 | 0.8 |
|
||||
| 197 | 0.9.0 | | | **Let the human edit what they type at loop-claude's terminal questions with the arrow keys, so Left moves the cursor in place of printing `^[[D`.** | 2 | 2 | 3 | 5 | 2 | 1.5 by 1 | 0.4 |
|
||||
| 1 | 0.10.0 | | question | **Say in README → Install how the transcript archive is backed up, once bender-infra backs up ai-sandbox's data volume.** | 1 | 2 | 1 | 2 | 1 | | 0.0 |
|
||||
| 331 | 0.9.0 | | question | **Reword four decisions to expire when the rungs their replays tested change, not whenever a model joins the ladder.** | 1 | 1 | 1 | 1 | 2 | 1.4 by 2 | 0.9 |
|
||||
| 315 | 0.9.0 | | | **Start each reviewer under `agents/` without `CLAUDE.md`, and hand it the vocabulary, the prose rules and the project's decision titles.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 6 | 2.0 |
|
||||
| 312 | 0.9.0 | | | **Research the tooling agents read, search and run commands with, and file an item for each tool that cuts tokens a replay shows keep quality.** | 1 | 2 | 1 | 2 | 3 | 1.4 by 3, 1.5 by 2 | 2.0 |
|
||||
| 325 | 0.9.0 | | | **Give this repo's test suite one command that runs it as README → Test says, prints the failing tests and pytest's summary line, and saves the whole log to a file whose path it prints.** | 3 | 2 | 2 | 5 | 3 | 1.4 by 3, 1.5 by 2 | 2.0 |
|
||||
| 305 | 0.9.0 | | | **Record with each archived verdict the claude-config commit that ran it, the raw tokens each model spent by kind, and each choice of the worker's that the human reversed, so a change to the setup can be judged before and after.** | 3 | 2 | 3 | 6 | 5 | 1.4 by 4, 1.2 by 3 | 1.8 |
|
||||
| 335 | 0.9.0 | | | **Print an item's row and detail with `todo-item show <ID>`.** | 1 | 1 | 2 | 2 | 2 | 1.4 by 3, 1.5 by 1 | 1.8 |
|
||||
| 318 | 0.9.0 | | | **Let `review-replay` qualify a rung whose recall is no lower than the project's rung's own replay, and replay Opus 5.5 at low effort on the prose pass.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 5 | 1.7 |
|
||||
| 308 | 0.9.0 | | | **Skip a stability round 2 whose every must-fix finding named a surviving mutant or a failing test, both of which the worker now checks before review.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 3, 1.5 by 2 | 1.6 |
|
||||
| 295 | 0.9.0 | | | **Have `chunk-pr merge` wait for the forge's required checks itself, and give workers one command that waits for a background log or report file.** | 2 | 2 | 3 | 5 | 3 | 1.4 by 2, 1.5 by 2 | 1.6 |
|
||||
| 319 | 0.9.0 | | | **Start a fresh session with a brief of the chunk when a rung step changes the worker's model, in place of resuming the old session.** | 3 | 2 | 3 | 6 | 4 | 1.1 by 2, 1.4 by 2 | 1.4 |
|
||||
| 309 | 0.9.0 | | | **Run a scoring run's second pass on one head with two seats in place of four, once `larv-review agreement` shows the seats agree with each other more than a run agrees with its rerun.** | 2 | 2 | 2 | 4 | 2 | 1.4 by 3 | 1.3 |
|
||||
| 299 | 0.9.0 | | | **Replay the archived judge verdicts through code rules and a classifier trained locally on the archive, and file an item for each verdict kind one of them decides with no missed interrupt.** | 2 | 2 | 2 | 4 | 3 | 1.4 by 3 | 1.2 |
|
||||
| 311 | 0.9.0 | | | **Hand each worker's claude a Bash output ceiling that saves longer output to a file, and refuse a Read of a session transcript under `~/.claude/projects`.** | 2 | 2 | 3 | 5 | 3 | 1.4 by 3 | 1.2 |
|
||||
| 316 | 0.9.0 | | | **Launch comprehension seats as an agent type of their own under `agents/`, without `CLAUDE.md` and the skill and agent listings a general-purpose subagent carries.** | 2 | 2 | 2 | 4 | 3 | 1.4 by 3 | 1.2 |
|
||||
| 310 | 0.9.0 | | | **Compact a waiting worker's session shortly before its prompt cache expires, only when the human has not answered an interrupt by then.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 3 | 1.0 |
|
||||
| 298 | 0.9.0 | | | **Send the judge only the decision entries and the transcript tail a verdict needs, and keep the cut only where `judge-replay` changes no verdict kind.** | 3 | 3 | 3 | 7 | 4 | 1.4 by 2, 1.5 by 1 | 1.0 |
|
||||
| 326 | 0.9.0 | | | **Let `chunk-pr ready` take the pull request's final title and set it as it marks the pull request ready.** | 2 | 1 | 3 | 4 | 2 | 1.4 by 1, 1.5 by 1 | 0.9 |
|
||||
| 337 | 0.9.0 | | | **Write each Bash call of a release's chunks to a file of JSON lines with `command-patterns <version> --calls <file>`.** | 1 | 1 | 1 | 1 | 2 | 1.4 by 1, 1.5 by 1 | 0.9 |
|
||||
| 332 | 0.9.0 | | defect | **Let `deploy-release` move a checkout whose `settings.json` differs from the release only by a `/model` pick or the key order Claude Code writes.** | 2 | 2 | 2 | 4 | 2 | 1.5 by 2 | 0.9 |
|
||||
| 336 | 0.9.0 | | | **Bring a chunk's branch level with origin's default branch, and print the rank check, with one `chunk-pr sync`.** | 2 | 2 | 3 | 5 | 3 | 1.4 by 1, 1.5 by 1 | 0.8 |
|
||||
| 334 | 0.9.0 | | | **Set up a scoring run with one `larv-review` command that makes the scoring worktree, writes each seat's prompt file, and removes both once `record-scoring` has run.** | 3 | 2 | 2 | 5 | 5 | 1.4 by 2, 1.5 by 1 | 0.7 |
|
||||
| 327 | 0.9.0 | | | **Have `larv-review` print a round commit's title prefix, counted from the round's report, and have rule-hook refuse a round title whose counts differ from it.** | 3 | 2 | 3 | 6 | 4 | 1.1 by 1, 1.4 by 1 | 0.7 |
|
||||
| 303 | 0.10.0 | | defect | **Archive each judge run's prompt and json reply beside the verdict it gave, so judge cost, replays and backups cover the judge as they cover the worker.** | 2 | 2 | 3 | 5 | 3 | 1.4 by 3, 3 by 2 | 4.8 |
|
||||
| 304 | 0.10.0 | 303 | defect | **Archive each review-replay and judge-replay run's transcript beside its result, so a replay that decided a rung can be checked and re-priced later.** | 2 | 2 | 2 | 4 | 3 | 1.4 by 2, 3 by 2 | 4.4 |
|
||||
| 306 | 0.10.0 | | | **Set a strategy that keeps loop-claude's archive and larv-review's review folders backed up and small over the years, compressing older entries without losing any.** | 3 | 2 | 4 | 7 | 5 | 3 by 5 | 3.9 |
|
||||
| 302 | 0.10.0 | | | **Call a scoring run for an item whose tagline makes the comprehension floor its target, and not for one that only names the floor, such as in a quoted decision title.** | 2 | 2 | 3 | 5 | 3 | code health by 2 | 3.6 |
|
||||
| 287 | 0.10.0 | | | **Move the forge helpers `Forge`, `forge_of`, `runner`, `open_pull`, `merged_pull`, `pull_at` and `gitea` into one module that `chunk_preflight`, `chunk_pr`, `deploy_release` and `larv_review` all import from, so no tool imports another tool's internals for them.** | 3 | 1 | 3 | 5 | 5 | code health by 3 | 3.4 |
|
||||
| 338 | 0.10.0 | | owner | **Script each step that 0.9.0's chunks repeated by hand and a program can compute, filing one item per step, and file this audit again for the next release.** | 1 | 2 | 1 | 2 | 2 | 1.4 by 3, 1.5 by 3 | 2.6 |
|
||||
| 288 | 0.10.0 | | | **Point the two reading-cost decisions at code health and goal 1.4's counter-signal, in place of the goal 1.1 they cite.** | 1 | 2 | 1 | 2 | 1 | code health by 1, 1.4 by 1 | 2.6 |
|
||||
| 77 | 0.10.0 | | | **Teach `bin/metric-bench` Go and TypeScript, rerun it once two projects' comprehension histories name places, and bring into review only a metric that tracks the panel.** | 4 | 2 | 1 | 5 | 6 | 1.1 by 7, 1.4 by 7 | 2.4 |
|
||||
| 321 | 0.10.0 | 318 | | **Evaluate the review passes that run on a rung item 318 qualified, against the chunks before them, and revert any pass whose findings or later fixes worsened.** | 1 | 2 | 1 | 2 | 2 | 1.1 by 3, 1.4 by 2 | 2.3 |
|
||||
| 273 | 0.10.0 | | decision | **Re-tune the E + I steps of `REVIEW_STEPS` for 6 to 8 once 10 finished chunks have scored an E + I of 6 or more, from how well E + I orders their review rounds and 🔴 findings.** | 1 | 2 | 2 | 3 | 2 | 1.1 by 2, 1.4 by 3 | 2.3 |
|
||||
| 268 | 0.10.0 | | | **End a run whose release is ready to cut with a notice on loop-claude's terminal, in place of an interrupt that waits for an answer.** | 2 | 2 | 3 | 5 | 3 | 1 by 5 | 2.2 |
|
||||
| 171 | 0.10.0 | | decision | **Group the routing figures' review rounds by the reviewers' rung as well as the worker's, so a call blames a rung only for rounds its own reviews raised.** | 3 | 2 | 2 | 5 | 4 | 1.2 by 3, 1.4 by 3 | 2.0 |
|
||||
| 300 | 0.10.0 | | owner | **Restructure the places the comprehension seats found hardest to follow, so the project reads at 7.0 or above on every dimension, Locality first: today the comprehension floor run at 52da15e scored Locality 6.00, Shape 6.25, Self-sufficiency 6.38 and Overall 6.38.** | 4 | 2 | 3 | 7 | 8 | code health by 8 | 2.0 |
|
||||
| 264 | 0.10.0 | | | **Report the comprehension seats and the escalated subagents as subagent types of their own in `routing-figures.md`, with their dollars.** | 2 | 2 | 1 | 3 | 3 | 1.4 by 5 | 2.0 |
|
||||
| 323 | 0.10.0 | | | **Count a release review as landed once its pull request has merged, whatever its commits are titled.** | 3 | 2 | 3 | 6 | 3 | 1.4 by 3, 1.5 by 2 | 2.0 |
|
||||
| 149 | 0.10.0 | | decision | **Fill each release by priority up to a capacity it states, in place of the bar, and move what does not fit to a later release.** | 4 | 2 | 3 | 7 | 5 | 1.1 by 7 | 1.8 |
|
||||
| 165 | 0.10.0 | | | **Make this repo's tests assert the facts a prompt or help text carries in place of its sentences, and drop the tests that scan source or assert a constant.** | 3 | 2 | 1 | 4 | 5 | 1.1 by 4, 1.4 by 3 | 1.8 |
|
||||
| 151 | 0.10.0 | | decision | **Keep 10 to 20 settled decisions per project as its goals' test set, and rerun them after a goal changes.** | 3 | 2 | 2 | 5 | 5 | 1.2 by 7 | 1.8 |
|
||||
| 68 | 0.10.0 | | principle | **Test `workflow-bench/compare.py`'s blinding and `bench.py`'s run plan.** | 2 | 1 | 1 | 2 | 4 | 1.1 by 5 | 1.8 |
|
||||
| 102 | 0.10.0 | | | **Give loop-claude's retry delay, and the file it reads the machine's memory from, environment overrides, so the black-box test stops replacing `time.sleep` and `machine_load.memory.MEMINFO` through `sitecustomize`.** | 1 | 1 | 2 | 2 | 3 | 1.1 by 4 | 1.7 |
|
||||
| 135 | 0.10.0 | | | **Fingerprint only the modules loop-claude imports, so editing another tool's code no longer reloads a running loop.** | 2 | 2 | 3 | 5 | 3 | 1.1 by 4 | 1.7 |
|
||||
| 5 | 0.10.0 | | decision | **Key a project on its checkout's full path, and refuse to start while another session uses that key.** | 4 | 2 | 3 | 7 | 5 | 1.1 by 6 | 1.6 |
|
||||
| 291 | 0.10.0 | | owner | **Let `principles/technical-principles.md` → "Sane defaults" allow a library whose README goals ask that it work with no config to default the clock and randomness in its public constructor, where a documented option overrides each.** | 1 | 2 | 3 | 4 | 1 | 1.2 by 3 | 1.4 |
|
||||
| 156 | 0.10.0 | | decision | **Drop `rank_todo.py`'s ranking of an old-shape table once no project under `~/code` holds one.** | 2 | 1 | 3 | 4 | 4 | 1.1 by 4 | 1.4 |
|
||||
| 196 | 0.10.0 | | decision | **Replay the architecture, principles, overrides and product-owner passes with `review-replay` on Opus 5.5 projects, record each run in the review-replay routing decision, and, where a run qualifies a rung, add back the code that lowers a pass to it.** | 2 | 2 | 3 | 5 | 2 | 1.4 by 3 | 1.3 |
|
||||
| 260 | 0.10.0 | | decision | **Compare the first 20 chunks whose worker got the reading rule with the 20 before them, on review rounds past each pass's first, unfinished verdicts, 🔴, 🟡 and misread findings, dollars and hours per chunk, and drop the rule where any rose.** | 1 | 2 | 1 | 2 | 2 | 1.4 by 3 | 1.3 |
|
||||
| 51 | 0.10.0 | | principle | **Hand loop-claude's terminal output to an injected effect, so no storage or retry function prints.** | 2 | 1 | 3 | 4 | 5 | 1.1 by 5 | 1.3 |
|
||||
| 201 | 0.10.0 | | owner | **Save the human's tmux setups and restore them after a reboot, so work is up and running again quickly.** | 3 | 2 | 1 | 4 | 4 | 1.5 by 4 | 1.3 |
|
||||
| 267 | 0.10.0 | | | **Keep waiting when an interrupt gets an empty answer, at the terminal or in the claude opened for it, in place of stopping the loop.** | 2 | 1 | 3 | 4 | 2 | 1.5 by 3 | 1.3 |
|
||||
| 4 | 0.10.0 | | | **Name each chunk's archive folder by the chunk's start time, so `<key>/` lists chunks in the order they ran.** | 3 | 2 | 3 | 6 | 3 | 1.1 by 3 | 1.3 |
|
||||
| 324 | 0.10.0 | | | **Count in the routing figures the finished chunks whose worker wrote no `Chunk items:` line.** | 2 | 2 | 1 | 3 | 3 | 1.1 by 2, 1.4 by 1 | 1.2 |
|
||||
| 187 | 0.10.0 | | | **Count the tokens a worker spends reading reviewers' reports, so goal 1.4's signal shows whether report files lowered what a review costs the worker's context.** | 2 | 2 | 1 | 3 | 3 | 1.4 by 3 | 1.2 |
|
||||
| 266 | 0.10.0 | | | **Move the chunks archived under the key `home/lilleman/.claude` to the key `claude-config`, so the routing figures and `score-outcomes` count this repo's chunks as one project.** | 3 | 2 | 2 | 5 | 3 | 1.4 by 3 | 1.2 |
|
||||
| 181 | 0.10.0 | | principle | **Have the test of a quoted answer's step-up assert the stepped rung's facts as literals, not through `prompts.rungs_held`.** | 1 | 1 | 1 | 1 | 1 | 1.1 by 2 | 1.0 |
|
||||
| 193 | 0.10.0 | | | **Narrow `readme_goals`'s mark to `Mark` by a typed lookup in place of `typing.cast`, so a mark added to the regex but not the lookup fails at run time, and one added to the lookup but not `Mark` fails mypy.** | 1 | 1 | 3 | 3 | 1 | 1.1 by 2 | 1.0 |
|
||||
| 194 | 0.10.0 | | | **Make `test_waits_out_a_usage_limit_which_ends_a_run_of_failures` expect a usage-limit wait independent of the wall-clock time that passes during the run.** | 1 | 1 | 1 | 1 | 1 | 1.1 by 2 | 1.0 |
|
||||
| 265 | 0.10.0 | | | **Archive each wait that costs a chunk wall time, for a usage limit, low memory, a failed worker start or a heavy slot, with its start and end stamps, so goal 1.5's hours split waiting from work.** | 3 | 2 | 2 | 5 | 4 | 1.5 by 3 | 1.0 |
|
||||
| 169 | 0.10.0 | | | **Have rule-hook's `todo-rank-check` catch a `todo.md` that the same Bash call edits and then commits.** | 3 | 1 | 3 | 5 | 3 | 1.1 by 2 | 0.8 |
|
||||
| 197 | 0.10.0 | | | **Let the human edit what they type at loop-claude's terminal questions with the arrow keys, so Left moves the cursor in place of printing `^[[D`.** | 2 | 2 | 3 | 5 | 2 | 1.5 by 1 | 0.4 |
|
||||
| 1 | 0.11.0 | | question | **Say in README → Install how the transcript archive is backed up, once bender-infra backs up ai-sandbox's data volume.** | 1 | 2 | 1 | 2 | 1 | | 0.0 |
|
||||
|
||||
## Details
|
||||
|
||||
@@ -81,22 +84,10 @@ The architect's 🔀 answer on PR #493 (item 292): four decisions expire "when a
|
||||
- `review: each pass keeps a reviewer of its own`: the merge trials ran on Opus 5.5 at medium. Reword the "Valid" line to name that rung.
|
||||
- `review: the principles audit runs only in the release review…`: its trial ran on the project's rung. Reword the line to name that rung.
|
||||
- `routing: a review pass runs below the project's rung only on a rung that a replay…`: `review-replay` tests only rungs below the project's rung. Have the line expire when those rungs change, the event item 196 names ("until a cheaper model joins the ladder").
|
||||
- `routing: on a model judge-replay covered, the judge runs…`: the replay tested the project's rung and below, while the climb above rests on the ladder's order alone. Have the line name both, and point the climb at item 330.
|
||||
- `routing: on a model judge-replay covered, the judge runs…`: the replays tested the project's rung and below, and each rung above it that a review climbs to. Have the line expire when those rungs change.
|
||||
|
||||
Recommendation: reword all four as above. They are decisions the repo held before item 292, so the rewording is lilleman's call.
|
||||
|
||||
### 330. Replay the judge on each Fable 5.2 rung an Opus 5.5 project's E + I climbs it to, and keep it off any rung that misses an interrupt.
|
||||
|
||||
Item 292 put Fable 5.2 on the routing ladder. On an Opus 5.5 project the judge now climbs with its chunk's E + I onto Fable 5.2 at low, medium and high, at E + I 5, 6 and 8. Fable 5.2 has never returned a judge verdict, and the 2026-10-15 replay showed that another model can miss an interrupt in kind, not only in strength. `routing: on a model judge-replay covered, the judge runs …` rests on that replay.
|
||||
|
||||
`bin/judge-replay` replays only the project's rung and the rungs below it (`down_from` in `judge_replay/main.py`), so as it stands it never runs a Fable 5.2 rung. Give it the rungs the judge climbs to as well, run `bin/judge-replay claude-opus-5-5`, and record the result in that decision. Where a Fable 5.2 rung misses an interrupt the reference judge returns, keep the judge off it until a decision says otherwise.
|
||||
|
||||
The review passes need no replay: `review-replay` tests only rungs below the project's rung, which item 292 left as they were.
|
||||
|
||||
### 320. Bench a worker below the project's rung with the advisor tool against the same worker alone and the project's rung, and file the switch if it wins.
|
||||
|
||||
Anthropic reports Sonnet 4.6 with an Opus 4.6 advisor scored 2.7 points more on SWE-bench Multilingual at 11.9% less cost than Sonnet alone (the vendor's own run; https://claude.com/blog/the-advisor-strategy). The docs say `/advisor` works with `-p`, but not outright that the advisor is called during a `-p` run, so probe that first. Each advisor call hands the advisor the whole conversation, so count its cost. Bench on `workflow-bench` with archived L 1 and L 2 items: Sonnet with the advisor, Sonnet alone, Opus at medium. lilleman approved on 2026-11-11.
|
||||
|
||||
### 315. Start each reviewer under `agents/` without `CLAUDE.md`, and hand it the vocabulary, the prose rules and the project's decision titles.
|
||||
|
||||
`omitClaudeMd: true` in an agent's frontmatter (Claude Code 2.1.271 or later) starts it without the user, project and local instruction files. About 77% of `CLAUDE.md` is the worker's: "Working loop", "Working with the codebase", "Git", "Handoffs", "Compact instructions". Over the archive, each 1,000 prefix tokens cost $31 across the six reviewers, so this saves about 1.9% of spend. A reviewer still needs "Vocabulary", "Prose" and the project's decision titles: put the first two in the agent bodies or a `SubagentStart` hook's `additionalContext`, and have `larv-review reviewer-header` print the titles.
|
||||
@@ -129,6 +120,14 @@ Three records the archive lacks, asked for by lilleman on 2026-11-11 after the t
|
||||
|
||||
Build on item 303's archive layout for the judge's part.
|
||||
|
||||
### 335. Print an item's row and detail with `todo-item show <ID>`.
|
||||
|
||||
Found by item 328's audit of release 0.8.0. All 9 of its chunks looked items up in `todo.md` by hand: `grep -n '^### N'`, `awk '/^### N\./,/^### [0-9]+\./'` ranges, `sed -n` offsets computed from a grep, and several retries to find the `## Details` line first. About 29 calls did only that, costing 1.3k command tokens and 15.9k result tokens; a looser grep over the audit's calls finds 40 such calls in all 9 chunks, many of them compound with other reads. Most of the result tokens went on reading far more than the one item, such as `sed -n 1,140p todo.md`.
|
||||
|
||||
`todo-item show <ID>` prints the item's table row, under the table's header line, and its detail, from `### <ID>.` to the next heading, and fails, saying so, where the ID has no row. It reads only `todo.md`, so it fits beside `add` and `finish` in `bin/todo_item/main.py`. `CLAUDE.md` → "Working loop" tells a worker to read the details of the items its chunk takes; that line names the command once it ships.
|
||||
|
||||
Left with the model: reading the item and judging what it asks.
|
||||
|
||||
### 318. Let `review-replay` qualify a rung whose recall is no lower than the project's rung's own replay, and replay Opus 5.5 at low effort on the prose pass.
|
||||
|
||||
Today a rung qualifies only if it re-finds every finding the project's rung found. The project's rung itself re-finds only 69 to 73% of its own findings on a replay (29 of 40, 27 of 39, 20 of 29), so even a reviewer exactly as good would fail, and "no pass has such a rung" says less than it seems. Qualify a rung when its share of the archived findings is no lower than the project's rung's own replay share, within a margin, over enough rounds, and it misses no 🔴 that both project-rung runs found. Then replay Opus 5.5 at low effort on the prose pass first, the pass whose misses cost least; the `effort` frontmatter key sets it per reviewer.
|
||||
@@ -193,6 +192,38 @@ Let `chunk-pr ready` take an optional final title and set it as it marks the pul
|
||||
|
||||
Left with the model: wording the title.
|
||||
|
||||
### 337. Write each Bash call of a release's chunks to a file of JSON lines with `command-patterns <version> --calls <file>`.
|
||||
|
||||
Found by item 328's audit of release 0.8.0. `command-patterns <version>` prints only a table of patterns, so an audit that must read the calls behind a pattern writes its own script. This audit wrote a 20-line Python script over `read_threads` and `calls` to dump 0.8.0's 2,317 calls, one per line, with the chunk, the pattern, the seconds, the command's and the result's sizes, and the command's text. Item 284's chunk, the 0.7.0 audit, wrote `/tmp/audit284/calls.jsonl` the same way. Each audit pays for writing and checking that script again, and item 328 recurs every release.
|
||||
|
||||
`--calls <file>` writes one JSON object per Bash call to `<file>`, besides printing the table: the chunk's number in the window, the pattern `pattern` in `bin/command_patterns/tally.py` gives it, its seconds, its command's and its result's characters, and the command's text. It needs `Call` to carry its pattern and its chunk, or `main.py` to pair them as it tallies. `command-patterns --help` and item 328's recurring detail name the flag.
|
||||
|
||||
Left with the model: reading the calls and judging which steps a program computes the same way each time.
|
||||
|
||||
### 332. Let `deploy-release` move a checkout whose `settings.json` differs from the release only by a `/model` pick or the key order Claude Code writes.
|
||||
|
||||
On 2026-11-12, moving `~/.claude` from v0.7.0 to v0.8.0, `deploy-release` failed at `git checkout --quiet --detach v0.8.0`: "Your local changes to the following files would be overwritten by checkout: settings.json". Claude Code had rewritten the file with `"model": "opus"` and its keys in another order. The `settings` clean filter drops the model and sorts the keys, so `git diff` showed no change and the tool's own check passed, but checkout compares the file as it is on disk. `deploy-release --help` says a model picked with `/model` doesn't block the move.
|
||||
|
||||
The move worked after `git checkout -- settings.json`, with the model added back by hand. Have the tool set aside a change the clean filter removes, move, and restore the model pick, or tell the user to pick it again, as it already does when the move changes `settings.json`. Test it with a working file that differs from HEAD only by the model and the key order.
|
||||
|
||||
### 336. Bring a chunk's branch level with origin's default branch, and print the rank check, with one `chunk-pr sync`.
|
||||
|
||||
Found by item 328's audit of release 0.8.0. 8 of its 9 chunks synced with the default branch by hand before the merge, in 13 calls (about 2.4k tokens, 6 s): `git fetch -q origin && git merge-base --is-ancestor origin/main HEAD && echo holds-main`, then, where that failed, `git merge -q origin/main`, then `rank_todo.py --check todo.md`.
|
||||
|
||||
`chunk-pr sync` fetches origin, merges its default branch into the chunk's branch where the branch does not already hold it, and prints one line saying which it did. Then it runs `rank_todo.py --check` where the worktree has a `todo.md`, and prints its result. On a merge conflict it stops with the merge in progress and names the conflicted files. chunk-pr already finds origin's default branch for `open`, so `sync` reuses that; where the change touches `bin/chunk_pr/main.py:42` `forge`, which the comprehension seats found hard because its helpers live in other packages, make it easier to read. `chunk-pr --help` and `larv-review` §4 step 1, which merges origin's default branch in before the gate, name the command.
|
||||
|
||||
Left with the model: resolving a conflict, such as one in `todo.md`, and fixing what the rank check reports.
|
||||
|
||||
### 334. Set up a scoring run with one `larv-review` command that makes the scoring worktree, writes each seat's prompt file, and removes both once `record-scoring` has run.
|
||||
|
||||
Found by item 328's audit of release 0.8.0. Of its 9 chunks, only item 296's ran a scoring run, since scoring runs are rare, and it set the run up by hand in about 20 Bash calls: 7 reads of `skills/comprehension-panel/SKILL.md`, `seat-prompts.md` and the scoring-run values (ls, wc, sed; about 12k result tokens); `git worktree add --detach ../claude-config-scoring origin/main`, then `git checkout -b scoring-item-301`; one `mkdir /tmp/seat296` and three heredocs writing shared.txt, report-plain.txt and report-arch.txt (6.6k chars); two heredocs writing scores.md (4.5k and 3.6k chars); `larv-review record-scoring`; and `rm -rf /tmp/seat296`. About 16k tokens in all.
|
||||
|
||||
The prompt text is fixed: `seat-prompts.md` says to copy the opening, each seat's background, the shared brief and the report for its kind of seat verbatim, and lists each `{placeholder}`. A program fills most of them: `{checkout}`, `{branch}`, `{main}` and `{git}` from the worktree it makes, `{forbidden}` from fixed text, `{files}` from `git ls-files`, `{anchors}` and `{dimensions}` from `SKILL.md` → "The score", and `{language}`, `{kind}`, `{domain}`, `{domain docs}` and `{3am question}` from the project's scoring-run values (claude-config's in `seat-prompts.md` → "claude-config's values"). Where one needs judgement, such as `{preloaded}`, the command takes it as an argument. It refuses, writing nothing, where the project has no scoring-run values. Where the prompt files land, a folder under the chunk's review folder or the state folder, is the implementer's call.
|
||||
|
||||
The command makes the detached scoring worktree on origin's default branch, writes one prompt file per seat of the four `SKILL.md` → "The scoring run" names, and prints their paths. A second form, or `record-scoring` itself, removes the worktree and the prompt folder after recording.
|
||||
|
||||
Left with the model: launching the seats, reading their reports and writing the scores. Item 316 (the seats' own agent type) and item 309 (two seats in the second pass) change who reads these prompts and how many, not how they are built, so this item does not overlap them.
|
||||
|
||||
### 327. Have `larv-review` print a round commit's title prefix, counted from the round's report, and have rule-hook refuse a round title whose counts differ from it.
|
||||
|
||||
The 0.8.0 audit (item 284) measured, over the 35 chunks that shipped 0.7.0: 72 commit calls in 33 chunks titled `Answer <pass> round <n>: R 🔴, Y 🟡 (K misread); <what changed>`, about 11k command tokens, most of them the summary. Each worker counts R, Y and K by hand. All three are in the round's report, `<pass>-round-<n>.md` in the review folder: R and Y are its finding headings, and K counts the findings the reviewer marked `[misread]`, as `bin/review_rules/round_titles.py` says. That module parses the counts for `score-outcomes`, which reports them as goal 1.1's signal, and rule-hook's `round_cap.py` checks only the round number, so nothing checks today that the counts match the report. Of the 8 titles whose report the audit could match, none miscounted; one report wrote its markers at line start rather than in `###` headings, so the reports' format varies by reviewer.
|
||||
@@ -239,11 +270,13 @@ Both comprehension seats of PR #453's paired ruling (2026-11-09) named this web
|
||||
|
||||
Put the seven helpers in a folder named by what it holds, such as `bin/forge/`, and import them from there. Keep each helper's behaviour and its tests. `chunk_preflight/choices.py` keeps `pulls_command`, which is preflight's own. Check `docs/decisions.md` for a mention of where a helper lives, and update it.
|
||||
|
||||
### 328. Script each step that 0.8.0's chunks repeated by hand and a program can compute, filing one item per step, and file this audit again for the next release.
|
||||
### 338. Script each step that 0.9.0's chunks repeated by hand and a program can compute, filing one item per step, and file this audit again for the next release.
|
||||
|
||||
lilleman asked, on 2026-10-16, for a standing audit each release, so the loop keeps moving work a program does as well from the model to scripts (goals 1.4 and 1.5). This audit reads the archived transcripts of the chunks that shipped release 0.8.0 for every step that chunks repeated by hand, before, during or after review. It keeps the steps whose answer a program computes the same way each time, such as a lookup, a check, a prompt assembled for a reviewer, a cleanup. File one item per such step, with the time and tokens it cost, into the next release with items left. Leave a step that needs judgement with the model. Run `command-patterns 0.8.0` first; its table names the patterns, and `read_threads` and `calls` in `bin/command_patterns/tally.py` open the calls of one pattern. The 0.7.0 audit found that most steps its chunks repeated were already scripted by that release's own tools, so a step a shipped item already covers is not filed.
|
||||
lilleman asked, on 2026-10-16, for a standing audit each release, so the loop keeps moving work a program does as well from the model to scripts (goals 1.4 and 1.5). This audit reads the archived transcripts of the chunks that shipped release 0.9.0 for every step that chunks repeated by hand, before, during or after review. It keeps the steps whose answer a program computes the same way each time, such as a lookup, a check, a prompt assembled for a reviewer, a cleanup. File one item per such step, with the time and tokens it cost, into the next release with items left. Leave a step that needs judgement with the model. Run `command-patterns 0.9.0` first; its table names the patterns, and `read_threads` and `calls` in `bin/command_patterns/tally.py` open the calls of one pattern, or `--calls <file>` dumps them once item 337 ships. The 0.7.0 audit found that most steps its chunks repeated were already scripted by that release's own tools, so a step a shipped item already covers is not filed.
|
||||
|
||||
The chunk that ships this item files a copy of this audit in release 0.10.0, the release after this item's own, to audit release 0.9.0, rewording "0.8.0" to "0.9.0", and marks the copy `owner`, so the audit recurs each release until lilleman drops it.
|
||||
The 0.8.0 audit filed four steps, items 334, 335, 336 and 337, and found most other repeated steps already covered by items 295, 312, 325, 326 and 327.
|
||||
|
||||
The chunk that ships this item files a copy of this audit in release 0.11.0, the release after this item's own, to audit release 0.10.0, rewording "0.9.0" to "0.10.0", and marks the copy `owner`, so the audit recurs each release until lilleman drops it.
|
||||
|
||||
### 288. Point the two reading-cost decisions at code health and goal 1.4's counter-signal, in place of the goal 1.1 they cite.
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
You judge one worker's change to a todo item. You see the item, the change that shipped for it, the worker's change, and the result of the tests of the packages that either change touches, run on the worker's tree. You don't know which model wrote the worker's change.
|
||||
|
||||
Rule `pass` where the worker's change does what the item asks, comes with a test that fails without the change, and causes no failing test. Rule `partial` where it does most of the item or lacks that test. Rule `fail` where it misses the item, causes a failing test, or changes unrelated code. The shipped change is one correct answer, not the only one.
|
||||
|
||||
{text}
|
||||
|
||||
## The shipped change
|
||||
|
||||
{reference}
|
||||
|
||||
## The worker's change
|
||||
|
||||
{diff}
|
||||
|
||||
## The tests on the worker's tree
|
||||
|
||||
{tests}
|
||||
|
||||
Reply with JSON only: {{"verdict": "pass" | "partial" | "fail", "why": "<one sentence>"}}
|
||||
@@ -0,0 +1,10 @@
|
||||
You are the worker of one chunk of this repository, a throwaway clone at `{base}`. Implement todo item {item} below as `CLAUDE.md` → "Working loop" says, and stop when it is done and its tests pass.
|
||||
|
||||
{text}
|
||||
|
||||
## Bench rules
|
||||
|
||||
- The clone is yours and has no remote: make no worktree and no branch, open no pull request, don't push anything, run no review pass, and don't edit `todo.md`, `CHANGELOG.md` or `docs/`. Leave your change uncommitted.
|
||||
- Write the test first where a test can check the change, and see it fail.
|
||||
- Run the tests as `README.md` → Test says. No human is reachable: where the item leaves a choice open, take your recommendation.
|
||||
- End with a two-line summary of what you changed.
|
||||
@@ -0,0 +1,204 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Bench the advisor tool on archived chunks: advisor_bench.py <work dir> run|grade <case>-<arm>-<n> ..., then advisor_bench.py <work dir> summary
|
||||
|
||||
The question: does a worker below the project's rung, Sonnet 5.5 with Opus 5.5 as its advisor, beat the same
|
||||
Sonnet alone, or match Opus 5.5 at medium for less? Each case is an archived L 1 or L 2 chunk of this repo
|
||||
(CASES holds its todo.md item, the commit it started from and the commit it merged at). `run` clones the repo at
|
||||
the start commit and hands the arm's worker the item's text from todo.md, with the bench rules of
|
||||
advisor-run-prompt.md in place of loop-claude's prompt. It saves, beside the clone in <work dir>: the claude
|
||||
stream (.jsonl), the worker's change (.diff) and the result of the tests of the packages that either change touches (.tests).
|
||||
`grade` has a judge on Opus 5.5 at medium, blind to the arm, rule on the .diff against the merged commit's change
|
||||
(.verdict); `summary` prints a table per arm.
|
||||
Run each arm of each case once; the table shows a direction, not a significance.
|
||||
"""
|
||||
import concurrent.futures
|
||||
import dataclasses
|
||||
import json
|
||||
import pathlib
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
BENCH = pathlib.Path(__file__).resolve().parent
|
||||
REPO = BENCH.parent
|
||||
RUN_HEAVY = pathlib.Path.home() / ".claude/bin/run-heavy"
|
||||
SUITE = ["uvx", "--python", sys.executable, "--with", "pytest-xdist==3.8.0", "pytest==9.2.0", "-n", "4", "-q"]
|
||||
CASES = {
|
||||
"290": ("cda45a931", "509804da0"),
|
||||
"251": ("b74322892", "d13c4fb0d"),
|
||||
"218": ("62d57344d", "c424fa66a"),
|
||||
"289": ("034356f34", "62d1f5edd"),
|
||||
"229": ("e2aca90c9", "2321f4930"),
|
||||
"214": ("39dd51bb4", "4764d3d52"),
|
||||
}
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Arm:
|
||||
model: str
|
||||
effort: str
|
||||
advisor: str | None = None
|
||||
|
||||
def flags(self):
|
||||
return ["--model", self.model, "--effort", self.effort, *(["--advisor", self.advisor] if self.advisor else [])]
|
||||
|
||||
|
||||
ARMS = {
|
||||
"sonnet-advisor": Arm("claude-sonnet-5-5", "high", "claude-opus-5-5"),
|
||||
"sonnet": Arm("claude-sonnet-5-5", "high"),
|
||||
"opus-medium": Arm("claude-opus-5-5", "medium"),
|
||||
}
|
||||
VERDICTS = ("pass", "partial", "fail")
|
||||
JUDGE = Arm("claude-opus-5-5", "medium")
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Outcome:
|
||||
cost: float
|
||||
seconds: float
|
||||
advisor_calls: int
|
||||
|
||||
|
||||
def item_text(todo, item):
|
||||
"""The item's heading and detail in todo.md, up to the next item's heading."""
|
||||
found = re.search(rf"^### {item}\. .*?(?=^### \d+\. |\Z)", todo, re.DOTALL | re.MULTILINE)
|
||||
if not found:
|
||||
raise ValueError(f"item {item} has no detail in todo.md")
|
||||
return found.group().strip()
|
||||
|
||||
|
||||
def read_result(lines):
|
||||
"""The cost, seconds and advisor calls of a claude stream's first result line, which is the worker's: a background task's notification makes the later ones. The cost counts the advisor's tokens."""
|
||||
for line in lines:
|
||||
try:
|
||||
entry = json.loads(line)
|
||||
except ValueError:
|
||||
continue
|
||||
if entry.get("type") == "result":
|
||||
if entry.get("is_error"):
|
||||
raise ValueError(f"the run ended in an error: {entry.get('result')}")
|
||||
iterations = entry.get("usage", {}).get("iterations", [])
|
||||
return Outcome(
|
||||
cost=entry["total_cost_usd"], seconds=entry["duration_ms"] / 1000,
|
||||
advisor_calls=sum(1 for each in iterations if each.get("type") == "advisor_message"))
|
||||
raise ValueError("the stream has no result line")
|
||||
|
||||
|
||||
def verdict_of(reply):
|
||||
"""The verdict in the judge's `claude -p --output-format json` reply."""
|
||||
found = re.search(r"\{.*\}", json.loads(reply)["result"], re.DOTALL)
|
||||
if not found:
|
||||
raise ValueError("the judge's reply has no JSON object")
|
||||
verdict = json.loads(found.group())["verdict"]
|
||||
if verdict not in VERDICTS:
|
||||
raise ValueError(f"the judge's verdict {verdict!r} is none of {VERDICTS}")
|
||||
return verdict
|
||||
|
||||
|
||||
def split_name(name):
|
||||
"""The case, arm and run number of a run's name, such as 290-sonnet-advisor-1."""
|
||||
case, rest = name.split("-", 1)
|
||||
arm, number = rest.rsplit("-", 1)
|
||||
return case, arm, number
|
||||
|
||||
|
||||
def suite_targets(changed):
|
||||
"""The tests to run for a change: the package, or the lone module, under bin/ of each changed file, else all of bin/."""
|
||||
found = {"/".join(path.split("/")[:2]) for path in changed if path.startswith("bin/")}
|
||||
return sorted(found) or ["bin"]
|
||||
|
||||
|
||||
def summary(rows):
|
||||
"""A markdown table with one row per arm, in ARMS' order: its runs, passes, partials, mean cost, mean advisor calls and mean seconds."""
|
||||
lines = ["| arm | runs | pass | partial | mean cost $ | mean advisor calls | mean seconds |", "|---|---|---|---|---|---|---|"]
|
||||
for name in ARMS:
|
||||
own = [row for row in rows if row["arm"] == name]
|
||||
if own:
|
||||
passes, partials = (sum(row["verdict"] == kind for row in own) for kind in ("pass", "partial"))
|
||||
cost, advisor_calls, seconds = (sum(row[key] for row in own) / len(own) for key in ("cost", "advisor_calls", "seconds"))
|
||||
lines.append(f"| {name} | {len(own)} | {passes} | {partials} | {cost:.2f} | {advisor_calls:.1f} | {seconds:.0f} |")
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def git(repo, *args):
|
||||
return subprocess.run(["git", "-C", str(repo), *args], check=True, capture_output=True, text=True).stdout
|
||||
|
||||
|
||||
def fresh_clone(base, dest):
|
||||
"""A clone of this repo at base, with no remote to push to."""
|
||||
subprocess.run(["git", "clone", "-q", "--no-local", str(REPO), str(dest)], check=True)
|
||||
git(dest, "checkout", "-q", "--detach", base)
|
||||
git(dest, "remote", "remove", "origin")
|
||||
|
||||
|
||||
def run(work, name):
|
||||
"""One worker run of <case>-<arm>-<n>; the files it leaves are in the module docstring."""
|
||||
case, arm, _ = split_name(name)
|
||||
base = CASES[case][0]
|
||||
clone = work / name
|
||||
if clone.exists():
|
||||
raise ValueError(f"{name} already ran: remove {clone}")
|
||||
fresh_clone(base, clone)
|
||||
prompt = (BENCH / "advisor-run-prompt.md").read_text().format(base=base, item=case, text=item_text(git(REPO, "show", f"{base}:todo.md"), case))
|
||||
with (work / f"{name}.jsonl").open("w") as out:
|
||||
subprocess.run(
|
||||
["claude", "-p", prompt, *ARMS[arm].flags(), "--setting-sources", "project", "--permission-mode", "bypassPermissions",
|
||||
"--no-session-persistence", "--output-format", "stream-json", "--verbose"],
|
||||
cwd=clone, stdout=out, stderr=subprocess.STDOUT)
|
||||
read_result((work / f"{name}.jsonl").read_text().splitlines())
|
||||
git(clone, "add", "--all")
|
||||
(work / f"{name}.diff").write_text(git(clone, "diff", "--cached", base))
|
||||
changed = [*git(clone, "diff", "--cached", "--name-only", base).split(), *git(REPO, "diff", "--name-only", base, CASES[case][1]).split()]
|
||||
targets = [target for target in suite_targets(changed) if (clone / target).exists()] or ["bin"]
|
||||
tests = subprocess.run([str(RUN_HEAVY), *SUITE, *targets], cwd=clone, capture_output=True, text=True)
|
||||
(work / f"{name}.tests").write_text(f"exit {tests.returncode}\n{tests.stdout[-1500:]}")
|
||||
return f"{name}: ran"
|
||||
|
||||
|
||||
def grade(work, name):
|
||||
"""Have the judge rule on one run's diff, blind to its arm, and save the verdict beside it."""
|
||||
case = split_name(name)[0]
|
||||
base, merged = CASES[case]
|
||||
prompt = (BENCH / "advisor-judge-prompt.md").read_text().format(
|
||||
text=item_text(git(REPO, "show", f"{base}:todo.md"), case), reference=git(REPO, "diff", base, merged, "--", ".", ":!todo.md", ":!docs", ":!CHANGELOG.md"),
|
||||
diff=(work / f"{name}.diff").read_text(), tests=(work / f"{name}.tests").read_text())
|
||||
reply = subprocess.run(
|
||||
["claude", "-p", prompt, *JUDGE.flags(), "--setting-sources", "", "--no-session-persistence", "--output-format", "json", "--tools", ""],
|
||||
capture_output=True, text=True, check=True).stdout
|
||||
verdict = verdict_of(reply)
|
||||
(work / f"{name}.verdict").write_text(json.dumps({"verdict": verdict, "reply": json.loads(reply)["result"]}))
|
||||
return f"{name}: {verdict}"
|
||||
|
||||
|
||||
def attempted(step, work, name):
|
||||
"""step's result line, or a line naming the failure, so one failed run doesn't stop the other runs' results printing."""
|
||||
try:
|
||||
return step(work, name)
|
||||
except (KeyError, ValueError, subprocess.CalledProcessError, OSError) as failure:
|
||||
return f"{name}: FAILED: {type(failure).__name__}: {failure}"
|
||||
|
||||
|
||||
def rows_of(work):
|
||||
rows = []
|
||||
for verdict_file in sorted(work.glob("*.verdict")):
|
||||
name = verdict_file.stem
|
||||
try:
|
||||
outcome = read_result((work / f"{name}.jsonl").read_text().splitlines())
|
||||
except ValueError as failure:
|
||||
raise ValueError(f"{name}: {failure}") from failure
|
||||
rows.append({"arm": split_name(name)[1], "verdict": json.loads(verdict_file.read_text())["verdict"], **dataclasses.asdict(outcome)})
|
||||
return rows
|
||||
|
||||
|
||||
def main(argv):
|
||||
work, step, names = pathlib.Path(argv[0]), argv[1], argv[2:]
|
||||
if step == "summary":
|
||||
print(summary(rows_of(work)))
|
||||
return
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=3) as pool:
|
||||
for result in pool.map(lambda name: attempted({"run": run, "grade": grade}[step], work, name), names):
|
||||
print(result, flush=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv[1:])
|
||||
@@ -0,0 +1,309 @@
|
||||
import contextlib
|
||||
import io
|
||||
import json
|
||||
import pathlib
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
import unittest.mock
|
||||
|
||||
import advisor_bench
|
||||
|
||||
TODO = """| table |
|
||||
|
||||
## Details
|
||||
|
||||
### 7. Do the seventh thing.
|
||||
|
||||
Its detail.
|
||||
|
||||
### 8. Do the eighth thing.
|
||||
|
||||
Another detail.
|
||||
"""
|
||||
|
||||
|
||||
def result_line(**fields):
|
||||
return json.dumps({"type": "result", "total_cost_usd": 0.5, "num_turns": 9, "duration_ms": 12000, "usage": {"iterations": []}, **fields})
|
||||
|
||||
|
||||
class Arms(unittest.TestCase):
|
||||
def test_the_advisor_arm_names_its_model_effort_and_advisor(self):
|
||||
self.assertEqual(
|
||||
advisor_bench.ARMS["sonnet-advisor"].flags(), ["--model", "claude-sonnet-5-5", "--effort", "high", "--advisor", "claude-opus-5-5"])
|
||||
|
||||
def test_an_arm_without_an_advisor_passes_no_advisor_flag(self):
|
||||
self.assertEqual(advisor_bench.ARMS["opus-medium"].flags(), ["--model", "claude-opus-5-5", "--effort", "medium"])
|
||||
self.assertNotIn("--advisor", advisor_bench.ARMS["sonnet"].flags())
|
||||
|
||||
|
||||
class SplitName(unittest.TestCase):
|
||||
def test_keeps_a_hyphen_in_the_arm(self):
|
||||
self.assertEqual(advisor_bench.split_name("290-sonnet-advisor-2"), ("290", "sonnet-advisor", "2"))
|
||||
|
||||
|
||||
class SuiteTargets(unittest.TestCase):
|
||||
def test_names_the_package_of_each_changed_file_under_bin_once(self):
|
||||
self.assertEqual(
|
||||
advisor_bench.suite_targets(["bin/rule_hook/rules.py", "bin/rule_hook/test_rule_hook.py", "bin/shell_command.py", "README.md"]),
|
||||
["bin/rule_hook", "bin/shell_command.py"])
|
||||
|
||||
def test_falls_back_to_the_whole_of_bin_where_no_changed_file_is_in_it(self):
|
||||
self.assertEqual(advisor_bench.suite_targets(["README.md"]), ["bin"])
|
||||
|
||||
|
||||
class ItemText(unittest.TestCase):
|
||||
def test_reads_the_heading_and_detail_up_to_the_next_item(self):
|
||||
self.assertEqual(advisor_bench.item_text(TODO, 7), "### 7. Do the seventh thing.\n\nIts detail.")
|
||||
|
||||
def test_reads_the_last_item_to_the_end(self):
|
||||
self.assertEqual(advisor_bench.item_text(TODO, 8), "### 8. Do the eighth thing.\n\nAnother detail.")
|
||||
|
||||
def test_refuses_an_item_with_no_detail(self):
|
||||
with self.assertRaisesRegex(ValueError, "item 9"):
|
||||
advisor_bench.item_text(TODO, 9)
|
||||
|
||||
|
||||
class ReadResult(unittest.TestCase):
|
||||
def test_reads_cost_seconds_and_counts_advisor_calls(self):
|
||||
iterations = [{"type": "message"}, {"type": "advisor_message"}, {"type": "message"}, {"type": "message"}, {"type": "advisor_message"}]
|
||||
outcome = advisor_bench.read_result(["not json", result_line(usage={"iterations": iterations})])
|
||||
self.assertEqual(outcome, advisor_bench.Outcome(cost=0.5, seconds=12.0, advisor_calls=2))
|
||||
|
||||
def test_reads_the_first_result_where_a_background_task_makes_later_ones(self):
|
||||
self.assertEqual(advisor_bench.read_result([result_line(total_cost_usd=0.5), result_line(total_cost_usd=2.0)]).cost, 0.5)
|
||||
|
||||
def test_counts_no_advisor_call_where_the_run_has_no_iterations(self):
|
||||
self.assertEqual(advisor_bench.read_result([result_line(usage={})]).advisor_calls, 0)
|
||||
|
||||
def test_counts_no_advisor_call_where_the_run_has_no_usage(self):
|
||||
line = json.dumps({"type": "result", "total_cost_usd": 0.5, "num_turns": 9, "duration_ms": 12000})
|
||||
self.assertEqual(advisor_bench.read_result([line]).advisor_calls, 0)
|
||||
|
||||
def test_refuses_a_run_that_ended_in_an_error(self):
|
||||
with self.assertRaisesRegex(ValueError, "the run ended in an error: API Error"):
|
||||
advisor_bench.read_result([result_line(is_error=True, result="API Error")])
|
||||
|
||||
def test_refuses_a_stream_with_no_result_line(self):
|
||||
with self.assertRaises(ValueError) as refused:
|
||||
advisor_bench.read_result(['{"type": "assistant"}'])
|
||||
self.assertEqual(str(refused.exception), "the stream has no result line")
|
||||
|
||||
|
||||
class Verdict(unittest.TestCase):
|
||||
def test_reads_the_verdict_from_a_json_reply(self):
|
||||
self.assertEqual(advisor_bench.verdict_of(json.dumps({"result": '{"verdict": "partial", "why": "no test"}'})), "partial")
|
||||
|
||||
def test_reads_the_verdict_from_a_reply_in_a_code_fence_or_after_prose(self):
|
||||
for reply in ('```json\n{"verdict": "fail", "why": "x"}\n```', 'Ruling: {"verdict": "fail", "why": "x"} Done.'):
|
||||
self.assertEqual(advisor_bench.verdict_of(json.dumps({"result": reply})), "fail")
|
||||
|
||||
def test_reads_a_verdict_from_a_reply_that_spans_lines(self):
|
||||
self.assertEqual(advisor_bench.verdict_of(json.dumps({"result": '{\n"verdict": "pass",\n"why": "x"\n}'})), "pass")
|
||||
|
||||
def test_refuses_a_reply_with_no_json_object(self):
|
||||
with self.assertRaises(ValueError) as refused:
|
||||
advisor_bench.verdict_of(json.dumps({"result": "I cannot rule."}))
|
||||
self.assertEqual(str(refused.exception), "the judge's reply has no JSON object")
|
||||
|
||||
def test_refuses_a_verdict_outside_pass_partial_fail(self):
|
||||
with self.assertRaisesRegex(ValueError, "verdict"):
|
||||
advisor_bench.verdict_of(json.dumps({"result": '{"verdict": "great", "why": "x"}'}))
|
||||
|
||||
|
||||
class Summary(unittest.TestCase):
|
||||
def test_prints_one_row_per_arm_with_passes_and_mean_cost(self):
|
||||
rows = [
|
||||
{"arm": "sonnet", "verdict": "pass", "cost": 1.0, "advisor_calls": 0, "seconds": 100.0},
|
||||
{"arm": "sonnet", "verdict": "fail", "cost": 3.0, "advisor_calls": 0, "seconds": 300.0},
|
||||
{"arm": "opus-medium", "verdict": "pass", "cost": 4.0, "advisor_calls": 0, "seconds": 200.0},
|
||||
]
|
||||
rows.append({"arm": "sonnet-advisor", "verdict": "partial", "cost": 1.0, "advisor_calls": 2, "seconds": 50.0})
|
||||
self.assertEqual(advisor_bench.summary(rows).splitlines(), [
|
||||
"| arm | runs | pass | partial | mean cost $ | mean advisor calls | mean seconds |",
|
||||
"|---|---|---|---|---|---|---|",
|
||||
"| sonnet-advisor | 1 | 0 | 1 | 1.00 | 2.0 | 50 |",
|
||||
"| sonnet | 2 | 1 | 0 | 2.00 | 0.0 | 200 |",
|
||||
"| opus-medium | 1 | 1 | 0 | 4.00 | 0.0 | 200 |",
|
||||
])
|
||||
|
||||
|
||||
def commit(repo, message):
|
||||
subprocess.run(["git", "-C", str(repo), "-c", "user.name=bench", "-c", "user.email=bench@example.com", "commit", "-q", "-a", "-m", message], check=True)
|
||||
|
||||
|
||||
class Orchestration(unittest.TestCase):
|
||||
"""run, grade, main and rows_of, on a throwaway repo, with claude and run-heavy faked.
|
||||
|
||||
Case 7 starts at a commit holding bin/pkg/mod.py, and merges a change to bin/pkg/mod.py, a new bin/other/mod.py, and
|
||||
todo.md, docs and CHANGELOG.md; a later commit then changes bin/pkg/mod.py again and adds bin/later/mod.py, which the judge must not see."""
|
||||
|
||||
def setUp(self):
|
||||
scratch = tempfile.TemporaryDirectory()
|
||||
self.addCleanup(scratch.cleanup)
|
||||
root = pathlib.Path(scratch.name)
|
||||
self.repo, self.work = root / "repo", root / "work"
|
||||
self.work.mkdir()
|
||||
subprocess.run(["git", "init", "-q", str(self.repo)], check=True)
|
||||
base = self.commit({"todo.md": TODO, "bin/pkg/mod.py": "x = 1\n", "docs/notes.md": "a\n", "CHANGELOG.md": "a\n"})
|
||||
merged = self.commit({"todo.md": TODO + "\nmore\n", "bin/pkg/mod.py": "x = 2\n", "bin/other/mod.py": "z = 1\n", "docs/notes.md": "b\n", "CHANGELOG.md": "b\n"})
|
||||
self.commit({"bin/pkg/mod.py": "x = 5\n", "bin/later/mod.py": "y = 1\n"})
|
||||
self.calls = []
|
||||
real_run = subprocess.run
|
||||
for patch in (
|
||||
unittest.mock.patch.object(advisor_bench, "REPO", self.repo), unittest.mock.patch.object(advisor_bench, "CASES", {"7": (base, merged)}),
|
||||
unittest.mock.patch.object(advisor_bench.subprocess, "run", side_effect=lambda args, **kwargs: self.fake(real_run, args, **kwargs)),
|
||||
):
|
||||
patch.start()
|
||||
self.addCleanup(patch.stop)
|
||||
self.tests_output = "3 passed\n"
|
||||
self.worker_result = {}
|
||||
self.base = base
|
||||
|
||||
def commit(self, files):
|
||||
for path, text in files.items():
|
||||
(self.repo / path).parent.mkdir(parents=True, exist_ok=True)
|
||||
(self.repo / path).write_text(text)
|
||||
subprocess.run(["git", "-C", str(self.repo), "add", "."], check=True)
|
||||
commit(self.repo, "a commit")
|
||||
return advisor_bench.git(self.repo, "rev-parse", "HEAD").strip()
|
||||
|
||||
def fake(self, real_run, args, **kwargs):
|
||||
if args[0] == "claude":
|
||||
self.calls.append((args, kwargs))
|
||||
if "--tools" in args:
|
||||
return subprocess.CompletedProcess(args, 0, stdout=json.dumps({"result": '{"verdict": "pass", "why": "ok"}'}), stderr="")
|
||||
pathlib.Path(kwargs["cwd"], "bin/pkg/mod.py").write_text("x = 3\n")
|
||||
pathlib.Path(kwargs["cwd"], "bin/pkg/new.py").write_text("n = 1\n")
|
||||
pathlib.Path(kwargs["cwd"], "bin/third").mkdir()
|
||||
pathlib.Path(kwargs["cwd"], "bin/third/mod.py").write_text("t = 1\n")
|
||||
subprocess.run(["git", "-C", str(kwargs["cwd"]), "add", "bin/third"], check=True)
|
||||
commit(kwargs["cwd"], "the worker commits")
|
||||
kwargs["stdout"].write(result_line(**self.worker_result) + "\n")
|
||||
return subprocess.CompletedProcess(args, 0)
|
||||
if args[0] == str(advisor_bench.RUN_HEAVY):
|
||||
self.calls.append((args, kwargs))
|
||||
return subprocess.CompletedProcess(args, 4, stdout=self.tests_output, stderr="")
|
||||
return real_run(args, **kwargs)
|
||||
|
||||
def test_run_clones_at_the_start_commit_and_saves_the_stream_the_diff_and_the_tests(self):
|
||||
self.assertEqual(advisor_bench.run(self.work, "7-sonnet-advisor-1"), "7-sonnet-advisor-1: ran")
|
||||
(claude, claude_kwargs), (tests, tests_kwargs) = self.calls
|
||||
clone = self.work / "7-sonnet-advisor-1"
|
||||
self.assertEqual((claude_kwargs["cwd"], tests_kwargs["cwd"]), (clone, clone))
|
||||
self.assertEqual(claude[:2] + claude[3:], [
|
||||
"claude", "-p", *advisor_bench.ARMS["sonnet-advisor"].flags(), "--setting-sources", "project", "--permission-mode", "bypassPermissions",
|
||||
"--no-session-persistence", "--output-format", "stream-json", "--verbose"])
|
||||
self.assertIn("Do the seventh thing.", claude[2])
|
||||
self.assertIn(f"`{self.base}`", claude[2])
|
||||
self.assertIn("todo item 7 ", claude[2])
|
||||
self.assertEqual(tests, [str(advisor_bench.RUN_HEAVY), *advisor_bench.SUITE, "bin/pkg", "bin/third"])
|
||||
self.assertEqual((tests_kwargs["capture_output"], tests_kwargs["text"]), (True, True))
|
||||
self.assertEqual(claude_kwargs["stdout"].name, str(self.work / "7-sonnet-advisor-1.jsonl"))
|
||||
self.assertEqual(claude_kwargs["stderr"], subprocess.STDOUT)
|
||||
self.assertEqual(advisor_bench.git(clone, "remote"), "")
|
||||
self.assertEqual(advisor_bench.git(clone, "rev-parse", "HEAD~").strip(), self.base)
|
||||
self.assertEqual(json.loads((self.work / "7-sonnet-advisor-1.jsonl").read_text())["total_cost_usd"], 0.5)
|
||||
diff = (self.work / "7-sonnet-advisor-1.diff").read_text()
|
||||
self.assertIn("-x = 1\n+x = 3\n", diff)
|
||||
self.assertIn("+++ b/bin/pkg/new.py", diff)
|
||||
self.assertIn("+++ b/bin/third/mod.py", diff)
|
||||
self.assertEqual((self.work / "7-sonnet-advisor-1.tests").read_text(), "exit 4\n3 passed\n")
|
||||
|
||||
def test_run_tests_all_of_bin_where_no_touched_package_is_in_the_clone(self):
|
||||
with unittest.mock.patch.object(advisor_bench, "suite_targets", return_value=["bin/absent"]):
|
||||
advisor_bench.run(self.work, "7-sonnet-1")
|
||||
self.assertEqual(self.calls[1][0][-1:], ["bin"])
|
||||
|
||||
def test_run_refuses_a_run_that_ended_in_an_error_before_it_tests(self):
|
||||
self.worker_result = {"is_error": True, "result": "API Error"}
|
||||
with self.assertRaisesRegex(ValueError, "API Error"):
|
||||
advisor_bench.run(self.work, "7-sonnet-1")
|
||||
self.assertEqual(len(self.calls), 1)
|
||||
self.assertFalse((self.work / "7-sonnet-1.tests").exists())
|
||||
|
||||
def test_run_keeps_the_last_1500_characters_of_the_tests(self):
|
||||
self.tests_output = "a" * 2000 + "b" * 1500
|
||||
advisor_bench.run(self.work, "7-sonnet-1")
|
||||
self.assertEqual((self.work / "7-sonnet-1.tests").read_text(), "exit 4\n" + "b" * 1500)
|
||||
|
||||
def test_run_refuses_a_name_that_already_ran(self):
|
||||
advisor_bench.run(self.work, "7-sonnet-1")
|
||||
with self.assertRaisesRegex(ValueError, "7-sonnet-1 already ran: remove .*7-sonnet-1"):
|
||||
advisor_bench.run(self.work, "7-sonnet-1")
|
||||
|
||||
def test_a_clone_of_a_missing_repo_fails(self):
|
||||
with unittest.mock.patch.object(advisor_bench, "REPO", self.work / "missing"), self.assertRaises(subprocess.CalledProcessError):
|
||||
advisor_bench.fresh_clone(self.base, self.work / "clone")
|
||||
|
||||
def test_git_fails_where_git_does(self):
|
||||
with self.assertRaises(subprocess.CalledProcessError):
|
||||
advisor_bench.git(self.repo, "rev-parse", "no-such-revision")
|
||||
|
||||
def test_grade_saves_the_verdict_and_shows_the_judge_both_changes_but_not_the_arm(self):
|
||||
advisor_bench.run(self.work, "7-sonnet-advisor-1")
|
||||
self.calls.clear()
|
||||
self.assertEqual(advisor_bench.grade(self.work, "7-sonnet-advisor-1"), "7-sonnet-advisor-1: pass")
|
||||
((judge, kwargs),) = self.calls
|
||||
self.assertEqual(judge[:2] + judge[3:], [
|
||||
"claude", "-p", *advisor_bench.JUDGE.flags(), "--setting-sources", "", "--no-session-persistence", "--output-format", "json", "--tools", ""])
|
||||
self.assertEqual((kwargs["capture_output"], kwargs["text"], kwargs["check"]), (True, True, True))
|
||||
prompt = judge[2]
|
||||
self.assertIn("Do the seventh thing.", prompt)
|
||||
self.assertIn("-x = 1\n+x = 2\n", prompt)
|
||||
self.assertIn("+++ b/bin/other/mod.py", prompt)
|
||||
for left_out in ("x = 5", "later", "docs/notes.md", "CHANGELOG.md", "todo.md"):
|
||||
self.assertNotIn(left_out, prompt)
|
||||
self.assertIn("+x = 3", prompt)
|
||||
self.assertIn("3 passed", prompt)
|
||||
self.assertNotIn("sonnet", prompt)
|
||||
self.assertEqual(
|
||||
json.loads((self.work / "7-sonnet-advisor-1.verdict").read_text()),
|
||||
{"verdict": "pass", "reply": '{"verdict": "pass", "why": "ok"}'})
|
||||
|
||||
def test_attempted_names_a_failure_in_place_of_raising_it(self):
|
||||
def step(work, name):
|
||||
raise KeyError("9")
|
||||
self.assertEqual(advisor_bench.attempted(step, self.work, "9-sonnet-1"), "9-sonnet-1: FAILED: KeyError: '9'")
|
||||
|
||||
def test_attempted_hands_the_step_the_work_dir_and_the_name(self):
|
||||
self.assertEqual(advisor_bench.attempted(lambda work, name: f"{work.name} {name}", self.work, "9-sonnet-1"), "work 9-sonnet-1")
|
||||
|
||||
def test_rows_of_pairs_each_verdict_with_its_runs_outcome(self):
|
||||
(self.work / "7-sonnet-advisor-1.jsonl").write_text(result_line(total_cost_usd=2.0) + "\n")
|
||||
(self.work / "7-sonnet-advisor-1.verdict").write_text(json.dumps({"verdict": "fail"}))
|
||||
(self.work / "7-sonnet-2.jsonl").write_text(result_line() + "\n")
|
||||
self.assertEqual(advisor_bench.rows_of(self.work), [{"arm": "sonnet-advisor", "verdict": "fail", "cost": 2.0, "seconds": 12.0, "advisor_calls": 0}])
|
||||
|
||||
def test_rows_of_names_a_run_whose_stream_has_no_result(self):
|
||||
(self.work / "7-sonnet-1.jsonl").write_text("")
|
||||
(self.work / "7-sonnet-1.verdict").write_text(json.dumps({"verdict": "pass"}))
|
||||
with self.assertRaisesRegex(ValueError, "^7-sonnet-1: the stream has no result line$"):
|
||||
advisor_bench.rows_of(self.work)
|
||||
|
||||
def run_main(self, *argv):
|
||||
out = io.StringIO()
|
||||
with contextlib.redirect_stdout(out):
|
||||
advisor_bench.main([str(self.work), *argv])
|
||||
return out.getvalue()
|
||||
|
||||
def test_main_prints_each_runs_line_though_an_earlier_run_failed(self):
|
||||
def step(work, name):
|
||||
if name == "7-a-1":
|
||||
raise ValueError("no")
|
||||
return f"{name}: ran"
|
||||
with unittest.mock.patch.object(advisor_bench, "run", step):
|
||||
self.assertEqual(self.run_main("run", "7-a-1", "7-b-1"), "7-a-1: FAILED: ValueError: no\n7-b-1: ran\n")
|
||||
|
||||
def test_main_grades_on_grade(self):
|
||||
with unittest.mock.patch.object(advisor_bench, "grade", lambda work, name: f"{work.name} {name}: graded"):
|
||||
self.assertEqual(self.run_main("grade", "7-a-1"), "work 7-a-1: graded\n")
|
||||
|
||||
def test_main_prints_the_work_dirs_summary_on_summary(self):
|
||||
(self.work / "7-sonnet-1.jsonl").write_text(result_line() + "\n")
|
||||
(self.work / "7-sonnet-1.verdict").write_text(json.dumps({"verdict": "pass"}))
|
||||
self.assertIn("| sonnet | 1 | 1 | 0 | 0.50 | 0.0 | 12 |", self.run_main("summary"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user