From 62d1f5edd4b5806ef6558303c699e0a4a3627f73 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 10 Nov 2026 10:38:50 +0100 Subject: [PATCH 1/3] Pick each replay's commits by the newest author time, in place of the first such commit in log order --- CHANGELOG.md | 1 + bin/review_replay/rounds.py | 4 ++-- bin/review_replay/test_review_replay.py | 8 ++++++++ docs/reading-cost.md | 17 +++++++++++++++++ reviewer-merge-trials/README.md | 2 +- todo.md | 5 ----- 6 files changed, 29 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf73d91f..c2534b9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- `review-replay` now takes each replay's reviewed commit and base by the newest author time at or before the round's time, where it took the first such commit in log order, which a commit authored early but merged late, such as a dependency bump, could win. - The shared goal every project pursues, code health, now asks that code stay easy to read, change safely and debug, tomorrow and after seven years of development. - `rank_todo.py` now lets an item that adds a test, a gate leg or a probe name the maintain goal it guards, by how much more confident the project becomes that the goal holds, 1 to 10. Each point is worth 0.5. - `chunk-preflight` now quotes the detail of each item that may join the chunk, so a worker no longer opens `todo.md` to read it. diff --git a/bin/review_replay/rounds.py b/bin/review_replay/rounds.py index f72f6595..71c6e135 100644 --- a/bin/review_replay/rounds.py +++ b/bin/review_replay/rounds.py @@ -93,8 +93,8 @@ def lost_inputs(prompt: str, reports: str, held: typing.Callable[[str], bool]) - def authored_by(log: list[tuple[str, float]], seconds: float) -> str | None: - """The newest commit in log, which lists newest first, authored at or before seconds. A rebase keeps author times, so a merged branch's commits still say what it held.""" - return next((commit for commit, authored in log if authored <= seconds), None) + """The commit in log with the newest author time at or before seconds; the first in log order breaks a tie. A rebase keeps author times, so a merged branch's commits still say what it held. Log order alone would not do: a commit authored early but merged late, such as a dependency bump, sits high in it.""" + return max(((commit, authored) for commit, authored in log if authored <= seconds), key=lambda listed: listed[1], default=(None, 0))[0] def sample(rounds: list[Round], latest: int) -> list[Round]: diff --git a/bin/review_replay/test_review_replay.py b/bin/review_replay/test_review_replay.py index d32f26d9..cbb011f7 100644 --- a/bin/review_replay/test_review_replay.py +++ b/bin/review_replay/test_review_replay.py @@ -99,6 +99,14 @@ class AuthoredBy(unittest.TestCase): self.assertEqual(authored_by(log, 30), "c3") self.assertIsNone(authored_by(log, 5)) + def test_takes_the_newest_author_time_over_a_commit_authored_early_but_merged_late(self): + log = [("bump", 5), ("c3", 30), ("c2", 20)] + self.assertEqual(authored_by(log, 25), "c2") + self.assertEqual(authored_by(log, 10), "bump") + + def test_breaks_a_tie_by_log_order(self): + self.assertEqual(authored_by([("merged", 20), ("earlier", 20)], 25), "merged") + class Sample(unittest.TestCase): def test_keeps_the_latest_rounds_in_the_order_they_ran(self): diff --git a/docs/reading-cost.md b/docs/reading-cost.md index bbb3c016..ccd0c7a4 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -1436,3 +1436,20 @@ Read most (opens and searches): - `docs/decisions.md` 2 - `README.md` 1 - `bin/repo_checks/test_types.py` 1 + +## Reading cost, chunk f6826c5875c1, finished 2026-11-10T09:07:58Z + +79952 new input tokens before the first commit. + +Read most (opens and searches): + +- `bin/chunk_preflight/test_chunk_preflight.py` 5 +- `todo.md` 4 +- `docs/reading-cost.md` 3 +- `CLAUDE.md` 2 +- `README.md` 2 +- `bin/chunk_preflight/facts.py` 2 +- `bin/chunk_preflight/gathered.py` 2 +- `bin/chunk_preflight/main.py` 2 +- `bin/release_plan/todo_table.py` 2 +- `docs/decisions.md` 2 diff --git a/reviewer-merge-trials/README.md b/reviewer-merge-trials/README.md index 27653314..51005195 100644 --- a/reviewer-merge-trials/README.md +++ b/reviewer-merge-trials/README.md @@ -49,7 +49,7 @@ Candidate 4 has that. Candidate 1's merged reviewer ran once, but its prose loss ### The reviewed-commit fix -Every trial used a fix for a review-replay defect, filed as `todo.md` item 289: `driver.py` → `code_of` takes the commit with the newest author time, log order breaking ties. +Every trial took the commit with the newest author time, log order breaking ties, which `review-replay` took too only from 2026-11-10: before, it took the first commit in log order authored by then (`driver.py` → `code_of`). Without it, two plainpages rounds would have replayed at a commit older than their own base. ## Samples diff --git a/todo.md b/todo.md index f5074fe1..f6d4a2ab 100644 --- a/todo.md +++ b/todo.md @@ -14,7 +14,6 @@ |---|---|---|---|---|---|---|---|---|---|---|---| | 277 | 0.7.0 | | question | **Map the size of the code an item names onto S, on a scale the human picks, and have `score-outcomes` print that S for the item being scored and for each finished item it lists.** | 3 | 2 | 2 | 5 | 4 | 1.1 by 4, 1.4 by 3 | 2.4 | | 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 | -| 289 | 0.7.0 | | defect | **Pick each replay's commits by the newest author time, in place of the first such commit in git log order.** | 2 | 2 | 2 | 4 | 2 | 1.4 by 3, 1.1 by 2 | 2.3 | | 281 | 0.7.0 | | | **Remove a merged chunk's worktree and branch and fast-forward the main checkout with one command.** | 3 | 2 | 3 | 6 | 3 | 1.4 by 2, 1.5 by 2 | 1.6 | | 290 | 0.7.0 | | defect | **Have `rule-hook overrides` read the branch's reflog when a file or folder shares the branch's name.** | 1 | 2 | 2 | 3 | 1 | 1.1 by 2 | 1.0 | | 286 | 0.7.0 | | | **Lower the reading cost of the files a chunk reads most before its first commit.** | 3 | 2 | 2 | 5 | 5 | 1.4 by 4 | 1.0 | @@ -73,10 +72,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). -### 289. Pick each replay's commits by the newest author time, in place of the first such commit in git log order. - -`authored_by` in `bin/review_replay/rounds.py` takes the first commit in log order authored at or before a time. A commit authored early but merged late, such as a dependency bump, sits high in log order, so it wins over the commits the round actually reviewed. `code_of` in `bin/review_replay/main.py` uses it for both the reviewed commit and the clone's base. Found on 2026-11-09 by the reviewer-merge trials (`reviewer-merge-trials/README.md`): two plainpages rounds would have replayed at a commit older than their own base. Fix as the trials' driver did: take the commit with the newest author time at or before the time, log order breaking ties. Archived replays may have reviewed the wrong code, and so may the replays the routing decisions cite; once fixed, say in the PR which of those decisions' replays would change. - ### 281. Remove a merged chunk's worktree and branch and fast-forward the main checkout with one command. Audit of release 0.2.0's chunks (item 162): 31 chunks ran `git worktree remove`, `git branch -d` and `git pull --ff-only` by hand, 56 calls and about 5k command tokens. The program refuses a dirty main checkout, as `CLAUDE.md` → "Working with the codebase" says, and reports it. -- 2.52.0 From ba903c58d2955cae49fab50d4d7b4c9575997a3f Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 10 Nov 2026 10:43:43 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=203=20=F0=9F=9F=A1=20(0=20misread);=20drop=20the?= =?UTF-8?q?=20trials'=20patch=20of=20authored=5Fby,=20test=20names=20that?= =?UTF-8?q?=20sort=20against=20times?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- bin/review_replay/rounds.py | 2 +- bin/review_replay/test_review_replay.py | 8 ++++---- reviewer-merge-trials/README.md | 3 +-- reviewer-merge-trials/driver.py | 12 +----------- reviewer-merge-trials/shas.py | 2 +- 6 files changed, 9 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2534b9b..12efc979 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- `review-replay` now takes each replay's reviewed commit and base by the newest author time at or before the round's time, where it took the first such commit in log order, which a commit authored early but merged late, such as a dependency bump, could win. +- `review-replay` now replays each round at the commit with the newest author time at or before the round's time, and takes the clone's base the same way by the time the chunk began. It took the first such commit in log order, so a commit authored early but merged late, such as a dependency bump, could win over the commits the round reviewed. - The shared goal every project pursues, code health, now asks that code stay easy to read, change safely and debug, tomorrow and after seven years of development. - `rank_todo.py` now lets an item that adds a test, a gate leg or a probe name the maintain goal it guards, by how much more confident the project becomes that the goal holds, 1 to 10. Each point is worth 0.5. - `chunk-preflight` now quotes the detail of each item that may join the chunk, so a worker no longer opens `todo.md` to read it. diff --git a/bin/review_replay/rounds.py b/bin/review_replay/rounds.py index 71c6e135..9b897670 100644 --- a/bin/review_replay/rounds.py +++ b/bin/review_replay/rounds.py @@ -93,7 +93,7 @@ def lost_inputs(prompt: str, reports: str, held: typing.Callable[[str], bool]) - def authored_by(log: list[tuple[str, float]], seconds: float) -> str | None: - """The commit in log with the newest author time at or before seconds; the first in log order breaks a tie. A rebase keeps author times, so a merged branch's commits still say what it held. Log order alone would not do: a commit authored early but merged late, such as a dependency bump, sits high in it.""" + """The commit in log with the newest author time at or before seconds; the first in log order breaks a tie. The log lists commits newest first by when they were merged, so taking the first one authored by seconds would pick a commit authored early but merged late, such as a dependency bump, over the commits a round reviewed. A rebase keeps author times, so a merged branch's commits keep the times their author wrote them.""" return max(((commit, authored) for commit, authored in log if authored <= seconds), key=lambda listed: listed[1], default=(None, 0))[0] diff --git a/bin/review_replay/test_review_replay.py b/bin/review_replay/test_review_replay.py index cbb011f7..ff0df5da 100644 --- a/bin/review_replay/test_review_replay.py +++ b/bin/review_replay/test_review_replay.py @@ -100,12 +100,12 @@ class AuthoredBy(unittest.TestCase): self.assertIsNone(authored_by(log, 5)) def test_takes_the_newest_author_time_over_a_commit_authored_early_but_merged_late(self): - log = [("bump", 5), ("c3", 30), ("c2", 20)] - self.assertEqual(authored_by(log, 25), "c2") - self.assertEqual(authored_by(log, 10), "bump") + log = [("z-bump", 5), ("a-new", 30), ("m-mid", 20)] + self.assertEqual(authored_by(log, 25), "m-mid") + self.assertEqual(authored_by(log, 10), "z-bump") def test_breaks_a_tie_by_log_order(self): - self.assertEqual(authored_by([("merged", 20), ("earlier", 20)], 25), "merged") + self.assertEqual(authored_by([("a-merged", 20), ("z-earlier", 20)], 25), "a-merged") class Sample(unittest.TestCase): diff --git a/reviewer-merge-trials/README.md b/reviewer-merge-trials/README.md index 51005195..457790b0 100644 --- a/reviewer-merge-trials/README.md +++ b/reviewer-merge-trials/README.md @@ -49,8 +49,7 @@ Candidate 4 has that. Candidate 1's merged reviewer ran once, but its prose loss ### The reviewed-commit fix -Every trial took the commit with the newest author time, log order breaking ties, which `review-replay` took too only from 2026-11-10: before, it took the first commit in log order authored by then (`driver.py` → `code_of`). -Without it, two plainpages rounds would have replayed at a commit older than their own base. +Every trial took the commit with the newest author time, log order breaking ties, as `review-replay` does from 2026-11-10. Before that it took the first commit in log order authored by then, and a trial's driver patched that in. Without the patch, two plainpages rounds would have replayed at a commit older than their own base. ## Samples diff --git a/reviewer-merge-trials/driver.py b/reviewer-merge-trials/driver.py index 9168a758..67a86b05 100644 --- a/reviewer-merge-trials/driver.py +++ b/reviewer-merge-trials/driver.py @@ -17,16 +17,6 @@ FX = system_effects() PASS = {"stability-reviewer": "stability", "product-owner-reviewer": "product-owner", "prose-reviewer": "prose", "systems-architect": "architecture", "principles-auditor": "principles", "override-reviewer": "overrides"} MERGED = {"wave3": ("wave3-reviewer", "agents-wave3.json"), "release": ("release-reviewer", "agents-release.json"), "pair": ("pair-reviewer", "agents-pair.json")} -def code_of(rnd, fx): - """review_replay.main.code_of, but picking the commit with the newest author time by then rather than the first in log order: a commit authored early and merged late (e.g. a dependency update) sits high in log order and would otherwise be taken as the reviewed commit.""" - import review_replay.rounds as rr - orig = rm.authored_by - rm.authored_by = lambda log, secs: max(((a, -i, c) for i, (c, a) in enumerate(log) if a <= secs), default=(None, None, None))[2] - try: - return rm.code_of(rnd, fx) - finally: - rm.authored_by = orig - def as_round(r): return Round(r["reviewer"], r["checkout"], r["branch"], r["at"], r["began"], r["prompt"], tuple(r["findings"])) @@ -93,7 +83,7 @@ def main(): rounds = [as_round(by_meta[m]) for m in case["metas"]] codes = {} for r in rounds: - c = code_of(r, FX) + c = rm.code_of(r, FX) if isinstance(c, Failure): print(case["id"], "no code:", c.reason); break codes[r] = c else: diff --git a/reviewer-merge-trials/shas.py b/reviewer-merge-trials/shas.py index fe11f8d2..b9c6ad41 100644 --- a/reviewer-merge-trials/shas.py +++ b/reviewer-merge-trials/shas.py @@ -5,5 +5,5 @@ runs = {r["meta"]: r for r in pickle.load(open(d.HERE / "runs.pkl", "rb"))} for cand in sys.argv[1:]: for c in d.load_cases(cand): r = d.as_round(runs[c["metas"][0]]) - code = d.code_of(r, d.FX) + code = d.rm.code_of(r, d.FX) print(cand, c["id"], getattr(code, "reviewed", code), getattr(code, "base", "")) -- 2.52.0 From 067fa84fcbe2ecb1d22f3645e485e6a07d5a791c Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 10 Nov 2026 10:43:43 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Answer=20prose=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=204=20=F0=9F=9F=A1=20(0=20misread);=20say=20which?= =?UTF-8?q?=20log=20order=20and=20time=20each=20commit=20pick=20follows,?= =?UTF-8?q?=20fix=20the=20trials'=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0