From 51b10aaf4129d30e92a15c42bb468661d9680eaf Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 18 Nov 2026 17:28:45 +0100 Subject: [PATCH 1/3] File items 428 to 438: principle and review changes brought back from a client setup --- todo.md | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 136 insertions(+), 1 deletion(-) diff --git a/todo.md b/todo.md index 5fdea232..30f76b58 100644 --- a/todo.md +++ b/todo.md @@ -6,7 +6,7 @@ `Bar = 0.1` -`Next ID = 428` +`Next ID = 439` ## Items @@ -21,15 +21,26 @@ | 418 | 0.12.0 | 415 | | **Describe do-epic in `README.md`'s tools and setup, with its machine settings and `repo-rule.md`.** | 1 | 2 | 1 | 2 | 2 | 1 by 5 | 2.1 | | 400 | 0.12.0 | | | **Forbid a test that decides at run time whether to check anything in `principles/technical-principles.md`, and point stability-reviewer's Tests checks at it.** | 1 | 2 | 3 | 4 | 2 | 1.1 by 5 | 2.0 | | 420 | 0.12.0 | | | **End a worker that printed its final result and lingers, by killing the background shells it left, after a few minutes, and print each kill with its evidence on loop-claude's terminal.** | 2 | 2 | 2 | 4 | 3 | 1.5 by 6 | 2.0 | +| 429 | 0.12.0 | | | **Open a chunk's pull request only once its local review is done, where the repo's CI runs on pushed branches, and keep the draft-first order where CI runs only on pull requests.** | 3 | 2 | 3 | 6 | 4 | 1.1 by 3, 1.6 by 4 | 2.0 | +| 433 | 0.12.0 | | | **Let a project's config name a team's convention files in a `conventions` setting, which every reviewer reads beside the principles and standards, the team's rule winning where they conflict.** | 2 | 2 | 3 | 5 | 3 | 1.6 by 6 | 2.0 | | 409 | 0.12.0 | | | **Split an epic item that changes several repos into one Jira sub-task per repo, each labelled for its repo, with the parent tracking the whole change, when do-epic plans the item.** | 2 | 2 | 3 | 5 | 3 | 1 by 5 | 1.9 | | 411 | 0.12.0 | 410 | | **Park a chunk whose PR waits on a long gate, keeping its worktree, PR and session in a state file that survives a reboot, and resume its session when the gate passes or a reviewer comments.** | 3 | 2 | 3 | 6 | 5 | 1 by 5 | 1.2 | | 412 | 0.12.0 | 410, 411 | | **Print each chunk of an epic, running, parked with its gate and since when, or stopped, each human task and each open interrupt with `do-epic --status`, and name a parked chunk's gate in its tmux window's name.** | 2 | 1 | 1 | 2 | 3 | 1 by 5 | 1.9 | | 414 | 0.12.0 | 410 | | **DM the human through the notifier when a human-task issue blocks the epic's next item, and poll until it closes.** | 2 | 2 | 2 | 4 | 3 | 1 by 5 | 1.9 | | 417 | 0.12.0 | 410 | | **Run do-epic end to end against a sandbox epic on a real Jira site with a command of its own, outside `run-tests`.** | 2 | 1 | 1 | 2 | 3 | 1 by 5 | 1.9 | +| 430 | 0.12.0 | | | **Hold tests on a shared environment to five rules in the principles' "Tests and tooling": assert only on named records, touch only owned state, survive any order and a concurrent copy, register teardown before creating, and check what a save stored.** | 1 | 2 | 3 | 4 | 2 | 1.1 by 4 | 1.6 | | 421 | 0.12.0 | | | **Refuse in rule-hook a Bash or Monitor wait that has no end: a loop without a time or count cap, and a `pgrep -f` or `pkill -f` whose pattern the same command line contains.** | 2 | 2 | 3 | 5 | 3 | 1.5 by 4 | 1.3 | +| 432 | 0.12.0 | | | **Have stability-reviewer check, for a change that stores a value differently, that its longest value fits the column and that every search on the column still finds what users type.** | 1 | 2 | 3 | 4 | 1 | 1.1 by 3 | 1.3 | +| 436 | 0.12.0 | | | **Add the principle "Never mock a service your own team runs": test its seam against the real build, and mock only a third party that can't be run locally.** | 1 | 2 | 3 | 4 | 1 | 1.1 by 3 | 1.3 | +| 434 | 0.12.0 | | | **File a plan item to add the language's mutation tool, pinned to a version that supports the project's language version, when `mutate-changes` reports changed files no tool covers.** | 2 | 2 | 3 | 5 | 2 | 1.1 by 3 | 1.2 | | 316 | 0.12.0 | | | **Launch comprehension seats as an agent type of their own under `agents/`, without `CLAUDE.md` and the skill and agent listings a general-purpose subagent carries.** | 2 | 2 | 2 | 4 | 3 | 1.4 by 3 | 1.0 | +| 431 | 0.12.0 | | | **Give "Make invalid states unrepresentable" an example about a function's inputs, and the rule to change a signature once review finds a second edge case in a check.** | 1 | 2 | 3 | 4 | 1 | 1.1 by 2 | 0.9 | +| 438 | 0.12.0 | | | **Add the principle "Don't loosen a type when refactoring": a function keeps its concrete return type, and a DTO or value object replaces an `object`, `array`, `mixed` or `any`.** | 1 | 2 | 3 | 4 | 1 | 1.1 by 2 | 0.9 | | 310 | 0.12.0 | | | **Compact a waiting worker's session shortly before its prompt cache expires, only when the human has not answered an interrupt by then.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 3 | 0.9 | | 422 | 0.12.0 | 420 | | **Check every 5 minutes whether a tmux window of the loop looks stuck by other signs than a lingering worker, investigate it with a headless claude, and kill only the process the investigation names.** | 3 | 2 | 3 | 6 | 5 | 1.5 by 4 | 0.8 | +| 428 | 0.12.0 | | | **Split the technical principles into blocking rules and rules of thumb, map a breach of a rule of thumb to 🟡, and add "keep each pull request as small as its chunk allows" to that tier.** | 2 | 2 | 3 | 5 | 3 | 1.1 by 2 | 0.7 | +| 435 | 0.12.0 | | | **Count rounds, diff for review and find the pull request against a stacked branch's own base, in larv-review, rule-hook's round cap, mutate-changes and chunk-pr.** | 3 | 2 | 3 | 6 | 6 | 1.6 by 3, 1.5 by 2 | 0.7 | +| 437 | 0.12.0 | 428 | | **Add "Coverage doesn't fall" to the rules of thumb, as a 🟡 where a change deletes or skips tests of code it keeps, measured only where CI already reports coverage.** | 1 | 2 | 3 | 4 | 1 | 1.1 by 1 | 0.4 | | 365 | 0.13.0 | | | **Have `score-outcomes` read the finished and dropped items of a plan outside the checkout, from the project repo's history or from Jira's issue changelogs.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.1 by 2 | 1.2 | | 368 | 0.13.0 | | | **Call a release review due, call a release ready to cut, and tell whether a chunk owes a scoring run, for a plan outside the checkout, from the project repo's history or from Jira.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.1 by 2 | 1.2 | | 309 | 0.13.0 | | | **Run a scoring run's second pass on one head with two seats in place of four, once `larv-review agreement` shows the seats agree with each other more than a run agrees with its rerun.** | 2 | 2 | 2 | 4 | 2 | 1.4 by 3 | 1.2 | @@ -192,6 +203,31 @@ Touches: - `bin/loop_claude/loop/lingering_workers.py` - `README.md`: `## Tools` (small) +### 429. Open a chunk's pull request only once its local review is done, where the repo's CI runs on pushed branches, and keep the draft-first order where CI runs only on pull requests. + +Today larv-review §2 opens a draft pull request first, so CI cycles while the review runs. A forge's auto-reviewer reviews drafts too, and human reviewers see them, so outside findings land before any of our own passes have run. In a client's chunk that put about six findings on the forge that our own passes would have caught. Nothing in larv-review needs a pull request before the gate: `reviewer-header` prints `PR: none open at the pushed head`, and round counts read commit titles. + +Where the repo's CI runs on pushed branches: push early, so CI runs; run `chunk-pr open` once every §3 pass is done and §2's tests, static analysis and mutation tests pass; mark it ready at once. Where CI runs only on pull requests, keep today's draft-first order. Decide from the repo's CI config which case holds, and say in the summary which order the chunk took. + +Item 419 runs the auto-reviewer until clean; this item makes its first review see a change our passes already cleaned. + +Touches: +- `skills/larv-review/SKILL.md`: `## 2. Ship the branch`, `## 4. Gate` +- `bin/chunk_pr/main.py`: `opened` (small) +- `bin/chunk_pr/test_chunk_pr.py` + +### 433. Let a project's config name a team's convention files in a `conventions` setting, which every reviewer reads beside the principles and standards, the team's rule winning where they conflict. + +Today a team's conventions reach the reviewers only by hand, and copying them into claude-config's standards would drift. Add an optional `conventions` setting: a list of paths, in the same path syntax as the other settings, such as `checkout:CONVENTIONS.md`. `reviewer-header` prints them, every reviewer reads them beside the principles and the standards, and the team's rule wins where the two conflict, as `CLAUDE.md` → "A client project's `CLAUDE.md` and `AGENTS.md`" already has it for those files. A missing file fails as an empty principles folder does today. + +Touches: +- `bin/project_config/settings.py`: `SETTINGS` +- `bin/project_config/test_project_config.py` +- `bin/larv_review/reviewer_header.py` +- `bin/larv_review/test_larv_review.py` +- `skills/larv-review/SKILL.md`: `### Principles` (small) +- `README.md`: `## Install` (small) + ### 409. Split an epic item that changes several repos into one Jira sub-task per repo, each labelled for its repo, with the parent tracking the whole change, when do-epic plans the item. do-epic predicts the repos from the code, as `Touches:` predictions are made. A person's issue is split too, with a comment for the team in the epic's language (`docs/decisions.md` → `do-epic: drives one Jira epic …`). The parent is finished once every sub-task is. @@ -243,6 +279,22 @@ Touches: - `bin/do-epic-e2e` - `bin/do_epic/e2e/` +### 430. Hold tests on a shared environment to five rules in the principles' "Tests and tooling": assert only on named records, touch only owned state, survive any order and a concurrent copy, register teardown before creating, and check what a save stored. + +A test that runs against a shared environment, such as a staging database or a shared queue, meets other runs' data. Add to the "Tests and tooling" bullet under "Compose, do not entangle": + +- Assert only on records the test created and can name, never on a count or on the first row. +- Never change state the test doesn't own. +- Pass in any order, and beside a second copy of itself running at the same time. +- A test helper registers its teardown before it creates anything, keyed by a value the helper made itself, and the teardown deletes only what it can name. +- A helper that saves checks what was saved, never the status code alone. + +Give one BANNED/GOOD pair for each. These come from a client team's conventions and one of its reviews; state them in our own words, naming neither. + +Touches: +- `principles/technical-principles.md`: `Compose, do not entangle`, `Most, if not all, code should have automated tests, and each test earns its keep.` +- `agents/stability-reviewer.md`: `### 11. Tests` (small) + ### 421. Refuse in rule-hook a Bash or Monitor wait that has no end: a loop without a time or count cap, and a `pgrep -f` or `pkill -f` whose pattern the same command line contains. On 2026-11-18 a worker in the item 402 chunk started `until [ -s /tmp/merge-402.log ] && ! pgrep -f "chunk-pr merg"; do sleep 15; done` in the background. The `pgrep -f` pattern is part of the loop's own command line, so it matched itself and the loop never ended; the worker's `claude -p` waited on it for 95 minutes and its slot started no new chunk (item 420 ends such a worker; item 422 handles other stuck windows). A wait that cannot end is cheaper to refuse before it starts. @@ -260,6 +312,33 @@ Touches: - `bin/rule_hook/test_rule_hook.py`: `CommandBreaches` (small) - `settings.json` +### 432. Have stability-reviewer check, for a change that stores a value differently, that its longest value fits the column and that every search on the column still finds what users type. + +A change that escapes, converts or grows a stored value: the longest value it can now write must fit the column, and every search, filter or comparison on the column must still find what users type. In a client's chunk, escaping text into a TEXT column lowered its overflow limit fivefold, and a LIKE search stopped matching apostrophes. Product-owner and the auto-reviewer caught it; stability didn't. + +It goes in stability-reviewer's "Data Integrity & Persistence" checks, beside the one on a new column, since it is a check a reviewer runs on a change, not a design rule, and the agent is shared by every project. + +Touches: +- `agents/stability-reviewer.md`: `### 7. Data Integrity & Persistence` (small) + +### 436. Add the principle "Never mock a service your own team runs": test its seam against the real build, and mock only a third party that can't be run locally. + +Today the principles say to mock only slow, nondeterministic or external edges, which leaves room to mock a service the team itself runs; such a mock drifts from the real service unseen. Add: test the seam to a service your team runs against its real build, in a harness that runs the real stack. Mock only a third party that can't be run locally in a reasonable way. + +Recommended scope: the rule binds the test that covers the seam. A unit test of the caller's own logic may still use a fake, as "Use real collaborators or fakes" allows, so the lowest-level rule still holds. + +Touches: +- `principles/technical-principles.md`: `Most, if not all, code should have automated tests, and each test earns its keep.` (small) + +### 434. File a plan item to add the language's mutation tool, pinned to a version that supports the project's language version, when `mutate-changes` reports changed files no tool covers. + +`mutate-changes` prints a line naming the changed files in a language no tool covers. Today that line goes to the stability reviewer, which then hunts mutants by hand. In a client's PHP chunk without Infection, three findings were surviving mutants a tool would have reported before review. + +On that line, larv-review §2 files a plan item, or refreshes the one an earlier chunk filed, to add the language's mutation tool to the project, with a pinned version that supports the project's language version. In a plan kept in Jira that is a ticket for the team. + +Touches: +- `skills/larv-review/SKILL.md`: `## 2. Ship the branch` (small) + ### 316. Launch comprehension seats as an agent type of their own under `agents/`, without `CLAUDE.md` and the skill and agent listings a general-purpose subagent carries. Seats run as general-purpose subagents, so each starts with the skill and agent listings, about 7,500 tokens, at $9.00 per 1,000 prefix tokens over the archive measured from 2026-09-30 to 2026-11-11: about 1.3% of spend. An agent under `agents/` with Read, Grep, Glob and Bash, `omitClaudeMd: true`, and the seat's persona in its prompt drops both; a seat reads the project as a newcomer does, which is what it simulates. Keep each seat's prompt from `skills/comprehension-panel/seat-prompts.md`. Check that a scoring run's scores on one head stay within the spread two runs of today's seats show. lilleman approved on 2026-11-11. @@ -275,6 +354,23 @@ Touches: - `bin/rule_hook/test_rule_hook.py`: `ReviewerRung` - `bin/larv_review/test_scoring_setup.py` +### 431. Give "Make invalid states unrepresentable" an example about a function's inputs, and the rule to change a signature once review finds a second edge case in a check. + +The principle's only example is a database time type, so in a client's chunk neither the implementer nor the reviewers connected it to a test helper that validated its own caller's input, over four review rounds. Add: + +- BANNED: a helper that takes a token and a message, and checks that the message holds the token. GOOD: the helper makes the token and builds the message. +- "When a review finds a second edge case in a check, change the signature so the input can't occur." + +Touches: +- `principles/technical-principles.md`: `Make invalid states unrepresentable.` (small) + +### 438. Add the principle "Don't loosen a type when refactoring": a function keeps its concrete return type, and a DTO or value object replaces an `object`, `array`, `mixed` or `any`. + +A function that returned a concrete type keeps returning it when its implementation changes: never degrade it to `object`, `array`, `mixed` or `any`. Introduce a DTO or value object instead. From a client team's PHP conventions, but it holds in any typed language. Add it under "Validate data and build DTOs as early as possible.", with one BANNED/GOOD pair. + +Touches: +- `principles/technical-principles.md`: `Validate data and build DTOs as early as possible.` (small) + ### 310. Compact a waiting worker's session shortly before its prompt cache expires, only when the human has not answered an interrupt by then. 281 worker resumes after the 1-hour cache expired rewrote a whole context, $379 of the $9,154 measured from 2026-09-30 to 2026-11-11 (4.1%). A compaction while the cache is warm reads the context at a twentieth of the input price and leaves about 20k tokens to rewrite later. @@ -306,6 +402,45 @@ Touches: - `bin/agent_cycle/tmux.py`: `Listed`, `listed` - `README.md`: `## Tools` (small) +### 428. Split the technical principles into blocking rules and rules of thumb, map a breach of a rule of thumb to 🟡, and add "keep each pull request as small as its chunk allows" to that tier. + +Today every principle holds at blocking strength: a breach is a 🔴. A client team's principles keep a "Rules of thumb" tier whose breach is guidance. Add the tier as its own section of `principles/technical-principles.md`, and map a breach of a rule in it to 🟡 in `review-findings.md`. + +Its first rule: "Keep each pull request as small as its chunk allows: leave out every change none of the chunk's items needs." Not "as small as possible": the working loop bundles items that share a review into one chunk on purpose, since each review has a fixed cost, and a bare small-PR rule would contradict it. + +Touches: +- `principles/technical-principles.md`: `# Principles` +- `skills/larv-review/review-findings.md` +- `agents/principles-auditor.md` + +### 435. Count rounds, diff for review and find the pull request against a stacked branch's own base, in larv-review, rule-hook's round cap, mutate-changes and chunk-pr. + +For a branch based on another chunk's branch, round counts and the review diff are taken against the default branch, so they count the parent pull request's rounds too. In a client's chunk, rule-hook's round cap refused a real round commit, and `reviewer-header` reported "stability takes no more rounds". `chunk-pr open` and `ready` only find pull requests into the default branch. + +Take the pull request's base, from the forge or from a `--base ` option, everywhere a merge base or a commit range with the default branch is taken. The CLAUDE.md rule to branch off the default branch stays the default; a stack is the exception a team's workflow asks for. + +Touches: +- `bin/git_cli/git_repo.py`: `default_branch`, `default_ref`, `branch_titles` +- `bin/larv_review/main.py`: `with_default_branch` +- `bin/larv_review/reviewer_header.py` +- `bin/larv_review/owed.py` +- `bin/rule_hook/round_cap.py`: `earlier_titles` +- `bin/chunk_pr/main.py`: `default_branch`, `opened` +- `bin/mutate_changes/main.py`: `mutate` +- `bin/larv_review/test_larv_review.py` +- `bin/chunk_pr/test_chunk_pr.py` +- `bin/rule_hook/test_rule_hook.py` +- `skills/larv-review/SKILL.md`: `## 2. Ship the branch` (small) + +### 437. Add "Coverage doesn't fall" to the rules of thumb, as a 🟡 where a change deletes or skips tests of code it keeps, measured only where CI already reports coverage. + +A client team holds "Test coverage must not decline" as a principle. Ours says "Coverage is no target: it finds untested code, not weak tests", and the mutation rule already fails a changed line no test runs, since its mutants survive. What a coverage ratchet adds is a signal on unchanged code whose tests a change deleted or weakened. + +Recommendation: add it to item 428's rules-of-thumb tier as "Coverage doesn't fall", a 🟡 where a change deletes or skips tests of code it keeps; measure it only where the project's CI already reports coverage, and add no coverage tooling for it. Never a target, so the existing line stays. + +Touches: +- `principles/technical-principles.md`: `Every mutant of a changed line fails a test` (small) + ### 365. Have `score-outcomes` read the finished and dropped items of a plan outside the checkout, from the project repo's history or from Jira's issue changelogs. lilleman's call, 2026-11-12: 0.10.0 and 0.11.0 switch the history tools off for a plan outside the checkout, and 0.13.0 holds only their ports. In Jira a dropped item, which `Drop item` commit titles mark today, is an issue resolved by a resolution the config names. -- 2.52.0 From da066fd0b4a6e2111eae27d5a8bc99d5381bd360 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 18 Nov 2026 17:34:50 +0100 Subject: [PATCH 2/3] Drop items 428, 430, 431, 432, 433, 434, 435, 436, 437 and 438: merged into item 429, or dropped by the human --- todo.md | 153 +++++++++----------------------------------------------- 1 file changed, 23 insertions(+), 130 deletions(-) diff --git a/todo.md b/todo.md index 30f76b58..c75e9fb0 100644 --- a/todo.md +++ b/todo.md @@ -21,26 +21,16 @@ | 418 | 0.12.0 | 415 | | **Describe do-epic in `README.md`'s tools and setup, with its machine settings and `repo-rule.md`.** | 1 | 2 | 1 | 2 | 2 | 1 by 5 | 2.1 | | 400 | 0.12.0 | | | **Forbid a test that decides at run time whether to check anything in `principles/technical-principles.md`, and point stability-reviewer's Tests checks at it.** | 1 | 2 | 3 | 4 | 2 | 1.1 by 5 | 2.0 | | 420 | 0.12.0 | | | **End a worker that printed its final result and lingers, by killing the background shells it left, after a few minutes, and print each kill with its evidence on loop-claude's terminal.** | 2 | 2 | 2 | 4 | 3 | 1.5 by 6 | 2.0 | -| 429 | 0.12.0 | | | **Open a chunk's pull request only once its local review is done, where the repo's CI runs on pushed branches, and keep the draft-first order where CI runs only on pull requests.** | 3 | 2 | 3 | 6 | 4 | 1.1 by 3, 1.6 by 4 | 2.0 | -| 433 | 0.12.0 | | | **Let a project's config name a team's convention files in a `conventions` setting, which every reviewer reads beside the principles and standards, the team's rule winning where they conflict.** | 2 | 2 | 3 | 5 | 3 | 1.6 by 6 | 2.0 | | 409 | 0.12.0 | | | **Split an epic item that changes several repos into one Jira sub-task per repo, each labelled for its repo, with the parent tracking the whole change, when do-epic plans the item.** | 2 | 2 | 3 | 5 | 3 | 1 by 5 | 1.9 | | 411 | 0.12.0 | 410 | | **Park a chunk whose PR waits on a long gate, keeping its worktree, PR and session in a state file that survives a reboot, and resume its session when the gate passes or a reviewer comments.** | 3 | 2 | 3 | 6 | 5 | 1 by 5 | 1.2 | | 412 | 0.12.0 | 410, 411 | | **Print each chunk of an epic, running, parked with its gate and since when, or stopped, each human task and each open interrupt with `do-epic --status`, and name a parked chunk's gate in its tmux window's name.** | 2 | 1 | 1 | 2 | 3 | 1 by 5 | 1.9 | | 414 | 0.12.0 | 410 | | **DM the human through the notifier when a human-task issue blocks the epic's next item, and poll until it closes.** | 2 | 2 | 2 | 4 | 3 | 1 by 5 | 1.9 | | 417 | 0.12.0 | 410 | | **Run do-epic end to end against a sandbox epic on a real Jira site with a command of its own, outside `run-tests`.** | 2 | 1 | 1 | 2 | 3 | 1 by 5 | 1.9 | -| 430 | 0.12.0 | | | **Hold tests on a shared environment to five rules in the principles' "Tests and tooling": assert only on named records, touch only owned state, survive any order and a concurrent copy, register teardown before creating, and check what a save stored.** | 1 | 2 | 3 | 4 | 2 | 1.1 by 4 | 1.6 | | 421 | 0.12.0 | | | **Refuse in rule-hook a Bash or Monitor wait that has no end: a loop without a time or count cap, and a `pgrep -f` or `pkill -f` whose pattern the same command line contains.** | 2 | 2 | 3 | 5 | 3 | 1.5 by 4 | 1.3 | -| 432 | 0.12.0 | | | **Have stability-reviewer check, for a change that stores a value differently, that its longest value fits the column and that every search on the column still finds what users type.** | 1 | 2 | 3 | 4 | 1 | 1.1 by 3 | 1.3 | -| 436 | 0.12.0 | | | **Add the principle "Never mock a service your own team runs": test its seam against the real build, and mock only a third party that can't be run locally.** | 1 | 2 | 3 | 4 | 1 | 1.1 by 3 | 1.3 | -| 434 | 0.12.0 | | | **File a plan item to add the language's mutation tool, pinned to a version that supports the project's language version, when `mutate-changes` reports changed files no tool covers.** | 2 | 2 | 3 | 5 | 2 | 1.1 by 3 | 1.2 | | 316 | 0.12.0 | | | **Launch comprehension seats as an agent type of their own under `agents/`, without `CLAUDE.md` and the skill and agent listings a general-purpose subagent carries.** | 2 | 2 | 2 | 4 | 3 | 1.4 by 3 | 1.0 | -| 431 | 0.12.0 | | | **Give "Make invalid states unrepresentable" an example about a function's inputs, and the rule to change a signature once review finds a second edge case in a check.** | 1 | 2 | 3 | 4 | 1 | 1.1 by 2 | 0.9 | -| 438 | 0.12.0 | | | **Add the principle "Don't loosen a type when refactoring": a function keeps its concrete return type, and a DTO or value object replaces an `object`, `array`, `mixed` or `any`.** | 1 | 2 | 3 | 4 | 1 | 1.1 by 2 | 0.9 | +| 429 | 0.12.0 | | | **Bring nine lessons from a client setup into the principles, the reviewers, larv-review and the project config, and rank a deterministic tool first where an outside reviewer's finding changes the setup.** | 4 | 2 | 3 | 7 | 7 | 1.1 by 5, 1.6 by 5 | 0.9 | | 310 | 0.12.0 | | | **Compact a waiting worker's session shortly before its prompt cache expires, only when the human has not answered an interrupt by then.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 3 | 0.9 | | 422 | 0.12.0 | 420 | | **Check every 5 minutes whether a tmux window of the loop looks stuck by other signs than a lingering worker, investigate it with a headless claude, and kill only the process the investigation names.** | 3 | 2 | 3 | 6 | 5 | 1.5 by 4 | 0.8 | -| 428 | 0.12.0 | | | **Split the technical principles into blocking rules and rules of thumb, map a breach of a rule of thumb to 🟡, and add "keep each pull request as small as its chunk allows" to that tier.** | 2 | 2 | 3 | 5 | 3 | 1.1 by 2 | 0.7 | -| 435 | 0.12.0 | | | **Count rounds, diff for review and find the pull request against a stacked branch's own base, in larv-review, rule-hook's round cap, mutate-changes and chunk-pr.** | 3 | 2 | 3 | 6 | 6 | 1.6 by 3, 1.5 by 2 | 0.7 | -| 437 | 0.12.0 | 428 | | **Add "Coverage doesn't fall" to the rules of thumb, as a 🟡 where a change deletes or skips tests of code it keeps, measured only where CI already reports coverage.** | 1 | 2 | 3 | 4 | 1 | 1.1 by 1 | 0.4 | | 365 | 0.13.0 | | | **Have `score-outcomes` read the finished and dropped items of a plan outside the checkout, from the project repo's history or from Jira's issue changelogs.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.1 by 2 | 1.2 | | 368 | 0.13.0 | | | **Call a release review due, call a release ready to cut, and tell whether a chunk owes a scoring run, for a plan outside the checkout, from the project repo's history or from Jira.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.1 by 2 | 1.2 | | 309 | 0.13.0 | | | **Run a scoring run's second pass on one head with two seats in place of four, once `larv-review agreement` shows the seats agree with each other more than a run agrees with its rerun.** | 2 | 2 | 2 | 4 | 2 | 1.4 by 3 | 1.2 | @@ -203,31 +193,6 @@ Touches: - `bin/loop_claude/loop/lingering_workers.py` - `README.md`: `## Tools` (small) -### 429. Open a chunk's pull request only once its local review is done, where the repo's CI runs on pushed branches, and keep the draft-first order where CI runs only on pull requests. - -Today larv-review §2 opens a draft pull request first, so CI cycles while the review runs. A forge's auto-reviewer reviews drafts too, and human reviewers see them, so outside findings land before any of our own passes have run. In a client's chunk that put about six findings on the forge that our own passes would have caught. Nothing in larv-review needs a pull request before the gate: `reviewer-header` prints `PR: none open at the pushed head`, and round counts read commit titles. - -Where the repo's CI runs on pushed branches: push early, so CI runs; run `chunk-pr open` once every §3 pass is done and §2's tests, static analysis and mutation tests pass; mark it ready at once. Where CI runs only on pull requests, keep today's draft-first order. Decide from the repo's CI config which case holds, and say in the summary which order the chunk took. - -Item 419 runs the auto-reviewer until clean; this item makes its first review see a change our passes already cleaned. - -Touches: -- `skills/larv-review/SKILL.md`: `## 2. Ship the branch`, `## 4. Gate` -- `bin/chunk_pr/main.py`: `opened` (small) -- `bin/chunk_pr/test_chunk_pr.py` - -### 433. Let a project's config name a team's convention files in a `conventions` setting, which every reviewer reads beside the principles and standards, the team's rule winning where they conflict. - -Today a team's conventions reach the reviewers only by hand, and copying them into claude-config's standards would drift. Add an optional `conventions` setting: a list of paths, in the same path syntax as the other settings, such as `checkout:CONVENTIONS.md`. `reviewer-header` prints them, every reviewer reads them beside the principles and the standards, and the team's rule wins where the two conflict, as `CLAUDE.md` → "A client project's `CLAUDE.md` and `AGENTS.md`" already has it for those files. A missing file fails as an empty principles folder does today. - -Touches: -- `bin/project_config/settings.py`: `SETTINGS` -- `bin/project_config/test_project_config.py` -- `bin/larv_review/reviewer_header.py` -- `bin/larv_review/test_larv_review.py` -- `skills/larv-review/SKILL.md`: `### Principles` (small) -- `README.md`: `## Install` (small) - ### 409. Split an epic item that changes several repos into one Jira sub-task per repo, each labelled for its repo, with the parent tracking the whole change, when do-epic plans the item. do-epic predicts the repos from the code, as `Touches:` predictions are made. A person's issue is split too, with a comment for the team in the epic's language (`docs/decisions.md` → `do-epic: drives one Jira epic …`). The parent is finished once every sub-task is. @@ -279,22 +244,6 @@ Touches: - `bin/do-epic-e2e` - `bin/do_epic/e2e/` -### 430. Hold tests on a shared environment to five rules in the principles' "Tests and tooling": assert only on named records, touch only owned state, survive any order and a concurrent copy, register teardown before creating, and check what a save stored. - -A test that runs against a shared environment, such as a staging database or a shared queue, meets other runs' data. Add to the "Tests and tooling" bullet under "Compose, do not entangle": - -- Assert only on records the test created and can name, never on a count or on the first row. -- Never change state the test doesn't own. -- Pass in any order, and beside a second copy of itself running at the same time. -- A test helper registers its teardown before it creates anything, keyed by a value the helper made itself, and the teardown deletes only what it can name. -- A helper that saves checks what was saved, never the status code alone. - -Give one BANNED/GOOD pair for each. These come from a client team's conventions and one of its reviews; state them in our own words, naming neither. - -Touches: -- `principles/technical-principles.md`: `Compose, do not entangle`, `Most, if not all, code should have automated tests, and each test earns its keep.` -- `agents/stability-reviewer.md`: `### 11. Tests` (small) - ### 421. Refuse in rule-hook a Bash or Monitor wait that has no end: a loop without a time or count cap, and a `pgrep -f` or `pkill -f` whose pattern the same command line contains. On 2026-11-18 a worker in the item 402 chunk started `until [ -s /tmp/merge-402.log ] && ! pgrep -f "chunk-pr merg"; do sleep 15; done` in the background. The `pgrep -f` pattern is part of the loop's own command line, so it matched itself and the loop never ended; the worker's `claude -p` waited on it for 95 minutes and its slot started no new chunk (item 420 ends such a worker; item 422 handles other stuck windows). A wait that cannot end is cheaper to refuse before it starts. @@ -312,33 +261,6 @@ Touches: - `bin/rule_hook/test_rule_hook.py`: `CommandBreaches` (small) - `settings.json` -### 432. Have stability-reviewer check, for a change that stores a value differently, that its longest value fits the column and that every search on the column still finds what users type. - -A change that escapes, converts or grows a stored value: the longest value it can now write must fit the column, and every search, filter or comparison on the column must still find what users type. In a client's chunk, escaping text into a TEXT column lowered its overflow limit fivefold, and a LIKE search stopped matching apostrophes. Product-owner and the auto-reviewer caught it; stability didn't. - -It goes in stability-reviewer's "Data Integrity & Persistence" checks, beside the one on a new column, since it is a check a reviewer runs on a change, not a design rule, and the agent is shared by every project. - -Touches: -- `agents/stability-reviewer.md`: `### 7. Data Integrity & Persistence` (small) - -### 436. Add the principle "Never mock a service your own team runs": test its seam against the real build, and mock only a third party that can't be run locally. - -Today the principles say to mock only slow, nondeterministic or external edges, which leaves room to mock a service the team itself runs; such a mock drifts from the real service unseen. Add: test the seam to a service your team runs against its real build, in a harness that runs the real stack. Mock only a third party that can't be run locally in a reasonable way. - -Recommended scope: the rule binds the test that covers the seam. A unit test of the caller's own logic may still use a fake, as "Use real collaborators or fakes" allows, so the lowest-level rule still holds. - -Touches: -- `principles/technical-principles.md`: `Most, if not all, code should have automated tests, and each test earns its keep.` (small) - -### 434. File a plan item to add the language's mutation tool, pinned to a version that supports the project's language version, when `mutate-changes` reports changed files no tool covers. - -`mutate-changes` prints a line naming the changed files in a language no tool covers. Today that line goes to the stability reviewer, which then hunts mutants by hand. In a client's PHP chunk without Infection, three findings were surviving mutants a tool would have reported before review. - -On that line, larv-review §2 files a plan item, or refreshes the one an earlier chunk filed, to add the language's mutation tool to the project, with a pinned version that supports the project's language version. In a plan kept in Jira that is a ticket for the team. - -Touches: -- `skills/larv-review/SKILL.md`: `## 2. Ship the branch` (small) - ### 316. Launch comprehension seats as an agent type of their own under `agents/`, without `CLAUDE.md` and the skill and agent listings a general-purpose subagent carries. Seats run as general-purpose subagents, so each starts with the skill and agent listings, about 7,500 tokens, at $9.00 per 1,000 prefix tokens over the archive measured from 2026-09-30 to 2026-11-11: about 1.3% of spend. An agent under `agents/` with Read, Grep, Glob and Bash, `omitClaudeMd: true`, and the seat's persona in its prompt drops both; a seat reads the project as a newcomer does, which is what it simulates. Keep each seat's prompt from `skills/comprehension-panel/seat-prompts.md`. Check that a scoring run's scores on one head stay within the spread two runs of today's seats show. lilleman approved on 2026-11-11. @@ -354,22 +276,32 @@ Touches: - `bin/rule_hook/test_rule_hook.py`: `ReviewerRung` - `bin/larv_review/test_scoring_setup.py` -### 431. Give "Make invalid states unrepresentable" an example about a function's inputs, and the rule to change a signature once review finds a second edge case in a check. +### 429. Bring nine lessons from a client setup into the principles, the reviewers, larv-review and the project config, and rank a deterministic tool first where an outside reviewer's finding changes the setup. -The principle's only example is a database time type, so in a client's chunk neither the implementer nor the reviewers connected it to a test helper that validated its own caller's input, over four review rounds. Add: +Lessons from running this setup in a client's repo, shipped as one chunk. Each part names the gap it closes; none names the client, its code or its reviewers' text. -- BANNED: a helper that takes a token and a message, and checks that the message holds the token. GOOD: the helper makes the token and builds the message. -- "When a review finds a second edge case in a check, change the signature so the input can't occur." +1. **Open the pull request after our own review, where CI runs on pushed branches.** Today larv-review §2 opens a draft first. A forge's auto-reviewer reviews drafts and human reviewers see them, so in a client's chunk about six outside findings landed that our passes would have caught. Nothing in larv-review needs a pull request before the gate: `reviewer-header` prints `PR: none open at the pushed head`, and round counts read commit titles. Push early so CI runs; run `chunk-pr open` once every §3 pass is done and §2's tests, static analysis and mutation tests pass; mark it ready at once. Where CI runs only on pull requests, keep the draft-first order. Decide which from the repo's CI config, and say in the summary which order the chunk took. +2. **Rules for tests on a shared environment**, in the "Tests and tooling" bullet under "Compose, do not entangle", one BANNED/GOOD pair each: assert only on records the test created and can name, never on a count or the first row; never change state the test doesn't own; pass in any order and beside a second copy of itself running at the same time; a helper registers its teardown before it creates anything, keyed by a value it made itself, and the teardown deletes only what it can name; a helper that saves checks what was saved, never the status code alone. +3. **"Make invalid states unrepresentable" gets an example about function inputs.** Its only example is a database time type, so in a client's chunk nobody connected it to a test helper that validated its caller's input, over four review rounds. BANNED: a helper that takes a token and a message, and checks that the message holds the token. GOOD: the helper makes the token and builds the message. Add: "When a review finds a second edge case in a check, change the signature so the input can't occur." +4. **stability-reviewer checks a change that stores a value differently**, in "Data Integrity & Persistence": where a change escapes, converts or grows a stored value, the longest value it can now write must fit the column, and every search, filter or comparison on the column must still find what users type. In a client's chunk, escaping text into a TEXT column lowered its overflow limit fivefold, and a LIKE search stopped matching apostrophes; stability missed both. +5. **A `conventions` setting in the project config**: an optional list of paths, in the other settings' path syntax, such as `checkout:CONVENTIONS.md`. `reviewer-header` prints them, every reviewer reads them beside the principles and standards, and the team's rule wins where they conflict. A missing file fails as an empty principles folder does. Today a team's conventions reach reviewers only by hand. +6. **larv-review §2 files an item to add a mutation tool** when `mutate-changes` prints its line naming changed files no tool covers, or refreshes the item an earlier chunk filed: the language's mutation tool, pinned to a version that supports the project's language version. In a client's PHP repo without one, three findings were surviving mutants a tool would have reported before review. +7. **The principle "Never mock a service your own team runs."** Test the seam to it against its real build, in a harness that runs the real stack; mock only a third party that can't be run locally in a reasonable way. The rule binds the test that covers the seam: a unit test of the caller's own logic may still use a fake, as "Use real collaborators or fakes" allows. +8. **The principle "Don't loosen a type when refactoring"**, under "Validate data and build DTOs as early as possible.", with one BANNED/GOOD pair: a function that returned a concrete type keeps returning it when its implementation changes, never `object`, `array`, `mixed` or `any`; introduce a DTO or value object instead. +9. **Reflect on every outside reviewer's finding, deterministic tools first.** `CLAUDE.md` → "Change the setup for each reasonable fix an outside reviewer asked for on a PR" already asks why our review missed it, but ranks reviewer agents and larv-review with the hooks and tools, and covers only fixes. Make it cover every finding an outside reviewer raises, and rank the places: 1. a deterministic tool that would have caught it, such as a rule-hook rule, a gate check, a linter setting or `mutate-changes`; 2. the technical principles or review standards; 3. anything else: the reviewers' agents, `larv-review`'s text, or the project's own settings, principles folder or `AGENTS.md`. Touches: -- `principles/technical-principles.md`: `Make invalid states unrepresentable.` (small) - -### 438. Add the principle "Don't loosen a type when refactoring": a function keeps its concrete return type, and a DTO or value object replaces an `object`, `array`, `mixed` or `any`. - -A function that returned a concrete type keeps returning it when its implementation changes: never degrade it to `object`, `array`, `mixed` or `any`. Introduce a DTO or value object instead. From a client team's PHP conventions, but it holds in any typed language. Add it under "Validate data and build DTOs as early as possible.", with one BANNED/GOOD pair. - -Touches: -- `principles/technical-principles.md`: `Validate data and build DTOs as early as possible.` (small) +- `CLAUDE.md`: `## Working loop` (small) +- `skills/larv-review/SKILL.md`: `## 2. Ship the branch`, `## 4. Gate`, `### Principles` (small) +- `bin/chunk_pr/main.py`: `opened` (small) +- `bin/chunk_pr/test_chunk_pr.py` +- `principles/technical-principles.md`: `Compose, do not entangle`, `Make invalid states unrepresentable.`, `Validate data and build DTOs as early as possible.`, `Most, if not all, code should have automated tests, and each test earns its keep.` +- `agents/stability-reviewer.md`: `### 7. Data Integrity & Persistence` (small), `### 11. Tests` (small) +- `bin/project_config/settings.py`: `SETTINGS` +- `bin/project_config/test_project_config.py` +- `bin/larv_review/reviewer_header.py` +- `bin/larv_review/test_larv_review.py` +- `README.md`: `## Install` (small) ### 310. Compact a waiting worker's session shortly before its prompt cache expires, only when the human has not answered an interrupt by then. @@ -402,45 +334,6 @@ Touches: - `bin/agent_cycle/tmux.py`: `Listed`, `listed` - `README.md`: `## Tools` (small) -### 428. Split the technical principles into blocking rules and rules of thumb, map a breach of a rule of thumb to 🟡, and add "keep each pull request as small as its chunk allows" to that tier. - -Today every principle holds at blocking strength: a breach is a 🔴. A client team's principles keep a "Rules of thumb" tier whose breach is guidance. Add the tier as its own section of `principles/technical-principles.md`, and map a breach of a rule in it to 🟡 in `review-findings.md`. - -Its first rule: "Keep each pull request as small as its chunk allows: leave out every change none of the chunk's items needs." Not "as small as possible": the working loop bundles items that share a review into one chunk on purpose, since each review has a fixed cost, and a bare small-PR rule would contradict it. - -Touches: -- `principles/technical-principles.md`: `# Principles` -- `skills/larv-review/review-findings.md` -- `agents/principles-auditor.md` - -### 435. Count rounds, diff for review and find the pull request against a stacked branch's own base, in larv-review, rule-hook's round cap, mutate-changes and chunk-pr. - -For a branch based on another chunk's branch, round counts and the review diff are taken against the default branch, so they count the parent pull request's rounds too. In a client's chunk, rule-hook's round cap refused a real round commit, and `reviewer-header` reported "stability takes no more rounds". `chunk-pr open` and `ready` only find pull requests into the default branch. - -Take the pull request's base, from the forge or from a `--base ` option, everywhere a merge base or a commit range with the default branch is taken. The CLAUDE.md rule to branch off the default branch stays the default; a stack is the exception a team's workflow asks for. - -Touches: -- `bin/git_cli/git_repo.py`: `default_branch`, `default_ref`, `branch_titles` -- `bin/larv_review/main.py`: `with_default_branch` -- `bin/larv_review/reviewer_header.py` -- `bin/larv_review/owed.py` -- `bin/rule_hook/round_cap.py`: `earlier_titles` -- `bin/chunk_pr/main.py`: `default_branch`, `opened` -- `bin/mutate_changes/main.py`: `mutate` -- `bin/larv_review/test_larv_review.py` -- `bin/chunk_pr/test_chunk_pr.py` -- `bin/rule_hook/test_rule_hook.py` -- `skills/larv-review/SKILL.md`: `## 2. Ship the branch` (small) - -### 437. Add "Coverage doesn't fall" to the rules of thumb, as a 🟡 where a change deletes or skips tests of code it keeps, measured only where CI already reports coverage. - -A client team holds "Test coverage must not decline" as a principle. Ours says "Coverage is no target: it finds untested code, not weak tests", and the mutation rule already fails a changed line no test runs, since its mutants survive. What a coverage ratchet adds is a signal on unchanged code whose tests a change deleted or weakened. - -Recommendation: add it to item 428's rules-of-thumb tier as "Coverage doesn't fall", a 🟡 where a change deletes or skips tests of code it keeps; measure it only where the project's CI already reports coverage, and add no coverage tooling for it. Never a target, so the existing line stays. - -Touches: -- `principles/technical-principles.md`: `Every mutant of a changed line fails a test` (small) - ### 365. Have `score-outcomes` read the finished and dropped items of a plan outside the checkout, from the project repo's history or from Jira's issue changelogs. lilleman's call, 2026-11-12: 0.10.0 and 0.11.0 switch the history tools off for a plan outside the checkout, and 0.13.0 holds only their ports. In Jira a dropped item, which `Drop item` commit titles mark today, is an issue resolved by a resolution the config names. -- 2.52.0 From 1c2791f2ad3a0947e05ac8fa331c618f3ae81f80 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 18 Nov 2026 17:43:47 +0100 Subject: [PATCH 3/3] Name the Working loop heading in item 429's citation --- todo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todo.md b/todo.md index 0a4da490..98e56fb8 100644 --- a/todo.md +++ b/todo.md @@ -298,7 +298,7 @@ Lessons from running this setup in a client's repo, shipped as one chunk. Each p 6. **larv-review §2 files an item to add a mutation tool** when `mutate-changes` prints its line naming changed files no tool covers, or refreshes the item an earlier chunk filed: the language's mutation tool, pinned to a version that supports the project's language version. In a client's PHP repo without one, three findings were surviving mutants a tool would have reported before review. 7. **The principle "Never mock a service your own team runs."** Test the seam to it against its real build, in a harness that runs the real stack; mock only a third party that can't be run locally in a reasonable way. The rule binds the test that covers the seam: a unit test of the caller's own logic may still use a fake, as "Use real collaborators or fakes" allows. 8. **The principle "Don't loosen a type when refactoring"**, under "Validate data and build DTOs as early as possible.", with one BANNED/GOOD pair: a function that returned a concrete type keeps returning it when its implementation changes, never `object`, `array`, `mixed` or `any`; introduce a DTO or value object instead. -9. **Reflect on every outside reviewer's finding, deterministic tools first.** `CLAUDE.md` → "Change the setup for each reasonable fix an outside reviewer asked for on a PR" already asks why our review missed it, but ranks reviewer agents and larv-review with the hooks and tools, and covers only fixes. Make it cover every finding an outside reviewer raises, and rank the places: 1. a deterministic tool that would have caught it, such as a rule-hook rule, a gate check, a linter setting or `mutate-changes`; 2. the technical principles or review standards; 3. anything else: the reviewers' agents, `larv-review`'s text, or the project's own settings, principles folder or `AGENTS.md`. +9. **Reflect on every outside reviewer's finding, deterministic tools first.** `CLAUDE.md` → "Working loop" → "Change the setup for each reasonable fix an outside reviewer asked for on a PR" already asks why our review missed it, but ranks reviewer agents and larv-review with the hooks and tools, and covers only fixes. Make it cover every finding an outside reviewer raises, and rank the places: 1. a deterministic tool that would have caught it, such as a rule-hook rule, a gate check, a linter setting or `mutate-changes`; 2. the technical principles or review standards; 3. anything else: the reviewers' agents, `larv-review`'s text, or the project's own settings, principles folder or `AGENTS.md`. Touches: - `CLAUDE.md`: `## Working loop` (small) -- 2.52.0