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

This commit is contained in:
2026-11-08 19:12:38 +01:00
parent 064ce09dcc
commit c042551aaf
5 changed files with 40 additions and 29 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 the reviewer on project 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
+1 -6
View File
@@ -13,7 +13,6 @@
| 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 |
@@ -86,10 +85,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 +103,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, before item 219's chunk: 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.