Compare commits

...

9 Commits

Author SHA1 Message Date
lilleman 5f47b4e1d5 Drop item 277, as the human chose
CI / tests (pull_request) Successful in 2m45s
2026-11-10 21:14:55 +01:00
lilleman ed0fea8eef Answer product-owner round 1: 0 🔴, 0 🟡 (0 misread); the ❓ on the other files is answered in the PR summary
CI / tests (pull_request) Successful in 2m10s
2026-11-10 11:26:05 +01:00
lilleman b195ba8bf1 Answer prose round 1: 0 🔴, 1 🟡 (0 misread); the changelog bullet states what holds 2026-11-10 11:26:05 +01:00
lilleman 7143c9daad Reset the reading-cost trend after item 286
CI / tests (pull_request) Successful in 2m9s
2026-11-10 11:24:57 +01:00
lilleman cfd3008615 Give the test commands their own README section 2026-11-10 11:24:44 +01:00
lilleman 41b91e2265 Answer prose round 1: 0 🔴, 0 🟡 (0 misread); clean
CI / tests (pull_request) Successful in 2m10s
2026-11-10 11:18:53 +01:00
lilleman 968f22b5ae Answer stability round 1: 0 🔴, 0 🟡 (0 misread); the 🟢 on a detached-HEAD test predates this change and is declined 2026-11-10 11:18:53 +01:00
lilleman 23381b08eb Answer security round 1: 0 🔴, 0 🟡 (0 misread); clean 2026-11-10 11:18:53 +01:00
lilleman 509804da0d Read the branch's reflog in rule-hook overrides when a path shares its name
CI / tests (pull_request) Successful in 2m11s
2026-11-10 11:17:17 +01:00
7 changed files with 65 additions and 40 deletions
+2
View File
@@ -2,6 +2,8 @@
## Unreleased
- README's test, CI and mutation-test commands now have their own section, README → Test.
- `rule-hook overrides` now lists the chunk's overrides when a file or folder shares the branch's name. It used to exit saying it could not read the reflog.
- `chunk-pr clean` removes a merged chunk's worktree and local branch and fast-forwards the main checkout. It leaves a main checkout with uncommitted files, another branch or commits of its own as it was, and says why.
- `review-replay` now replays each round at the commit with the newest author time at or before the round's time, and takes the clone's base the same way by the time the chunk began. It took the first such commit in log order, so a commit authored early but merged late, such as a dependency bump, could win over the commits the round reviewed.
- The shared goal every project pursues, code health, now asks that code stay easy to read, change safely and debug, tomorrow and after seven years of development.
+19 -17
View File
@@ -113,23 +113,6 @@ Install puts only `loop-claude` and `loop-inbox` on `PATH`; call the others by t
- `subagent-rung [--plan] <model> <L>` prints the Agent tool's model and effort for a subagent's task, picked by its L from the project's model, and with `--plan` never below the project's rung; `subagent-rung --help` states the rule.
- `todo-item add …` files an item in a project's `todo.md`, taking `Next ID` as the item's ID, and `todo-item finish <ID>` removes a finished item and adds the bullet passed with `--changelog` to `CHANGELOG.md`; both rank the file, and `todo-item --help` states the flags.
Test on the host with `uvx --python "$(command -v python3)" --with pytest-xdist==3.8.0 pytest==9.2.0 -n 4 bin`. It needs `uv` on `PATH`, which fetches pytest, pytest-xdist and mypy. pytest-xdist runs the tests in four workers, one heavy slot's CPUs (`docs/decisions.md` → `bin/: the tools support only the latest stable Python, …`). `python3 -m unittest discover -s bin -p 'test_*.py'` runs the same tests one at a time. Test the bench's scripts with `python3 -m unittest discover -s workflow-bench -p 'test_*.py'`.
CI runs `ci.sh` on every pull request, and `main` merges nothing until it passes. The script runs the same tests on the committed HEAD in a pinned Python container; run it under `run-heavy` to reproduce a CI failure, with Docker on `PATH`.
To mutation-test a changed module, copy `bin/` to a scratch directory (`cp -r bin "$scratch"`): mutmut writes files beside its config. In the copy, name the module and its tests in a `setup.cfg`, as below for `score_outcomes/results.py`. Leave out each test class that starts a tool's launcher through `subprocess`: a mutated module fails to load in a process mutmut did not start.
```ini
[mutmut]
source_paths=score_outcomes/results.py
also_copy=.
pytest_add_cli_args_test_selection=score_outcomes/
pytest_add_cli_args=-k
not ScoreOutcomesTool
```
Then, in the copy: `uvx --with pytest==9.2.0 'mutmut>=3,<4' run && uvx --with pytest==9.2.0 'mutmut>=3,<4' results`, and `uvx --with pytest==9.2.0 'mutmut>=3,<4' show <mutant>` to see a mutant's change. The config keys are mutmut 3's.
`bin/` is the import root: each launcher puts it on `sys.path`, so a module imports another by its path under `bin/`, such as `from claude_code.entries import parse_entry`. Each tool's package holds its tests. Beside the packages, `bin/`'s root holds only the launchers, the tools of one file with their tests, `test_env.py` and `failure.py`. `failure.py`'s `Failure`, which modules across `bin/` return for a failed step, belongs to no single package. `branch_chunks/`, `claude_code/`, `command_lines/`, `git_cli/`, `machine_load/`, `model_routing/`, `records/`, `release_plan/`, `review_rules/`, `rung_replay/` and `transcript_archive/` serve more than one tool.
- `branch_chunks/` cuts a default branch into chunks and finds, for each, the items it shipped and the later chunks that fixed its code, for `score_outcomes` and `routing_figures`. It imports `reading_cost`'s record path.
@@ -152,6 +135,25 @@ Then, in the copy: `uvx --with pytest==9.2.0 'mutmut>=3,<4' run && uvx --with py
- `test_env.py` serves the tests.
- `transcript_archive/` stores loop-claude's transcripts. Its `project_key.py` names each project's archive folder, loop-claude session and models-file entry.
## Test
Test on the host with `uvx --python "$(command -v python3)" --with pytest-xdist==3.8.0 pytest==9.2.0 -n 4 bin`. It needs `uv` on `PATH`, which fetches pytest, pytest-xdist and mypy. pytest-xdist runs the tests in four workers, one heavy slot's CPUs (`docs/decisions.md` → `bin/: the tools support only the latest stable Python, …`). `python3 -m unittest discover -s bin -p 'test_*.py'` runs the same tests one at a time. Test the bench's scripts with `python3 -m unittest discover -s workflow-bench -p 'test_*.py'`.
CI runs `ci.sh` on every pull request, and `main` merges nothing until it passes. The script runs the same tests on the committed HEAD in a pinned Python container; run it under `run-heavy` to reproduce a CI failure, with Docker on `PATH`.
To mutation-test a changed module, copy `bin/` to a scratch directory (`cp -r bin "$scratch"`): mutmut writes files beside its config. In the copy, name the module and its tests in a `setup.cfg`, as below for `score_outcomes/results.py`. Leave out each test class that starts a tool's launcher through `subprocess`: a mutated module fails to load in a process mutmut did not start.
```ini
[mutmut]
source_paths=score_outcomes/results.py
also_copy=.
pytest_add_cli_args_test_selection=score_outcomes/
pytest_add_cli_args=-k
not ScoreOutcomesTool
```
Then, in the copy: `uvx --with pytest==9.2.0 'mutmut>=3,<4' run && uvx --with pytest==9.2.0 'mutmut>=3,<4' results`, and `uvx --with pytest==9.2.0 'mutmut>=3,<4' show <mutant>` to see a mutant's change. The config keys are mutmut 3's.
## Tracking a new file
`.gitignore` is an allowlist. Track a file by negating it and its parent directories, then confirm with `git check-ignore -v <path>`:
+1 -1
View File
@@ -95,7 +95,7 @@ def print_overrides(directory: str) -> int:
return 1
found = guarded_git(directory, "branch", "--show-current")
branch = found if isinstance(found, str) and found else "HEAD"
reflog = guarded_git(directory, "reflog", "show", "--format=%H", branch)
reflog = guarded_git(directory, "reflog", "show", "--format=%H", branch, "--")
head = guarded_git(directory, "rev-parse", "HEAD")
unread = unread_reflog(reflog, head)
if unread:
+9
View File
@@ -682,6 +682,15 @@ class Hook(unittest.TestCase):
git(self.repo, "branch", "-m", "renamed")
self.assertIn("\timage-pin\t", self.listed(), "the reflog keeps the amended commit")
def test_a_folder_named_like_the_branch_doesn_t_hide_the_overrides(self):
os.mkdir(f"{self.repo}/chunk")
pathlib.Path(self.repo, "chunk", "notes.md").write_text("x\n", encoding="utf-8")
git(self.repo, "add", "chunk")
git(self.repo, "commit", "-q", "-m", "a folder named like the branch")
content = "# rule-override image-pin: the vendor tags no patch versions\nFROM vendor/tool:2\n"
hook({"cwd": self.repo, "tool_input": {"file_path": f"{self.repo}/Dockerfile", "content": content}, "tool_name": "Write"}, self.repo)
self.assertIn("\timage-pin\t", self.listed())
def test_an_unreadable_reflog_fails_the_listing(self):
unborn = tempfile.mkdtemp()
self.addCleanup(subprocess.run, ["rm", "-rf", unborn])
+1 -1
View File
@@ -288,7 +288,7 @@ A trial checked that it keeps goal 1.1. It replayed the 6 latest first rounds th
2026-10-13, lilleman through todo item 108, implemented by claude. Serves goals 1.1 and 1.4. Coverage counts the lines a test runs, so a test without a meaningful assertion still raises it. A surviving mutant shows a test that would let behaviour break. Every mutant of an untested changed line survives, so mutation testing of the changed lines also shows what a coverage drop on them would. Coverage would also catch a deleted test; the stability reviewer sees one in the diff without it. Measuring coverage beside it would add cost without raising quality, so todo item 69 was dropped and `principles/technical-principles.md` replaced "Test coverage should not decline" with the mutant rule.
The reviewer limits each run to the changed lines, so its cost grows with the chunk. The tools are widely deployed, each with its own way to limit a run to a diff: cargo-mutants `--in-diff` (https://mutants.rs/in-diff.html), Infection `--git-diff-lines` (https://infection.github.io/guide/command-line-options.html), Stryker's mutation ranges (https://stryker-mutator.io/docs/stryker-js/configuration/). mutmut has no such option, so the reviewer mutates the changed files and keeps the mutants on changed lines. On 2026-10-13 mutmut 3 ran on this repo's `larv_review/rounds.py` in under two seconds, set up as README → "Tools" says.
The reviewer limits each run to the changed lines, so its cost grows with the chunk. The tools are widely deployed, each with its own way to limit a run to a diff: cargo-mutants `--in-diff` (https://mutants.rs/in-diff.html), Infection `--git-diff-lines` (https://infection.github.io/guide/command-line-options.html), Stryker's mutation ranges (https://stryker-mutator.io/docs/stryker-js/configuration/). mutmut has no such option, so the reviewer mutates the changed files and keeps the mutants on changed lines. On 2026-10-13 mutmut 3 ran on this repo's `larv_review/rounds.py` in under two seconds, set up as README → "Test" says.
The run has no time cap. Limiting it to the changed lines already bounds it by the chunk's size, and no published standard gives a cap to copy. Each run's wall time in the reviewer's report shows when the premise below fails.
+33
View File
@@ -1470,3 +1470,36 @@ Read most (opens and searches):
- `bin/review-replay` 1
- `bin/review_replay/rounds.py` 1
- `bin/review_replay/test_review_replay.py` 1
## Reading cost, chunk cd3529c360f1, finished 2026-11-10T10:16:31Z
62832 new input tokens before the first commit.
Read most (opens and searches):
- `README.md` 2
- `bin/chunk_pr/main.py` 2
- `bin/chunk_pr/test_chunk_pr.py` 2
- `skills/larv-review/SKILL.md` 2
- `CLAUDE.md` 1
- `bin/chunk-pr` 1
- `bin/deploy_release/forge.py` 1
- `bin/git_cli/test_git_repo.py` 1
- `bin/test_env.py` 1
- `ci.sh` 1
## Reading cost, chunk 28ce38e83321, finished 2026-11-10T10:22:17Z
45353 new input tokens before the first commit.
Read most (opens and searches):
- `todo.md` 5
- `bin/rule_hook/test_rule_hook.py` 3
- `bin/rule_hook/override_log.py` 2
- `AGENTS.md` 1
- `CHANGELOG.md` 1
- `README.md` 1
- `docs/decisions.md` 1
## Reading cost reset, 2026-11-10T10:24:57Z
-21
View File
@@ -12,10 +12,7 @@
| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 277 | 0.7.0 | | question | **Map the size of the code an item names onto S, on a scale the human picks, and have `score-outcomes` print that S for the item being scored and for each finished item it lists.** | 3 | 2 | 2 | 5 | 4 | 1.1 by 4, 1.4 by 3 | 2.4 |
| 1 | 0.7.0 | | question | **Say in README → Install how the transcript archive is backed up, once bender-infra backs up ai-sandbox's data volume.** | 1 | 2 | 1 | 2 | 1 | | 0.0 |
| 290 | 0.7.0 | | defect | **Have `rule-hook overrides` read the branch's reflog when a file or folder shares the branch's name.** | 1 | 2 | 2 | 3 | 1 | 1.1 by 2 | 1.0 |
| 286 | 0.7.0 | | | **Lower the reading cost of the files a chunk reads most before its first commit.** | 3 | 2 | 2 | 5 | 5 | 1.4 by 4 | 1.0 |
| 287 | 0.8.0 | | | **Move the forge helpers `Forge`, `forge_of`, `runner`, `open_pull`, `merged_pull`, `pull_at` and `gitea` into one module that `chunk_preflight`, `chunk_pr`, `deploy_release` and `larv_review` all import from, so no tool imports another tool's internals for them.** | 3 | 1 | 3 | 5 | 5 | code health by 3 | 3.4 |
| 284 | 0.8.0 | | owner | **Script each step that 0.7.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.** | 1 | 2 | 1 | 2 | 2 | 1.4 by 3, 1.5 by 3 | 2.6 |
| 288 | 0.8.0 | | | **Point the two reading-cost decisions at code health and goal 1.4's counter-signal, in place of the goal 1.1 they cite.** | 1 | 2 | 1 | 2 | 1 | code health by 1, 1.4 by 1 | 2.6 |
@@ -55,14 +52,6 @@
## Details
### 277. Map the size of the code an item names onto S, on a scale the human picks, and have `score-outcomes` print that S for the item being scored and for each finished item it lists.
Item 113 shipped the figure: beside each finished item it lists, `score-outcomes` prints how many tracked files the item's tagline or detail names in backticks, as full paths from the repo root with a folder counting the files it holds, and how many lines they held before its chunk. It maps nothing onto S's 1 to 10 scale, prints nothing for the item being scored, and counts a unit named without its file, such as a function, as nothing.
Question for the human: which scale maps named lines to S? No published scale maps lines to S, so the threshold is yours (`CLAUDE.md` → "Web research"). One option, from this repo's data: give the S whose finished items' median lines changed sits nearest the named lines. On 2026-11-08 those medians were S 1 → 11, 2 → 36, 3 → 83, 4 → 219, 5 → 370, 6 → 848. A named file's size bounds a change only loosely: item 84 named files holding 2422 lines and changed 227, and item 132 named 385 and changed 2.
Find units named without their file too, such as a function in backticks, and count the lines of the file that defines each. Once `score-outcomes` prints the S, point `~/.claude/rules/todo-items.md`'s S rule (→ "Score L, E and I against the project's anchors") at it, so a scorer sets S from the figure.
### 1. Say in README → Install how the transcript archive is backed up, once bender-infra backs up ai-sandbox's data volume.
It lives under `~/.claude`, which `.gitignore` keeps from the remote, so a lost disk loses every unattended run's record. Back it up only to a destination private to me and encrypted at rest: the worker runs with permissions bypassed, so the archived tool results can hold credentials it read.
@@ -71,16 +60,6 @@ It lives under `~/.claude`, which `.gitignore` keeps from the remote, so a lost
The README line covers the bench's transcripts in `workflow-bench/logs/` too (goal 3).
### 290. Have `rule-hook overrides` read the branch's reflog when a file or folder shares the branch's name.
`bin/rule_hook/override_log.py:98` runs `git reflog show --format=%H <branch>` without a `--` after the branch. When a tracked path has the branch's name, git stops with "ambiguous argument … both revision and filename", and `rule-hook overrides` exits saying it cannot tell which overrides are the chunk's. larv-review's Overrides pass then has no list to judge, so an override in such a chunk would go unreviewed. Found on 2026-11-09 in PR #456, whose branch and new folder were both `reviewer-merge-trials`. Fix by passing `--` after the branch, and test it with a branch named after a tracked folder.
### 286. Lower the reading cost of the files a chunk reads most before its first commit.
`reading-cost` reports Rising: the last five chunks' median is 151,930 new input tokens before the first commit, against 103,215 for the five before them. Those five chunks opened or searched these files most: `todo.md` 42 times, `README.md` 16, `docs/decisions.md` 12, `AGENTS.md` 10, `bin/rank_todo.py` 9, `bin/release_plan/ranking.py` 8, `docs/reading-cost.md` 8, `CHANGELOG.md` 7, `rules/todo-items.md` 7 and `bin/rule_hook/test_rule_hook.py` 6.
Item 285 removed the `todo.md` reads for a joining item's detail; the rest are for edits. Find why a worker opens each of them before its first commit, and cut that cause, such as a test file too large to read in parts.
### 287. Move the forge helpers `Forge`, `forge_of`, `runner`, `open_pull`, `merged_pull`, `pull_at` and `gitea` into one module that `chunk_preflight`, `chunk_pr`, `deploy_release` and `larv_review` all import from, so no tool imports another tool's internals for them.
Today the helpers live in two tools. `Forge` is defined in `bin/chunk_preflight/gathered.py` and imported by `bin/chunk_preflight/choices.py`, `bin/chunk_preflight/facts.py`, `bin/chunk_preflight/main.py` and `bin/chunk_pr/main.py`, and again through `choices` by `bin/deploy_release/forge.py`. `forge_of` lives in `choices.py`, which `bin/chunk_pr/main.py`, `bin/deploy_release/cut.py` and `bin/larv_review/reviewer_header.py` import. `open_pull`, `runner` and `gitea` live in `bin/deploy_release/forge.py`, which `bin/chunk_pr/main.py` and `bin/larv_review/reviewer_header.py` import. So `deploy_release` imports `chunk_preflight`, and `chunk_pr` and `larv_review` import both.