Pick each replay's commits by the newest author time, in place of the first such commit in log order #460
@@ -2,6 +2,7 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- `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.
|
||||
|
||||
@@ -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. 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]
|
||||
|
||||
|
||||
def sample(rounds: list[Round], latest: int) -> list[Round]:
|
||||
|
||||
@@ -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 = [("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([("a-merged", 20), ("z-earlier", 20)], 25), "a-merged")
|
||||
|
||||
|
||||
class Sample(unittest.TestCase):
|
||||
def test_keeps_the_latest_rounds_in_the_order_they_ran(self):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 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.
|
||||
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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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", ""))
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user