From b00aa61a8848f17a20c013fc46eebfe654e5644c Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 22:52:41 +0100 Subject: [PATCH 1/8] Record the reading cost of the last finished chunk --- docs/reading-cost.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/reading-cost.md b/docs/reading-cost.md index 0f51e3c2..dbccf37e 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -911,3 +911,11 @@ Read most (opens and searches): ## Reading cost, chunk da9c1fcad7c3, finished 2026-10-28T17:55:08Z 139037 new input tokens before the first commit. + +## Reading cost, chunk 07c647e1636e, finished 2026-10-28T21:51:38Z + +105188 new input tokens before the first commit. + +Read most (opens and searches): + +- `rules/todo-items.md` 1 -- 2.52.0 From 4307240e8c58009c739c50d978acd70e9ea3c61c Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 22:52:41 +0100 Subject: [PATCH 2/8] Read the comprehension history's changes from the checkout's top in larv-review --- CHANGELOG.md | 1 + bin/larv_review/history_changes.py | 18 +++++++++++------- bin/larv_review/test_larv_review.py | 6 ++++-- todo.md | 5 ----- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cab74fbc..6de37e6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- `larv-review ruling-base` now finds the last measured commit when run in a subfolder of a checkout. Before, it found no change to the comprehension history there and fell back to the merge base. - `score-outcomes` now counts each finished chunk's later fixes: the later chunks on the default branch that fixed code it shipped, each a defect that review let through. A later chunk counts where a change of it rewrites or removes lines that `git blame` traces to the earlier chunk: its whole change where it ships a `todo.md` item marked `defect` or `security`, or one of its round commits whose title counts both a 🔴 and a finding a reviewer marked `[misread]`. Each finished item shows the count beside its guessed scores, and a new list, after the misread findings, names the chunks that fixed each one, newest first. `routing-figures.md` shows the mean per rung, over the chunks whose later fixes are known, in a new column of the routed-chunks table. To find them, loop-claude now reads each archived project's checkout, and the figures name each project whose default branch it could not read. - `loop-claude` now opens every message it prints with the machine's local time, as in `2026-10-28 11:46:01`, so you can see when each happened, such as how long a question has waited. A message of several lines, such as a question, carries the time on its first line only. The `retrying at …` time of a usage-limit wait now also shows seconds, and no longer names the zone. - larv-review now gives each review pass at most two rounds per chunk, where it gave three and then asked for more, and no longer asks: the fixes answering a pass's second round merge once the gate passes. rule-hook's new `round-cap` rule refuses a round commit that would take a pass past round 2, such as `Answer stability round 3: …`, and takes no override. It counts the pass's earlier round commits on the branch, so a third commit titled round 2 is refused too. `larv-review round-count` marks a pass at two rounds as at the cap. diff --git a/bin/larv_review/history_changes.py b/bin/larv_review/history_changes.py index 782e9a3b..b39bc104 100644 --- a/bin/larv_review/history_changes.py +++ b/bin/larv_review/history_changes.py @@ -1,5 +1,5 @@ from failure import Failure -from git_repo import file_at, full_history, git +from git_repo import file_at, full_history, git, top from comprehension_history import HISTORY, HistoryChange @@ -7,24 +7,28 @@ def history_changes(default: str) -> list[HistoryChange] | Failure: """Each merged change on the default branch that touched the history, newest first.""" if partial := full_history(): return partial - commits = git("log", "--first-parent", "--format=%H", default, "--", HISTORY) + # HISTORY names the file from the checkout's top, and git reads a path from the directory it runs in. + root = top() + if isinstance(root, Failure): + return root + commits = git("log", "--first-parent", "--format=%H", default, "--", HISTORY, cwd=root) if isinstance(commits, Failure): return commits changes = [] for commit in commits.split(): - change = history_change(commit) + change = history_change(commit, root) if isinstance(change, Failure): return change changes.append(change) return changes -def history_change(commit: str) -> HistoryChange | Failure: - """The history before and after commit. A merge commit counts as one change, against its first parent.""" - before = file_at(f"{commit}^1", HISTORY) +def history_change(commit: str, root: str) -> HistoryChange | Failure: + """The history before and after commit, read in the checkout at root. A merge commit counts as one change, against its first parent.""" + before = file_at(f"{commit}^1", HISTORY, root) if isinstance(before, Failure): return before - after = file_at(commit, HISTORY) + after = file_at(commit, HISTORY, root) if isinstance(after, Failure): return after return HistoryChange(commit, before, after) diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py index ccebdc6a..738c9723 100644 --- a/bin/larv_review/test_larv_review.py +++ b/bin/larv_review/test_larv_review.py @@ -364,8 +364,8 @@ class LarvReviewTool(unittest.TestCase): self.git("add", name) self.git("commit", "-q", "--allow-empty", "-m", title) - def run_tool(self, *args): - return subprocess.run([sys.executable, str(TOOL), *args], capture_output=True, cwd=self.checkout, env=self.env, text=True) + def run_tool(self, *args, cwd=None): + return subprocess.run([sys.executable, str(TOOL), *args], capture_output=True, cwd=cwd or self.checkout, env=self.env, text=True) def seats_file(self, text, name="seats.md"): path = self.checkout.parent / name @@ -383,6 +383,8 @@ class LarvReviewTool(unittest.TestCase): measured = self.git("rev-parse", "HEAD").strip() self.git("switch", "-q", "chunk") self.assertEqual(self.run_tool("ruling-base").stdout.splitlines()[0], measured) + (self.checkout / "docs").mkdir(exist_ok=True) + self.assertEqual(self.run_tool("ruling-base", cwd=self.checkout / "docs").stdout.splitlines()[0], measured) def test_counts_rounds_on_this_branch_alone(self): self.commit("Answer stability round 1: a") diff --git a/todo.md b/todo.md index 9cb3a628..19c1d9f0 100644 --- a/todo.md +++ b/todo.md @@ -12,7 +12,6 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| -| 251 | 0.4.0 | | defect | **Have larv-review read the comprehension history's changes from the checkout's top, so it still finds them when run in a subfolder of a checkout.** | 1 | 1 | 3 | 3 | 1 | 1.1 by 2 | 3.4 | | 243 | 0.4.0 | | owner | **Show every loop-claude on the machine that waits for the human in one terminal app, and let the human answer each one there, `/talk` included.** | 4 | 2 | 3 | 7 | 6 | 1.5 by 4 | 0.9 | | 226 | 0.5.0 | | question | **Answer whether rule-hook's `run-heavy` rule should also catch a mutation run or docker build behind `uv run`, `poetry run`, `python3 -m`, `sudo`, `docker image build` and `docker compose up --build`, or narrow the `machine load:` decision's wording.** | 2 | 2 | 3 | 5 | 3 | 1.2 by 2, 1.5 by 2 | 4.0 | | 248 | 0.5.0 | | question | **Answer whether the `rule-hook:` decision should name every rule that takes no override, `repeat-read`, `reviewer-report` and `reviewer-rung`, with each one's reason.** | 1 | 2 | 1 | 2 | 1 | 1.2 by 2 | 3.3 | @@ -78,10 +77,6 @@ ## Details -### 251. Have larv-review read the comprehension history's changes from the checkout's top, so it still finds them when run in a subfolder of a checkout. - -Found while building item 247, 2026-10-28. `history_changes` in `bin/larv_review/history_changes.py` names the history by its path from the checkout's top, but git reads that path from the current directory, twice: in its `git log -- `, and in `file_at` in `bin/git_repo.py`, which lists the path with `git ls-tree -- `. Run from `bin/`, larv-review finds no change to the history instead of failing. Running git in the checkout's top, as `score-outcomes` does since item 247, reads both paths from the top. - ### 243. Show every loop-claude on the machine that waits for the human in one terminal app, and let the human answer each one there, `/talk` included. lilleman's call, 2026-10-28: with several loops running, each asks on its own terminal, so the human jumps between terminals to find which wait. On 2026-10-28 three of five loops waited on round-cap questions at once. Today `put_question` in `bin/loop_claude/cycle/interrupt.py` reads the answer with `input()`, and nothing outside that terminal sees a question. -- 2.52.0 From 862a5cb91e81ebeb065d95ecc0872cbe0b4df26a Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 22:54:07 +0100 Subject: [PATCH 3/8] =?UTF-8?q?Answer=20principles=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread);=20the=20test'?= =?UTF-8?q?s=20name=20now=20says=20it=20covers=20a=20subfolder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/larv_review/test_larv_review.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py index 738c9723..3b1a3649 100644 --- a/bin/larv_review/test_larv_review.py +++ b/bin/larv_review/test_larv_review.py @@ -372,7 +372,7 @@ class LarvReviewTool(unittest.TestCase): path.write_text(textwrap.dedent(text)) return str(path) - def test_takes_the_merge_base_until_a_merged_change_records_an_entry(self): + def test_takes_the_merge_base_until_a_merged_change_records_an_entry_and_finds_it_from_a_subfolder(self): start = self.git("rev-parse", "HEAD").strip() self.commit("work") ran = self.run_tool("ruling-base") -- 2.52.0 From e9da351e400f384c74b35fb3d4b9bd2f4ffdf6cc Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 22:54:07 +0100 Subject: [PATCH 4/8] =?UTF-8?q?Answer=20security=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread);=20no=20findin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 81a33725432b3f2bc46d66d2899f910e6121c666 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 22:57:42 +0100 Subject: [PATCH 5/8] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=201=20=F0=9F=9F=A1=20(0=20misread);=20the=20test?= =?UTF-8?q?=20merges=20a=20later=20edit=20to=20the=20history=20that=20adds?= =?UTF-8?q?=20no=20entry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/larv_review/test_larv_review.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py index 3b1a3649..fd83d9f8 100644 --- a/bin/larv_review/test_larv_review.py +++ b/bin/larv_review/test_larv_review.py @@ -381,6 +381,8 @@ class LarvReviewTool(unittest.TestCase): self.commit("Merge a scoring run", {"docs/comprehension-history.md": "# Comprehension history\n\n" + SCORING}) self.git("push", "-q", "origin", "HEAD:main") measured = self.git("rev-parse", "HEAD").strip() + self.commit("Fix a typo", {"docs/comprehension-history.md": "# Comprehension history\n\n" + SCORING + "\nA note.\n"}) + self.git("push", "-q", "origin", "HEAD:main") self.git("switch", "-q", "chunk") self.assertEqual(self.run_tool("ruling-base").stdout.splitlines()[0], measured) (self.checkout / "docs").mkdir(exist_ok=True) -- 2.52.0 From bc62ec498271af2b9ba376f632e9dc58142bb5c0 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 22:57:42 +0100 Subject: [PATCH 6/8] =?UTF-8?q?Answer=20prose=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread);=20no=20findin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 5e0ed821d6d427535802fe2a602692865e2c0371 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 22:58:35 +0100 Subject: [PATCH 7/8] =?UTF-8?q?Answer=20stability=20round=202:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread);=20no=20findin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 45955a6c495f04d3fea0d77df466bc6dce598baa Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 22:58:36 +0100 Subject: [PATCH 8/8] =?UTF-8?q?Answer=20principles=20round=202:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread);=20no=20findin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0