Read a release whose items all moved to other releases as renamed, never finished

This commit is contained in:
2026-10-18 00:03:20 +02:00
parent e291f6ca3d
commit 32eb16cd20
13 changed files with 65 additions and 21 deletions
+1
View File
@@ -28,6 +28,7 @@ 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 items all moved to other releases, none leaving the plan, was renamed, never finished
- 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
+1
View File
@@ -2,6 +2,7 @@
## Unreleased
- `chunk-preflight` and `loop-claude` skip a release that `todo.md` named since the last tag when all its items moved to other releases and none left the plan, as when a planned 0.2.1 becomes 0.3.0 because an item turned out breaking. Before, they took the renamed release for 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.
- 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.
+2 -1
View File
@@ -13,7 +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; otherwise it is todo.md's earliest release.
x.y.z that todo.md has named at that tag or since, less a release renamed since: one whose items
all moved to other releases with none leaving todo.md. 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
@@ -166,6 +166,16 @@ 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_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."""
cases = (
+2 -2
View File
@@ -78,10 +78,10 @@ def default_plan(root: str, ref: str) -> DefaultPlan:
def todos_since(tag: str | None | Failure, ref: str, cwd: str) -> list[str] | Failure:
"""todo.md's text at tag and at each later commit on ref that changed it, read in cwd; empty where there is no tag. A pull request's own commits do not count, only the merge that landed it: --first-parent."""
"""todo.md's text at tag and at each later commit on ref that changed it, oldest first, read in cwd; empty where there is no tag. A pull request's own commits do not count, only the merge that landed it: --first-parent."""
if not isinstance(tag, str):
return []
changed = git("log", "--first-parent", "--format=%H", f"{tag}..{ref}", "--", "todo.md", cwd=cwd)
changed = git("log", "--first-parent", "--reverse", "--format=%H", f"{tag}..{ref}", "--", "todo.md", cwd=cwd)
if isinstance(changed, Failure):
return changed
texts = []
+2 -1
View File
@@ -26,7 +26,8 @@ another round. It also lists each name in such a title that is not a pass.
needs-scoring-run takes the IDs of the todo.md items the chunk ships, none when it ships none, and
prints why the chunk is due a scoring run, or `No scoring run due.` It is due when the chunk ships
an item whose tagline names the comprehension floor, or when it leaves a release with no item in
the checkout's todo.md, less the shipped items, and work has landed towards that release. Work has
the checkout's todo.md, less the shipped items, and work has landed towards that release. A release
whose items all moved to other releases, none leaving todo.md, was renamed and is due none. 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.
+5 -5
View File
@@ -2,14 +2,14 @@ import pathlib
from failure import Failure
from git_repo import file_at, top
from todo_table import Item, items
from todo_table import Item, items, renamed
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.
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. 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. That covers a release whose last item moved to another release.
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. 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 items all moved to other releases was renamed, as todo_table.renamed says, and is due none.
"""
plan = {item.id: item for item in before + after}
if unknown := sorted(set(ships) - set(plan)):
@@ -25,10 +25,10 @@ def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], lan
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."""
"""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."""
named = {item.release for item in before + shipped}
left = {item.release for item in after if item.id not in {ship.id for ship in shipped}}
return sorted(named - left)
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))
def plan_reasons(default: str, ids: list[int]) -> list[str] | Failure:
+5
View File
@@ -281,6 +281,11 @@ class ScoringRunDue(unittest.TestCase):
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), [])
def test_is_not_due_when_the_chunk_renames_the_next_release(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), [])
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), [])
+2 -1
View File
@@ -55,7 +55,8 @@ interrupt run on one of the ladder's rungs: a model at an effort. As a chunk sta
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, or any earliest release where no tag names a version. Otherwise no
has named at that tag or since, less one renamed since, whose items all moved to other releases,
or any earliest release where no tag names a version. 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
+16
View File
@@ -457,6 +457,22 @@ 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):
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)
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)}),
)
for name, texts, named in cases:
with self.subTest(name):
self.assertEqual(todo_table.named_releases(texts), named)
class Main(unittest.TestCase):
def run_main(self, *argv):
+15 -4
View File
@@ -19,7 +19,7 @@ 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, even once its items moved to a later release, as larv_review/plan.py's emptied counts such a release emptied too.
# A release named since the cut stays the next until a tag cuts it, unless renamed says it was renamed; larv_review/plan.py's emptied counts a release the same way.
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)
@@ -186,7 +186,7 @@ class LastCut:
changelog: str | Failure
# How many commits follow the tag, or make up the branch where it has none.
commits: int | Failure
# todo.md's text at the tag and at each later commit that changed it; empty without a tag.
# todo.md's text at the tag and at each later commit that changed it, oldest first; empty without a tag.
todos_since: list[str] | Failure
@@ -203,10 +203,21 @@ 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 file items under; a text that does not parse names none."""
"""Each release the todo.md texts, oldest first, file items under, less each that renamed says a later text renamed and none names again; a text that does not parse names none."""
if isinstance(todos, Failure):
return todos
return {item.release for parsed in map(items, todos) if isinstance(parsed, list) for item in parsed}
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)
return named
def renamed(before: list[Item], after: list[Item]) -> set[tuple[int, int, int]]:
"""Each release before names and after does not whose items after all holds: no item left the plan from it, so it was renamed, never finished, as `docs/decisions.md` → `todo.md: a release whose items all moved` 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 standing(tag: str | None | Failure, landed: int | Failure, earliest: tuple[int, int, int] | None, named: set[tuple[int, int, int]] | Failure) -> Standing:
+4
View File
@@ -142,6 +142,10 @@ 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 items all moved to other releases, none leaving the plan, was renamed, never finished
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 plan 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 for the release its items moved to, and larv-review's scoring-run trigger calls no run for it. A release whose leftovers were deferred no longer stops the loop for a cut or calls a scoring run; the human cuts it. `bin/todo_table.py`'s `renamed` holds the rule, and `bin/larv_review/plan.py`'s `emptied` applies it. Valid while todo.md has no way to mark a release finished other than emptying 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).
-7
View File
@@ -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 |
| 181 | 0.2.0 | | defect | **Count a release that todo.md named since the last cut, and whose items all moved to another release, as renamed, so `chunk-preflight` and larv-review's scoring-run trigger never call it finished.** | 2 | 2 | 3 | 5 | 3 | 1.5 by 7 | 3.8 |
| 168 | 0.2.0 | | | **Have the human answer an interrupt on loop-claude's terminal and resume the worker headless with the answer, opening the interactive session only when they ask for it.** | 4 | 2 | 3 | 7 | 5 | 1.5 by 8 | 1.8 |
| 73 | 0.2.0 | | | **Have each reviewer write its full report to a file and return the worker only its findings' one-line summaries.** | 3 | 2 | 3 | 6 | 5 | 1.4 by 4 | 1.1 |
| 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 |
@@ -96,12 +95,6 @@ Options:
Only the human can choose, and the answer revises that decision. Found by the stability review of PR #307.
### 181. Count a release that todo.md named since the last cut, and whose items all moved to another release, as renamed, so `chunk-preflight` and larv-review's scoring-run trigger never call it finished.
`todo_table.standing` takes every release named in todo.md since the last tag as a candidate for the next release, even one that no text names any longer. So a release renamed before it was cut, its items moved to the next minor because one of them turned out breaking, stays the next release, empty and with work landed, and `chunk-preflight` reports it finished and ready to cut. The loop then stops on every cycle while the renamed release still holds open items. `larv_review/plan.py`'s `emptied` makes the same call, so a chunk that renames the next release calls a scoring run.
A release named since the cut counts only while todo.md names it, or where it stopped being named because an item left the plan from it; where every item it held moved to another release, it was renamed and counts as never named.
### 168. Have the human answer an interrupt on loop-claude's terminal and resume the worker headless with the answer, opening the interactive session only when they ask for it.
Today an interrupt runs `claude --resume` on the terminal and waits for it to exit (`bin/loop_claude/cycle/interrupt.py`). Once the human answers, the worker carries on in that interactive session, so the loop waits until the human exits it, often for the rest of the chunk. Instead, the loop prints the question and reads the answer on its own terminal. The next cycle resumes the worker headless with a prompt like `prompts.answered`'s, saying the human gave the answer. A word typed in place of an answer, such as `/talk`, opens today's interactive session, for when the human wants to read the diff or discuss first. An empty answer stops the loop, as an interrupt with nothing typed does today. A release ready to cut still opens the interactive session. Bench the word, and the line that asks for the answer, as `CLAUDE.md` says.