Name the project's rung project in judge_replay, subagent_rung and review_replay #426

Merged
lilleman merged 5 commits from item-219 into main 2026-11-08 19:19:39 +01:00
5 changed files with 49 additions and 30 deletions
+8 -8
View File
@@ -50,21 +50,21 @@ REFERENCE_EFFORT = "xhigh"
def main(argv: list[str], env: typing.Mapping[str, str], home: pathlib.Path, effects: Effects) -> int:
anchor = arguments_or_exit(TOOL, argv, __doc__, USAGE, model_argument)
if isinstance(anchor, int):
return anchor
cases = archived_cases(anchor.model, archive_root(home, env), home)
project = arguments_or_exit(TOOL, argv, __doc__, USAGE, model_argument)
if isinstance(project, int):
return project
cases = archived_cases(project.model, archive_root(home, env), home)
if isinstance(cases, Failure):
return failed(TOOL, cases.reason)
if not cases:
return failed(TOOL, f"no archived verdicts of projects on {anchor.model} in {archive_root(home, env)}; run loop-claude on a project on that model first")
return failed(TOOL, f"no archived verdicts of projects on {project.model} in {archive_root(home, env)}; run loop-claude on a project on that model first")
cases = sample(cases, PER_KIND)
reference = Rung(anchor.model, REFERENCE_EFFORT)
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(anchor, lowest_worker_rung(anchor)), 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")
if isinstance(replay, Limited):
return limited_exit(TOOL, replay)
print(report(anchor.model, reference, cases, replay))
print(report(project.model, reference, cases, replay))
return 0
+12 -12
View File
@@ -71,24 +71,24 @@ def main(argv: list[str], env: typing.Mapping[str, str], home: pathlib.Path, eff
read = arguments_or_exit(TOOL, argv, __doc__, USAGE, pass_and_model)
if isinstance(read, int):
return read
reviewed, anchor = read
rounds = archived_rounds(REVIEWERS[reviewed], anchor.model, archive_root(home, env), home)
reviewed, project = read
rounds = archived_rounds(REVIEWERS[reviewed], project.model, archive_root(home, env), home)
if isinstance(rounds, Failure):
return failed(TOOL, rounds.reason)
codes = codes_found(rounds, effects)
if not codes:
return failed(TOOL, f"no archived {reviewed} round of projects on {anchor.model} in {archive_root(home, env)} holds a 🔴 or 🟡 on code it can find")
return failed(TOOL, f"no archived {reviewed} round of projects on {project.model} in {archive_root(home, env)} holds a 🔴 or 🟡 on code it can find")
chosen = sample(list(codes), LATEST)
# The project's rung is the reference, so the candidates start below it. They reach the ladder's lowest rung, below the lowest a worker routes to, since a pass may run below the worker's rung.
candidates = down_from(anchor, LADDER[0])[1:]
candidates = down_from(project, LADDER[0])[1:]
def found_on(found: Round, rung: Rung) -> set[int] | Limited:
return findings_found(found, codes[found], rung, anchor, home, effects)
return findings_found(found, codes[found], rung, project, home, effects)
replay = replayed(chosen, anchor, candidates, found_on, reproduced, f"{reviewed} rounds")
replay = replayed(chosen, project, candidates, found_on, reproduced, f"{reviewed} rounds")
if isinstance(replay, Limited):
return limited_exit(TOOL, replay)
print(report(reviewed, anchor.model, anchor, chosen, replay))
print(report(reviewed, project.model, project, chosen, replay))
return 0
@@ -97,8 +97,8 @@ def pass_and_model(argv: list[str]) -> tuple[ReviewedPass, Rung] | None:
if len(argv) != 2:
return None
reviewed = next((kind for kind in REVIEWERS if kind == argv[0]), None)
anchor = project_rung(argv[1])
return (reviewed, anchor) if reviewed and anchor else None
project = project_rung(argv[1])
return (reviewed, project) if reviewed and project else None
def codes_found(rounds: list[Round], effects: Effects) -> dict[Round, Code]:
@@ -177,12 +177,12 @@ def commit_log(listed: str) -> list[tuple[str, float]]:
return [(commit, float(authored)) for commit, authored in (line.split() for line in listed.splitlines())]
def findings_found(found: Round, code: Code, rung: Rung, anchor: Rung, home: pathlib.Path, effects: Effects) -> set[int] | Limited:
"""The indexes of the round's findings that its replay on rung reports, as the reviewer on anchor matches them."""
def findings_found(found: Round, code: Code, rung: Rung, project: Rung, home: pathlib.Path, effects: Effects) -> set[int] | Limited:
"""The indexes of the round's findings that its replay on rung reports, as claude on the project's rung matches them."""
reviewed: str | Failure | Limited = first_reply(lambda: review(found, code, rung, home, effects))
if isinstance(reviewed, Limited):
return reviewed
matched: set[int] | Failure | Limited = reviewed if isinstance(reviewed, Failure) else first_reply(lambda: match(found.findings, reviewed, found.root, anchor, effects))
matched: set[int] | Failure | Limited = reviewed if isinstance(reviewed, Failure) else first_reply(lambda: match(found.findings, reviewed, found.root, project, effects))
if isinstance(matched, Failure):
print(f" {found.root} {found.at} on {rung} found nothing: {matched.reason}", file=sys.stderr, flush=True)
return set()
+3 -3
View File
@@ -23,10 +23,10 @@ USAGE = f"usage: subagent-rung [--plan] <model> <L>, L a level from 1 to {LEVELS
def agent_args(model: str, likelihood: int, planning: bool = False) -> str | None:
"""The Agent tool's model and effort for the rung likelihood picks from model's cheapest rung, never below it when planning; None for a model off the ladder."""
anchor = project_rung(model)
if anchor is None:
project = project_rung(model)
if project is None:
return None
return (planning_rung if planning else worker_rung)(anchor, likelihood).agent_args()
return (planning_rung if planning else worker_rung)(project, likelihood).agent_args()
def main(argv: list[str]) -> int:
+16
View File
@@ -1025,3 +1025,19 @@ Read most (opens and searches):
- `bin/loop_claude/loop/main.py` 1
- `bin/routing_figures/archive.py` 1
- `bin/score-outcomes` 1
## Reading cost, chunk cbe1c9d0886f, finished 2026-11-08T18:11:52Z
70801 new input tokens before the first commit.
Read most (opens and searches):
- `README.md` 3
- `bin/loop_claude/loop/main.py` 3
- `bin/loop_claude/test_loop_claude.py` 3
- `bin/model_routing/route.py` 3
- `bin/routing_figures/test_routing_figures.py` 3
- `bin/model_routing/ladder.py` 2
- `todo.md` 2
- `AGENTS.md` 1
- `docs/decisions.md` 1
+10 -7
View File
@@ -6,14 +6,13 @@
`Bar = 0.1`
`Next ID = 275`
`Next ID = 276`
## Items
| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 0.7.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 |
| 219 | 0.7.0 | | | **Name the project's rung `project` in `bin/judge_replay/main.py`, `bin/subagent_rung/main.py` and `bin/review_replay/main.py`, in place of `anchor`, as `bin/model_routing/ladder.py` and `bin/loop_claude` name it.** | 1 | 1 | 3 | 3 | 2 | code health by 2 | 12.0 |
| 224 | 0.7.0 | | | **Split `docs/decisions.md` → `todo.md: one table of items, …`'s 420-word scoring paragraph into one paragraph per choice, and drop the sentences that tell how the goal weights changed.** | 1 | 1 | 1 | 1 | 2 | code health by 2 | 12.0 |
| 123 | 0.7.0 | | | **Have `bin/comprehension_history.py` parse each history entry once into seats, votes and places, so `latest_places`, `worse_places` and `worse_votes` neither depend on table order nor split a label to find a seat.** | 2 | 1 | 2 | 3 | 5 | code health by 5, 1.4 by 5 | 11.0 |
| 139 | 0.7.0 | | | **Split `bin/routing_figures/measure.py` by concern, and keep the figures' measured cycle and each raised call as fields loop-claude reads back, not as the prose it renders.** | 3 | 1 | 2 | 4 | 5 | code health by 5, 1.4 by 5 | 11.0 |
@@ -41,6 +40,7 @@
| 101 | 0.7.0 | | principle | **Have `larv_review/history_commands.py`'s `read_seats` take the time, the commit check and the history as inputs, so it parses and decides without effects.** | 2 | 1 | 2 | 3 | 3 | 1.1 by 5 | 5.3 |
| 12 | 0.7.0 | | | **Run the test suite in CI on every PR, or record in `docs/decisions.md` why the local run is enough.** | 3 | 2 | 1 | 4 | 4 | 1.1 by 6 | 4.2 |
| 272 | 0.7.0 | | owner | **Make `deploy-release --cut` say when each step finishes, end on one line saying the release is cut and `~/.claude` is on it, and delete the merged release branch.** | 1 | 1 | 1 | 1 | 2 | 1.5 by 3 | 3.9 |
| 275 | 0.7.0 | | | **Make the `Main` tests of `judge-replay` and `review-replay` fail when the replays ignore the project's model, its lowest worker rung or the round's checkout.** | 1 | 2 | 1 | 2 | 2 | 1.1 by 2 | 2.8 |
| 274 | 0.7.0 | | | **Let an item name a maintain goal it raises confidence in, such as a test leg that guards it, and weigh that move against the achieve goals in `bin/rank_todo.py`.** | 2 | 2 | 3 | 5 | 4 | 1 by 3 | 2.2 |
| 273 | 0.8.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 | 6.8 |
| 102 | 0.8.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 | 4.2 |
@@ -86,10 +86,6 @@ It lives under `~/.claude`, which `.gitignore` keeps from the remote, so a lost
The README line covers the bench's transcripts in `workflow-bench/logs/` too (goal 3).
### 219. Name the project's rung `project` in `bin/judge_replay/main.py`, `bin/subagent_rung/main.py` and `bin/review_replay/main.py`, in place of `anchor`, as `bin/model_routing/ladder.py` and `bin/loop_claude` name it.
Item 172 renamed `anchor` to `project` across `bin/loop_claude`, after release 0.3.0's inherited architect named `bin/loop_claude/cycle/judge.py:68` `Reply.bundled`: "the project's rung is also called anchor". Three tools outside it still call the same rung `anchor`: `bin/judge_replay/main.py:54` (`anchor = arguments_or_exit(...)`, a `Rung` parsed from the model argument), `bin/subagent_rung/main.py:26` (`anchor = project_rung(model)`), and `bin/review_replay/main.py:74`, `:100` and `:180`, with `findings_found`'s docstring. While the name differs between tools, a reader works out each time that the two are one rung. The rename keeps behaviour. `bin/score_outcomes/anchors.py` uses `anchor` for score anchors, a different thing, and keeps the name.
### 224. Split `docs/decisions.md` → `todo.md: one table of items, …`'s 420-word scoring paragraph into one paragraph per choice, and drop the sentences that tell how the goal weights changed.
Found by the prose review of PR #368. The paragraph that opens `2026-10-16, PR #283: items rank by` covers the formula, F, the goal weights, the panels' spelling picks, the column order and the old shape, and grew a sentence per chunk. A reader looking for what F is, or why `2**S`, searches all of it. Its sentences on how the goal weights changed over time, such as the one on PR #319, describe past states, not what holds; git history keeps them.
@@ -108,7 +104,7 @@ F is 8 until then, about one S 3 change, lilleman's call in PR #283. A chunk cos
### 155. Lower the reading cost of the files a chunk reads most before its first commit.
`bin/reading-cost` on 2026-11-08, before item 218's chunk: the median of the last 5 chunks is 139,686 new input tokens before their first commit, up from 105,744 for the 5 before them. The files read most over the last 5, counting opens and searches, were `todo.md` 15 times, `README.md` 11, `docs/decisions.md` 8, `CHANGELOG.md` 7, `AGENTS.md` 6, `bin/chunk_preflight/test_chunk_preflight.py` 6, `bin/loop_claude/loop/main.py` 6, `bin/loop_claude/test_black_box.py` 5, `bin/rule_hook/test_rule_hook.py` 4 and `bin/run_heavy/test_run_heavy.py` 4. The chunk that ships this item runs `bin/reading-cost --reset`.
`bin/reading-cost` on 2026-11-08: the median of the last 5 chunks is 139,686 new input tokens before their first commit, up from 105,188 for the 5 before them. The files read most over the last 5, counting opens and searches, were `todo.md` 13 times, `README.md` 11, `bin/loop_claude/loop/main.py` 9, `AGENTS.md` 6, `bin/chunk_preflight/test_chunk_preflight.py` 6, `docs/decisions.md` 6, `CHANGELOG.md` 5, `bin/loop_claude/test_black_box.py` 5, `bin/run_heavy/test_run_heavy.py` 4 and `bin/claude_code/test_claude_code.py` 3. The chunk that ships this item runs `bin/reading-cost --reset`.
### 215. Decode a reload's handed JSON with a decoder for `LoopRun` and its `Route`, in place of `decoded_as`'s generic one with its two sentinels and `Route.fits` hook.
@@ -214,6 +210,13 @@ When CI runs a rule check, such as one of `bin/rule-hook`'s, let `<!-- rule-over
Cutting 0.6.0 printed `waiting for the checks of pull request 418`, then `Cut v0.6.0.` and `Moved from v0.5.0 to v0.6.0.`, then the whole 0.6.0 changelog section. The two lines saying it worked scrolled off behind the changelog, and no line said the checks passed or the pull request merged. So the human couldn't tell whether the cut had finished or was still waiting. Print a line on stderr as each step finishes: branch pushed, pull request opened, checks passed, merged, tagged, tag pushed. End stdout with one line, after the changelog: `Done: v<version> is cut and pushed, and <checkout> is on it.` Once the tag is pushed, delete the remote branch `release-<version>`, which 0.6.0's cut left on origin. A failed delete only warns, since the release is cut by then. Update the tests in `bin/deploy_release/test_deploy_release.py` and `deploy-release --help`.
### 275. Make the `Main` tests of `judge-replay` and `review-replay` fail when the replays ignore the project's model, its lowest worker rung or the round's checkout.
Found by the stability review of item 219's chunk, findings 1 and 2; both gaps predate it. Mutants that survive today:
- `bin/judge_replay/main.py` `main`: passing `None` in place of `lowest_worker_rung(project)` to `down_from`, since every `Main` test in `bin/judge_replay/test_judge_replay.py` uses an Opus 5.5 project, whose lowest worker rung already is the ladder's bottom. No test checks that the report's first line names the model passed as `report(project.model, ...)` either. Add a `Main` test with a Fable 5.1 project asserting that the replays stop at Opus 5.5 at max effort and that the first line names the model.
- `bin/review_replay/main.py` `findings_found`: passing `None` in place of `found.root` to `match`, since the `Main` tests' fake claude in `bin/review_replay/test_review_replay.py` ignores the folder a match call runs in. The model `main` passes to `report` is unchecked too. Record the folder each match call runs in and assert it is the round's checkout, and assert that the first output line names the model.
### 274. Let an item name a maintain goal it raises confidence in, such as a test leg that guards it, and weigh that move against the achieve goals in `bin/rank_todo.py`.
Today only a `defect` item may name a maintain goal, and only to restore one the project breaks