From ac33c733c784f8bf7e7a126c7e479224f947b55f Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 18 Oct 2026 09:32:04 +0200 Subject: [PATCH 01/12] Mark a renamed release in todo.md, so a release whose items moved unmarked reads as finished --- AGENTS.md | 1 - CHANGELOG.md | 2 +- bin/chunk_preflight/main.py | 5 +-- bin/chunk_preflight/test_chunk_preflight.py | 20 +++++----- bin/larv_review/main.py | 5 ++- bin/larv_review/plan.py | 21 +++++----- bin/larv_review/test_larv_review.py | 44 +++++++++++++++------ bin/loop_claude/loop/main.py | 5 +-- bin/rank_todo.py | 7 +++- bin/test_rank_todo.py | 30 ++++++++++---- bin/todo_table.py | 31 +++++++++------ docs/decisions.md | 6 +-- docs/reading-cost.md | 8 ++++ rules/todo-items.md | 2 +- todo.md | 7 +--- 15 files changed, 121 insertions(+), 73 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index a0a0958f..9ecdf30b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -28,7 +28,6 @@ Decisions live in `docs/decisions.md`: - settings.json: Claude Code runs in auto mode with the dangerous-mode prompt skipped - the repo may name bender, bender-infra and ai-sandbox - todo.md: one table of items scored by the formula it states, each README achieve goal weighed by its position, the first heaviest, held to its bar, ranked by `bin/rank_todo.py`, which ranks each blocker above the items it blocks; the table's order is the plan's only order -- todo.md: a release whose last items all move to other releases in one change, none leaving the plan, is read as renamed, never finished, until item 185 lets the plan say which - todo.md: only a session or subagent on the project's rung or above scores or reshapes the plan; one below it drafts new items and changes to filed ones for a subagent at or above that rung to apply and score, and removes finished ones - reading cost: larv-review measures each finished chunk from loop-claude's archive and appends the figure to `docs/reading-cost.md` in the next chunk's PR - reading cost: a rise is the last 5 chunks' median above the 5 before them, and files or refreshes one plan item diff --git a/CHANGELOG.md b/CHANGELOG.md index f8ec0c63..76c4a766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - Each reviewer under `agents/` now writes its full report to a file that larv-review names in the reviewer's prompt, in a folder per chunk under `~/.local/state/larv-review/`. It returns only its verdict and one line per finding, so a review takes less of the worker's context. The worker reads a finding's full entry before it fixes or answers a 🔴 or 🟡. Each reviewer now holds Write. `rule-hook` refuses a reviewer's Edit and MultiEdit, and any Write outside `~/.local/state/larv-review/`; no override waives this rule. Each chunk's folder stays after the merge, so `stability-replay` can replay a round that reads an earlier round's report. It replays on a copy of the folder. - `loop-claude` asks an interrupt's question on its own terminal and resumes the worker headless with your one-line answer, so the loop no longer waits for you to leave a claude session. Type `/talk` instead to open the worker's session in claude, as every interrupt did before, to read the diff or discuss first. A release ready to cut opens that session at once. Pressing Enter on an empty answer stops the loop, exit 2. Keys typed before the question shows are dropped, and a pasted answer keeps only its first line; type `/talk` for a longer one. The judge counts that answer as yours, like one typed in claude: the chunk stays open until the answer is recorded, where a later chunk could need it. -- `chunk-preflight` and `loop-claude` no longer count a renamed release as finished: one that `todo.md` named since the last tag, whose last items all moved to other releases in one change, none leaving the plan. An example is a planned 0.2.1 that becomes 0.3.0 because an item turned out breaking. Before, they reported it finished and ready to cut, and the loop stopped on every cycle while the release it became still held open items. larv-review's scoring-run trigger calls no run for such a release either. A release whose leftover items you defer to a later release reads the same way now, so cut it yourself when you want it cut. +- `todo.md` may mark a renamed release in a `## Renamed` section, one line per rename, such as `- 0.2.1 renamed to 0.3.0`. `chunk-preflight` and `loop-claude` then skip that release when they pick the next one, and larv-review's scoring-run trigger calls no run for it. Without the mark, a release named since the last tag whose items all moved to other releases reads as finished: `chunk-preflight` says it is ready to cut and the loop stops for you, and the trigger calls a scoring run. `rank_todo.py` fails on a `## Renamed` line of another shape. - When a worker's run ends with a question and a request for a higher rung, `loop-claude` now steps the worker one rung up as the judge interrupts, or as it answers the question with a quote from `README.md` or another file it may quote. The judge must quote a passage showing that the escalation trigger the run cites fired. Before, the step was lost for an answered question, and the worker carried on from the answer on its old rung. The step has the same limits as the step on an unfinished verdict, and no later ruling of that cycle carries a second escalation. The archive's interrupt and quoted-answer outcomes now name the worker's rung. - A scoring run due because a release's items ran out costs four more seats: it is done twice on one head. `larv-review agreement` compares how often Mid A and the inherited architect vote alike in paired rulings with how often their overall scores move the same way between the two runs. After 10 such pairs it gives a verdict, and on `Assumption fails:` larv-review asks you whether to keep the paired ruling. - `workflow-bench/bench.py` gives each run a fixed list of allowed tools. Before, it skipped every permission check. A run may launch agents, run `/security-review`, edit its clone (not the clone's `.git/` or `.claude/`) and its report, and read its clone and the copy of `~/.claude` it benches. For git it gets one command, `workflow-bench/review_git.py`, and no bare `git`. The wrapper runs `log`, `diff`, `show`, `status`, `ls-files`, `add` and `commit -m` on the run's clone, whatever the working directory. It allows only the options it lists for each, and refuses an argument that names a path outside the clone. git runs with no global or system config, hook, pager or editor. A run loads no settings or MCP servers from `~/.claude` or from the case's clone, so their hooks and extra directories do not apply to it. Every other call is denied. Expect a benched review that needs another git command, or to run a project's code or tests, to say in its report that it could not. diff --git a/bin/chunk_preflight/main.py b/bin/chunk_preflight/main.py index 98019f94..f7fa9e49 100644 --- a/bin/chunk_preflight/main.py +++ b/bin/chunk_preflight/main.py @@ -13,9 +13,8 @@ holds it, the plan loop-claude routes on. It prints: - the next release and its first item that does not wait, the item loop-claude routes on, with its L and E + I. An item waits while it is marked question, or while an item still in todo.md blocks it. Where the newest tag names a version x.y.z, the next release is the earliest after - x.y.z that todo.md has named at that tag or since, less a release renamed since: one whose last - items all moved to other releases in one change, none leaving todo.md in that change. Otherwise it - is todo.md's earliest release. + x.y.z that todo.md has named at that tag or since, less a release its ## Renamed section marks + renamed. Otherwise it is todo.md's earliest release. Where the next release holds no item, it says so: finished and ready to cut where work landed since the tag (the ## Unreleased entries, or else the commits), and else to be planned first. Where todo.md's earliest release is x.y.z or earlier, it says todo.md files items under a release diff --git a/bin/chunk_preflight/test_chunk_preflight.py b/bin/chunk_preflight/test_chunk_preflight.py index 64c7f89f..67aa84cf 100644 --- a/bin/chunk_preflight/test_chunk_preflight.py +++ b/bin/chunk_preflight/test_chunk_preflight.py @@ -166,15 +166,17 @@ class ChunkPreflightTool(unittest.TestCase): self.assertNotIn("item 9", done.stdout) self.assertFalse((repo.temp / "proj-item-9").exists()) - def test_takes_the_next_item_where_the_plan_renamed_the_release_after_the_last_cut(self): - repo = Repo(self) - repo.write(repo.root, "todo.md", TODO.replace("| 0.3.0 |", "| 0.4.0 |").replace("| 0.2.0 |", "| 0.3.0 |")) - repo.commit(repo.root, "rename 0.2.0 to 0.3.0") - repo.git(repo.root, "push", "--quiet", "origin", "main") - done = repo.preflight() - self.assertEqual(done.returncode, 0, done.stderr) - self.assertIn("item 3", done.stdout) - self.assertNotIn("finished", done.stdout) + def test_takes_the_next_item_where_the_plan_marks_the_release_after_the_last_cut_renamed_and_calls_it_finished_where_it_does_not(self): + for mark, fact, absent in (("\n## Renamed\n\n- 0.2.0 renamed to 0.3.0\n", "item 3", "finished"), ("", "finished and ready to cut", "item 3")): + with self.subTest(mark=mark): + repo = Repo(self) + repo.write(repo.root, "todo.md", TODO.replace("| 0.3.0 |", "| 0.4.0 |").replace("| 0.2.0 |", "| 0.3.0 |") + mark) + repo.commit(repo.root, "move 0.2.0's items to 0.3.0") + repo.git(repo.root, "push", "--quiet", "origin", "main") + done = repo.preflight() + self.assertEqual(done.returncode, 0, done.stderr) + self.assertIn(fact, done.stdout) + self.assertNotIn(absent, done.stdout) def test_weighs_todo_md_at_the_last_cut_and_on_the_default_branch_after_it_alone(self): """Each case's plans: before the tag, at it, on a side branch merged after it, and after it, each committed in turn where given.""" diff --git a/bin/larv_review/main.py b/bin/larv_review/main.py index 6adf4754..94a5e635 100644 --- a/bin/larv_review/main.py +++ b/bin/larv_review/main.py @@ -33,8 +33,9 @@ an item whose tagline names the comprehension floor, or when it leaves a release the checkout's todo.md, less the shipped items, and work has landed towards that release. Work has landed when the chunk ships one of the release's items, or when the release is the earliest the default branch's todo.md names and the default branch has a commit after its newest v* tag, or has -no v* tag. A release whose last items all moved to other releases, none leaving todo.md, reads as -renamed and is due none. +no v* tag. A release the checkout's todo.md marks renamed in its ## Renamed section, as +`- 0.2.1 renamed to 0.3.0`, is due none; one whose items all moved to other releases unmarked was +deferred, and is due one. A second scoring run of one head names itself ` rerun at `, so record-scoring does not refuse it as a repeat of the first. diff --git a/bin/larv_review/plan.py b/bin/larv_review/plan.py index af018d74..4feaba84 100644 --- a/bin/larv_review/plan.py +++ b/bin/larv_review/plan.py @@ -2,14 +2,14 @@ import pathlib from failure import Failure from git_repo import file_at, top -from todo_table import Item, items, renamed +from todo_table import Item, items, renames from larv_review.git import landed_since_release -def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], landed: bool) -> list[str] | Failure: - """Why the plan calls a scoring run, empty when it does not. before is the default branch's plan, after the chunk's, ships the IDs it ships, and landed whether the default branch holds a commit after its newest release tag. +def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], landed: bool, renamed: set[tuple[int, int, int]]) -> list[str] | Failure: + """Why the plan calls a scoring run, empty when it does not. before is the default branch's plan, after the chunk's, ships the IDs it ships, landed whether the default branch holds a commit after its newest release tag, and renamed the releases the chunk's plan marks renamed. - A chunk that ships an item naming the floor is due one, so it can prove the floor met. So is a chunk that empties a release after work has landed towards it, so no release ends unmeasured, short of one deferred as below. Work has landed when the chunk ships one of the release's items, or when the release is the earliest one `before` names and `landed` holds. A release whose last items all moved to other releases, renamed or deferred, reads as renamed, as todo_table.renamed says, and is due none. + A chunk that ships an item naming the floor is due one, so it can prove the floor met. So is a chunk that empties a release after work has landed towards it, so no release ends unmeasured, short of one renamed as below. Work has landed when the chunk ships one of the release's items, or when the release is the earliest one `before` names and `landed` holds. A release the chunk's plan marks renamed is due none; one whose last items moved to other releases unmarked was deferred, and is due one. """ plan = {item.id: item for item in before + after} if unknown := sorted(set(ships) - set(plan)): @@ -17,18 +17,18 @@ def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], lan shipped = [plan[id_] for id_ in ships] reasons = [f"ships item {item.id}, which names the comprehension floor" for item in shipped if "comprehension floor" in item.tagline.lower()] next_release = min((item.release for item in before), default=None) - for release in emptied(before, after, shipped): + for release in emptied(before, after, shipped, renamed): if any(item.release == release for item in shipped) or (release == next_release and landed): # SKILL.md → "Second run" keys on this wording. reasons.append(f"leaves release {'.'.join(map(str, release))} with no plan item") return reasons -def emptied(before: list[Item], after: list[Item], shipped: list[Item]) -> list[tuple[int, int, int]]: - """Each release the default branch's plan or a shipped item names that the chunk's plan, less the shipped items, names no longer, unless the chunk renamed it.""" +def emptied(before: list[Item], after: list[Item], shipped: list[Item], renamed: set[tuple[int, int, int]]) -> list[tuple[int, int, int]]: + """Each release the default branch's plan or a shipped item names that the chunk's plan, less the shipped items, names no longer, unless the chunk's plan marks it renamed.""" named = {item.release for item in before + shipped} kept = [item for item in after if item.id not in {ship.id for ship in shipped}] - return sorted(named - {item.release for item in kept} - renamed(before, kept)) + return sorted(named - {item.release for item in kept} - renamed) def plan_reasons(default: str, ids: list[int]) -> list[str] | Failure: @@ -52,7 +52,10 @@ def plan_reasons(default: str, ids: list[int]) -> list[str] | Failure: return Failure("the checkout's todo.md has no items table; rank_todo.py --help shows one") if isinstance(chunk, Failure): return Failure(f"the checkout's todo.md: {chunk.reason}") + renamed = renames(after) + if isinstance(renamed, Failure): + return Failure(f"the checkout's todo.md: {renamed.reason}") landed = landed_since_release(default) if isinstance(landed, Failure): return landed - return scoring_run_due(planned, chunk, ids, landed) + return scoring_run_due(planned, chunk, ids, landed, renamed) diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py index 38325177..7d738684 100644 --- a/bin/larv_review/test_larv_review.py +++ b/bin/larv_review/test_larv_review.py @@ -263,32 +263,39 @@ class ScoringRunDue(unittest.TestCase): def test_is_due_for_an_item_naming_the_floor(self): plan = [item(1, (0, 1, 0), "**Lift the project to the Comprehension floor.**"), item(2, (0, 1, 0))] - self.assertEqual(scoring_run_due(plan, plan, [1], True), ["ships item 1, which names the comprehension floor"]) - self.assertIsInstance(scoring_run_due(plan, plan, [9], True), Failure) + self.assertEqual(scoring_run_due(plan, plan, [1], True, set()), ["ships item 1, which names the comprehension floor"]) + self.assertIsInstance(scoring_run_due(plan, plan, [9], True, set()), Failure) def test_is_due_when_the_chunk_ships_a_releases_last_item(self): plan = [item(1, (0, 1, 0)), item(2, (0, 2, 0))] - self.assertEqual(scoring_run_due(plan, plan, [1], False), ["leaves release 0.1.0 with no plan item"]) - self.assertEqual(scoring_run_due(plan, plan + [item(3, (0, 1, 0))], [1], True), []) + self.assertEqual(scoring_run_due(plan, plan, [1], False, set()), ["leaves release 0.1.0 with no plan item"]) + self.assertEqual(scoring_run_due(plan, plan + [item(3, (0, 1, 0))], [1], True, set()), []) def test_is_due_when_the_chunk_removes_the_next_releases_last_item_after_work_landed(self): before = [item(1, (0, 1, 0)), item(2, (0, 1, 0)), item(3, (0, 2, 0))] after = [item(2, (0, 1, 0)), item(3, (0, 2, 0))] - self.assertEqual(scoring_run_due(before, after, [2], True), ["leaves release 0.1.0 with no plan item"]) - self.assertEqual(scoring_run_due(before, after, [], True), []) + self.assertEqual(scoring_run_due(before, after, [2], True, set()), ["leaves release 0.1.0 with no plan item"]) + self.assertEqual(scoring_run_due(before, after, [], True, set()), []) emptied = [item(3, (0, 2, 0))] - self.assertEqual(scoring_run_due(before, emptied, [2], False), ["leaves release 0.1.0 with no plan item"]) - self.assertEqual(scoring_run_due(before, emptied, [], True), ["leaves release 0.1.0 with no plan item"]) - self.assertEqual(scoring_run_due(before, emptied, [], False), []) + self.assertEqual(scoring_run_due(before, emptied, [2], False, set()), ["leaves release 0.1.0 with no plan item"]) + self.assertEqual(scoring_run_due(before, emptied, [], True, set()), ["leaves release 0.1.0 with no plan item"]) + self.assertEqual(scoring_run_due(before, emptied, [], False, set()), []) - def test_is_not_due_when_the_chunk_renames_the_next_release(self): + def test_is_not_due_when_the_chunk_marks_the_next_release_renamed(self): before = [item(1, (0, 2, 1)), item(2, (0, 3, 0))] - self.assertEqual(scoring_run_due(before, [item(1, (0, 3, 0)), item(2, (0, 4, 0))], [], True), []) - self.assertEqual(scoring_run_due(before, [item(1, (0, 3, 0)), item(2, (0, 3, 0))], [], True), []) + renamed = {(0, 2, 1)} + self.assertEqual(scoring_run_due(before, [item(1, (0, 3, 0)), item(2, (0, 4, 0))], [], True, renamed), []) + self.assertEqual(scoring_run_due(before, [item(1, (0, 3, 0)), item(2, (0, 3, 0))], [], True, renamed), []) + dropped = [item(1, (0, 2, 1)), item(3, (0, 2, 1)), item(2, (0, 3, 0))] + self.assertEqual(scoring_run_due(dropped, [item(1, (0, 3, 0)), item(2, (0, 3, 0))], [], True, renamed), []) + + def test_is_due_when_the_chunk_defers_the_next_releases_last_items_unmarked(self): + before = [item(1, (0, 2, 1)), item(2, (0, 3, 0))] + self.assertEqual(scoring_run_due(before, [item(1, (0, 3, 0)), item(2, (0, 3, 0))], [], True, set()), ["leaves release 0.2.1 with no plan item"]) def test_is_not_due_when_a_later_release_loses_its_last_item_unshipped(self): before = [item(1, (0, 1, 0)), item(3, (0, 2, 0))] - self.assertEqual(scoring_run_due(before, before[:1], [], True), []) + self.assertEqual(scoring_run_due(before, before[:1], [], True, set()), []) class LarvReviewTool(unittest.TestCase): @@ -357,6 +364,17 @@ class LarvReviewTool(unittest.TestCase): self.assertEqual(self.run_tool("needs-scoring-run").stdout, "No scoring run due.\n") self.assertIn("todo.md's ID column", self.run_tool("needs-scoring-run", "item-85").stderr) + def test_calls_a_scoring_run_for_a_deferred_release_and_none_for_one_the_checkouts_plan_marks_renamed(self): + rows = ("| 1 | 0.2.0 | | **Do it.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |", "| 2 | 0.2.0 | | **Then this.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |", "| 3 | 0.2.0 | | **And this.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |") + self.commit("Move 0.1.0's item to 0.2.0", {"todo.md": todo(*rows)}) + self.assertEqual(self.run_tool("needs-scoring-run").stdout, "Scoring run due: the chunk leaves release 0.1.0 with no plan item.\n") + self.commit("Mark 0.1.0 renamed", {"todo.md": todo(*rows) + "\n## Renamed\n\n- 0.1.0 renamed to 0.2.0\n"}) + self.assertEqual(self.run_tool("needs-scoring-run").stdout, "No scoring run due.\n") + self.commit("Break the mark", {"todo.md": todo(*rows) + "\n## Renamed\n\nsoon\n"}) + broken = self.run_tool("needs-scoring-run") + self.assertEqual(broken.returncode, 1) + self.assertIn("## Renamed", broken.stderr) + def test_reads_a_default_branch_plan_without_a_table_as_empty_and_refuses_a_checkout_without_one(self): self.git("switch", "-q", "-c", "reshape", "main") self.commit("Plan as a list", {"todo.md": "# todo\n\n- [ ] Do it.\n"}) diff --git a/bin/loop_claude/loop/main.py b/bin/loop_claude/loop/main.py index 3b2a64af..0d659046 100644 --- a/bin/loop_claude/loop/main.py +++ b/bin/loop_claude/loop/main.py @@ -61,9 +61,8 @@ session /talk opens run on one of the ladder's rungs: a model at an effort. As a on the item chunk-preflight names, read from todo.md on the default branch as the preflight just fetched it (todo_table.chunk_item). That item is the earliest release's top item that does not wait, but only where that release is the next one: the earliest after the newest vX.Y.Z tag that todo.md -has named at that tag or since, skipping a release renamed since (its last items all moved to other -releases in one change, none leaving todo.md), or, where no tag names a version, the earliest -release. Otherwise no item routes the chunk. An item waits while it is marked question, or while an +has named at that tag or since, skipping a release its ## Renamed section marks renamed, or, where +no tag names a version, the earliest release. Otherwise no item routes the chunk. An item waits while it is marked question, or while an item that blocks it is still in the table. The item's L picks the worker's rung, stepping from the model's cheapest rung by WORKER_STEPS in bin/model_routing/ladder.py, below it for a low L; without such an item, or with its L, E or I diff --git a/bin/rank_todo.py b/bin/rank_todo.py index 0b28179d..63364226 100755 --- a/bin/rank_todo.py +++ b/bin/rank_todo.py @@ -59,6 +59,9 @@ A valid todo.md; ## Details and each item's detail are optional: loop. An ID at or above Next ID fails; one below it that the table no longer holds was finished or deleted, and is dropped. - ## Items holds the table and nothing else: an order goes in the scores or the Blocked by column. +- ## Renamed is optional: one line `- 0.2.1 renamed to 0.3.0` per release the plan renamed. The tools + skip a marked release when they pick the next one, and call no scoring run for it. A release whose + items all moved to other releases without a mark reads as finished, so the human cuts it. - The table holds the columns above. One missing L, E or I fails, and so does one with a column this version does not know, since writing it would drop that column. - A table in the old shape, with C, A, G and Goals columns in place of L, E, I and Moves, still @@ -77,7 +80,7 @@ import re import sys import typing -from todo_table import BLOCKED_BY, cells, DETAILS, HEADER_START, Item, item_details, items_table, MOVES, OLD_SHAPE, parse_row, risk, Shape, SHAPE, shape_of, Table, table_rows +from todo_table import BLOCKED_BY, cells, DETAILS, HEADER_START, Item, item_details, items_table, MOVES, OLD_SHAPE, parse_row, renames, risk, Shape, SHAPE, shape_of, Table, table_rows from failure import Failure from markdown_text import listed, sections from file_writes import replace_file @@ -201,6 +204,8 @@ def rank(text: str, readme: str, decisions: str) -> Ranked | Failure: return items if uncited := check_citations(items, decisions): return uncited + if isinstance(marked := renames(text), Failure): + return marked scored = ordered(items, scoring) if isinstance(scored, Failure): return scored diff --git a/bin/test_rank_todo.py b/bin/test_rank_todo.py index cba92d50..67b29e12 100644 --- a/bin/test_rank_todo.py +++ b/bin/test_rank_todo.py @@ -457,22 +457,36 @@ class Standing(unittest.TestCase): self.assertEqual(todo_table.named_releases(texts), {(0, 2, 0), (0, 3, 0)}) self.assertEqual(todo_table.named_releases(Failure("log unreadable")), Failure("log unreadable")) - def test_leaves_out_a_release_whose_items_all_moved_to_other_releases(self): + def test_leaves_out_a_release_the_plan_marks_renamed_and_keeps_one_whose_items_moved_unmarked(self): row = "| {id} | {release} | | | **Do {id}.** | 1 | 1 | 1 | 1 | 1 | 1 by 1 | 10.0 |\n" header = "## Items\n\n| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |\n|---|---|---|---|---|---|---|---|---|---|---|---|\n" - plan = lambda *rows: header + "".join(row.format(id=id_, release=release) for id_, release in rows) + plan = lambda *rows, renamed=(): header + "".join(row.format(id=id_, release=release) for id_, release in rows) + ("\n## Renamed\n\n" + "".join(f"- {old} renamed to {new}\n" for old, new in renamed) if renamed else "") cases = ( - ("the plan shifted one minor", [plan((1, "0.2.1"), (2, "0.3.0")), plan((1, "0.3.0"), (2, "0.4.0"))], {(0, 3, 0), (0, 4, 0)}), - ("renamed to a release not named before", [plan((1, "0.2.1")), plan((1, "0.3.0"))], {(0, 3, 0)}), - ("renamed, then named again", [plan((1, "0.2.1")), plan((1, "0.3.0")), plan((1, "0.3.0"), (3, "0.2.1"))], {(0, 2, 1), (0, 3, 0)}), - ("its items joined a release keeping its own", [plan((1, "0.2.1"), (2, "0.3.0")), plan((1, "0.3.0"), (2, "0.3.0"))], {(0, 3, 0)}), - ("its items split over two releases", [plan((1, "0.2.1"), (3, "0.2.1")), plan((1, "0.3.0"), (3, "0.4.0"))], {(0, 3, 0), (0, 4, 0)}), - ("an item left the plan from it", [plan((1, "0.2.1"), (3, "0.2.1")), plan((1, "0.3.0"))], {(0, 2, 1), (0, 3, 0)}), + ("renamed", [plan((1, "0.2.1")), plan((1, "0.3.0"), renamed=[("0.2.1", "0.3.0")])], {(0, 3, 0)}), + ("deferred: its items moved without a mark", [plan((1, "0.2.1"), (2, "0.3.0")), plan((1, "0.3.0"), (2, "0.3.0"))], {(0, 2, 1), (0, 3, 0)}), + ("renamed in a change that also dropped one of its items", [plan((1, "0.2.1"), (3, "0.2.1")), plan((1, "0.3.0"), renamed=[("0.2.1", "0.3.0")])], {(0, 3, 0)}), + ("the plan shifted one minor", [plan((1, "0.2.1"), (2, "0.3.0")), plan((1, "0.3.0"), (2, "0.4.0"), renamed=[("0.2.1", "0.3.0"), ("0.3.0", "0.4.0")])], {(0, 3, 0), (0, 4, 0)}), + ("the mark stays in later plans", [plan((1, "0.2.1")), plan((1, "0.3.0"), renamed=[("0.2.1", "0.3.0")]), plan((1, "0.3.0"), (2, "0.3.0"), renamed=[("0.2.1", "0.3.0")])], {(0, 3, 0)}), + ("renamed, then named again", [plan((1, "0.2.1")), plan((1, "0.3.0"), renamed=[("0.2.1", "0.3.0")]), plan((1, "0.3.0"), (3, "0.2.1"), renamed=[("0.2.1", "0.3.0")])], {(0, 2, 1), (0, 3, 0)}), + ("a mark that does not parse", [plan((1, "0.2.1")), plan((1, "0.3.0")) + "\n## Renamed\n\nsoon\n"], {(0, 2, 1)}), ) for name, texts, named in cases: with self.subTest(name): self.assertEqual(todo_table.named_releases(texts), named) + def test_reads_the_releases_the_renamed_section_names(self): + self.assertEqual(todo_table.renames("## Items\n\n## Details\n"), set()) + self.assertEqual(todo_table.renames("## Renamed\n\n- 0.2.1 renamed to 0.3.0\n- 0.3.0 renamed to 0.4.0\n\n## Details\n"), {(0, 2, 1), (0, 3, 0)}) + for bad in ("soon", "- 0.2.1 is now 0.3.0", "- 0.2 renamed to 0.3.0", "- 0.2.1 renamed to 0.3.0 later"): + with self.subTest(bad): + self.assertIsInstance(todo_table.renames(f"## Renamed\n\n{bad}\n"), Failure) + + def test_fails_on_a_renamed_section_that_does_not_parse(self): + failed = rank_todo.rank(TODO + "\n## Renamed\n\nsoon\n", README, DECISIONS) + self.assertIsInstance(failed, Failure) + self.assertIn("## Renamed", failed.reason) + self.assertIsInstance(rank_todo.rank(TODO + "\n## Renamed\n\n- 0.2.1 renamed to 0.3.0\n", README, DECISIONS), rank_todo.Ranked) + class Main(unittest.TestCase): def run_main(self, *argv): diff --git a/bin/todo_table.py b/bin/todo_table.py index 1677b408..a52567ef 100644 --- a/bin/todo_table.py +++ b/bin/todo_table.py @@ -19,10 +19,12 @@ MOVES = "Moves" HEADER_START = "| ID | Release |" # How the plan's earliest release stands to the version x.y.z the newest tag names, the last cut. "next": it is the earliest release after x.y.z that todo.md has named at that tag or since, or no tag names a version, or the tag cannot be read. "cut": it is x.y.z or earlier. # Else the next release, the earliest named since the cut, holds no item: "finished" where work landed since the cut, and "unplanned" where none did. "unknown": todo.md's texts since the cut, or the count of work landed since it, cannot be read. -# A release named since the cut stays the next until a tag cuts it, unless `renamed` finds it renamed; larv_review/plan.py's `emptied` skips the same releases. +# A release named since the cut stays the next until a tag cuts it, unless todo.md marks it renamed (`renames`); larv_review/plan.py's `emptied` skips the same releases. Standing = typing.Literal["next", "cut", "finished", "unplanned", "unknown"] # todo.md's ## Details section, its body the first group. DETAILS = re.compile(r"^## Details\n(.*?)(?=^## |\Z)", re.M | re.S) +# One line of todo.md's ## Renamed section, the release it renamed and the one it became. +RENAME = re.compile(r"- ([0-9]+\.[0-9]+\.[0-9]+) renamed to [0-9]+\.[0-9]+\.[0-9]+") # Each goal an item names, in its order, with how far the item moves it; None in OLD_SHAPE, whose Goals cell names no move. Moves = tuple[tuple[str, int | None], ...] @@ -203,21 +205,28 @@ def landed(cut: LastCut) -> int | Failure: def named_releases(todos: list[str] | Failure) -> set[tuple[int, int, int]] | Failure: - """Each release the todo.md texts, oldest first, file items under, leaving out one that `renamed` finds a later text renamed, unless a text after that names it again; a text that does not parse names none.""" + """Each release the todo.md texts, oldest first, file items under, leaving out one that a later text marks renamed, unless a text after that files items under it again; a text that does not parse names none.""" if isinstance(todos, Failure): return todos - plans = [parsed for parsed in map(items, todos) if isinstance(parsed, list)] - named = {item.release for item in plans[0]} if plans else set() - for before, after in zip(plans, plans[1:]): - named = (named | {item.release for item in after}) - renamed(before, after) + named: set[tuple[int, int, int]] = set() + for text in todos: + plan, marked = items(text), renames(text) + if isinstance(plan, list) and isinstance(marked, set): + named = (named - marked) | {item.release for item in plan} return named -def renamed(before: list[Item], after: list[Item]) -> set[tuple[int, int, int]]: - """Each release `before` names and `after` does not, where `after` still holds every item `before` filed under it: renamed, never finished, as `docs/decisions.md` → `todo.md: a release whose last items all move …` says.""" - held = {item.id for item in after} - gone = {item.release for item in before} - {item.release for item in after} - return {release for release in gone if all(item.id in held for item in before if item.release == release)} +def renames(todo: str) -> set[tuple[int, int, int]] | Failure: + """Each release todo.md's ## Renamed section says was renamed, as `- 0.2.1 renamed to 0.3.0`, so never finished. Without such a line, a release whose items all moved to other releases reads as finished or deferred, and the human cuts it.""" + marked: set[tuple[int, int, int]] = set() + for body in sections(todo).get("Renamed", []): + for line in body.splitlines(): + rename = RENAME.fullmatch(line.strip()) + if rename is None: + return Failure(f"todo.md's ## Renamed section holds {line.strip()!r}, not a line such as `- 0.2.1 renamed to 0.3.0`") + major, minor, patch = (int(part) for part in rename.group(1).split(".")) + marked.add((major, minor, patch)) + return marked def standing(tag: str | None | Failure, landed: int | Failure, earliest: tuple[int, int, int] | None, named: set[tuple[int, int, int]] | Failure) -> Standing: diff --git a/docs/decisions.md b/docs/decisions.md index 14a47e51..5273d15b 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -80,7 +80,7 @@ Valid while the ladder orders its rungs by competence. ## review: the comprehension check records how hard a project is to read and blocks no merge: a paired ruling against the last measured commit where the architecture pass ran, and the four-seat scoring run, once when an item names the floor and twice on one head when a release's items run out -2026-10-08, lilleman. Serves goals 1.1 and 1.4. Two independent four-seat runs moved up to 0.4 on near-identical code, so a fall within that noise forced rounds that changed nothing (PR #224). A seat reading both versions judges the difference on the same material, so the noise the versions share cancels. No conventional significance level lets a sign test settle with four votes, so the human chose a lead of two votes over every other ruling, same included. Two seats that agree settle it, so a PR that leaves the reading as it was costs two seats. A third seat alone can never settle it, so the third and fourth launch together. The human chose the last measured commit on the architect's finding that with a merge base as the base, chunks without an architecture pass, and a suspended restructure's steps, could each lower comprehension unseen. Reading the default branch one merged change at a time keeps the rule working for merge commits and squash merges alike. The scoring run also runs on a chunk shipping an item that names the floor, so the chunk that lifts a project to the floor can prove it. A chunk that removes a release's last item without shipping it runs it too, so no release ends unmeasured, unless every item it held moved to other releases: such a release reads as renamed, as `todo.md: a release whose last items all move …` says. Valid while seats reading both versions agree more often than two absolute runs do. +2026-10-08, lilleman. Serves goals 1.1 and 1.4. Two independent four-seat runs moved up to 0.4 on near-identical code, so a fall within that noise forced rounds that changed nothing (PR #224). A seat reading both versions judges the difference on the same material, so the noise the versions share cancels. No conventional significance level lets a sign test settle with four votes, so the human chose a lead of two votes over every other ruling, same included. Two seats that agree settle it, so a PR that leaves the reading as it was costs two seats. A third seat alone can never settle it, so the third and fourth launch together. The human chose the last measured commit on the architect's finding that with a merge base as the base, chunks without an architecture pass, and a suspended restructure's steps, could each lower comprehension unseen. Reading the default branch one merged change at a time keeps the rule working for merge commits and squash merges alike. The scoring run also runs on a chunk shipping an item that names the floor, so the chunk that lifts a project to the floor can prove it. A chunk that removes a release's last item without shipping it runs it too, so no release ends unmeasured, unless `todo.md` marks it renamed in a `## Renamed` section (`bin/todo_table.py` → `renames`). Valid while seats reading both versions agree more often than two absolute runs do. 2026-10-13, lilleman. No published study validates simulated reader panels as a measure of how easy code is to understand, and no test of whether the panel's signal beats its noise has run. So no ruling, score or floor blocks a merge. The runs go on, so the history keeps the scores and the places the seats found hard, for later measurement. The architect, the stability reviewer and a session filing an item read the newest places, since those places are what a chunk can improve. With nothing to block, the check runs once per chunk, on the branch as review left it, in place of a run in each architecture round and a rescore after later commits. A fallen dimension no longer calls the four scoring seats either: their scores only decided the block. The base is now the newest merged change that adds any ruling or scoring run: with worse rulings merging, a base left behind them would charge one chunk's ruling with earlier chunks' falls. The newest places are the newest scoring run's and each later ruling's places a seat voted worse, so they change with each ruling. A chunk that leaves a touched place as hard says why in its PR summary, not in a decline's record, which would outlive the place. @@ -146,10 +146,6 @@ Valid while the ladder orders its rungs by competence. 2026-10-15, lilleman. Serves goal 1.4: loop-claude routes a chunk's first cycle on the item the chunk takes (`routing: a chunk's worker runs on the rung its item's L picks`). An item lists the items that must be done before it starts in a Blocked by column, and `rank_todo.py` ranks each blocker above every item it blocks. The table's order is `todo.md`'s only order: `rank_todo.py` fails on text beside the table under `## Items`, since a prose order there, "Release 0.3.0 takes items 125, 114 and 124 first", contradicted the table and loop-claude could not read it. A decision that wants an order sets the scores instead. An item waits while it is marked `question` or a blocker of it is still in the table, whatever the rows' order, so a release's first row that does not wait is the item a chunk takes. A blocker the table no longer holds was finished or deleted, and is dropped, so the cell shows what still blocks. A panel of three readers seated as lilleman picked the spelling: two ranked "Blocked by" first, as the cell lists only what still blocks, and all three chose bare IDs such as `12, 14` in a column right after Release, read before the tagline and kept apart from the scores. `rank_todo.py` adds the column to a table without it. The tools read cells by column name, so a later column leaves a reader on an older release working; `rank_todo.py`, which writes every column, fails on one it does not know rather than drop it. -## todo.md: a release whose last items all move to other releases in one change, none leaving the plan, is read as renamed, never finished, until item 185 lets the plan say which - -2026-10-18, lilleman. Serves goal 1.5: adf-codec renamed its next release, 0.2.1, to 0.3.0 once one of its items turned out breaking, and `chunk-preflight` then called 0.2.1 finished and ready to cut, stopping the loop on every cycle while 0.3.0 held open items. A change to todo.md that moves a release's last items to other releases reads the same whether it renamed the release or deferred its leftovers, so the tools read it as renamed: `chunk-preflight` and `loop-claude` skip it when choosing the next release, and larv-review's scoring-run trigger calls no run for it. `bin/todo_table.py`'s `renamed` holds the rule, and `bin/larv_review/plan.py`'s `emptied` applies it. It costs goal 1.1: a release whose leftovers were deferred no longer stops the loop for a cut or calls a scoring run, so the human may cut it unmeasured. A rename that drops one of the release's items in the same change reads as finished, so rename in a change of its own. Valid until `todo.md` item 185 lets todo.md say which it was. - ## todo.md: only a session or subagent on the project's rung or above scores or reshapes the plan; one below it drafts new items and changes to filed ones for a subagent at or above that rung to apply and score, and removes finished ones 2026-10-15, lilleman. Serves goal 1.1: a cheaper rung writes worse scores, and a wrong score routes a chunk onto the wrong rung, ranks the plan wrong and drops an item under the bar that should stay. Below the project's rung, a session or subagent may not score an item, move it between releases, split a milestone, delete an item under the bar, or rewrite a filed item. It drafts each new item, and each change to a filed item, such as a refresh a rule asks for. Before the next commit, one subagent on the project's rung or above applies and scores the drafts. One launch covers all of a chunk's drafts (goal 1.4). A security finding gets that subagent at once, since it is filed the moment it is found. Removing a finished item closes work and plans none, so any rung does it. Scoring a delegated task's L runs on any rung too: a launch on the project's rung to score each delegation would cost more than the cheaper task saves (goal 1.4). diff --git a/docs/reading-cost.md b/docs/reading-cost.md index 05db8f14..e279a628 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -645,3 +645,11 @@ Read most (opens and searches): - `todo.md` 4 - `rules/todo-items.md` 1 + +## Reading cost, chunk cec7aa03e832, finished 2026-10-18T07:21:37Z + +88622 new input tokens before the first commit. + +Read most (opens and searches): + +- `rules/decisions.md` 1 diff --git a/rules/todo-items.md b/rules/todo-items.md index 33ded0b3..0b83e196 100644 --- a/rules/todo-items.md +++ b/rules/todo-items.md @@ -5,7 +5,7 @@ paths: # Todo items (`todo.md`) -- **`todo.md` is mandatory in every project, in the shape `rank_todo.py --help` shows**, which `~/.claude/bin/rank_todo.py` checks and ranks; its `--help` shows a valid file. `## Scoring` holds the formula and the bar; `## Items` is one table of every item; `## Details` holds each item's detail under its ID. Cite an item by its ID. The formula and bar are the project's own to tune. +- **`todo.md` is mandatory in every project, in the shape `rank_todo.py --help` shows**, which `~/.claude/bin/rank_todo.py` checks and ranks; its `--help` shows a valid file. `## Scoring` holds the formula and the bar; `## Items` is one table of every item; `## Details` holds each item's detail under its ID. `## Renamed`, when a release was renamed, holds one line `- 0.2.1 renamed to 0.3.0` per rename; a release whose items all moved elsewhere without that line reads as finished, ready to cut. Cite an item by its ID. The formula and bar are the project's own to tune. - **Order items only by score and the Blocked by column.** An item's Blocked by cell lists the IDs of the items that must be done before it starts, such as `12, 14`; `rank_todo.py --help` says how it ranks them. No text in `todo.md` outside the table orders items: where an item must go first, score it so, and say why in its detail. - **Plan only on the project's rung or above.** loop-claude's prompt tells you when you run below it. Below it, never score or re-score an item, move it between releases, split a milestone into items, delete an item under the bar, rewrite a filed item's tagline or detail, or choose or replace an item in `docs/score-anchors.md`. Draft each new item, each change to a filed item, and each change to the anchors, instead. Before your next commit, launch one subagent to apply the drafts, score them and set their release. Launch it on the rung `CLAUDE.md`'s delegation rule gives a subagent that files or scores items. Keep the scores and releases it writes. For a security finding, launch it at once. Any rung may remove a finished item's row and detail, and score a delegated task's L. A subagent launched for another task leaves `todo.md` alone. - **An item's release allows the bump that semver read strictly asks for.** An item that changes what exists needs a major, or before 1.0.0 a minor. One that only adds needs a minor, and a fix a patch. diff --git a/todo.md b/todo.md index 25c6a293..831f00e2 100644 --- a/todo.md +++ b/todo.md @@ -13,7 +13,6 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| | 180 | 0.2.0 | | question | **Settle how a trigger that fires after a step-up at an interrupt or a quoted answer steps the worker, which today it never does.** | 2 | 2 | 2 | 4 | 3 | 1.1 by 3 | 4.1 | -| 185 | 0.2.0 | | decision | **Let todo.md say whether a release whose last items moved to other releases was renamed or deferred, so the tools stop guessing and a deferred release stops the loop for its cut and calls its scoring run.** | 2 | 2 | 3 | 5 | 3 | 1.1 by 4, 1.2 by 4 | 9.1 | | 177 | 0.2.0 | | | **Move the next chunk's pick, from `LastCut` and `standing` to `chunk_item` and `default_plan`, into one module named for it, so `git_repo` only runs git and `todo_table` only parses the plan.** | 3 | 1 | 3 | 5 | 4 | 1.1 by 4 | 3.6 | | 159 | 0.2.0 | | decision | **Run each review pass on the lowest rung that a replay of its archived rounds shows finding every 🔴 and 🟡 the project's rung finds, even below the worker's rung.** | 4 | 2 | 3 | 7 | 6 | 1.4 by 7 | 1.1 | | 80 | 0.3.0 | | defect | **State in README → Install that every machine taking this checkout must be a sandbox, as `settings.json`'s auto mode assumes.** | 1 | 2 | 1 | 2 | 1 | 2 by 4 | 17.5 | @@ -100,16 +99,12 @@ Options: Only the human can choose, and the answer revises that decision. Found by the stability review of PR #307. -### 185. Let todo.md say whether a release whose last items moved to other releases was renamed or deferred, so the tools stop guessing and a deferred release stops the loop for its cut and calls its scoring run. - -`bin/todo_table.py`'s `renamed` reads every such release as renamed, as `docs/decisions.md` → `todo.md: a release whose last items all move …` records, because the table cannot tell the two apart. A deferred release then neither stops the loop for its cut nor calls a scoring run, and `chunk-preflight` skips it without a word. A rename that drops one of the release's items in the same change reads as finished. Give the plan an explicit mark for either, such as a line naming the old release and the new one, have `renamed`, `chunk-preflight` and larv-review's scoring-run trigger read it, and retire the decision. - ### 177. Move the next chunk's pick, from `LastCut` and `standing` to `chunk_item` and `default_plan`, into one module named for it, so `git_repo` only runs git and `todo_table` only parses the plan. Raised by PR #302's paired ruling, where two of four seats read the project as worse at these places. Item 161 put the pick in `bin/todo_table.py` (`Standing`, `LastCut`, `unreleased_entries`, `landed`, `named_releases`, `standing`, `chunk_item`) and its reader in `bin/git_repo.py` (`DefaultPlan`, `default_plan`, `todos_since`), so the git module now imports the plan model and the table parser decides how a release stands. Make each of those places easier to read: - `bin/git_repo.py` → `DefaultPlan`: the git module knows todo.md and CHANGELOG.md. -- `bin/todo_table.py` → `standing`: a five-state literal whose three-line comment must be decoded first, and whose `named` set comes from `named_releases`' fold over `renamed`, read separately. +- `bin/todo_table.py` → `standing`: a five-state literal whose three-line comment must be decoded first, and whose `named` set comes from `named_releases`' fold over the `## Renamed` marks, read separately. - `bin/git_repo.py` → `todos_since`: it promises the texts oldest first, an order `named_releases` needs, stated again in `LastCut`'s comment; let the pick's module own that order. - `bin/todo_table.py` → `landed`: it counts ## Unreleased entries first, while `bin/larv_review/git.py` → `landed_since_release` counts commits only, two meanings of "work has landed"; give them one meaning or two names. - `bin/loop_claude/loop/main.py` → `run_loop`: routing reads the plan as chunk-preflight's fetch left it, an order only a comment states. -- 2.52.0 From 28a3f9c5e9b2d85db9792e90da2bfa78cc1660db Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 18 Oct 2026 09:35:44 +0200 Subject: [PATCH 02/12] =?UTF-8?q?Answer=20architecture=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=202=20=F0=9F=9F=A1;=20fail=20on=20a=20mark=20over?= =?UTF-8?q?=20a=20live=20release,=20pin=20the=20second=20run's=20reason=20?= =?UTF-8?q?wording,=20state=20the=20target=20is=20for=20the=20reader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/larv_review/plan.py | 2 +- bin/larv_review/test_larv_review.py | 6 ++++++ bin/rank_todo.py | 8 ++++++-- bin/test_rank_todo.py | 2 ++ bin/todo_table.py | 2 +- rules/todo-items.md | 2 +- 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/bin/larv_review/plan.py b/bin/larv_review/plan.py index 4feaba84..0938e7ee 100644 --- a/bin/larv_review/plan.py +++ b/bin/larv_review/plan.py @@ -19,7 +19,7 @@ def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], lan next_release = min((item.release for item in before), default=None) for release in emptied(before, after, shipped, renamed): if any(item.release == release for item in shipped) or (release == next_release and landed): - # SKILL.md → "Second run" keys on this wording. + # SKILL.md → "Second run" keys on this wording; a test pins both. reasons.append(f"leaves release {'.'.join(map(str, release))} with no plan item") return reasons diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py index 7d738684..70c75be8 100644 --- a/bin/larv_review/test_larv_review.py +++ b/bin/larv_review/test_larv_review.py @@ -293,6 +293,12 @@ class ScoringRunDue(unittest.TestCase): before = [item(1, (0, 2, 1)), item(2, (0, 3, 0))] self.assertEqual(scoring_run_due(before, [item(1, (0, 3, 0)), item(2, (0, 3, 0))], [], True, set()), ["leaves release 0.2.1 with no plan item"]) + def test_words_the_emptied_release_reason_as_skill_md_s_second_run_quotes_it(self): + skill = (pathlib.Path(__file__).resolve().parents[2] / "skills" / "larv-review" / "SKILL.md").read_text() + self.assertIn("`leaves release … with no plan item`", skill) + reasons = scoring_run_due([item(1, (0, 1, 0))], [], [], True, set()) + self.assertRegex(reasons[0], r"^leaves release [0-9.]+ with no plan item$") + def test_is_not_due_when_a_later_release_loses_its_last_item_unshipped(self): before = [item(1, (0, 1, 0)), item(3, (0, 2, 0))] self.assertEqual(scoring_run_due(before, before[:1], [], True, set()), []) diff --git a/bin/rank_todo.py b/bin/rank_todo.py index 63364226..8289421a 100755 --- a/bin/rank_todo.py +++ b/bin/rank_todo.py @@ -60,8 +60,9 @@ A valid todo.md; ## Details and each item's detail are optional: or deleted, and is dropped. - ## Items holds the table and nothing else: an order goes in the scores or the Blocked by column. - ## Renamed is optional: one line `- 0.2.1 renamed to 0.3.0` per release the plan renamed. The tools - skip a marked release when they pick the next one, and call no scoring run for it. A release whose - items all moved to other releases without a mark reads as finished, so the human cuts it. + skip a marked release when they pick the next one, and call no scoring run for it; they read only + the old release, the new one is for the reader. No item may sit under a marked release. A release + whose items all moved to other releases without a mark reads as finished, so the human cuts it. - The table holds the columns above. One missing L, E or I fails, and so does one with a column this version does not know, since writing it would drop that column. - A table in the old shape, with C, A, G and Goals columns in place of L, E, I and Moves, still @@ -206,6 +207,9 @@ def rank(text: str, readme: str, decisions: str) -> Ranked | Failure: return uncited if isinstance(marked := renames(text), Failure): return marked + if live := next((item for item in items if item.release in marked), None): + release = ".".join(map(str, live.release)) + return Failure(f"todo.md marks release {release} renamed but files item {live.id} under it; drop the mark or move the item") scored = ordered(items, scoring) if isinstance(scored, Failure): return scored diff --git a/bin/test_rank_todo.py b/bin/test_rank_todo.py index 67b29e12..f529704f 100644 --- a/bin/test_rank_todo.py +++ b/bin/test_rank_todo.py @@ -486,6 +486,8 @@ class Standing(unittest.TestCase): self.assertIsInstance(failed, Failure) self.assertIn("## Renamed", failed.reason) self.assertIsInstance(rank_todo.rank(TODO + "\n## Renamed\n\n- 0.2.1 renamed to 0.3.0\n", README, DECISIONS), rank_todo.Ranked) + live = rank_todo.rank(TODO + "\n## Renamed\n\n- 0.2.0 renamed to 0.3.0\n", README, DECISIONS) + self.assertEqual(live, Failure("todo.md marks release 0.2.0 renamed but files item 1 under it; drop the mark or move the item")) class Main(unittest.TestCase): diff --git a/bin/todo_table.py b/bin/todo_table.py index a52567ef..3c105063 100644 --- a/bin/todo_table.py +++ b/bin/todo_table.py @@ -217,7 +217,7 @@ def named_releases(todos: list[str] | Failure) -> set[tuple[int, int, int]] | Fa def renames(todo: str) -> set[tuple[int, int, int]] | Failure: - """Each release todo.md's ## Renamed section says was renamed, as `- 0.2.1 renamed to 0.3.0`, so never finished. Without such a line, a release whose items all moved to other releases reads as finished or deferred, and the human cuts it.""" + """Each release todo.md's ## Renamed section says was renamed, as `- 0.2.1 renamed to 0.3.0`, so never finished; the new release is for the reader. Without such a line, a release whose items all moved to other releases reads as finished or deferred, and the human cuts it, so a forgotten mark costs one interrupt, never a silent skip. A panel of three readers seated as lilleman picked the spelling 3-0 over `- 0.2.1 → 0.3.0` and a `Renamed 0.2.1 = 0.3.0` line under ## Scoring.""" marked: set[tuple[int, int, int]] = set() for body in sections(todo).get("Renamed", []): for line in body.splitlines(): diff --git a/rules/todo-items.md b/rules/todo-items.md index 0b83e196..43806ad3 100644 --- a/rules/todo-items.md +++ b/rules/todo-items.md @@ -5,7 +5,7 @@ paths: # Todo items (`todo.md`) -- **`todo.md` is mandatory in every project, in the shape `rank_todo.py --help` shows**, which `~/.claude/bin/rank_todo.py` checks and ranks; its `--help` shows a valid file. `## Scoring` holds the formula and the bar; `## Items` is one table of every item; `## Details` holds each item's detail under its ID. `## Renamed`, when a release was renamed, holds one line `- 0.2.1 renamed to 0.3.0` per rename; a release whose items all moved elsewhere without that line reads as finished, ready to cut. Cite an item by its ID. The formula and bar are the project's own to tune. +- **`todo.md` is mandatory in every project, in the shape `rank_todo.py --help` shows**, which `~/.claude/bin/rank_todo.py` checks and ranks; its `--help` shows a valid file. `## Scoring` holds the formula and the bar; `## Items` is one table of every item; `## Details` holds each item's detail under its ID. `## Renamed`, when a release was renamed, holds one line `- 0.2.1 renamed to 0.3.0` per rename, and no item under a marked release; a release whose items all moved elsewhere without that line reads as finished, ready to cut. Cite an item by its ID. The formula and bar are the project's own to tune. - **Order items only by score and the Blocked by column.** An item's Blocked by cell lists the IDs of the items that must be done before it starts, such as `12, 14`; `rank_todo.py --help` says how it ranks them. No text in `todo.md` outside the table orders items: where an item must go first, score it so, and say why in its detail. - **Plan only on the project's rung or above.** loop-claude's prompt tells you when you run below it. Below it, never score or re-score an item, move it between releases, split a milestone into items, delete an item under the bar, rewrite a filed item's tagline or detail, or choose or replace an item in `docs/score-anchors.md`. Draft each new item, each change to a filed item, and each change to the anchors, instead. Before your next commit, launch one subagent to apply the drafts, score them and set their release. Launch it on the rung `CLAUDE.md`'s delegation rule gives a subagent that files or scores items. Keep the scores and releases it writes. For a security finding, launch it at once. Any rung may remove a finished item's row and detail, and score a delegated task's L. A subagent launched for another task leaves `todo.md` alone. - **An item's release allows the bump that semver read strictly asks for.** An item that changes what exists needs a major, or before 1.0.0 a minor. One that only adds needs a minor, and a fix a patch. -- 2.52.0 From 1f0a046dd44cdcea757883efbdc2982adfb1b030 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 18 Oct 2026 09:47:44 +0200 Subject: [PATCH 03/12] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=202=20=F0=9F=9F=A1;=20name=20the=20rename=20fix?= =?UTF-8?q?=20in=20the=20finished=20message=20and=20the=20changelog,=20rea?= =?UTF-8?q?d=20a=20bad=20newest=20mark=20as=20unknown,=20refuse=20a=20self?= =?UTF-8?q?-rename,=20share=20the=20release=20parser,=20test=20the=20strip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- bin/chunk_preflight/gathered.py | 2 +- bin/larv_review/test_larv_review.py | 4 +++- bin/rank_todo.py | 8 ++++---- bin/test_rank_todo.py | 19 +++++++++++++++---- bin/todo_table.py | 23 ++++++++++++++++------- rules/todo-items.md | 2 +- 7 files changed, 41 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76c4a766..9e36412e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - Each reviewer under `agents/` now writes its full report to a file that larv-review names in the reviewer's prompt, in a folder per chunk under `~/.local/state/larv-review/`. It returns only its verdict and one line per finding, so a review takes less of the worker's context. The worker reads a finding's full entry before it fixes or answers a 🔴 or 🟡. Each reviewer now holds Write. `rule-hook` refuses a reviewer's Edit and MultiEdit, and any Write outside `~/.local/state/larv-review/`; no override waives this rule. Each chunk's folder stays after the merge, so `stability-replay` can replay a round that reads an earlier round's report. It replays on a copy of the folder. - `loop-claude` asks an interrupt's question on its own terminal and resumes the worker headless with your one-line answer, so the loop no longer waits for you to leave a claude session. Type `/talk` instead to open the worker's session in claude, as every interrupt did before, to read the diff or discuss first. A release ready to cut opens that session at once. Pressing Enter on an empty answer stops the loop, exit 2. Keys typed before the question shows are dropped, and a pasted answer keeps only its first line; type `/talk` for a longer one. The judge counts that answer as yours, like one typed in claude: the chunk stays open until the answer is recorded, where a later chunk could need it. -- `todo.md` may mark a renamed release in a `## Renamed` section, one line per rename, such as `- 0.2.1 renamed to 0.3.0`. `chunk-preflight` and `loop-claude` then skip that release when they pick the next one, and larv-review's scoring-run trigger calls no run for it. Without the mark, a release named since the last tag whose items all moved to other releases reads as finished: `chunk-preflight` says it is ready to cut and the loop stops for you, and the trigger calls a scoring run. `rank_todo.py` fails on a `## Renamed` line of another shape. +- `todo.md` may mark a renamed release in a `## Renamed` section, one line per rename, such as `- 0.2.1 renamed to 0.3.0`. `chunk-preflight` and `loop-claude` then skip that release when they pick the next one, and larv-review's scoring-run trigger calls no run for it. Without the mark, a release named since the last tag whose items all moved to other releases reads as finished: `chunk-preflight` says it is ready to cut and the loop stops for you, and the trigger calls a scoring run. `rank_todo.py` fails on a `## Renamed` line of another shape, and on an item filed under a release it marks. Before you move a project to this release, add the line to every project whose `todo.md` renamed a release since its last tag, or its loop stops for that release's cut. - When a worker's run ends with a question and a request for a higher rung, `loop-claude` now steps the worker one rung up as the judge interrupts, or as it answers the question with a quote from `README.md` or another file it may quote. The judge must quote a passage showing that the escalation trigger the run cites fired. Before, the step was lost for an answered question, and the worker carried on from the answer on its old rung. The step has the same limits as the step on an unfinished verdict, and no later ruling of that cycle carries a second escalation. The archive's interrupt and quoted-answer outcomes now name the worker's rung. - A scoring run due because a release's items ran out costs four more seats: it is done twice on one head. `larv-review agreement` compares how often Mid A and the inherited architect vote alike in paired rulings with how often their overall scores move the same way between the two runs. After 10 such pairs it gives a verdict, and on `Assumption fails:` larv-review asks you whether to keep the paired ruling. - `workflow-bench/bench.py` gives each run a fixed list of allowed tools. Before, it skipped every permission check. A run may launch agents, run `/security-review`, edit its clone (not the clone's `.git/` or `.claude/`) and its report, and read its clone and the copy of `~/.claude` it benches. For git it gets one command, `workflow-bench/review_git.py`, and no bare `git`. The wrapper runs `log`, `diff`, `show`, `status`, `ls-files`, `add` and `commit -m` on the run's clone, whatever the working directory. It allows only the options it lists for each, and refuses an argument that names a path outside the clone. git runs with no global or system config, hook, pager or editor. A run loads no settings or MCP servers from `~/.claude` or from the case's clone, so their hooks and extra directories do not apply to it. Every other call is denied. Expect a benched review that needs another git command, or to run a project's code or tests, to say in its report that it could not. diff --git a/bin/chunk_preflight/gathered.py b/bin/chunk_preflight/gathered.py index 407dfa3f..d0361575 100644 --- a/bin/chunk_preflight/gathered.py +++ b/bin/chunk_preflight/gathered.py @@ -97,7 +97,7 @@ def planned(todo: str | Failure, cut: LastCut, default: str) -> Plan | NoItem: return NoItem(f"{where} files items under release {version(earliest)}, which is not after the last cut, {cut.tag}; ask the human which release they belong to.") gap = f"{where} holds no item for the next release after the last cut, {cut.tag}, and" if stands == "finished": - return NoItem(f"{gap} work has landed since, so that release is finished and ready to cut, and the working loop stops here.") + return NoItem(f"{gap} work has landed since, so that release is finished and ready to cut, and the working loop stops here. If todo.md renamed that release instead, add `- renamed to ` under its `## Renamed`.") if stands == "unplanned": return NoItem(f"{gap} no work has landed since, so that release is to be planned first.") if stands == "unknown": diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py index 70c75be8..ec89d960 100644 --- a/bin/larv_review/test_larv_review.py +++ b/bin/larv_review/test_larv_review.py @@ -376,7 +376,9 @@ class LarvReviewTool(unittest.TestCase): self.assertEqual(self.run_tool("needs-scoring-run").stdout, "Scoring run due: the chunk leaves release 0.1.0 with no plan item.\n") self.commit("Mark 0.1.0 renamed", {"todo.md": todo(*rows) + "\n## Renamed\n\n- 0.1.0 renamed to 0.2.0\n"}) self.assertEqual(self.run_tool("needs-scoring-run").stdout, "No scoring run due.\n") - self.commit("Break the mark", {"todo.md": todo(*rows) + "\n## Renamed\n\nsoon\n"}) + + def test_refuses_a_checkout_plan_whose_renamed_section_does_not_parse(self): + self.commit("Break the mark", {"todo.md": todo("| 1 | 0.2.0 | | **Do it.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |") + "\n## Renamed\n\nsoon\n"}) broken = self.run_tool("needs-scoring-run") self.assertEqual(broken.returncode, 1) self.assertIn("## Renamed", broken.stderr) diff --git a/bin/rank_todo.py b/bin/rank_todo.py index 8289421a..9d759c04 100755 --- a/bin/rank_todo.py +++ b/bin/rank_todo.py @@ -61,8 +61,9 @@ A valid todo.md; ## Details and each item's detail are optional: - ## Items holds the table and nothing else: an order goes in the scores or the Blocked by column. - ## Renamed is optional: one line `- 0.2.1 renamed to 0.3.0` per release the plan renamed. The tools skip a marked release when they pick the next one, and call no scoring run for it; they read only - the old release, the new one is for the reader. No item may sit under a marked release. A release - whose items all moved to other releases without a mark reads as finished, so the human cuts it. + the old release, the new one is for the reader. No item may sit under a marked release. Delete a + line once a tag at or past its release is cut. A release whose items all moved to other releases + without a mark reads as finished, so the human cuts it. - The table holds the columns above. One missing L, E or I fails, and so does one with a column this version does not know, since writing it would drop that column. - A table in the old shape, with C, A, G and Goals columns in place of L, E, I and Moves, still @@ -208,8 +209,7 @@ def rank(text: str, readme: str, decisions: str) -> Ranked | Failure: if isinstance(marked := renames(text), Failure): return marked if live := next((item for item in items if item.release in marked), None): - release = ".".join(map(str, live.release)) - return Failure(f"todo.md marks release {release} renamed but files item {live.id} under it; drop the mark or move the item") + return Failure(f"todo.md marks release {release_name(live)} renamed but files item {live.id} under it; drop the mark or move the item") scored = ordered(items, scoring) if isinstance(scored, Failure): return scored diff --git a/bin/test_rank_todo.py b/bin/test_rank_todo.py index f529704f..523e4e8a 100644 --- a/bin/test_rank_todo.py +++ b/bin/test_rank_todo.py @@ -468,7 +468,7 @@ class Standing(unittest.TestCase): ("the plan shifted one minor", [plan((1, "0.2.1"), (2, "0.3.0")), plan((1, "0.3.0"), (2, "0.4.0"), renamed=[("0.2.1", "0.3.0"), ("0.3.0", "0.4.0")])], {(0, 3, 0), (0, 4, 0)}), ("the mark stays in later plans", [plan((1, "0.2.1")), plan((1, "0.3.0"), renamed=[("0.2.1", "0.3.0")]), plan((1, "0.3.0"), (2, "0.3.0"), renamed=[("0.2.1", "0.3.0")])], {(0, 3, 0)}), ("renamed, then named again", [plan((1, "0.2.1")), plan((1, "0.3.0"), renamed=[("0.2.1", "0.3.0")]), plan((1, "0.3.0"), (3, "0.2.1"), renamed=[("0.2.1", "0.3.0")])], {(0, 2, 1), (0, 3, 0)}), - ("a mark that does not parse", [plan((1, "0.2.1")), plan((1, "0.3.0")) + "\n## Renamed\n\nsoon\n"], {(0, 2, 1)}), + ("an older plan's mark that does not parse", [plan((1, "0.2.1")), plan((1, "0.3.0")) + "\n## Renamed\n\nsoon\n", plan((1, "0.3.0"))], {(0, 2, 1), (0, 3, 0)}), ) for name, texts, named in cases: with self.subTest(name): @@ -477,7 +477,8 @@ class Standing(unittest.TestCase): def test_reads_the_releases_the_renamed_section_names(self): self.assertEqual(todo_table.renames("## Items\n\n## Details\n"), set()) self.assertEqual(todo_table.renames("## Renamed\n\n- 0.2.1 renamed to 0.3.0\n- 0.3.0 renamed to 0.4.0\n\n## Details\n"), {(0, 2, 1), (0, 3, 0)}) - for bad in ("soon", "- 0.2.1 is now 0.3.0", "- 0.2 renamed to 0.3.0", "- 0.2.1 renamed to 0.3.0 later"): + self.assertEqual(todo_table.renames("## Renamed\n\n- 0.2.1 renamed to 0.3.0 \n"), {(0, 2, 1)}) + for bad in ("soon", "- 0.2.1 is now 0.3.0", "- 0.2 renamed to 0.3.0", "- 0.2.1 renamed to 0.3.0 later", "- 0.2.1 renamed to 0.2.1"): with self.subTest(bad): self.assertIsInstance(todo_table.renames(f"## Renamed\n\n{bad}\n"), Failure) @@ -485,9 +486,19 @@ class Standing(unittest.TestCase): failed = rank_todo.rank(TODO + "\n## Renamed\n\nsoon\n", README, DECISIONS) self.assertIsInstance(failed, Failure) self.assertIn("## Renamed", failed.reason) - self.assertIsInstance(rank_todo.rank(TODO + "\n## Renamed\n\n- 0.2.1 renamed to 0.3.0\n", README, DECISIONS), rank_todo.Ranked) + + def test_ranks_a_plan_with_a_valid_renamed_section(self): + self.assertIsInstance(rank_todo.rank(TODO + "\n## Renamed\n\n- 0.3.0 renamed to 0.4.0\n", README, DECISIONS), rank_todo.Ranked) + + def test_fails_on_an_item_filed_under_a_release_the_plan_marks_renamed(self): live = rank_todo.rank(TODO + "\n## Renamed\n\n- 0.2.0 renamed to 0.3.0\n", README, DECISIONS) - self.assertEqual(live, Failure("todo.md marks release 0.2.0 renamed but files item 1 under it; drop the mark or move the item")) + self.assertIsInstance(live, Failure) + self.assertIn("marks release 0.2.0 renamed but files item 1 under it", live.reason) + + def test_fails_to_name_releases_when_the_newest_plan_marks_one_in_a_form_it_cannot_read(self): + plan = "## Items\n\n| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |\n|---|---|---|---|---|---|---|---|---|---|---|---|\n| 1 | 0.3.0 | | | **Do 1.** | 1 | 1 | 1 | 1 | 1 | 1 by 1 | 10.0 |\n" + self.assertIsInstance(todo_table.named_releases([plan, plan + "\n## Renamed\n\nsoon\n"]), Failure) + self.assertEqual(todo_table.named_releases([plan + "\n## Renamed\n\nsoon\n", plan]), {(0, 3, 0)}) class Main(unittest.TestCase): diff --git a/bin/todo_table.py b/bin/todo_table.py index 3c105063..3e28bbd8 100644 --- a/bin/todo_table.py +++ b/bin/todo_table.py @@ -24,7 +24,8 @@ Standing = typing.Literal["next", "cut", "finished", "unplanned", "unknown"] # todo.md's ## Details section, its body the first group. DETAILS = re.compile(r"^## Details\n(.*?)(?=^## |\Z)", re.M | re.S) # One line of todo.md's ## Renamed section, the release it renamed and the one it became. -RENAME = re.compile(r"- ([0-9]+\.[0-9]+\.[0-9]+) renamed to [0-9]+\.[0-9]+\.[0-9]+") +RELEASE = r"[0-9]+\.[0-9]+\.[0-9]+" +RENAME = re.compile(rf"- ({RELEASE}) renamed to ({RELEASE})") # Each goal an item names, in its order, with how far the item moves it; None in OLD_SHAPE, whose Goals cell names no move. Moves = tuple[tuple[str, int | None], ...] @@ -205,9 +206,11 @@ def landed(cut: LastCut) -> int | Failure: def named_releases(todos: list[str] | Failure) -> set[tuple[int, int, int]] | Failure: - """Each release the todo.md texts, oldest first, file items under, leaving out one that a later text marks renamed, unless a text after that files items under it again; a text that does not parse names none.""" + """Each release the todo.md texts, oldest first, file items under, leaving out one that a later text marks renamed, unless a text after that files items under it again. A text whose items do not parse names none; the newest text's marks failing to parse fails the whole, since a release left unmarked would read as finished.""" if isinstance(todos, Failure): return todos + if todos and isinstance(newest := renames(todos[-1]), Failure): + return newest named: set[tuple[int, int, int]] = set() for text in todos: plan, marked = items(text), renames(text) @@ -224,8 +227,9 @@ def renames(todo: str) -> set[tuple[int, int, int]] | Failure: rename = RENAME.fullmatch(line.strip()) if rename is None: return Failure(f"todo.md's ## Renamed section holds {line.strip()!r}, not a line such as `- 0.2.1 renamed to 0.3.0`") - major, minor, patch = (int(part) for part in rename.group(1).split(".")) - marked.add((major, minor, patch)) + if rename.group(1) == rename.group(2): + return Failure(f"todo.md's ## Renamed section renames {rename.group(1)} to itself; name the release it became") + marked.add(release_of(rename.group(1))) return marked @@ -318,8 +322,13 @@ def parse_row(row: str, table: Table) -> Item | Failure: moves = shape.read_goals(named["ID"], named[shape.goals_column]) if isinstance(moves, Failure): return moves - major, minor, patch = (int(part) for part in named["Release"].split(".")) - return Item(int(named["ID"]), (major, minor, patch), named["Exempt"], named["Item"], scores, moves, blocked_by) + return Item(int(named["ID"]), release_of(named["Release"]), named["Exempt"], named["Item"], scores, moves, blocked_by) + + +def release_of(version: str) -> tuple[int, int, int]: + """The release a RELEASE-shaped version names.""" + major, minor, patch = (int(part) for part in version.split(".")) + return major, minor, patch def check_cells(row: str, named: dict[str, str]) -> Failure | None: @@ -327,7 +336,7 @@ def check_cells(row: str, named: dict[str, str]) -> Failure | None: id_, release, exempt, tagline = named["ID"], named["Release"], named["Exempt"], named["Item"] if not re.fullmatch(r"[0-9]+", id_) or int(id_) < 1: return Failure(f"the ID {id_!r} is not a positive whole number: {row}") - if not re.fullmatch(r"[0-9]+\.[0-9]+\.[0-9]+", release): + if not re.fullmatch(RELEASE, release): return Failure(f"item {id_}'s release {release!r} is not a semver version") if exempt not in EXEMPTIONS: return Failure(f"item {id_}'s Exempt {exempt!r} is not empty or one of {', '.join(EXEMPTIONS[1:])}") diff --git a/rules/todo-items.md b/rules/todo-items.md index 43806ad3..c5333ea2 100644 --- a/rules/todo-items.md +++ b/rules/todo-items.md @@ -5,7 +5,7 @@ paths: # Todo items (`todo.md`) -- **`todo.md` is mandatory in every project, in the shape `rank_todo.py --help` shows**, which `~/.claude/bin/rank_todo.py` checks and ranks; its `--help` shows a valid file. `## Scoring` holds the formula and the bar; `## Items` is one table of every item; `## Details` holds each item's detail under its ID. `## Renamed`, when a release was renamed, holds one line `- 0.2.1 renamed to 0.3.0` per rename, and no item under a marked release; a release whose items all moved elsewhere without that line reads as finished, ready to cut. Cite an item by its ID. The formula and bar are the project's own to tune. +- **`todo.md` is mandatory in every project, in the shape `rank_todo.py --help` shows**, which `~/.claude/bin/rank_todo.py` checks and ranks; its `--help` shows a valid file. `## Scoring` holds the formula and the bar; `## Items` is one table of every item; `## Details` holds each item's detail under its ID. `## Renamed`, when a release was renamed, holds one line `- 0.2.1 renamed to 0.3.0` per rename, no item under a marked release, and a line gone once a tag at or past its release is cut; a release whose items all moved elsewhere without that line reads as finished, ready to cut. Cite an item by its ID. The formula and bar are the project's own to tune. - **Order items only by score and the Blocked by column.** An item's Blocked by cell lists the IDs of the items that must be done before it starts, such as `12, 14`; `rank_todo.py --help` says how it ranks them. No text in `todo.md` outside the table orders items: where an item must go first, score it so, and say why in its detail. - **Plan only on the project's rung or above.** loop-claude's prompt tells you when you run below it. Below it, never score or re-score an item, move it between releases, split a milestone into items, delete an item under the bar, rewrite a filed item's tagline or detail, or choose or replace an item in `docs/score-anchors.md`. Draft each new item, each change to a filed item, and each change to the anchors, instead. Before your next commit, launch one subagent to apply the drafts, score them and set their release. Launch it on the rung `CLAUDE.md`'s delegation rule gives a subagent that files or scores items. Keep the scores and releases it writes. For a security finding, launch it at once. Any rung may remove a finished item's row and detail, and score a delegated task's L. A subagent launched for another task leaves `todo.md` alone. - **An item's release allows the bump that semver read strictly asks for.** An item that changes what exists needs a major, or before 1.0.0 a minor. One that only adds needs a minor, and a fix a patch. -- 2.52.0 From d1ca16e9fc845f1e1caa7b31033308bfe9ce9067 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 18 Oct 2026 09:47:44 +0200 Subject: [PATCH 04/12] =?UTF-8?q?Answer=20principles=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=202=20=F0=9F=9F=A1;=20fixed=20in=20the=20stabilit?= =?UTF-8?q?y=20round=201=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 6479337ab1684610f22ab845c444c48d7825c3e1 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 18 Oct 2026 09:47:44 +0200 Subject: [PATCH 05/12] =?UTF-8?q?Answer=20product-owner=20round=201:=200?= =?UTF-8?q?=20=F0=9F=94=B4,=202=20=F0=9F=9F=A1;=20fixed=20in=20the=20stabi?= =?UTF-8?q?lity=20round=201=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From eae4ee9fb150949687c6a86158175cb75d9d6807 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 18 Oct 2026 09:47:44 +0200 Subject: [PATCH 06/12] =?UTF-8?q?Answer=20security=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1;=20no=20findings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 63392cea66af0fd3635ee50672b2ad79bb74c094 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 18 Oct 2026 09:56:53 +0200 Subject: [PATCH 07/12] =?UTF-8?q?Answer=20prose=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=206=20=F0=9F=9F=A1;=20record=20the=20rename=20rul?= =?UTF-8?q?e=20in=20the=20decision=20log,=20cut=20false=20and=20duplicate?= =?UTF-8?q?=20clauses,=20rewrite=20the=20help=20and=20rules=20bullets,=20f?= =?UTF-8?q?ile=20the=20sweep=20as=20item=20190?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- bin/chunk_preflight/gathered.py | 2 +- bin/larv_review/main.py | 3 +-- bin/larv_review/plan.py | 4 ++-- bin/loop_claude/loop/main.py | 4 ++-- bin/rank_todo.py | 9 ++++----- bin/test_rank_todo.py | 1 - bin/todo_table.py | 7 ++++--- docs/decisions.md | 4 +++- rules/todo-items.md | 2 +- todo.md | 8 +++++++- 11 files changed, 26 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e36412e..d143c15e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - Each reviewer under `agents/` now writes its full report to a file that larv-review names in the reviewer's prompt, in a folder per chunk under `~/.local/state/larv-review/`. It returns only its verdict and one line per finding, so a review takes less of the worker's context. The worker reads a finding's full entry before it fixes or answers a 🔴 or 🟡. Each reviewer now holds Write. `rule-hook` refuses a reviewer's Edit and MultiEdit, and any Write outside `~/.local/state/larv-review/`; no override waives this rule. Each chunk's folder stays after the merge, so `stability-replay` can replay a round that reads an earlier round's report. It replays on a copy of the folder. - `loop-claude` asks an interrupt's question on its own terminal and resumes the worker headless with your one-line answer, so the loop no longer waits for you to leave a claude session. Type `/talk` instead to open the worker's session in claude, as every interrupt did before, to read the diff or discuss first. A release ready to cut opens that session at once. Pressing Enter on an empty answer stops the loop, exit 2. Keys typed before the question shows are dropped, and a pasted answer keeps only its first line; type `/talk` for a longer one. The judge counts that answer as yours, like one typed in claude: the chunk stays open until the answer is recorded, where a later chunk could need it. -- `todo.md` may mark a renamed release in a `## Renamed` section, one line per rename, such as `- 0.2.1 renamed to 0.3.0`. `chunk-preflight` and `loop-claude` then skip that release when they pick the next one, and larv-review's scoring-run trigger calls no run for it. Without the mark, a release named since the last tag whose items all moved to other releases reads as finished: `chunk-preflight` says it is ready to cut and the loop stops for you, and the trigger calls a scoring run. `rank_todo.py` fails on a `## Renamed` line of another shape, and on an item filed under a release it marks. Before you move a project to this release, add the line to every project whose `todo.md` renamed a release since its last tag, or its loop stops for that release's cut. +- `todo.md` may mark a renamed release in a `## Renamed` section, one line per rename, such as `- 0.2.1 renamed to 0.3.0`. `chunk-preflight` and `loop-claude` then skip that release when they pick the next one, and larv-review's scoring-run trigger calls no run for it. Without the mark, a release named since the last tag whose items all moved to other releases reads as finished: `chunk-preflight` says it is ready to cut and the loop stops for you, and the trigger calls a scoring run. `rank_todo.py` fails on a `## Renamed` line of another shape, and on an item filed under a release it marks. Before you move a machine to this release, add the line to the `todo.md` of every project that renamed a release since its last tag, or its loop stops for that release's cut. - When a worker's run ends with a question and a request for a higher rung, `loop-claude` now steps the worker one rung up as the judge interrupts, or as it answers the question with a quote from `README.md` or another file it may quote. The judge must quote a passage showing that the escalation trigger the run cites fired. Before, the step was lost for an answered question, and the worker carried on from the answer on its old rung. The step has the same limits as the step on an unfinished verdict, and no later ruling of that cycle carries a second escalation. The archive's interrupt and quoted-answer outcomes now name the worker's rung. - A scoring run due because a release's items ran out costs four more seats: it is done twice on one head. `larv-review agreement` compares how often Mid A and the inherited architect vote alike in paired rulings with how often their overall scores move the same way between the two runs. After 10 such pairs it gives a verdict, and on `Assumption fails:` larv-review asks you whether to keep the paired ruling. - `workflow-bench/bench.py` gives each run a fixed list of allowed tools. Before, it skipped every permission check. A run may launch agents, run `/security-review`, edit its clone (not the clone's `.git/` or `.claude/`) and its report, and read its clone and the copy of `~/.claude` it benches. For git it gets one command, `workflow-bench/review_git.py`, and no bare `git`. The wrapper runs `log`, `diff`, `show`, `status`, `ls-files`, `add` and `commit -m` on the run's clone, whatever the working directory. It allows only the options it lists for each, and refuses an argument that names a path outside the clone. git runs with no global or system config, hook, pager or editor. A run loads no settings or MCP servers from `~/.claude` or from the case's clone, so their hooks and extra directories do not apply to it. Every other call is denied. Expect a benched review that needs another git command, or to run a project's code or tests, to say in its report that it could not. diff --git a/bin/chunk_preflight/gathered.py b/bin/chunk_preflight/gathered.py index d0361575..150f5380 100644 --- a/bin/chunk_preflight/gathered.py +++ b/bin/chunk_preflight/gathered.py @@ -97,7 +97,7 @@ def planned(todo: str | Failure, cut: LastCut, default: str) -> Plan | NoItem: return NoItem(f"{where} files items under release {version(earliest)}, which is not after the last cut, {cut.tag}; ask the human which release they belong to.") gap = f"{where} holds no item for the next release after the last cut, {cut.tag}, and" if stands == "finished": - return NoItem(f"{gap} work has landed since, so that release is finished and ready to cut, and the working loop stops here. If todo.md renamed that release instead, add `- renamed to ` under its `## Renamed`.") + return NoItem(f"{gap} work has landed since, so that release is finished and ready to cut, and the working loop stops here. If todo.md renamed that release instead, add `- renamed to ` to todo.md's `## Renamed` section.") if stands == "unplanned": return NoItem(f"{gap} no work has landed since, so that release is to be planned first.") if stands == "unknown": diff --git a/bin/larv_review/main.py b/bin/larv_review/main.py index 94a5e635..eb3d827c 100644 --- a/bin/larv_review/main.py +++ b/bin/larv_review/main.py @@ -34,8 +34,7 @@ the checkout's todo.md, less the shipped items, and work has landed towards that landed when the chunk ships one of the release's items, or when the release is the earliest the default branch's todo.md names and the default branch has a commit after its newest v* tag, or has no v* tag. A release the checkout's todo.md marks renamed in its ## Renamed section, as -`- 0.2.1 renamed to 0.3.0`, is due none; one whose items all moved to other releases unmarked was -deferred, and is due one. +`- 0.2.1 renamed to 0.3.0`, is due none. A second scoring run of one head names itself ` rerun at `, so record-scoring does not refuse it as a repeat of the first. diff --git a/bin/larv_review/plan.py b/bin/larv_review/plan.py index 0938e7ee..a6822e25 100644 --- a/bin/larv_review/plan.py +++ b/bin/larv_review/plan.py @@ -9,7 +9,7 @@ from larv_review.git import landed_since_release def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], landed: bool, renamed: set[tuple[int, int, int]]) -> list[str] | Failure: """Why the plan calls a scoring run, empty when it does not. before is the default branch's plan, after the chunk's, ships the IDs it ships, landed whether the default branch holds a commit after its newest release tag, and renamed the releases the chunk's plan marks renamed. - A chunk that ships an item naming the floor is due one, so it can prove the floor met. So is a chunk that empties a release after work has landed towards it, so no release ends unmeasured, short of one renamed as below. Work has landed when the chunk ships one of the release's items, or when the release is the earliest one `before` names and `landed` holds. A release the chunk's plan marks renamed is due none; one whose last items moved to other releases unmarked was deferred, and is due one. + A chunk that ships an item naming the floor is due one, so it can prove the floor met. So is a chunk that empties a release after work has landed towards it, so no release ends unmeasured, short of one renamed as below. Work has landed when the chunk ships one of the release's items, or when the release is the earliest one `before` names and `landed` holds. A release the chunk's plan marks renamed is due none. """ plan = {item.id: item for item in before + after} if unknown := sorted(set(ships) - set(plan)): @@ -19,7 +19,7 @@ def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], lan next_release = min((item.release for item in before), default=None) for release in emptied(before, after, shipped, renamed): if any(item.release == release for item in shipped) or (release == next_release and landed): - # SKILL.md → "Second run" keys on this wording; a test pins both. + # SKILL.md → "Second run" keys on this wording. reasons.append(f"leaves release {'.'.join(map(str, release))} with no plan item") return reasons diff --git a/bin/loop_claude/loop/main.py b/bin/loop_claude/loop/main.py index 0d659046..a4f8efb7 100644 --- a/bin/loop_claude/loop/main.py +++ b/bin/loop_claude/loop/main.py @@ -62,8 +62,8 @@ on the item chunk-preflight names, read from todo.md on the default branch as th fetched it (todo_table.chunk_item). That item is the earliest release's top item that does not wait, but only where that release is the next one: the earliest after the newest vX.Y.Z tag that todo.md has named at that tag or since, skipping a release its ## Renamed section marks renamed, or, where -no tag names a version, the earliest release. Otherwise no item routes the chunk. An item waits while it is marked question, or while an -item that blocks it is still in the table. The item's L +no tag names a version, the earliest release. Otherwise no item routes the chunk. An item waits +while it is marked question, or while an item that blocks it is still in the table. The item's L picks the worker's rung, stepping from the model's cheapest rung by WORKER_STEPS in bin/model_routing/ladder.py, below it for a low L; without such an item, or with its L, E or I unscored, the chunk runs on the model's cheapest rung. The diff --git a/bin/rank_todo.py b/bin/rank_todo.py index 9d759c04..32a50158 100755 --- a/bin/rank_todo.py +++ b/bin/rank_todo.py @@ -59,16 +59,15 @@ A valid todo.md; ## Details and each item's detail are optional: loop. An ID at or above Next ID fails; one below it that the table no longer holds was finished or deleted, and is dropped. - ## Items holds the table and nothing else: an order goes in the scores or the Blocked by column. -- ## Renamed is optional: one line `- 0.2.1 renamed to 0.3.0` per release the plan renamed. The tools - skip a marked release when they pick the next one, and call no scoring run for it; they read only - the old release, the new one is for the reader. No item may sit under a marked release. Delete a - line once a tag at or past its release is cut. A release whose items all moved to other releases - without a mark reads as finished, so the human cuts it. - The table holds the columns above. One missing L, E or I fails, and so does one with a column this version does not know, since writing it would drop that column. - A table in the old shape, with C, A, G and Goals columns in place of L, E, I and Moves, still ranks, by a formula over R, S, A, G and W and a | Goal | W | table that weighs every README goal, W being the heaviest cited goal's weight; ranking it says to reshape it. +- ## Renamed is optional: one line `- 0.2.1 renamed to 0.3.0` per renamed release. chunk-preflight, + loop-claude and larv-review skip the line's first release, and ignore the second, which is for the + reader. No item may sit under a marked release, and a line goes once a tag at or past its first + release is cut. A release whose items all moved elsewhere without a line reads as finished. Exit 1, saying why, on bad arguments, a file that cannot be read or written, a todo.md, README.md or docs/decisions.md that breaks the rules above, an item that is not exempt scoring under the bar, or diff --git a/bin/test_rank_todo.py b/bin/test_rank_todo.py index 523e4e8a..640cf739 100644 --- a/bin/test_rank_todo.py +++ b/bin/test_rank_todo.py @@ -498,7 +498,6 @@ class Standing(unittest.TestCase): def test_fails_to_name_releases_when_the_newest_plan_marks_one_in_a_form_it_cannot_read(self): plan = "## Items\n\n| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |\n|---|---|---|---|---|---|---|---|---|---|---|---|\n| 1 | 0.3.0 | | | **Do 1.** | 1 | 1 | 1 | 1 | 1 | 1 by 1 | 10.0 |\n" self.assertIsInstance(todo_table.named_releases([plan, plan + "\n## Renamed\n\nsoon\n"]), Failure) - self.assertEqual(todo_table.named_releases([plan + "\n## Renamed\n\nsoon\n", plan]), {(0, 3, 0)}) class Main(unittest.TestCase): diff --git a/bin/todo_table.py b/bin/todo_table.py index 3e28bbd8..5032f589 100644 --- a/bin/todo_table.py +++ b/bin/todo_table.py @@ -23,8 +23,9 @@ HEADER_START = "| ID | Release |" Standing = typing.Literal["next", "cut", "finished", "unplanned", "unknown"] # todo.md's ## Details section, its body the first group. DETAILS = re.compile(r"^## Details\n(.*?)(?=^## |\Z)", re.M | re.S) -# One line of todo.md's ## Renamed section, the release it renamed and the one it became. +# A release's version, such as 0.2.1. RELEASE = r"[0-9]+\.[0-9]+\.[0-9]+" +# One line of todo.md's ## Renamed section: the release it renamed and the one it became. RENAME = re.compile(rf"- ({RELEASE}) renamed to ({RELEASE})") # Each goal an item names, in its order, with how far the item moves it; None in OLD_SHAPE, whose Goals cell names no move. Moves = tuple[tuple[str, int | None], ...] @@ -206,7 +207,7 @@ def landed(cut: LastCut) -> int | Failure: def named_releases(todos: list[str] | Failure) -> set[tuple[int, int, int]] | Failure: - """Each release the todo.md texts, oldest first, file items under, leaving out one that a later text marks renamed, unless a text after that files items under it again. A text whose items do not parse names none; the newest text's marks failing to parse fails the whole, since a release left unmarked would read as finished.""" + """Each release the todo.md texts, oldest first, file items under. A release leaves the set when a text marks it renamed, and returns when a later text files items under it again. A text whose items or marks do not parse names none, except the newest: its marks failing to parse fails the whole, since the release they should have excluded would read as finished.""" if isinstance(todos, Failure): return todos if todos and isinstance(newest := renames(todos[-1]), Failure): @@ -220,7 +221,7 @@ def named_releases(todos: list[str] | Failure) -> set[tuple[int, int, int]] | Fa def renames(todo: str) -> set[tuple[int, int, int]] | Failure: - """Each release todo.md's ## Renamed section says was renamed, as `- 0.2.1 renamed to 0.3.0`, so never finished; the new release is for the reader. Without such a line, a release whose items all moved to other releases reads as finished or deferred, and the human cuts it, so a forgotten mark costs one interrupt, never a silent skip. A panel of three readers seated as lilleman picked the spelling 3-0 over `- 0.2.1 → 0.3.0` and a `Renamed 0.2.1 = 0.3.0` line under ## Scoring.""" + """Each release todo.md's ## Renamed section says was renamed, as `- 0.2.1 renamed to 0.3.0`, so never finished; the tools read only the old release. `docs/decisions.md` → `todo.md: one table …` gives the rule and the spelling's pick.""" marked: set[tuple[int, int, int]] = set() for body in sections(todo).get("Renamed", []): for line in body.splitlines(): diff --git a/docs/decisions.md b/docs/decisions.md index 5273d15b..672f719a 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -80,7 +80,7 @@ Valid while the ladder orders its rungs by competence. ## review: the comprehension check records how hard a project is to read and blocks no merge: a paired ruling against the last measured commit where the architecture pass ran, and the four-seat scoring run, once when an item names the floor and twice on one head when a release's items run out -2026-10-08, lilleman. Serves goals 1.1 and 1.4. Two independent four-seat runs moved up to 0.4 on near-identical code, so a fall within that noise forced rounds that changed nothing (PR #224). A seat reading both versions judges the difference on the same material, so the noise the versions share cancels. No conventional significance level lets a sign test settle with four votes, so the human chose a lead of two votes over every other ruling, same included. Two seats that agree settle it, so a PR that leaves the reading as it was costs two seats. A third seat alone can never settle it, so the third and fourth launch together. The human chose the last measured commit on the architect's finding that with a merge base as the base, chunks without an architecture pass, and a suspended restructure's steps, could each lower comprehension unseen. Reading the default branch one merged change at a time keeps the rule working for merge commits and squash merges alike. The scoring run also runs on a chunk shipping an item that names the floor, so the chunk that lifts a project to the floor can prove it. A chunk that removes a release's last item without shipping it runs it too, so no release ends unmeasured, unless `todo.md` marks it renamed in a `## Renamed` section (`bin/todo_table.py` → `renames`). Valid while seats reading both versions agree more often than two absolute runs do. +2026-10-08, lilleman. Serves goals 1.1 and 1.4. Two independent four-seat runs moved up to 0.4 on near-identical code, so a fall within that noise forced rounds that changed nothing (PR #224). A seat reading both versions judges the difference on the same material, so the noise the versions share cancels. No conventional significance level lets a sign test settle with four votes, so the human chose a lead of two votes over every other ruling, same included. Two seats that agree settle it, so a PR that leaves the reading as it was costs two seats. A third seat alone can never settle it, so the third and fourth launch together. The human chose the last measured commit on the architect's finding that with a merge base as the base, chunks without an architecture pass, and a suspended restructure's steps, could each lower comprehension unseen. Reading the default branch one merged change at a time keeps the rule working for merge commits and squash merges alike. The scoring run also runs on a chunk shipping an item that names the floor, so the chunk that lifts a project to the floor can prove it. A chunk that removes a release's last item without shipping it runs the scoring run too, so no release ends unmeasured, unless `todo.md` marks that release renamed in a `## Renamed` section (`bin/todo_table.py` → `renames`). Valid while seats reading both versions agree more often than two absolute runs do. 2026-10-13, lilleman. No published study validates simulated reader panels as a measure of how easy code is to understand, and no test of whether the panel's signal beats its noise has run. So no ruling, score or floor blocks a merge. The runs go on, so the history keeps the scores and the places the seats found hard, for later measurement. The architect, the stability reviewer and a session filing an item read the newest places, since those places are what a chunk can improve. With nothing to block, the check runs once per chunk, on the branch as review left it, in place of a run in each architecture round and a rescore after later commits. A fallen dimension no longer calls the four scoring seats either: their scores only decided the block. The base is now the newest merged change that adds any ruling or scoring run: with worse rulings merging, a base left behind them would charge one chunk's ruling with earlier chunks' falls. The newest places are the newest scoring run's and each later ruling's places a seat voted worse, so they change with each ruling. A chunk that leaves a touched place as hard says why in its PR summary, not in a decline's record, which would outlive the place. @@ -146,6 +146,8 @@ Valid while the ladder orders its rungs by competence. 2026-10-15, lilleman. Serves goal 1.4: loop-claude routes a chunk's first cycle on the item the chunk takes (`routing: a chunk's worker runs on the rung its item's L picks`). An item lists the items that must be done before it starts in a Blocked by column, and `rank_todo.py` ranks each blocker above every item it blocks. The table's order is `todo.md`'s only order: `rank_todo.py` fails on text beside the table under `## Items`, since a prose order there, "Release 0.3.0 takes items 125, 114 and 124 first", contradicted the table and loop-claude could not read it. A decision that wants an order sets the scores instead. An item waits while it is marked `question` or a blocker of it is still in the table, whatever the rows' order, so a release's first row that does not wait is the item a chunk takes. A blocker the table no longer holds was finished or deleted, and is dropped, so the cell shows what still blocks. A panel of three readers seated as lilleman picked the spelling: two ranked "Blocked by" first, as the cell lists only what still blocks, and all three chose bare IDs such as `12, 14` in a column right after Release, read before the tagline and kept apart from the scores. `rank_todo.py` adds the column to a table without it. The tools read cells by column name, so a later column leaves a reader on an older release working; `rank_todo.py`, which writes every column, fails on one it does not know rather than drop it. +2026-10-18, PR #312. Serves goals 1.5 and 1.1: adf-codec renamed its next release, 0.2.1, to 0.3.0, and `chunk-preflight` then called 0.2.1 finished and stopped the loop on every cycle. A change that moves a release's last items elsewhere reads the same whether it renamed the release or deferred its leftovers, so the plan says which: a `## Renamed` section holds one line `- 0.2.1 renamed to 0.3.0` per rename, which `bin/todo_table.py`'s `renames` reads. `chunk-preflight`, `loop-claude` and larv-review's scoring-run trigger skip a marked release; they read only the first version. A release whose items moved unmarked reads as finished: the loop stops, says so and names the fix, and the trigger calls a scoring run once work has landed. So a forgotten mark costs one interrupt and never lets a release end unmeasured. `rank_todo.py` fails on a line of another shape and on an item filed under a marked release, and a newest plan whose marks do not parse leaves the next release unknown. A line goes once a tag at or past its release is cut. Only a rename is marked, since an unmarked move is the deferral. A panel of three readers seated as lilleman picked the spelling 3-0 over `- 0.2.1 → 0.3.0` under `## Releases` and a `Renamed 0.2.1 = 0.3.0` line under `## Scoring`: plain words need no special character to type. Valid while a rename is the only move of a release's items that the tools must tell from finishing it. + ## todo.md: only a session or subagent on the project's rung or above scores or reshapes the plan; one below it drafts new items and changes to filed ones for a subagent at or above that rung to apply and score, and removes finished ones 2026-10-15, lilleman. Serves goal 1.1: a cheaper rung writes worse scores, and a wrong score routes a chunk onto the wrong rung, ranks the plan wrong and drops an item under the bar that should stay. Below the project's rung, a session or subagent may not score an item, move it between releases, split a milestone, delete an item under the bar, or rewrite a filed item. It drafts each new item, and each change to a filed item, such as a refresh a rule asks for. Before the next commit, one subagent on the project's rung or above applies and scores the drafts. One launch covers all of a chunk's drafts (goal 1.4). A security finding gets that subagent at once, since it is filed the moment it is found. Removing a finished item closes work and plans none, so any rung does it. Scoring a delegated task's L runs on any rung too: a launch on the project's rung to score each delegation would cost more than the cheaper task saves (goal 1.4). diff --git a/rules/todo-items.md b/rules/todo-items.md index c5333ea2..bfc8f188 100644 --- a/rules/todo-items.md +++ b/rules/todo-items.md @@ -5,7 +5,7 @@ paths: # Todo items (`todo.md`) -- **`todo.md` is mandatory in every project, in the shape `rank_todo.py --help` shows**, which `~/.claude/bin/rank_todo.py` checks and ranks; its `--help` shows a valid file. `## Scoring` holds the formula and the bar; `## Items` is one table of every item; `## Details` holds each item's detail under its ID. `## Renamed`, when a release was renamed, holds one line `- 0.2.1 renamed to 0.3.0` per rename, no item under a marked release, and a line gone once a tag at or past its release is cut; a release whose items all moved elsewhere without that line reads as finished, ready to cut. Cite an item by its ID. The formula and bar are the project's own to tune. +- **`todo.md` is mandatory in every project, in the shape `rank_todo.py --help` shows**, which `~/.claude/bin/rank_todo.py` checks and ranks; its `--help` shows a valid file. `## Scoring` holds the formula and the bar; `## Items` is one table of every item; `## Details` holds each item's detail under its ID. `## Renamed` marks each renamed release with a line such as `- 0.2.1 renamed to 0.3.0`; `rank_todo.py --help` says what a mark does. Cite an item by its ID. The formula and bar are the project's own to tune. - **Order items only by score and the Blocked by column.** An item's Blocked by cell lists the IDs of the items that must be done before it starts, such as `12, 14`; `rank_todo.py --help` says how it ranks them. No text in `todo.md` outside the table orders items: where an item must go first, score it so, and say why in its detail. - **Plan only on the project's rung or above.** loop-claude's prompt tells you when you run below it. Below it, never score or re-score an item, move it between releases, split a milestone into items, delete an item under the bar, rewrite a filed item's tagline or detail, or choose or replace an item in `docs/score-anchors.md`. Draft each new item, each change to a filed item, and each change to the anchors, instead. Before your next commit, launch one subagent to apply the drafts, score them and set their release. Launch it on the rung `CLAUDE.md`'s delegation rule gives a subagent that files or scores items. Keep the scores and releases it writes. For a security finding, launch it at once. Any rung may remove a finished item's row and detail, and score a delegated task's L. A subagent launched for another task leaves `todo.md` alone. - **An item's release allows the bump that semver read strictly asks for.** An item that changes what exists needs a major, or before 1.0.0 a minor. One that only adds needs a minor, and a fix a patch. diff --git a/todo.md b/todo.md index 831f00e2..30ce7520 100644 --- a/todo.md +++ b/todo.md @@ -6,7 +6,7 @@ `Bar = 0.1` -`Next ID = 188` +`Next ID = 191` ## Items @@ -38,6 +38,7 @@ | 172 | 0.3.0 | | | **Name the project's rung `project` across `bin/loop_claude`, in place of `anchor`, as `bin/model_routing/ladder.py` names it.** | 2 | 1 | 3 | 4 | 3 | 1.1 by 3, 1.4 by 3 | 6.2 | | 82 | 0.3.0 | | principle | **Sort `AGENTS.md`'s decision titles and `docs/decisions.md`'s entries by title.** | 2 | 2 | 1 | 3 | 4 | 1.1 by 4, 1.4 by 4 | 5.5 | | 173 | 0.3.0 | | | **Have rule-hook's `todo-rank-check` run a worktree's own `bin/rank_todo.py` when the worktree is of this repo, so a branch that changes `todo.md`'s shape commits without an override.** | 2 | 1 | 3 | 4 | 2 | 1.1 by 2, 1.4 by 2 | 5.5 | +| 190 | 0.3.0 | | | **Rewrite the `docs/decisions.md` entries `todo.md: one table …` and `loop-claude: a judge decides …` as the current state, so a reader no longer replays superseded paragraphs to learn what holds.** | 2 | 2 | 1 | 3 | 3 | 1.1 by 3, 1.4 by 2 | 5.5 | | 162 | 0.3.0 | | owner | **Script each step that 0.2.0's chunks repeated by hand and a program can compute, filing one item per step, and file this audit again for the next release.** | 2 | 2 | 1 | 3 | 3 | 1.4 by 4, 1.5 by 4 | 4.9 | | 175 | 0.3.0 | | | **Compare the first five chunks loop-claude starts with `chunk-preflight` against the five before them, and file an item where the preflight did not pay off.** | 1 | 2 | 1 | 2 | 2 | 1.4 by 3, 1.5 by 3 | 4.9 | | 181 | 0.3.0 | | principle | **Have the test of a quoted answer's step-up assert the stepped rung's facts as literals, not through `prompts.rungs_held`.** | 1 | 1 | 1 | 1 | 1 | 1.1 by 2 | 4.4 | @@ -109,6 +110,7 @@ Raised by PR #302's paired ruling, where two of four seats read the project as w - `bin/todo_table.py` → `landed`: it counts ## Unreleased entries first, while `bin/larv_review/git.py` → `landed_since_release` counts commits only, two meanings of "work has landed"; give them one meaning or two names. - `bin/loop_claude/loop/main.py` → `run_loop`: routing reads the plan as chunk-preflight's fetch left it, an order only a comment states. - `bin/chunk_preflight/gathered.py`: the name covers the data, not the pure choices it also holds. +- `bin/chunk_preflight/gathered.py` → `planned`: the "finished and ready to cut" message cannot name the release that finished, which `standing` works out, so the human has to find it; let the pick's module return that release and the message name it. ### 159. Run each review pass on the lowest rung that a replay of its archived rounds shows finding every 🔴 and 🟡 the project's rung finds, even below the worker's rung. @@ -212,6 +214,10 @@ The architecture pass of PR #296 found one rung under two names: `bin/model_rout Raised by the overrides pass of PR #296. The hook imports the main checkout's `rank_todo.py`, so while a branch of this repo changes the table's shape, every commit touching `todo.md` needs a `todo-rank-check` override: 33 log lines across four branches, the score-outcomes, plan-136, plan-148 and item-146 ones. The hook then checks nothing, and the rule rests on the worker chaining the branch's own check. Run another repo's `bin/rank_todo.py` never: that would run its code before every commit. +### 190. Rewrite the `docs/decisions.md` entries `todo.md: one table …` and `loop-claude: a judge decides …` as the current state, so a reader no longer replays superseded paragraphs to learn what holds. + +Found by the prose review of PR #312, which judged both entries to read as amendment logs, each paragraph correcting an earlier one. The rewrite keeps each paragraph's date and reason only where it still explains a rule that holds, and drops superseded states. It covers items 157 and 183, which reshape paragraphs of the same two entries. + ### 162. Script each step that 0.2.0's chunks repeated by hand and a program can compute, filing one item per step, and file this audit again for the next release. lilleman asked, on 2026-10-16, for a standing audit each release, so the loop keeps moving work a program does as well from the model to scripts (goals 1.4 and 1.5). Item 161 scripts the steps found before the first edit in item 140's chunk. This audit reads the archived transcripts of the chunks that shipped release 0.2.0 for every step repeated by hand across chunks whose answer a program computes the same way, before, during and after review: a lookup, a check, a prompt assembled for a reviewer, a cleanup. File one item per such step, with the time and tokens it cost, into the next release with items left. Leave a step that needs judgement with the model. -- 2.52.0 From e15f96fcd80d3d767edd6b187f10fa0111c9fec4 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 18 Oct 2026 09:56:53 +0200 Subject: [PATCH 08/12] =?UTF-8?q?Answer=20stability=20round=202:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1;=20the=20=F0=9F=9F=A2s=20are?= =?UTF-8?q?=20fixed=20or=20answered=20in=20the=20prose=20round=201=20commi?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From c07e58221290519a10b5c47fbab96d2d101386ea Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 18 Oct 2026 09:56:53 +0200 Subject: [PATCH 09/12] =?UTF-8?q?Answer=20principles=20round=202:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1;=20the=20=F0=9F=9F=A2s=20are?= =?UTF-8?q?=20fixed=20or=20answered=20in=20the=20prose=20round=201=20commi?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From ac2ed4095a5c352831eacceed56d87baa99d702e Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 18 Oct 2026 09:56:53 +0200 Subject: [PATCH 10/12] =?UTF-8?q?Answer=20product-owner=20round=202:=200?= =?UTF-8?q?=20=F0=9F=94=B4,=200=20=F0=9F=9F=A1;=20the=20=F0=9F=9F=A2s=20ar?= =?UTF-8?q?e=20fixed=20or=20answered=20in=20the=20prose=20round=201=20comm?= =?UTF-8?q?it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 6694d54e52363b90ca35c5eaaf6187ac9b72a4dd Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 18 Oct 2026 09:57:10 +0200 Subject: [PATCH 11/12] =?UTF-8?q?Answer=20architecture=20round=202:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1;=20approved?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From d0f6c806a392dd519f3dffa179467048d7fdfe9a Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 18 Oct 2026 09:59:16 +0200 Subject: [PATCH 12/12] Record the comprehension check: paired ruling better against e074b8b --- docs/comprehension-history.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/comprehension-history.md b/docs/comprehension-history.md index 14d0fc5d..311629a3 100644 --- a/docs/comprehension-history.md +++ b/docs/comprehension-history.md @@ -2162,3 +2162,23 @@ Inherited architect, decided by: - Locality, Self-sufficiency: `bin/stability_replay/main.py:183` `reviewed_in`: three chained replaces that must run in a fixed order, and the copy placed under REPORTS for a reason that lives only in `reviewer_report.py` - Shape: `bin/stability_replay/main.py:175` `reviewed_in`: seven positional parameters with `clone` and `reports` adjacent strings, and REPORTS meaning the root, its realpath and one round's copy in three files - Locality: `bin/review_folder.py:5` `REPORTS`: the path is spelled again in `settings.json`, SKILL.md, CLAUDE.md and larv-review's help, and only the Python reads the constant + +## 2026-10-18T07:59:13Z, PR #312 at 6694d54, against e074b8b + +Ruling: better + +| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall | +|---|---|---|---|---|---| +| Mid A | same (voted better, no place naming Navigation) | better | same | same | better | +| Inherited architect | better | better | same | better | better | + +Mid A, decided by: + +- Locality, Overall: `bin/todo_table.py:223` `renames`: one explicit `## Renamed` line in one text replaces a rename inferred from two plan snapshots +- Locality: `bin/todo_table.py:209` `named_releases`: an unparseable mark fails the result only in the newest text, an order dependence to keep in mind + +Inherited architect, decided by: + +- Locality, Overall: `bin/todo_table.py:223` `renames`: the answer sits in the file read, where `renamed` replayed the plan's history +- Locality: `bin/larv_review/plan.py:27` `emptied`: renamed is a parameter, no hidden second derivation +- Navigation, Self-sufficiency: `bin/chunk_preflight/gathered.py:100` `planned`: the stop names the fix and where it goes -- 2.52.0