From 3db4b771210ede55294dd21a35852063fcdeb86d Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 27 Nov 2026 20:50:24 +0100 Subject: [PATCH 01/10] Name the next release's items without a Touches list, and warn of them in rank_todo.py --check --- CLAUDE.md | 1 + bin/chunk_preflight/facts.py | 17 +++++++++++- bin/chunk_preflight/main.py | 4 +++ bin/chunk_preflight/test_chunk_preflight.py | 29 +++++++++++++++++++++ bin/plan/touches.py | 11 ++++++++ bin/plan_store/todo_md.py | 10 ++++++- bin/rank_todo.py | 5 ++-- bin/test_rank_todo.py | 26 +++++++++++++++--- docs/reading-cost.md | 9 +++++++ rules/todo-items.md | 2 +- 10 files changed, 106 insertions(+), 8 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 7c4a0645..1cf48aa1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -14,6 +14,7 @@ How work proceeds in any repo, unless the repo's `AGENTS.md` says otherwise. The - **A client project's `CLAUDE.md` and `AGENTS.md` in its repo belong to its team.** Read both at the start of each chunk there. Propose each change that aligns them with this setup in a pull request of its own, never inside a chunk's; the one edit a chunk makes there is a decision's title in `AGENTS.md`. Until the team accepts a proposal, and after it declines or doesn't answer, follow the team's rule unless it breaks one of the project's goals. Record each such conflict as a decision in the `decisions` record, as `rules/decisions.md` asks: which rule you follow, why, and the open proposal's PR. Then nobody is asked twice. - **Read the goals file's `## Goals` and `## Audience` before starting a chunk, unless your prompt quotes them.** The chunk's items set its scope. The goals choose between ways to deliver those items, and never add to them. - **Read the plan and the decisions only as far as the chunk needs.** Where your prompt quotes `chunk-preflight`'s facts, they hold the next item's L, E + I, tagline and detail, and each item that may join it with its L, E + I, S, tagline and detail; run `todo-item` only for what they leave out. Otherwise run `~/.claude/bin/todo-item list`, which prints every item's row in the plan's order, without details. Then read the details of only the items the chunk takes, with `~/.claude/bin/todo-item show `, which prints an item's row and detail. `AGENTS.md` lists the project principles and the title of each decision no project principle covers. Read an entry in `docs/decisions.md` only where the project principle or the title leaves open what the chunk or the review needs. Print one entry with `~/.claude/bin/markdown-section `, where `` is what `~/.claude/bin/project-record open decisions` prints. +- **Where `chunk-preflight`'s facts name items with no `Touches:` list, have one subagent write the lists before the chunk's own work.** Without them no other chunk may start beside this one. Launch it on the rung "Working with the codebase" gives a subagent that files or scores plan items. It reads the code and adds a list to each named item's detail with `todo-item edit --detail`, as `~/.claude/rules/todo-items.md` says, changing nothing else in the detail. Where it cannot tell which part of a file the item changes, it lists the whole file and says in the detail that the change is not predictable. It leaves alone a list an item already holds, even one a later edit of the item made stale. Where the plan is a file in the repo, it works in a worktree of its own off `origin/main`, and ships the plan as a pull request of its own with `chunk-pr`. - **Work one chunk at a time, and put every item that can share its review into it.** Every review has a fixed cost, so a chunk takes the next plan item plus every other item for which three things hold: they name one release; they fire the same review passes (`larv-review` §3); and no item outside the chunk blocks one of them. The items need not share a purpose. An item whose risk R, in the plan, is above 5 ships alone: it joins no chunk, and none joins it. The next plan item is the first that does not wait: an item waits while it is marked `question`, until the human answers, or while an item that blocks it is still in the plan. Tiny items, a few lines of change each, need not fire the same passes: bundle up to ten that name one release, and that no item outside the chunk blocks, into one chunk. Split a milestone into items in the plan before starting it. Fix a finding in the chunk's own change within the chunk. File a finding about anything else in `todo.md`. - **Ask, don't guess.** Three choices are always the human's: a goal; a release, meaning the items planned into it and when it is cut; and a change to loop-claude's routing ladder, its rungs included. Any other rule that asks the human's approval reserves that choice too. Ask about a reserved choice. For any other choice, first check whether the goals already answer it. If they nearly do, propose a change to the goals and show how it answers this case: an answer settles one question, a goal settles every question like it. Otherwise take the option you would recommend, and record it with its reason: in the item's detail, or, where it governs later work, as the next sentence says. A recommendation you can give a reason for is not a guess. Ask only where you have no recommendation. Write every answer once, where it belongs, never only in chat: a goal in the goals file, a working rule in `AGENTS.md`, a standing choice in a comment at the one place it governs, or in `docs/decisions.md` once made in more than one place. When an answer holds a goal and a choice, write the goal in the goals file, and record as a choice only what the goal leaves open. - **Bench a syntax with the people who write it.** Before a new or changed spelling of something users read or write ships — markdown, HTML, a config key, a CLI flag — a panel of fresh-context readers, seated as those users from the goals file's `## Audience`, picks it. diff --git a/bin/chunk_preflight/facts.py b/bin/chunk_preflight/facts.py index a8fc9ce0..6070745b 100644 --- a/bin/chunk_preflight/facts.py +++ b/bin/chunk_preflight/facts.py @@ -1,5 +1,5 @@ """The lines the preflight prints, stated from what it gathered.""" -from plan.todo_table import bundle_candidates, BUNDLE_MAX_R, Item, ships_alone +from plan.todo_table import bundle_candidates, BUNDLE_MAX_R, Item, next_item, ships_alone from touch_predictions.beside import chunks_beside from release_plan.next_chunk import cut_name, NextChunk, NoItem from release_plan.release_standing import dated_cut, LastCut, unreleased_entries, UNSEEN_RELEASES @@ -9,6 +9,7 @@ from chunk_preflight.gathered import Gathered, ItemFacts, NamedPath, Ran from text_files.markdown_text import listed, quoted from chunk_preflight.choices import PULLS_LIST from chunk_preflight.indentation import SpaceIndented +from plan.touches import unpredicted from plan.release import version @@ -73,6 +74,7 @@ def item_lines(plan: str, item: ItemFacts) -> list[str]: f"- Open pull requests from {item.plan.branch}: {pulls_text(item.pulls, item.plan.branch)}", *bundled(item.plan), *beside(item.plan), + *unpredicted_lines(item.plan), *named_lines(item.named), f"\nItem {first.id}'s tagline and detail:\n\n{quoted(item.plan.text)}", *joining_details(item.plan), @@ -147,6 +149,19 @@ def beside(plan: NextChunk) -> list[str]: return [f"- The items of release {version(first.release)} that may start chunks beside item {first.id}'s: {', '.join(map(str, found.picked))}. None is predicted to touch a part that item {first.id} touches, or that an item earlier in this list touches. An item this chunk takes doesn't start a chunk of its own.{refused}"] +def unpredicted_lines(plan: NextChunk) -> list[str]: + """The items of first's release without a `Touches:` list, for the worker to have a subagent write; no line where each holds one or first is alone in its release, where no chunk could start beside its. + + Only the chunk of the plan's next item gets the line: a chunk that starts beside it would have a second subagent write the same lists.""" + first = plan.first + missing = unpredicted(plan.items, first.release) + alone = sum(item.release == first.release for item in plan.items) < 2 + if not missing or alone or next_item(plan.items) != first: + return [] + them = "them" if missing.startswith("items") else "it" + return [f'- {missing[0].upper()}{missing[1:]}. Before the chunk, have one subagent write {them}, as `~/.claude/CLAUDE.md` → "Working loop" says.'] + + def named_lines(named: list[NamedPath] | Failure) -> list[str]: if isinstance(named, Failure): return [f"- The files the item names: cannot be listed: {named.reason}"] diff --git a/bin/chunk_preflight/main.py b/bin/chunk_preflight/main.py index 607dc661..c78230ae 100644 --- a/bin/chunk_preflight/main.py +++ b/bin/chunk_preflight/main.py @@ -71,6 +71,10 @@ and prints that the release reviews and the cuts are the human's to call. It pri it in the plan's order. A part either prediction marks (small) doesn't count. This line is left out where no item of the release that doesn't wait holds a prediction. The plan and the records belong in no prediction, since every chunk writes them; +- the items of that release whose details hold no `Touches:` list, for the worker to have a + subagent write, as `~/.claude/CLAUDE.md` → "Working loop" says. This line is left out where + the item is alone in its release, and where it is not the plan's next item: the chunk of the + next item gets the line, so the lists are written once; - each file or folder git tracks that the item's tagline or detail names in backticks, with a file's lines or a folder's files, then the item's tagline and detail, then the detail of each of the first {JOINING_DETAILS} items that may join, or that one has none; diff --git a/bin/chunk_preflight/test_chunk_preflight.py b/bin/chunk_preflight/test_chunk_preflight.py index 44a76492..8cfabda7 100644 --- a/bin/chunk_preflight/test_chunk_preflight.py +++ b/bin/chunk_preflight/test_chunk_preflight.py @@ -2,6 +2,7 @@ import contextlib import dataclasses import os import pathlib +import re import shutil import subprocess import sys @@ -867,6 +868,34 @@ class BesideTest(unittest.TestCase): self.assertEqual(self.said(TODO), []) +class UnpredictedTest(unittest.TestCase): + """The fact that names the next release's items whose details hold no `Touches:` list.""" + LIST = "\nTouches:\n\n- `src/app.py`: `run`\n" + # Item 3's detail ends TODO, so the first list is item 3's. + LISTED = TODO + LIST + f"\n### 5. Do it.\n{LIST}\n### 7. Do it.\n{LIST}\n### 8. Do it.\n{LIST}" + + def said(self, todo, *named): + return [line for line in rendered(item_facts(todo, plan=planned(todo, CUT, "origin/main", BRANCH, None, *named))).splitlines() if "have no `Touches:` list" in line or "has no `Touches:` list" in line] + + def test_says_nothing_where_every_item_of_the_release_holds_a_list(self): + self.assertEqual(self.said(self.LISTED), []) + + def test_names_each_item_without_a_list_where_other_items_of_the_release_wait(self): + self.assertEqual(self.said(self.LISTED.replace(f"\n### 7. Do it.\n{self.LIST}", "")), ['- Item 7 of release 0.2.0 has no `Touches:` list. Before the chunk, have one subagent write it, as `~/.claude/CLAUDE.md` → "Working loop" says.']) + self.assertEqual(self.said(TODO), ['- Items 5, 3, 7 and 8 of release 0.2.0 have no `Touches:` list. Before the chunk, have one subagent write them, as `~/.claude/CLAUDE.md` → "Working loop" says.']) + + def test_says_nothing_of_an_item_alone_in_its_release(self): + alone = "\n".join(line for line in TODO.splitlines() if not re.match(r"\| [578] \|", line)) + "\n" + self.assertEqual(self.said(alone), []) + + def test_leaves_alone_a_list_an_edit_of_its_item_made_stale(self): + # Item 3's detail names `src/app.py`'s `run`, and its list another file: only a missing list is written. + self.assertEqual(self.said(self.LISTED.replace("- `src/app.py`: `run`", "- `src/old.py`", 1)), []) + + def test_says_it_only_to_the_chunk_of_the_plans_next_item(self): + # Item 8's chunk starts beside item 3's, whose worker writes the lists: two subagents would write them twice. + self.assertEqual(self.said(TODO.replace("| 8 | 0.2.0 | 5 |", "| 8 | 0.2.0 | |"), 8), []) + if __name__ == "__main__": unittest.main() diff --git a/bin/plan/touches.py b/bin/plan/touches.py index 54e87e1a..ebe74503 100644 --- a/bin/plan/touches.py +++ b/bin/plan/touches.py @@ -17,6 +17,9 @@ import dataclasses import re from failure import Failure +from plan.todo_table import Item +from text_files.markdown_text import listed +from plan.release import Release, version LABEL = "Touches:" SMALL = " (small)" @@ -146,3 +149,11 @@ def same_part(one: Part, other: Part) -> bool: if spans[0] or spans[1]: return True return one.name == other.name or one.name.startswith(f"{other.name}.") or other.name.startswith(f"{one.name}.") + + +def unpredicted(found: list[Item], release: Release) -> str | None: + """Which of release's items hold no `Touches:` list in their details, in found's order, as a clause such as ``items 3 and 7 of release 0.2.0 have no `Touches:` list``; None where each holds one. A list that cannot be read is not missing: `rank_todo.py --check` fails on that one. Nor is one its item's later edit made stale, so a list is written once.""" + missing = [str(item.id) for item in found if item.release == release and predicted(item.detail) is None] + if not missing: + return None + return f"item{'s' if len(missing) > 1 else ''} {listed(missing, 'and')} of release {version(release)} ha{'ve' if len(missing) > 1 else 's'} no `{LABEL}` list" diff --git a/bin/plan_store/todo_md.py b/bin/plan_store/todo_md.py index ebe3cc54..72ff7873 100644 --- a/bin/plan_store/todo_md.py +++ b/bin/plan_store/todo_md.py @@ -7,7 +7,7 @@ from plan_store.plans import cells, Plan, Written from failure import Failure from plan.todo_table import item_details, items, NoItemsTable, renames from plan_store import markdown_edits -from plan.touches import predicted +from plan.touches import predicted, unpredicted from plan import ranking from record_store.stores import RecordStore from text_files.file_writes import replace_file @@ -95,6 +95,14 @@ class FilePlan: unranked = [] if ranked.text == texts[0] else [f"{self.path}: not ranked; run rank_todo.py on it"] return unranked + [f"{self.path}: {line}" for line in ranked.under_bar + unreadable_touches(texts[0])] + def warnings(self) -> list[str]: + """What `rank_todo.py --check` says of the file without failing on it: which items of its earliest release hold no `Touches:` list.""" + plan = self.read() + if isinstance(plan, Failure) or not plan.items: + return [] + missing = unpredicted(plan.items, min(item.release for item in plan.items)) + return [f"{self.path}: warning: {missing}; write each as `~/.claude/rules/todo-items.md` says"] if missing else [] + def reported(self, ranked: ranking.Ranked) -> list[str]: """Ranking's notes and under-bar lines, each prefixed with the file's path, as a tool prints them on stderr.""" return [f"{self.path}: {line}" for line in ranked.notes + ranked.under_bar] diff --git a/bin/rank_todo.py b/bin/rank_todo.py index e193e20f..583039de 100755 --- a/bin/rank_todo.py +++ b/bin/rank_todo.py @@ -12,7 +12,8 @@ then by ID. Then it moves each blocker, an item another's Blocked by cell names, an item it blocks to just above the first such item. Orders the details to match. Writes each item's R, and adds the Blocked by and R columns to a table without them. --check doesn't write anything and fails when the file is not ranked as it would be, or when an item's detail holds a -`Touches:` list not spelt as `touch-predictions --help` shows. +`Touches:` list not spelt as `touch-predictions --help` shows. On a file that passes, it warns on +stderr, still exiting 0, where items of the earliest release hold no `Touches:` list, naming them. A valid todo.md; ## Details and each item's detail are optional: @@ -120,7 +121,7 @@ def main(argv: list[str], home: pathlib.Path) -> int: plan = file_plan(config, todo) if check: failures = plan.check() - for line in failures: + for line in failures or plan.warnings(): print(line, file=sys.stderr) return 1 if failures else 0 ranked = plan.rank() diff --git a/bin/test_rank_todo.py b/bin/test_rank_todo.py index 19053a6e..ac132eef 100644 --- a/bin/test_rank_todo.py +++ b/bin/test_rank_todo.py @@ -14,6 +14,9 @@ from plan import goals_file, ranking import rank_todo from todo_item.doubles import READABLE_TOUCHES, UNREADABLE_BULLETS +# What --check says of plan.doubles' TODO, none of whose items of the next release, 0.1.0, holds a list. The order is the ranked table's. +UNPREDICTED = "items 4, 3, 2 and 5 of release 0.1.0 have no `Touches:` list; write each as `~/.claude/rules/todo-items.md` says" + class Main(unittest.TestCase): # The home of a test that writes no config. @@ -41,7 +44,7 @@ class Main(unittest.TestCase): self.assertEqual(self.run_main("--check", str(todo))[0], 1) self.assertEqual(todo.read_text(), TODO) self.assertEqual(self.run_main(str(todo)), (0, "")) - self.assertEqual(self.run_main("--check", str(todo)), (0, "")) + self.assertEqual(self.run_main("--check", str(todo)), (0, f"{todo}: warning: {UNPREDICTED}\n")) pathlib.Path(temp, "README.md").write_bytes(b"\xff") self.assertEqual(self.run_main(str(todo)), (1, f"cannot read {temp}/README.md: not UTF-8 on line 1\n")) pathlib.Path(temp, "README.md").unlink() @@ -62,7 +65,7 @@ class Main(unittest.TestCase): (folder / "decisions.md").write_text(DECISIONS) self.assertEqual(self.run_main("--check")[0], 1, "the plan in the config's folder is not ranked yet") self.assertEqual(self.run_main(), (0, "")) - self.assertEqual(self.run_main("--check"), (0, "")) + self.assertEqual(self.run_main("--check"), (0, f"{folder / 'todo.md'}: warning: {UNPREDICTED}\n")) self.assertEqual(pathlib.Path(temp, "todo.md").read_text(), "the project owners' own notes\n") (folder / "decisions.md").write_bytes(b"\xff") self.assertEqual(self.run_main(), (1, f"cannot read {folder}/decisions.md: not UTF-8 on line 1\n")) @@ -111,6 +114,23 @@ class Main(unittest.TestCase): self.assertEqual(self.run_main(str(todo)), (1, f"{todo}: {under}\n")) self.assertEqual(self.run_main("--check", str(todo)), (1, f"{todo}: {under}\n")) + def test_check_warns_without_failing_on_the_next_releases_items_without_a_touches_list(self): + with tempfile.TemporaryDirectory() as temp: + todo = pathlib.Path(temp, "todo.md") + self.configured(temp) + self.enterContext(contextlib.chdir(temp)) + pathlib.Path(temp, "README.md").write_text(README) + pathlib.Path(temp, "docs").mkdir() + pathlib.Path(temp, "docs", "decisions.md").write_text(DECISIONS) + # Item 3 of the next release, 0.1.0, holds a list; item 1 of 0.2.0 holds none, and is not named. + todo.write_text(TODO.replace("Fast detail.", READABLE_TOUCHES)) + self.assertEqual(self.run_main(str(todo))[0], 0) + self.assertEqual(self.run_main("--check", str(todo)), (0, f"{todo}: warning: {UNPREDICTED.replace('3, ', '')}\n")) + every = "".join(f"### {id_}. Do it.\n\n{READABLE_TOUCHES}\n" for id_ in (2, 4, 5)) + todo.write_text(todo.read_text().replace("## Notes", f"{every}## Notes")) + self.assertEqual(self.run_main(str(todo))[0], 0) + self.assertEqual(self.run_main("--check", str(todo)), (0, "")) + def test_check_fails_on_each_item_whose_touches_list_it_cannot_read(self): with tempfile.TemporaryDirectory() as temp: todo = pathlib.Path(temp, "todo.md") @@ -140,7 +160,7 @@ class Main(unittest.TestCase): pathlib.Path(temp, "docs").mkdir() pathlib.Path(temp, "docs", "decisions.md").write_text(DECISIONS) self.assertEqual(self.run_main(str(todo)), (0, f"{todo}: {ranking.RESHAPE}\n")) - self.assertEqual(self.run_main("--check", str(todo)), (0, "")) + self.assertEqual(self.run_main("--check", str(todo))[0], 0) def test_shows_a_valid_file_in_help_and_names_arguments_it_cannot_read(self): self.assertEqual(self.run_main("--help")[0], 0) diff --git a/docs/reading-cost.md b/docs/reading-cost.md index aa79ff19..2b911b18 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -3815,3 +3815,12 @@ Read most (opens and searches): - `skills/larv-review/SKILL.md` 5 - `agents/stability-reviewer.md` 4 - `README.md` 1 + +## Reading cost, chunk 3756be76994f, finished 2026-11-27T19:41:34Z + +52954 new input tokens before the first commit. + +Read most (opens and searches): + +- `principles/technical-principles.md` 7 +- `agents/stability-reviewer.md` 1 diff --git a/rules/todo-items.md b/rules/todo-items.md index 4c5eb925..e05b6e90 100644 --- a/rules/todo-items.md +++ b/rules/todo-items.md @@ -30,4 +30,4 @@ paths: - **The Exempt cell keeps an item whatever its score:** `security` for a security finding, `defect` for a 🔴 finding or an item that restores a maintain goal the project breaks today, `question` for a question only the human can answer, which ranks first in its release, `decision` for an item `docs/decisions.md` cites, `owner` for an item the human told you to keep, and, where no other reason fits, `principle` for a 🟡 finding against a file in the config's principles folder, whose item's detail names that principle. Every item `docs/decisions.md` cites carries one of these reasons. - **A maintain goal vetoes an item that breaks it,** whatever the item scores: redesign the item so it holds the goal, or drop it. - **When you remove an item that no chunk built, title the commit `Drop item : `,** or `Drop items 12, 14 and 15: ` for several. Such an item was deleted under the bar, vetoed, superseded or moot; a finished item is not one. Without the title, `score-outcomes` credits the item with the work of the chunk that removed it, where that chunk changed more than `todo.md`. -- **Predict, in the detail of each item of the next release, what the item will touch.** When you plan the next release, or file or move an item into it, give the item's detail a `Touches:` line, then one bullet per file the item will change. Each bullet names the file, then the parts of it the item will change: a function, a class or a section heading, or line ranges where the file has none of these. A path alone means the whole file. Read the code first; a prediction from the item's text alone misses. `~/.claude/bin/touch-predictions --help` shows the spelling and how a part is named; a name that holds a backtick takes a longer run of backticks with a space inside each end, as a Markdown code span does. Mark a part `(small)` where the item changes only a few lines of it. `(small)` follows a part, never a bare path. A part is a name in backticks, or `lines -`. BANNED: ``- `bin/a.py` (small)``, ``- `README.md`: loop-claude's section (small)``. GOOD: ``- `bin/a.py`: `main` (small)``, ``- `README.md`: `## Tools` (small)``. Leave out the plan and the project's records, which every chunk writes. `chunk-preflight` reads the predictions to name the items that may start chunks at once, and `touch-predictions record` keeps each beside what its chunk touched. `todo-item add`, `todo-item edit` and `rank_todo.py --check` refuse a list touch-predictions cannot read. +- **Predict, in the detail of each item of the next release, what the item will touch.** When you plan the next release, or file or move an item into it, give the item's detail a `Touches:` line, then one bullet per file the item will change. Each bullet names the file, then the parts of it the item will change: a function, a class or a section heading, or line ranges where the file has none of these. A path alone means the whole file. Read the code first; a prediction from the item's text alone misses. `~/.claude/bin/touch-predictions --help` shows the spelling and how a part is named; a name that holds a backtick takes a longer run of backticks with a space inside each end, as a Markdown code span does. Mark a part `(small)` where the item changes only a few lines of it. `(small)` follows a part, never a bare path. A part is a name in backticks, or `lines -`. BANNED: ``- `bin/a.py` (small)``, ``- `README.md`: loop-claude's section (small)``. GOOD: ``- `bin/a.py`: `main` (small)``, ``- `README.md`: `## Tools` (small)``. Leave out the plan and the project's records, which every chunk writes. `chunk-preflight` reads the predictions to name the items that may start chunks at once, and `touch-predictions record` keeps each beside what its chunk touched. `todo-item add`, `todo-item edit` and `rank_todo.py --check` refuse a list touch-predictions cannot read. `rank_todo.py --check` warns, without failing, of each item of the earliest release that has no list, and `chunk-preflight` names them where other items of the release wait, for a subagent to write (`CLAUDE.md` → "Working loop"). -- 2.52.0 From e4fa2275a6b2e666c9cd538ab95bceca4b3c6349 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 27 Nov 2026 20:51:04 +0100 Subject: [PATCH 02/10] =?UTF-8?q?Answer=20security=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread);=20no=20findin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From f89bdd9938da2c282e73cb246c9922c9d496e745 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 27 Nov 2026 21:05:06 +0100 Subject: [PATCH 03/10] Test the fact for two items and the warning's release --- bin/chunk_preflight/test_chunk_preflight.py | 5 +++++ bin/plan_store/todo_md.py | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/chunk_preflight/test_chunk_preflight.py b/bin/chunk_preflight/test_chunk_preflight.py index 8cfabda7..7a644844 100644 --- a/bin/chunk_preflight/test_chunk_preflight.py +++ b/bin/chunk_preflight/test_chunk_preflight.py @@ -884,6 +884,11 @@ class UnpredictedTest(unittest.TestCase): self.assertEqual(self.said(self.LISTED.replace(f"\n### 7. Do it.\n{self.LIST}", "")), ['- Item 7 of release 0.2.0 has no `Touches:` list. Before the chunk, have one subagent write it, as `~/.claude/CLAUDE.md` → "Working loop" says.']) self.assertEqual(self.said(TODO), ['- Items 5, 3, 7 and 8 of release 0.2.0 have no `Touches:` list. Before the chunk, have one subagent write them, as `~/.claude/CLAUDE.md` → "Working loop" says.']) + def test_names_two_items_and_one_of_two(self): + self.assertEqual(self.said(self.LISTED.replace(f"### 5. Do it.\n{self.LIST}", "").replace(f"### 7. Do it.\n{self.LIST}", "")), ['- Items 5 and 7 of release 0.2.0 have no `Touches:` list. Before the chunk, have one subagent write them, as `~/.claude/CLAUDE.md` → "Working loop" says.']) + pair = "\n".join(line for line in TODO.splitlines() if not re.match(r"\| [58] \|", line)) + "\n" + self.assertEqual(self.said(pair + self.LIST), ['- Item 7 of release 0.2.0 has no `Touches:` list. Before the chunk, have one subagent write it, as `~/.claude/CLAUDE.md` → "Working loop" says.']) + def test_says_nothing_of_an_item_alone_in_its_release(self): alone = "\n".join(line for line in TODO.splitlines() if not re.match(r"\| [578] \|", line)) + "\n" self.assertEqual(self.said(alone), []) diff --git a/bin/plan_store/todo_md.py b/bin/plan_store/todo_md.py index 72ff7873..26fa8925 100644 --- a/bin/plan_store/todo_md.py +++ b/bin/plan_store/todo_md.py @@ -98,10 +98,10 @@ class FilePlan: def warnings(self) -> list[str]: """What `rank_todo.py --check` says of the file without failing on it: which items of its earliest release hold no `Touches:` list.""" plan = self.read() - if isinstance(plan, Failure) or not plan.items: + if isinstance(plan, Failure): return [] - missing = unpredicted(plan.items, min(item.release for item in plan.items)) - return [f"{self.path}: warning: {missing}; write each as `~/.claude/rules/todo-items.md` says"] if missing else [] + earliest = sorted({item.release for item in plan.items})[:1] + return [f"{self.path}: warning: {missing}; write each as `~/.claude/rules/todo-items.md` says" for release in earliest if (missing := unpredicted(plan.items, release))] def reported(self, ranked: ranking.Ranked) -> list[str]: """Ranking's notes and under-bar lines, each prefixed with the file's path, as a tool prints them on stderr.""" -- 2.52.0 From 00bf9961497ae66851f2922004906e6bd271bd73 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 27 Nov 2026 21:24:47 +0100 Subject: [PATCH 04/10] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=202=20=F0=9F=9F=A1=20(0=20misread);=20state=20the?= =?UTF-8?q?=20warning=20as=20a=20fact=20and=20key=20the=20rule=20on=20the?= =?UTF-8?q?=20fact=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 2 +- bin/chunk_preflight/facts.py | 8 ++++---- bin/chunk_preflight/main.py | 4 ++-- bin/chunk_preflight/test_chunk_preflight.py | 10 +++++----- bin/plan/touches.py | 15 +++++++++------ bin/plan_store/todo_md.py | 8 +++++--- bin/test_rank_todo.py | 5 +++-- rules/todo-items.md | 2 +- 8 files changed, 30 insertions(+), 24 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 1cf48aa1..489c3b18 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -14,7 +14,7 @@ How work proceeds in any repo, unless the repo's `AGENTS.md` says otherwise. The - **A client project's `CLAUDE.md` and `AGENTS.md` in its repo belong to its team.** Read both at the start of each chunk there. Propose each change that aligns them with this setup in a pull request of its own, never inside a chunk's; the one edit a chunk makes there is a decision's title in `AGENTS.md`. Until the team accepts a proposal, and after it declines or doesn't answer, follow the team's rule unless it breaks one of the project's goals. Record each such conflict as a decision in the `decisions` record, as `rules/decisions.md` asks: which rule you follow, why, and the open proposal's PR. Then nobody is asked twice. - **Read the goals file's `## Goals` and `## Audience` before starting a chunk, unless your prompt quotes them.** The chunk's items set its scope. The goals choose between ways to deliver those items, and never add to them. - **Read the plan and the decisions only as far as the chunk needs.** Where your prompt quotes `chunk-preflight`'s facts, they hold the next item's L, E + I, tagline and detail, and each item that may join it with its L, E + I, S, tagline and detail; run `todo-item` only for what they leave out. Otherwise run `~/.claude/bin/todo-item list`, which prints every item's row in the plan's order, without details. Then read the details of only the items the chunk takes, with `~/.claude/bin/todo-item show `, which prints an item's row and detail. `AGENTS.md` lists the project principles and the title of each decision no project principle covers. Read an entry in `docs/decisions.md` only where the project principle or the title leaves open what the chunk or the review needs. Print one entry with `~/.claude/bin/markdown-section `, where `` is what `~/.claude/bin/project-record open decisions` prints. -- **Where `chunk-preflight`'s facts name items with no `Touches:` list, have one subagent write the lists before the chunk's own work.** Without them no other chunk may start beside this one. Launch it on the rung "Working with the codebase" gives a subagent that files or scores plan items. It reads the code and adds a list to each named item's detail with `todo-item edit --detail`, as `~/.claude/rules/todo-items.md` says, changing nothing else in the detail. Where it cannot tell which part of a file the item changes, it lists the whole file and says in the detail that the change is not predictable. It leaves alone a list an item already holds, even one a later edit of the item made stale. Where the plan is a file in the repo, it works in a worktree of its own off `origin/main`, and ships the plan as a pull request of its own with `chunk-pr`. +- **Where a line of `chunk-preflight`'s facts says to have one subagent write `Touches:` lists, launch it before the chunk's own work.** `rank_todo.py --check`'s warning of items with no list, which the facts also quote, doesn't call for it: only the next item's chunk gets that line, so the lists are written once. An item without a list starts no chunk beside another's. Launch the subagent on the rung "Working with the codebase" gives a subagent that files or scores plan items. It reads the code and adds a list to each named item's detail with `todo-item edit --detail`, as `~/.claude/rules/todo-items.md` says, and doesn't change anything else in the detail. Where it cannot tell which part of a file the item changes, it lists the whole file and says in the detail that the change is not predictable. It leaves alone a list an item already holds, even one a later edit of the item made stale. Where the plan is a file in the repo, it works in a worktree of its own off the default branch, and ships the plan as a pull request of its own with `chunk-pr`. - **Work one chunk at a time, and put every item that can share its review into it.** Every review has a fixed cost, so a chunk takes the next plan item plus every other item for which three things hold: they name one release; they fire the same review passes (`larv-review` §3); and no item outside the chunk blocks one of them. The items need not share a purpose. An item whose risk R, in the plan, is above 5 ships alone: it joins no chunk, and none joins it. The next plan item is the first that does not wait: an item waits while it is marked `question`, until the human answers, or while an item that blocks it is still in the plan. Tiny items, a few lines of change each, need not fire the same passes: bundle up to ten that name one release, and that no item outside the chunk blocks, into one chunk. Split a milestone into items in the plan before starting it. Fix a finding in the chunk's own change within the chunk. File a finding about anything else in `todo.md`. - **Ask, don't guess.** Three choices are always the human's: a goal; a release, meaning the items planned into it and when it is cut; and a change to loop-claude's routing ladder, its rungs included. Any other rule that asks the human's approval reserves that choice too. Ask about a reserved choice. For any other choice, first check whether the goals already answer it. If they nearly do, propose a change to the goals and show how it answers this case: an answer settles one question, a goal settles every question like it. Otherwise take the option you would recommend, and record it with its reason: in the item's detail, or, where it governs later work, as the next sentence says. A recommendation you can give a reason for is not a guess. Ask only where you have no recommendation. Write every answer once, where it belongs, never only in chat: a goal in the goals file, a working rule in `AGENTS.md`, a standing choice in a comment at the one place it governs, or in `docs/decisions.md` once made in more than one place. When an answer holds a goal and a choice, write the goal in the goals file, and record as a choice only what the goal leaves open. - **Bench a syntax with the people who write it.** Before a new or changed spelling of something users read or write ships — markdown, HTML, a config key, a CLI flag — a panel of fresh-context readers, seated as those users from the goals file's `## Audience`, picks it. diff --git a/bin/chunk_preflight/facts.py b/bin/chunk_preflight/facts.py index 6070745b..85541610 100644 --- a/bin/chunk_preflight/facts.py +++ b/bin/chunk_preflight/facts.py @@ -9,7 +9,7 @@ from chunk_preflight.gathered import Gathered, ItemFacts, NamedPath, Ran from text_files.markdown_text import listed, quoted from chunk_preflight.choices import PULLS_LIST from chunk_preflight.indentation import SpaceIndented -from plan.touches import unpredicted +from plan.touches import unpredicted, without_a_list from plan.release import version @@ -150,7 +150,7 @@ def beside(plan: NextChunk) -> list[str]: def unpredicted_lines(plan: NextChunk) -> list[str]: - """The items of first's release without a `Touches:` list, for the worker to have a subagent write; no line where each holds one or first is alone in its release, where no chunk could start beside its. + """The line that names the items of first's release without a `Touches:` list and has the worker launch a subagent to write the lists. No line where each item holds a list. No line either where first is alone in its release: no chunk could start beside first's then. Only the chunk of the plan's next item gets the line: a chunk that starts beside it would have a second subagent write the same lists.""" first = plan.first @@ -158,8 +158,8 @@ def unpredicted_lines(plan: NextChunk) -> list[str]: alone = sum(item.release == first.release for item in plan.items) < 2 if not missing or alone or next_item(plan.items) != first: return [] - them = "them" if missing.startswith("items") else "it" - return [f'- {missing[0].upper()}{missing[1:]}. Before the chunk, have one subagent write {them}, as `~/.claude/CLAUDE.md` → "Working loop" says.'] + clause = without_a_list(missing, first.release) + return [f'- {clause[0].upper()}{clause[1:]}. Before the chunk, have one subagent write each missing list, as `~/.claude/CLAUDE.md` → "Working loop" says.'] def named_lines(named: list[NamedPath] | Failure) -> list[str]: diff --git a/bin/chunk_preflight/main.py b/bin/chunk_preflight/main.py index c78230ae..30ec8e33 100644 --- a/bin/chunk_preflight/main.py +++ b/bin/chunk_preflight/main.py @@ -71,8 +71,8 @@ and prints that the release reviews and the cuts are the human's to call. It pri it in the plan's order. A part either prediction marks (small) doesn't count. This line is left out where no item of the release that doesn't wait holds a prediction. The plan and the records belong in no prediction, since every chunk writes them; -- the items of that release whose details hold no `Touches:` list, for the worker to have a - subagent write, as `~/.claude/CLAUDE.md` → "Working loop" says. This line is left out where +- the items of that release whose details hold no `Touches:` list, whose lists the worker has + a subagent write, as `~/.claude/CLAUDE.md` → "Working loop" says. This line is left out where the item is alone in its release, and where it is not the plan's next item: the chunk of the next item gets the line, so the lists are written once; - each file or folder git tracks that the item's tagline or detail names in backticks, with a diff --git a/bin/chunk_preflight/test_chunk_preflight.py b/bin/chunk_preflight/test_chunk_preflight.py index 7a644844..d2b47def 100644 --- a/bin/chunk_preflight/test_chunk_preflight.py +++ b/bin/chunk_preflight/test_chunk_preflight.py @@ -881,13 +881,13 @@ class UnpredictedTest(unittest.TestCase): self.assertEqual(self.said(self.LISTED), []) def test_names_each_item_without_a_list_where_other_items_of_the_release_wait(self): - self.assertEqual(self.said(self.LISTED.replace(f"\n### 7. Do it.\n{self.LIST}", "")), ['- Item 7 of release 0.2.0 has no `Touches:` list. Before the chunk, have one subagent write it, as `~/.claude/CLAUDE.md` → "Working loop" says.']) - self.assertEqual(self.said(TODO), ['- Items 5, 3, 7 and 8 of release 0.2.0 have no `Touches:` list. Before the chunk, have one subagent write them, as `~/.claude/CLAUDE.md` → "Working loop" says.']) + self.assertEqual(self.said(self.LISTED.replace(f"\n### 7. Do it.\n{self.LIST}", "")), ['- Item 7 of release 0.2.0 has no `Touches:` list. Before the chunk, have one subagent write each missing list, as `~/.claude/CLAUDE.md` → "Working loop" says.']) + self.assertEqual(self.said(TODO), ['- Items 5, 3, 7 and 8 of release 0.2.0 have no `Touches:` list. Before the chunk, have one subagent write each missing list, as `~/.claude/CLAUDE.md` → "Working loop" says.']) def test_names_two_items_and_one_of_two(self): - self.assertEqual(self.said(self.LISTED.replace(f"### 5. Do it.\n{self.LIST}", "").replace(f"### 7. Do it.\n{self.LIST}", "")), ['- Items 5 and 7 of release 0.2.0 have no `Touches:` list. Before the chunk, have one subagent write them, as `~/.claude/CLAUDE.md` → "Working loop" says.']) + self.assertEqual(self.said(self.LISTED.replace(f"### 5. Do it.\n{self.LIST}", "").replace(f"### 7. Do it.\n{self.LIST}", "")), ['- Items 5 and 7 of release 0.2.0 have no `Touches:` list. Before the chunk, have one subagent write each missing list, as `~/.claude/CLAUDE.md` → "Working loop" says.']) pair = "\n".join(line for line in TODO.splitlines() if not re.match(r"\| [58] \|", line)) + "\n" - self.assertEqual(self.said(pair + self.LIST), ['- Item 7 of release 0.2.0 has no `Touches:` list. Before the chunk, have one subagent write it, as `~/.claude/CLAUDE.md` → "Working loop" says.']) + self.assertEqual(self.said(pair + self.LIST), ['- Item 7 of release 0.2.0 has no `Touches:` list. Before the chunk, have one subagent write each missing list, as `~/.claude/CLAUDE.md` → "Working loop" says.']) def test_says_nothing_of_an_item_alone_in_its_release(self): alone = "\n".join(line for line in TODO.splitlines() if not re.match(r"\| [578] \|", line)) + "\n" @@ -898,7 +898,7 @@ class UnpredictedTest(unittest.TestCase): self.assertEqual(self.said(self.LISTED.replace("- `src/app.py`: `run`", "- `src/old.py`", 1)), []) def test_says_it_only_to_the_chunk_of_the_plans_next_item(self): - # Item 8's chunk starts beside item 3's, whose worker writes the lists: two subagents would write them twice. + # Item 8's chunk starts beside item 3's, whose worker has a subagent write the lists: a second subagent would write the same ones. self.assertEqual(self.said(TODO.replace("| 8 | 0.2.0 | 5 |", "| 8 | 0.2.0 | |"), 8), []) diff --git a/bin/plan/touches.py b/bin/plan/touches.py index ebe74503..54ee99dc 100644 --- a/bin/plan/touches.py +++ b/bin/plan/touches.py @@ -151,9 +151,12 @@ def same_part(one: Part, other: Part) -> bool: return one.name == other.name or one.name.startswith(f"{other.name}.") or other.name.startswith(f"{one.name}.") -def unpredicted(found: list[Item], release: Release) -> str | None: - """Which of release's items hold no `Touches:` list in their details, in found's order, as a clause such as ``items 3 and 7 of release 0.2.0 have no `Touches:` list``; None where each holds one. A list that cannot be read is not missing: `rank_todo.py --check` fails on that one. Nor is one its item's later edit made stale, so a list is written once.""" - missing = [str(item.id) for item in found if item.release == release and predicted(item.detail) is None] - if not missing: - return None - return f"item{'s' if len(missing) > 1 else ''} {listed(missing, 'and')} of release {version(release)} ha{'ve' if len(missing) > 1 else 's'} no `{LABEL}` list" +def unpredicted(found: list[Item], release: Release) -> list[int]: + """The IDs of release's items that hold no `Touches:` list in their details, in found's order. A list that cannot be read is not missing: `rank_todo.py --check` fails on that one. A list that a later edit of its item made stale is not missing either, so a list is written once.""" + return [item.id for item in found if item.release == release and predicted(item.detail) is None] + + +def without_a_list(ids: list[int], release: Release) -> str: + """What unpredicted found, as a clause that states it and tells the reader to do nothing, such as ``items 3 and 7 of release 0.2.0 have no `Touches:` list``.""" + several = len(ids) > 1 + return f"item{'s' * several} {listed([str(id_) for id_ in ids], 'and')} of release {version(release)} ha{'ve' if several else 's'} no `{LABEL}` list" diff --git a/bin/plan_store/todo_md.py b/bin/plan_store/todo_md.py index 26fa8925..3632d523 100644 --- a/bin/plan_store/todo_md.py +++ b/bin/plan_store/todo_md.py @@ -7,7 +7,7 @@ from plan_store.plans import cells, Plan, Written from failure import Failure from plan.todo_table import item_details, items, NoItemsTable, renames from plan_store import markdown_edits -from plan.touches import predicted, unpredicted +from plan.touches import predicted, unpredicted, without_a_list from plan import ranking from record_store.stores import RecordStore from text_files.file_writes import replace_file @@ -96,12 +96,14 @@ class FilePlan: return unranked + [f"{self.path}: {line}" for line in ranked.under_bar + unreadable_touches(texts[0])] def warnings(self) -> list[str]: - """What `rank_todo.py --check` says of the file without failing on it: which items of its earliest release hold no `Touches:` list.""" + """What `rank_todo.py --check` says of the file without failing on it: which items of its earliest release hold no `Touches:` list. + + The line states that and tells the reader to do nothing: `chunk-preflight` quotes it into every chunk's facts, and only the fact of `chunk_preflight.facts.unpredicted_lines` has a subagent write the lists.""" plan = self.read() if isinstance(plan, Failure): return [] earliest = sorted({item.release for item in plan.items})[:1] - return [f"{self.path}: warning: {missing}; write each as `~/.claude/rules/todo-items.md` says" for release in earliest if (missing := unpredicted(plan.items, release))] + return [f"{self.path}: warning: {without_a_list(missing, release)}" for release in earliest if (missing := unpredicted(plan.items, release))] def reported(self, ranked: ranking.Ranked) -> list[str]: """Ranking's notes and under-bar lines, each prefixed with the file's path, as a tool prints them on stderr.""" diff --git a/bin/test_rank_todo.py b/bin/test_rank_todo.py index ac132eef..52bb64a1 100644 --- a/bin/test_rank_todo.py +++ b/bin/test_rank_todo.py @@ -15,7 +15,7 @@ import rank_todo from todo_item.doubles import READABLE_TOUCHES, UNREADABLE_BULLETS # What --check says of plan.doubles' TODO, none of whose items of the next release, 0.1.0, holds a list. The order is the ranked table's. -UNPREDICTED = "items 4, 3, 2 and 5 of release 0.1.0 have no `Touches:` list; write each as `~/.claude/rules/todo-items.md` says" +UNPREDICTED = "items 4, 3, 2 and 5 of release 0.1.0 have no `Touches:` list" class Main(unittest.TestCase): @@ -160,7 +160,8 @@ class Main(unittest.TestCase): pathlib.Path(temp, "docs").mkdir() pathlib.Path(temp, "docs", "decisions.md").write_text(DECISIONS) self.assertEqual(self.run_main(str(todo)), (0, f"{todo}: {ranking.RESHAPE}\n")) - self.assertEqual(self.run_main("--check", str(todo))[0], 0) + # The old shape holds the items TODO does, so the check warns of the same ones, in the order ranking gives them. + self.assertEqual(self.run_main("--check", str(todo)), (0, f"{todo}: warning: {UNPREDICTED}\n")) def test_shows_a_valid_file_in_help_and_names_arguments_it_cannot_read(self): self.assertEqual(self.run_main("--help")[0], 0) diff --git a/rules/todo-items.md b/rules/todo-items.md index e05b6e90..8e0dd3ec 100644 --- a/rules/todo-items.md +++ b/rules/todo-items.md @@ -30,4 +30,4 @@ paths: - **The Exempt cell keeps an item whatever its score:** `security` for a security finding, `defect` for a 🔴 finding or an item that restores a maintain goal the project breaks today, `question` for a question only the human can answer, which ranks first in its release, `decision` for an item `docs/decisions.md` cites, `owner` for an item the human told you to keep, and, where no other reason fits, `principle` for a 🟡 finding against a file in the config's principles folder, whose item's detail names that principle. Every item `docs/decisions.md` cites carries one of these reasons. - **A maintain goal vetoes an item that breaks it,** whatever the item scores: redesign the item so it holds the goal, or drop it. - **When you remove an item that no chunk built, title the commit `Drop item : `,** or `Drop items 12, 14 and 15: ` for several. Such an item was deleted under the bar, vetoed, superseded or moot; a finished item is not one. Without the title, `score-outcomes` credits the item with the work of the chunk that removed it, where that chunk changed more than `todo.md`. -- **Predict, in the detail of each item of the next release, what the item will touch.** When you plan the next release, or file or move an item into it, give the item's detail a `Touches:` line, then one bullet per file the item will change. Each bullet names the file, then the parts of it the item will change: a function, a class or a section heading, or line ranges where the file has none of these. A path alone means the whole file. Read the code first; a prediction from the item's text alone misses. `~/.claude/bin/touch-predictions --help` shows the spelling and how a part is named; a name that holds a backtick takes a longer run of backticks with a space inside each end, as a Markdown code span does. Mark a part `(small)` where the item changes only a few lines of it. `(small)` follows a part, never a bare path. A part is a name in backticks, or `lines -`. BANNED: ``- `bin/a.py` (small)``, ``- `README.md`: loop-claude's section (small)``. GOOD: ``- `bin/a.py`: `main` (small)``, ``- `README.md`: `## Tools` (small)``. Leave out the plan and the project's records, which every chunk writes. `chunk-preflight` reads the predictions to name the items that may start chunks at once, and `touch-predictions record` keeps each beside what its chunk touched. `todo-item add`, `todo-item edit` and `rank_todo.py --check` refuse a list touch-predictions cannot read. `rank_todo.py --check` warns, without failing, of each item of the earliest release that has no list, and `chunk-preflight` names them where other items of the release wait, for a subagent to write (`CLAUDE.md` → "Working loop"). +- **Predict, in the detail of each item of the next release, what the item will touch.** When you plan the next release, or file or move an item into it, give the item's detail a `Touches:` line, then one bullet per file the item will change. Each bullet names the file, then the parts of it the item will change: a function, a class or a section heading, or line ranges where the file has none of these. A path alone means the whole file. Read the code first; a prediction from the item's text alone misses. `~/.claude/bin/touch-predictions --help` shows the spelling and how a part is named; a name that holds a backtick takes a longer run of backticks with a space inside each end, as a Markdown code span does. Mark a part `(small)` where the item changes only a few lines of it. `(small)` follows a part, never a bare path. A part is a name in backticks, or `lines -`. BANNED: ``- `bin/a.py` (small)``, ``- `README.md`: loop-claude's section (small)``. GOOD: ``- `bin/a.py`: `main` (small)``, ``- `README.md`: `## Tools` (small)``. Leave out the plan and the project's records, which every chunk writes. `chunk-preflight` reads the predictions to name the items that may start chunks at once, and `touch-predictions record` keeps each beside what its chunk touched. `todo-item add`, `todo-item edit` and `rank_todo.py --check` refuse a list touch-predictions cannot read. `rank_todo.py --check` warns, without failing, of each item of the earliest release that has no list, and `chunk-preflight` names them where the release holds other items, so that a subagent writes their lists (`CLAUDE.md` → "Working loop"). -- 2.52.0 From b8110bc4baa1cd1696a426512861a50ec14a74f3 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 27 Nov 2026 21:24:47 +0100 Subject: [PATCH 05/10] =?UTF-8?q?Answer=20product-owner=20round=201:=200?= =?UTF-8?q?=20=F0=9F=94=B4,=201=20=F0=9F=9F=A1=20(1=20misread);=20fixed=20?= =?UTF-8?q?in=20the=20stability=20round's=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From f88ce33b5111d98c70d64b59e0476cc4d708f350 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 27 Nov 2026 21:24:47 +0100 Subject: [PATCH 06/10] =?UTF-8?q?Answer=20prose=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=205=20=F0=9F=9F=A1=20(0=20misread);=20fixed=20in?= =?UTF-8?q?=20the=20stability=20round's=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 040941fc89fe373795b8dc44b3a05281516a9588 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 27 Nov 2026 21:39:04 +0100 Subject: [PATCH 07/10] =?UTF-8?q?Answer=20prose=20round=202:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=202=20=F0=9F=9F=A1=20(0=20misread);=20say=20the?= =?UTF-8?q?=20warning=20holds=20no=20instruction,=20and=20which=20line=20t?= =?UTF-8?q?he=20rule=20means?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 2 +- bin/chunk_preflight/test_chunk_preflight.py | 2 +- bin/plan/touches.py | 2 +- bin/plan_store/todo_md.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 489c3b18..b4b57204 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -14,7 +14,7 @@ How work proceeds in any repo, unless the repo's `AGENTS.md` says otherwise. The - **A client project's `CLAUDE.md` and `AGENTS.md` in its repo belong to its team.** Read both at the start of each chunk there. Propose each change that aligns them with this setup in a pull request of its own, never inside a chunk's; the one edit a chunk makes there is a decision's title in `AGENTS.md`. Until the team accepts a proposal, and after it declines or doesn't answer, follow the team's rule unless it breaks one of the project's goals. Record each such conflict as a decision in the `decisions` record, as `rules/decisions.md` asks: which rule you follow, why, and the open proposal's PR. Then nobody is asked twice. - **Read the goals file's `## Goals` and `## Audience` before starting a chunk, unless your prompt quotes them.** The chunk's items set its scope. The goals choose between ways to deliver those items, and never add to them. - **Read the plan and the decisions only as far as the chunk needs.** Where your prompt quotes `chunk-preflight`'s facts, they hold the next item's L, E + I, tagline and detail, and each item that may join it with its L, E + I, S, tagline and detail; run `todo-item` only for what they leave out. Otherwise run `~/.claude/bin/todo-item list`, which prints every item's row in the plan's order, without details. Then read the details of only the items the chunk takes, with `~/.claude/bin/todo-item show `, which prints an item's row and detail. `AGENTS.md` lists the project principles and the title of each decision no project principle covers. Read an entry in `docs/decisions.md` only where the project principle or the title leaves open what the chunk or the review needs. Print one entry with `~/.claude/bin/markdown-section `, where `` is what `~/.claude/bin/project-record open decisions` prints. -- **Where a line of `chunk-preflight`'s facts says to have one subagent write `Touches:` lists, launch it before the chunk's own work.** `rank_todo.py --check`'s warning of items with no list, which the facts also quote, doesn't call for it: only the next item's chunk gets that line, so the lists are written once. An item without a list starts no chunk beside another's. Launch the subagent on the rung "Working with the codebase" gives a subagent that files or scores plan items. It reads the code and adds a list to each named item's detail with `todo-item edit --detail`, as `~/.claude/rules/todo-items.md` says, and doesn't change anything else in the detail. Where it cannot tell which part of a file the item changes, it lists the whole file and says in the detail that the change is not predictable. It leaves alone a list an item already holds, even one a later edit of the item made stale. Where the plan is a file in the repo, it works in a worktree of its own off the default branch, and ships the plan as a pull request of its own with `chunk-pr`. +- **Where a line of `chunk-preflight`'s facts says to have one subagent write `Touches:` lists, launch it before the chunk's own work.** `rank_todo.py --check`'s warning of items with no list, which the facts also quote, doesn't call for it: only the next item's chunk gets the line that says to launch one, so the lists are written once. An item without a list starts no chunk beside another's. Launch the subagent on the rung "Working with the codebase" gives a subagent that files or scores plan items. It reads the code and adds a list to each named item's detail with `todo-item edit --detail`, as `~/.claude/rules/todo-items.md` says, and doesn't change anything else in the detail. Where it cannot tell which part of a file the item changes, it lists the whole file and says in the detail that the change is not predictable. It leaves alone a list an item already holds, even one a later edit of the item made stale. Where the plan is a file in the repo, it works in a worktree of its own off the default branch, and ships the plan as a pull request of its own with `chunk-pr`. - **Work one chunk at a time, and put every item that can share its review into it.** Every review has a fixed cost, so a chunk takes the next plan item plus every other item for which three things hold: they name one release; they fire the same review passes (`larv-review` §3); and no item outside the chunk blocks one of them. The items need not share a purpose. An item whose risk R, in the plan, is above 5 ships alone: it joins no chunk, and none joins it. The next plan item is the first that does not wait: an item waits while it is marked `question`, until the human answers, or while an item that blocks it is still in the plan. Tiny items, a few lines of change each, need not fire the same passes: bundle up to ten that name one release, and that no item outside the chunk blocks, into one chunk. Split a milestone into items in the plan before starting it. Fix a finding in the chunk's own change within the chunk. File a finding about anything else in `todo.md`. - **Ask, don't guess.** Three choices are always the human's: a goal; a release, meaning the items planned into it and when it is cut; and a change to loop-claude's routing ladder, its rungs included. Any other rule that asks the human's approval reserves that choice too. Ask about a reserved choice. For any other choice, first check whether the goals already answer it. If they nearly do, propose a change to the goals and show how it answers this case: an answer settles one question, a goal settles every question like it. Otherwise take the option you would recommend, and record it with its reason: in the item's detail, or, where it governs later work, as the next sentence says. A recommendation you can give a reason for is not a guess. Ask only where you have no recommendation. Write every answer once, where it belongs, never only in chat: a goal in the goals file, a working rule in `AGENTS.md`, a standing choice in a comment at the one place it governs, or in `docs/decisions.md` once made in more than one place. When an answer holds a goal and a choice, write the goal in the goals file, and record as a choice only what the goal leaves open. - **Bench a syntax with the people who write it.** Before a new or changed spelling of something users read or write ships — markdown, HTML, a config key, a CLI flag — a panel of fresh-context readers, seated as those users from the goals file's `## Audience`, picks it. diff --git a/bin/chunk_preflight/test_chunk_preflight.py b/bin/chunk_preflight/test_chunk_preflight.py index d2b47def..79258f38 100644 --- a/bin/chunk_preflight/test_chunk_preflight.py +++ b/bin/chunk_preflight/test_chunk_preflight.py @@ -880,7 +880,7 @@ class UnpredictedTest(unittest.TestCase): def test_says_nothing_where_every_item_of_the_release_holds_a_list(self): self.assertEqual(self.said(self.LISTED), []) - def test_names_each_item_without_a_list_where_other_items_of_the_release_wait(self): + def test_names_each_item_without_a_list_where_the_release_holds_other_items(self): self.assertEqual(self.said(self.LISTED.replace(f"\n### 7. Do it.\n{self.LIST}", "")), ['- Item 7 of release 0.2.0 has no `Touches:` list. Before the chunk, have one subagent write each missing list, as `~/.claude/CLAUDE.md` → "Working loop" says.']) self.assertEqual(self.said(TODO), ['- Items 5, 3, 7 and 8 of release 0.2.0 have no `Touches:` list. Before the chunk, have one subagent write each missing list, as `~/.claude/CLAUDE.md` → "Working loop" says.']) diff --git a/bin/plan/touches.py b/bin/plan/touches.py index 54ee99dc..862e2976 100644 --- a/bin/plan/touches.py +++ b/bin/plan/touches.py @@ -157,6 +157,6 @@ def unpredicted(found: list[Item], release: Release) -> list[int]: def without_a_list(ids: list[int], release: Release) -> str: - """What unpredicted found, as a clause that states it and tells the reader to do nothing, such as ``items 3 and 7 of release 0.2.0 have no `Touches:` list``.""" + """What unpredicted found, as a clause that states it, with no instruction to the reader, such as ``items 3 and 7 of release 0.2.0 have no `Touches:` list``.""" several = len(ids) > 1 return f"item{'s' * several} {listed([str(id_) for id_ in ids], 'and')} of release {version(release)} ha{'ve' if several else 's'} no `{LABEL}` list" diff --git a/bin/plan_store/todo_md.py b/bin/plan_store/todo_md.py index 3632d523..e5903b30 100644 --- a/bin/plan_store/todo_md.py +++ b/bin/plan_store/todo_md.py @@ -98,7 +98,7 @@ class FilePlan: def warnings(self) -> list[str]: """What `rank_todo.py --check` says of the file without failing on it: which items of its earliest release hold no `Touches:` list. - The line states that and tells the reader to do nothing: `chunk-preflight` quotes it into every chunk's facts, and only the fact of `chunk_preflight.facts.unpredicted_lines` has a subagent write the lists.""" + The line states that, with no instruction to its reader: `chunk-preflight` quotes it into every chunk's facts, and only the fact of `chunk_preflight.facts.unpredicted_lines` has a subagent write the lists.""" plan = self.read() if isinstance(plan, Failure): return [] -- 2.52.0 From 508cda57f3ec9add85b96dd7a1c0344c1bb76c7f Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 27 Nov 2026 21:39:04 +0100 Subject: [PATCH 08/10] =?UTF-8?q?Answer=20stability=20round=202:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread);=20its=20nit?= =?UTF-8?q?=20fixed=20in=20the=20prose=20round's=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From fe362cbe8ffe52f35dd6ea2e269616a9bf8fd565 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 27 Nov 2026 21:39:04 +0100 Subject: [PATCH 09/10] =?UTF-8?q?Answer=20product-owner=20round=202:=200?= =?UTF-8?q?=20=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread);=20no=20fin?= =?UTF-8?q?ding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 2abe472919b29710de2dbf60e35ff50a14358178 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 27 Nov 2026 21:41:33 +0100 Subject: [PATCH 10/10] Finish item 545 in the plan --- CHANGELOG.md | 1 + todo.md | 13 ------------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa12e9a7..c3e899a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- `chunk-preflight` names the next release's items that have no `Touches:` list, where the release holds other items, and the worker of the next item's chunk has one subagent write the lists before its chunk, so other chunks can start beside it. `rank_todo.py --check` warns of such items, still exiting 0. - Technical principles: a function keeps a copy of an argument it retains, and a size limit counts every cell the code allocates, empty ones too. - larv-review's security pass and stability-reviewer now check that the doc beside a new secret or token names what the credential can reach, such as the other repositories its owning account can use, not only what the change uses it for. - `chunk-pr` and `chunk-preflight` find a Gitea pull request however many newer ones exist, so `chunk-pr clean` and `chunk-pr merge` no longer miss an old one. diff --git a/todo.md b/todo.md index 2a1ade2f..cbe36f49 100644 --- a/todo.md +++ b/todo.md @@ -14,7 +14,6 @@ |---|---|---|---|---|---|---|---|---|---|---|---| | 477 | 0.17.0 | | question | **Rewrite `## Goals` and `## Audience` for a setup others install and run apart from their own `~/.claude`.** | 1 | 1 | 2 | 2 | 2 | | 0.0 | | 478 | 0.17.0 | | question | **Name the project, its repo and its two commands, today proposed as `do-release` and `do-epic`.** | 1 | 1 | 2 | 2 | 1 | | 0.0 | -| 545 | 0.17.0 | | | **Have chunk-preflight name each next-release item with no `Touches:` list while others wait, and have loop-claude launch a subagent that writes the lists before it starts the next chunk.** | 3 | 2 | 3 | 6 | 6 | 1.1 by 4 | 0.6 | | 544 | 0.17.0 | | | **Leave out of a `task-bench` fix a change Haiku makes to a PHP or JavaScript test that PHPUnit or `node --test` finds by a name `is_test` does not know.** | 2 | 2 | 1 | 3 | 3 | 1.1 by 1 | 0.4 | | 480 | 0.18.0 | | owner | **Resolve every path the tools use in one module: the release root (the folder the running code ships in), the config folder, the state folder and the Claude home. Then only that module names `~/.claude`, and the loop still runs from `~/.claude`.** | 3 | 2 | 3 | 6 | 6 | 1.6 by 3, code health by 3 | 2.4 | | 481 | 0.18.0 | 480 | owner | **Put the release's tools on `PATH` for every session the loop starts and every hook it runs, name them bare in the prose in place of `~/.claude/bin/`, and refuse the old spelling in new prose.** | 3 | 2 | 3 | 6 | 6 | 1.4 by 2, code health by 2 | 1.6 | @@ -114,18 +113,6 @@ Part of the standalone-install plan lilleman approved on 2026-11-20. `do-release Part of the standalone-install plan lilleman approved on 2026-11-20. Later items say `do-release` and `do-epic` for the names this item picks. The names set the install folders, such as `~/.config/do-release/`, so items 482, 485 and 496, and every item they block, wait for them. -### 545. Have chunk-preflight name each next-release item with no `Touches:` list while others wait, and have loop-claude launch a subagent that writes the lists before it starts the next chunk. - -In fejkdata on 2026-11-27 the loop ran one chunk for hours beside seven waiting items, because five items of the next release (one filed by the reading-cost report, four older) had no `Touches:` list, and `chunk-preflight` says only "No item may start a chunk beside item X's: its detail has no `Touches:` list". Nothing makes a session write the lists, and `rank_todo.py --check` refuses only a list it cannot read. - -Three changes: - -- `chunk-preflight` prints one fact where an item of the next release has no `Touches:` list and at least one other item of that release waits, naming the items. A release with one item left prints nothing. -- `loop-claude` acts on the fact before it starts the next chunk: it launches one subagent, on the rung `CLAUDE.md`'s delegation rule gives a subagent that files or scores items, to read the code and write each missing list with `todo-item edit --detail`. Where the subagent can't name a part, it lists the whole file and says in the detail that the change is not predictable. The plan edit ships as its own pull request with `chunk-pr`, as plan-only changes do. A list is written once per item and not again until the item is edited. -- `rank_todo.py --check` warns, without failing, on an item of the next release with no `Touches:` list. - -Test each with a fake plan: all lists present, one missing with other items waiting, one missing alone in its release, and a list the item's edit made stale is left alone. - ### 544. Leave out of a `task-bench` fix a change Haiku makes to a PHP or JavaScript test that PHPUnit or `node --test` finds by a name `is_test` does not know. PHPUnit finds a test by `*Test.php`, wherever it stands, and `node --test` also by `*-test.js`, `*_test.js`, `test-*.js` and `test.js`, with `.ts`, `.mjs` and `.cjs` alike. `mutate_changes.changed_lines.is_test` tells a test by a folder named `test`, `tests` or `__tests__`, or by a name such as `*.test.*`, so `src/PickTest.php` and `src/pick-test.js` count as code. `checked_tree` in `bin/task_bench/runs.py` then takes such a file as Haiku left it, so a fix that edits or deletes the failing test passes, at both sides alike, and `place_files` in `bin/task_bench/bugs/plant.py` may hand the file to the mutation tool as code. The help's Check paragraph says so. -- 2.52.0