From 4ab80160b689ed448c1570ff5233ccabdde26490 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 11:59:31 +0100 Subject: [PATCH 01/11] Give review-replay --omit-claude-md a control of three unchanged replays --- README.md | 2 +- bin/review_replay/main.py | 24 +++++++------- bin/review_replay/rounds.py | 25 ++++++++++----- bin/review_replay/test_review_replay.py | 42 ++++++++++++++----------- 4 files changed, 55 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 99797330..7f065a70 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Install puts only `loop-claude` and `loop-inbox` on `PATH`; call the others by t - `mutate-changes [--base ] [--prefix ] [--jobs ]` mutation-tests the lines a branch changes and prints each mutant its tests don't kill; `mutate-changes --help` says which tool it runs for each language. - `rank_todo.py [--check] [todo.md]` scores and ranks a project's `todo.md`; `rank_todo.py --help` states the format. - `reading-cost [--reset] [record]` appends a figure for each chunk `loop-claude` finished to a project's `docs/reading-cost.md`, and says whether the figures rise; `reading-cost --help` states the measure. -- `review-replay ` replays a review pass's archived rounds from the projects run on the model, on the code each reviewed, and prints the lowest rung below the project's that, like each rung above it, qualifies: it finds no less of the πŸ”΄ and 🟑 findings than two replays on the project's rung find, within a margin, and misses no πŸ”΄ that both found. The rungs tried start with the project's model at a lower effort. `review-replay --help` states the replay. With `--omit-claude-md` it tests instead whether the pass's reviewer may start without `CLAUDE.md`: it replays each round twice as archived and once without the instruction files, and prints each finding the last replay missed that both of the others found. Each replayed reviewer skips every permission prompt, stability-reviewer has Bash, and an archived prompt may name paths on the host. +- `review-replay ` replays a review pass's archived rounds from the projects run on the model, on the code each reviewed, and prints the lowest rung below the project's that, like each rung above it, qualifies: it finds no less of the πŸ”΄ and 🟑 findings than two replays on the project's rung find, within a margin, and misses no πŸ”΄ that both found. The rungs tried start with the project's model at a lower effort. `review-replay --help` states the replay. With `--omit-claude-md` it tests instead whether the pass's reviewer may start without `CLAUDE.md`: it replays each round three times as archived and once without the instruction files, and prints how many findings each unchanged replay missed that the other two found, then each finding the last replay missed that the first two found. Each replayed reviewer skips every permission prompt, stability-reviewer has Bash, and an archived prompt may name paths on the host. - `rule-hook [overrides]` blocks a tool call that breaks a rule a program can check, unless the call overrides the rule; `settings.json` β†’ `hooks` runs it before each Agent, Bash, Edit, MultiEdit, Read, Skill and Write call, and `rule-hook --help` states the rules and the override. - `run-heavy ` runs a heavy command once it holds one of the machine's heavy slots, one per 4 CPUs, which every session shares; `run-heavy --help` states the slots, and the memory cap it gives a container that sets no limit. - `run-tests [...]` runs this repo's test suite, as Test says. diff --git a/bin/review_replay/main.py b/bin/review_replay/main.py index 195a4a63..d2f51abe 100644 --- a/bin/review_replay/main.py +++ b/bin/review_replay/main.py @@ -31,13 +31,15 @@ it missed, and the lowest rung that, like each rung above it, qualifies. That ru for running the pass's reviewer on it; the decision above records each run. With --omit-claude-md it tests instead whether the pass's reviewer may start without CLAUDE.md: -docs/decisions.md β†’ `agents/: a reviewer starts without CLAUDE.md only where a replay of its pass -missed none…`. It replays every round three times on the project's rung: twice as archived, then -once without the instruction files. The unchanged reviewer does not find the same findings twice, -so the reviewer without CLAUDE.md is held only to the findings both of those replays found. It -prints how many findings each replay found, and each finding the third missed that the first two -both found; the reviewer passes where it missed none. A round that any of the three replays failed -on is left out, and where the first two share no finding the last line says there is no evidence. +docs/decisions.md β†’ `agents/: a reviewer starts without CLAUDE.md only where its replay missed no +more findings than the most an unchanged replay missed`. It replays every round four times on the +project's rung: three as archived, then once without the instruction files. The unchanged reviewer +does not find the same findings twice, so each unchanged replay is a control: the tool prints how +many findings it missed that the other two found. The replay without CLAUDE.md is held to the +findings the first two found, and passes where it missed no more than the most any unchanged replay +did. It prints how many findings each replay found, and each finding the last missed. A round that +any of the four replays failed on is left out, and where the first two share no finding the last +line says there is no evidence. Claude Code ignores an agent's `omitClaudeMd` where the agent runs the session, as it does in a replay, and runs no SubagentStart hook there. So the third replay turns the instruction files off in its settings and opens the prompt with what the hook hands a reviewer, and closes it with the @@ -150,9 +152,9 @@ def recalled(chosen: list[Round], project: Rung, replay_one: typing.Callable[[Ro def compared(reviewed: str, project: Rung, chosen: list[Round], found_on: typing.Callable[[Round, bool], set[int] | Failure | Limited]) -> int: - """Replays chosen twice with CLAUDE.md and once without, as found_on(round, bare) finds, and prints the comparison of the rounds no replay failed on.""" + """Replays chosen three times with CLAUDE.md and once without, as found_on(round, bare) finds, and prints the comparison of the rounds no replay failed on.""" runs: list[list[set[int] | Failure]] = [] - for bare in (False, False, True): + for bare in (False, False, False, True): def replay_one(one: Round, _: Rung, bare: bool = bare) -> set[int] | Failure | Limited: found = found_on(one, bare) if isinstance(found, Failure): @@ -165,8 +167,8 @@ def compared(reviewed: str, project: Rung, chosen: list[Round], found_on: typing runs.append(found) # A failed replay found nothing, which would lower the bar where it had CLAUDE.md and count as misses where it had none. kept = [(one, *found) for one, *found in zip(chosen, *runs) if not any(isinstance(each, Failure) for each in found)] - first, second, without = ([typing.cast(set[int], found[run]) for _, *found in kept] for run in range(3)) - print(comparison(reviewed, project, [one for one, *_ in kept], (first, second), without, len(chosen) - len(kept))) + first, second, third, without = ([typing.cast(set[int], found[run]) for _, *found in kept] for run in range(4)) + print(comparison(reviewed, project, [one for one, *_ in kept], (first, second, third), without, len(chosen) - len(kept))) return 0 diff --git a/bin/review_replay/rounds.py b/bin/review_replay/rounds.py index 68224610..b5a29783 100644 --- a/bin/review_replay/rounds.py +++ b/bin/review_replay/rounds.py @@ -107,19 +107,28 @@ def sample(rounds: list[Round], latest: int) -> list[Round]: return sorted(rounds, key=lambda found: (found.seconds, found.root))[-latest:] -def comparison(reviewed: str, reference: Rung, rounds: list[Round], with_it: tuple[list[set[int]], list[set[int]]], without: list[set[int]], left_out: int) -> str: - """What the two replays with CLAUDE.md and the one without found in rounds, and each finding the one without missed that both of the others found; left_out counts the rounds a replay failed on, which rounds leaves out.""" - first, second = with_it - both = [one & other for one, other in zip(first, second)] - missed = [(found_round, index) for found_round, held, found in zip(rounds, both, without) for index in sorted(held - found)] +def comparison(reviewed: str, reference: Rung, rounds: list[Round], with_it: tuple[list[set[int]], list[set[int]], list[set[int]]], without: list[set[int]], left_out: int) -> str: + """What the three replays with CLAUDE.md and the one without found in rounds. Each replay with it missed some findings the other two found: the control, the noise of an unchanged reviewer. The one without it is held to the findings the first two found, as the third is, and passes where it missed no more than the most a replay with it did. left_out counts the rounds a replay failed on, which rounds leaves out.""" + first, second, third = with_it + + def shared(one: list[set[int]], other: list[set[int]]) -> list[set[int]]: + return [found_by_one & found_by_other for found_by_one, found_by_other in zip(one, other)] + + def missing(held: list[set[int]], run: list[set[int]]) -> list[tuple[Round, int]]: + return [(found_round, index) for found_round, held_in_round, found in zip(rounds, held, run) for index in sorted(held_in_round - found)] def count(run: list[set[int]]) -> int: return sum(len(found) for found in run) + both = shared(first, second) + missed = missing(both, without) + control = [len(missing(shared(one, other), run)) for run, one, other in ((first, second, third), (second, first, third), (third, first, second))] + passes = len(missed) <= max(control) return "\n".join([ - f"Replayed {len(rounds)} {reviewed} rounds of {reference.model} projects, which hold {sum(len(found_round.findings) for found_round in rounds)} πŸ”΄ and 🟑 findings, three times on {reference}.", + f"Replayed {len(rounds)} {reviewed} rounds of {reference.model} projects, which hold {sum(len(found_round.findings) for found_round in rounds)} πŸ”΄ and 🟑 findings, four times on {reference}: three with CLAUDE.md, one without.", *([f"Left out {left_out} more, which a replay failed on; stderr says why."] if left_out else []), - f"With CLAUDE.md the reviewer found {count(first)} and then {count(second)} of them, and {count(both)} both times.", - f"Without CLAUDE.md it found {count(without)} of them, and missed {len(missed)} that it found both times with it{':' if missed else '.'}" if count(both) else f"Without CLAUDE.md it found {count(without)} of them. No evidence: with CLAUDE.md it found none both times, so there is no finding to hold it to.", + f"With CLAUDE.md the reviewer found {count(first)}, {count(second)} and {count(third)} of them. Each missed {control[0]}, {control[1]} and {control[2]} of the findings the other two found.", + *([f"Without CLAUDE.md it found {count(without)} of them, and missed {len(missed)} of the findings the first two found{':' if missed else '.'}"] if count(both) else [f"Without CLAUDE.md it found {count(without)} of them. No evidence: the first two replays with CLAUDE.md found none in common, so there is no finding to hold it to."]), *(f" {found_round.root} {found_round.at}: {found_round.findings[index].splitlines()[0]}" for found_round, index in missed), + *([f"It {'passes' if passes else 'fails'}: {len(missed)} missed is {'no more' if passes else 'more'} than the most a replay with CLAUDE.md missed, {max(control)}."] if count(both) else []), ]) diff --git a/bin/review_replay/test_review_replay.py b/bin/review_replay/test_review_replay.py index fdf8d7a6..a9cff132 100644 --- a/bin/review_replay/test_review_replay.py +++ b/bin/review_replay/test_review_replay.py @@ -246,30 +246,36 @@ class Main(unittest.TestCase): code = main.main(argv, {}, self.home, effects) return code, out.getvalue(), err.getvalue() - def test_without_claude_md_replays_each_round_twice_with_it_and_once_without_on_the_project_rung(self): - finds = iter(([0, 1], [0], [1])) + def test_without_claude_md_replays_each_round_three_times_with_it_and_once_without_on_the_project_rung(self): + finds = iter(([0, 1], [0], [1], [1])) code, out, err = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"found": next(finds)}) self.assertEqual(code, 0, err) - self.assertEqual([rung for rung, *_ in self.reviews], [REFERENCE] * 3) + self.assertEqual([rung for rung, *_ in self.reviews], [REFERENCE] * 4) context = reviewer_context(self.home) - self.assertEqual([prompt.startswith(context) for *_, prompt, _ in self.reviews], [False, False, True]) + self.assertEqual([prompt.startswith(context) for *_, prompt, _ in self.reviews], [False, False, False, True]) self.assertEqual(out, ( - f"Replayed 1 stability rounds of claude-opus-5-5 projects, which hold 2 πŸ”΄ and 🟑 findings, three times on {REFERENCE}.\n" - "With CLAUDE.md the reviewer found 2 and then 1 of them, and 1 both times.\n" - "Without CLAUDE.md it found 1 of them, and missed 1 that it found both times with it:\n" + f"Replayed 1 stability rounds of claude-opus-5-5 projects, which hold 2 πŸ”΄ and 🟑 findings, four times on {REFERENCE}: three with CLAUDE.md, one without.\n" + "With CLAUDE.md the reviewer found 2, 1 and 1 of them. Each missed 0, 1 and 1 of the findings the other two found.\n" + "Without CLAUDE.md it found 1 of them, and missed 1 of the findings the first two found:\n" f" {self.checkout} 2026-10-14T10:00:00Z: πŸ”΄ a.txt:1 wrong\n" + "It passes: 1 missed is no more than the most a replay with CLAUDE.md missed, 1.\n" )) with_them = f"replaying 1 stability rounds with the instruction files on {REFERENCE}\n" - self.assertEqual(err, with_them * 2 + f"replaying 1 stability rounds without the instruction files on {REFERENCE}\n") + self.assertEqual(err, with_them * 3 + f"replaying 1 stability rounds without the instruction files on {REFERENCE}\n") - def test_without_claude_md_says_so_where_the_reviewer_missed_nothing_and_names_a_reviewer_that_printed_no_json(self): - code, out, err = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"found": [0]}) - self.assertEqual((code, out.splitlines()[-1]), (0, "Without CLAUDE.md it found 1 of them, and missed 0 that it found both times with it.")) - - def test_without_claude_md_says_there_is_no_evidence_where_the_replays_with_it_share_no_finding(self): - finds = iter(([0], [1], [1])) + def test_without_claude_md_fails_where_it_missed_more_than_every_replay_with_it(self): + finds = iter(([0, 1], [0, 1], [0, 1], [])) _, out, _ = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"found": next(finds)}) - self.assertEqual(out.splitlines()[-1], "Without CLAUDE.md it found 1 of them. No evidence: with CLAUDE.md it found none both times, so there is no finding to hold it to.") + self.assertEqual(out.splitlines()[-1], "It fails: 2 missed is more than the most a replay with CLAUDE.md missed, 0.") + + def test_without_claude_md_says_so_where_the_reviewer_missed_nothing(self): + code, out, err = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"found": [0]}) + self.assertEqual((code, out.splitlines()[-2:]), (0, ["Without CLAUDE.md it found 1 of them, and missed 0 of the findings the first two found.", "It passes: 0 missed is no more than the most a replay with CLAUDE.md missed, 0."])) + + def test_without_claude_md_says_there_is_no_evidence_where_the_first_two_replays_share_no_finding(self): + finds = iter(([0], [1], [1], [1])) + _, out, _ = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"found": next(finds)}) + self.assertEqual(out.splitlines()[-1], "Without CLAUDE.md it found 1 of them. No evidence: the first two replays with CLAUDE.md found none in common, so there is no finding to hold it to.") def test_without_claude_md_leaves_out_a_round_that_a_replay_failed_on(self): failing = {} @@ -282,10 +288,10 @@ class Main(unittest.TestCase): code, out, err = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"found": [0, 1]}, review=review) self.assertEqual(code, 0, err) self.assertEqual(out, ( - f"Replayed 0 stability rounds of claude-opus-5-5 projects, which hold 0 πŸ”΄ and 🟑 findings, three times on {REFERENCE}.\n" + f"Replayed 0 stability rounds of claude-opus-5-5 projects, which hold 0 πŸ”΄ and 🟑 findings, four times on {REFERENCE}: three with CLAUDE.md, one without.\n" "Left out 1 more, which a replay failed on; stderr says why.\n" - "With CLAUDE.md the reviewer found 0 and then 0 of them, and 0 both times.\n" - "Without CLAUDE.md it found 0 of them. No evidence: with CLAUDE.md it found none both times, so there is no finding to hold it to.\n" + "With CLAUDE.md the reviewer found 0, 0 and 0 of them. Each missed 0, 0 and 0 of the findings the other two found.\n" + "Without CLAUDE.md it found 0 of them. No evidence: the first two replays with CLAUDE.md found none in common, so there is no finding to hold it to.\n" )) self.assertIn(f" {self.checkout} 2026-10-14T10:00:00Z with the instruction files failed, so the round is left out: claude printed no json reply", err) self.assertNotIn("without the instruction files failed", err) -- 2.52.0 From 545a57f01c6c9ddde76eaff4439faa57a3dbb635 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 12:38:23 +0100 Subject: [PATCH 02/11] Record the control run's figures in the CLAUDE.md gate's decision --- docs/decisions.md | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/decisions.md b/docs/decisions.md index 306036ee..103de6e6 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -530,7 +530,7 @@ Valid while a model switch inside a session discards its prompt cache. 2026-10-12, lilleman. Serves goals 1.2 and 1.3. Anthropic's best-practices page calls `CLAUDE.md` advisory and hooks deterministic, so a rule that must hold every time moves into `bin/rule-hook`, and `CLAUDE.md` keeps it only where the hook cannot check it. A Claude Code hook ties the check to one vendor ("Prefer the vendor-neutral option", `principles/technical-principles.md`), which is the target itself here: this repo configures Claude Code. What the tie buys: the hook blocks before a write lands, Edit and Write calls included, in every project with no per-repo install; a git `commit-msg` hook sees only commits, and CI sees them only after the push. The hook checks each write, so the agent fixes the line it just wrote; checking the staged diff at commit time would also cover files a Bash command writes, at the cost of later feedback. The marker's spelling was picked by a panel of three fresh readers, two to one. Each override is logged in the checkout's git directory, which is never pushed (goal 4). The plan had loop-claude's judge to rule on overrides inside a loop; lilleman approved larv-review's overrides pass in every run, because it rules before merge and an outrageous override still reaches the human through its ask. 2026-10-16, lilleman, answering plan item 166: no marker overrides `reviewer-rung`. 2026-11-04, lilleman: the title points at `rule-hook --help`, which lists every rule no marker overrides from the code, so the title can't drift from it; the comment above each in `bin/rule_hook/rules.py` says why. Valid while a PreToolUse hook that exits 2 blocks the call and hands its stderr to the model, and while an agent commits through Claude Code's Bash tool. 2026-11-11, lilleman: the hook also checks, at a `git commit`, each file the commit would commit against the rules that name a file, since a file a Bash command writes reaches no write check; the feedback comes at the commit, not at the write. -## agents/: a reviewer starts without `CLAUDE.md` only where a replay of its pass missed none of the findings two unchanged replays both found +## agents/: a reviewer starts without `CLAUDE.md` only where a replay of its pass missed no more findings than the most an unchanged replay missed 2026-11-12, lilleman through todo item 315, implemented by claude. Serves goal 1.4, and applies project principle 1. About 77% of `CLAUDE.md` is the worker's, and each reviewer loaded it whole. `omitClaudeMd: true` in an agent's frontmatter starts it without the user, project and local instruction files. `settings.json` β†’ `hooks.SubagentStart` runs `larv-review reviewer-context`, which hands such a reviewer the three sections of `~/.claude/CLAUDE.md` it needs: "Shared goal", which the agents cite, "Prose" and "Vocabulary". `larv-review reviewer-header` ends its header with a line naming the file that holds the project principles and decision titles, which the reviewer reads first. @@ -540,9 +540,9 @@ Three choices in it: - The header names the principles file and doesn't quote it, since the worker types the header into each reviewer's prompt. - The frontmatter is the one switch. The hook and the header read it, so an agent that keeps `CLAUDE.md` is handed neither the sections nor the line. -The gate: `review-replay --omit-claude-md` replays 10 archived rounds twice as archived and once without the instruction files. A pass's reviewer keeps `omitClaudeMd` only where the last replay missed none of the findings both of the others found. Two unchanged replays of one pass don't find the same findings: in the table below, each replay found between 22% and 100% of what the other found, and about 70% at the median. So one unchanged replay would not show the noise. A round that a replay fails on is left out of the comparison; the runs below predate that and counted such a replay as finding nothing. Claude Code 2.1.322 ignores `omitClaudeMd` in a main session and fires no `SubagentStart` hook there, and a replay runs the reviewer as one. So the replay sets `CLAUDE_CODE_DISABLE_CLAUDE_MDS` and puts the hook's context and the header's line in the prompt itself. +The gate: `review-replay --omit-claude-md` replays 10 archived rounds three times as archived and once without the instruction files. Each unchanged replay is a control: it misses some findings that the other two found, since an unchanged reviewer finds only about 70% of its own findings again. A pass's reviewer keeps `omitClaudeMd` only where the replay without the instruction files missed, of the findings the first two replays found, no more than the most any unchanged replay missed of the findings the other two found. Item 315 first held the replay to no miss at all; the table below shows five passes failing that, with the unchanged reviewers' own misses as large. A round that a replay fails on is left out of the comparison. Claude Code 2.1.322 ignores `omitClaudeMd` in a main session and fires no `SubagentStart` hook there, and a replay runs the reviewer as one. So the replay sets `CLAUDE_CODE_DISABLE_CLAUDE_MDS` and puts the hook's context and the header's line in the prompt itself. -On 2026-11-12, on claude-opus-5-5 at medium effort: +On 2026-11-12, first gate (two unchanged replays, no control): | Pass | πŸ”΄ and 🟑 archived | Found with `CLAUDE.md`, twice | Both times | Found without | Missed of those found both times | |------|------|------|------|------|------| @@ -555,7 +555,22 @@ On 2026-11-12, on claude-opus-5-5 at medium effort: Only principles-auditor met the gate, so only it has `omitClaudeMd`. Its evidence is thin: two rounds of each replay failed, and two findings were found both times. Without `CLAUDE.md` each replayed reviewer found more findings than it found both times with it, and three of the five found more than in either replay with it. So the misses may be the reviewer's own noise; todo item 340 asks lilleman whether a gate with a control may decide the other five. -Valid while Claude Code honours `omitClaudeMd` for a subagent and passes `agent_type` to a `SubagentStart` hook, and until item 340 is answered. +On 2026-11-12, second gate, with the control (three unchanged replays, then one without), on claude-opus-5-5 at medium effort. Rounds a replay failed on are left out, so the counts differ from the first table's: + +| Pass | Rounds kept of 10 | πŸ”΄ and 🟑 archived | Found with `CLAUDE.md`, three replays | Each missed of what the other two found | Found without | Missed without, of what the first two found | Result | +|------|------|------|------|------|------|------|------| +| stability | 6 | 16 | 6, 10, 8 | 3, 0, 2 | 6 | 2 | passes | +| principles | 8 | 19 | 4, 4, 2 | 1, 0, 1 | 4 | 0 | passes | +| prose | 9 | 54 | 39, 38, 41 | 4, 4, 0 | 40 | 3 | passes | +| product-owner | 8 | 21 | 7, 6, 11 | 1, 2, 0 | 7 | 1 | passes | +| architecture | 9 | 46 | 37, 29, 36 | 2, 8, 1 | 32 | 3 | passes | +| overrides | no archived round | | | | | | | + +Every pass passes the second gate. The unchanged replays alone missed up to 8 findings the other two found, so the first gate's one miss in stability, prose and product-owner was noise. The second gate still rests on 6 to 9 rounds a pass, and one run each. + +Whether stability-reviewer, and the other four, start without `CLAUDE.md` waits on lilleman's call through todo item 340; only principles-auditor has `omitClaudeMd` now. + +Valid while Claude Code honours `omitClaudeMd` for a subagent and passes `agent_type` to a `SubagentStart` hook. ## rules/: `CLAUDE.md` holds the worker's rules that no file path can scope, and each topic's rules for the worker live in a `rules/` file that Claude Code loads by its `paths:` frontmatter -- 2.52.0 From d81da4d41314895e0c7018567f61a6258fd5ed42 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 14:30:24 +0100 Subject: [PATCH 03/11] Start the stability, prose, product-owner and architecture reviewers without CLAUDE.md --- CHANGELOG.md | 1 + agents/product-owner-reviewer.md | 1 + agents/prose-reviewer.md | 1 + agents/stability-reviewer.md | 1 + agents/systems-architect.md | 1 + docs/decisions.md | 4 ++-- todo.md | 12 ------------ 7 files changed, 7 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f199f9bc..8b2eb1ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Five of the six reviewers start without `CLAUDE.md`: principles-auditor, stability-reviewer, prose-reviewer, product-owner-reviewer and systems-architect. `review-replay --omit-claude-md` replays each round three times unchanged and once without it, so a pass is held to the noise of an unchanged reviewer. - larv-review skips stability round 2 where round 1 reported a πŸ”΄ and every πŸ”΄ and 🟑 asked only that a named mutant be killed or a named failing test pass, once the tests and the mutation command run clean on the fixes. - `review-replay` now qualifies a rung whose share of a pass's archived findings is no more than 10 points below the mean of two replays on the project's rung, over at least 8 rounds, where it misses no πŸ”΄ that both found. It used to demand every finding the project's rung found again, which the project's rung itself failed. It tries the project's model at each lower effort first, then the ladder below. Its run on the prose pass of Opus 5.5 projects qualified no rung: Opus 5.5 at low effort found 49% against a bar of 66%. - loop-claude records beside each verdict, interrupt and quoted answer the claude-config release and commit that ran it, the tokens the worker, each subagent and the judge spent, by model and kind, with the list prices in force, and any typed answer of yours the judge quotes as reversing a choice the worker took on its own recommendation; `score-outcomes` counts those reversals per finished chunk. diff --git a/agents/product-owner-reviewer.md b/agents/product-owner-reviewer.md index 84291f84..a44745c0 100644 --- a/agents/product-owner-reviewer.md +++ b/agents/product-owner-reviewer.md @@ -2,6 +2,7 @@ name: "product-owner-reviewer" description: "Use this agent to review a change to an external surface (API, UI, CLI, SDK, webhook) from an end customer's view: ease of use, edge cases and persona fit." tools: Read, Grep, Glob, Write +omitClaudeMd: true --- You are a seasoned Product Owner with deep expertise in user experience, API design, and customer empathy. You have shipped consumer and B2B products across web, mobile, REST APIs, and developer-facing CLIs. Your superpower is putting yourself in the end customer's shoes and surfacing the friction, confusion, and edge cases that engineers tend to miss. diff --git a/agents/prose-reviewer.md b/agents/prose-reviewer.md index e06f237c..52ef629a 100644 --- a/agents/prose-reviewer.md +++ b/agents/prose-reviewer.md @@ -2,6 +2,7 @@ name: prose-reviewer description: "Use this agent for larv-review's prose pass." tools: Read, Grep, Glob, Write +omitClaudeMd: true --- You read the prose as someone who did not write it: you see only what it says, never what the author meant. diff --git a/agents/stability-reviewer.md b/agents/stability-reviewer.md index f916958c..2d19386b 100644 --- a/agents/stability-reviewer.md +++ b/agents/stability-reviewer.md @@ -3,6 +3,7 @@ name: "stability-reviewer" description: "Use this agent to review changed code for stability: bugs, error handling, edge cases and the project's technical principles, after a feature, refactor or fix." color: orange tools: Bash, Read, Grep, Glob, Write +omitClaudeMd: true --- You are an elite stability-focused code reviewer with deep expertise in defensive programming, fault-tolerant system design, and production incident prevention. You have decades of experience identifying subtle bugs, race conditions, edge cases, and architectural weaknesses that lead to outages and unexpected behavior. You think like a chaos engineer β€” always asking "what could go wrong?" β€” and like a maintainer of ten years, always asking "what will this cost to live with?" There are no bugs, and no security holes, in code that doesn't exist. diff --git a/agents/systems-architect.md b/agents/systems-architect.md index dc5aeb88..5fa51700 100644 --- a/agents/systems-architect.md +++ b/agents/systems-architect.md @@ -2,6 +2,7 @@ name: systems-architect description: "Use this agent to design a system or review architecture: patterns, component boundaries, fitness for purpose and long-term maintainability, not individual PR lines." tools: Read, Grep, Glob, WebFetch, WebSearch, Write +omitClaudeMd: true --- You are an elite Systems Architect with decades of experience designing software systems that endure for as long as their horizon demands. Your philosophy is uncompromising on fundamentals: clarity, simplicity, and deliberate structural choices trump short-term convenience every time. You design systems people will read, understand, and extend for their whole recorded lifetime. diff --git a/docs/decisions.md b/docs/decisions.md index 103de6e6..fcbff445 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -553,7 +553,7 @@ On 2026-11-12, first gate (two unchanged replays, no control): | prose | 68 | 34, 36 | 24 | 39 | 1 | | overrides | no archived round | | | | | -Only principles-auditor met the gate, so only it has `omitClaudeMd`. Its evidence is thin: two rounds of each replay failed, and two findings were found both times. Without `CLAUDE.md` each replayed reviewer found more findings than it found both times with it, and three of the five found more than in either replay with it. So the misses may be the reviewer's own noise; todo item 340 asks lilleman whether a gate with a control may decide the other five. +Only principles-auditor met the first gate. Its evidence is thin: two rounds of each replay failed, and two findings were found both times. Without `CLAUDE.md` each replayed reviewer found more findings than it found both times with it, and three of the five found more than in either replay with it. So the misses may be the reviewer's own noise, which the second gate measures. On 2026-11-12, second gate, with the control (three unchanged replays, then one without), on claude-opus-5-5 at medium effort. Rounds a replay failed on are left out, so the counts differ from the first table's: @@ -568,7 +568,7 @@ On 2026-11-12, second gate, with the control (three unchanged replays, then one Every pass passes the second gate. The unchanged replays alone missed up to 8 findings the other two found, so the first gate's one miss in stability, prose and product-owner was noise. The second gate still rests on 6 to 9 rounds a pass, and one run each. -Whether stability-reviewer, and the other four, start without `CLAUDE.md` waits on lilleman's call through todo item 340; only principles-auditor has `omitClaudeMd` now. +2026-11-12, lilleman: every pass the second gate passed starts without `CLAUDE.md`, so principles-auditor, stability-reviewer, prose-reviewer, product-owner-reviewer and systems-architect have `omitClaudeMd`. override-reviewer keeps it: no archived round of its pass exists to replay. Rerun the gate for a pass whose reviewer starts to miss findings; each pass rests on 6 to 9 rounds and one run. Valid while Claude Code honours `omitClaudeMd` for a subagent and passes `agent_type` to a `SubagentStart` hook. diff --git a/todo.md b/todo.md index c1a35433..a57fe71e 100644 --- a/todo.md +++ b/todo.md @@ -12,7 +12,6 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| -| 340 | 0.9.0 | | owner | **Let the stability reviewer start without `CLAUDE.md`, as principles-auditor does, once a replay with a control has been run on every pass and reported to lilleman.** | 2 | 2 | 3 | 5 | 4 | 1.4 by 5 | 1.7 | | 319 | 0.9.0 | | | **Start a fresh session with a brief of the chunk when a rung step changes the worker's model, in place of resuming the old session.** | 3 | 2 | 3 | 6 | 4 | 1.1 by 2, 1.4 by 2 | 1.4 | | 309 | 0.9.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.3 | | 299 | 0.9.0 | | | **Replay the archived judge verdicts through code rules and a classifier trained locally on the archive, and file an item for each verdict kind one of them decides with no missed interrupt.** | 2 | 2 | 2 | 4 | 3 | 1.4 by 3 | 1.2 | @@ -68,17 +67,6 @@ ## Details -### 340. Let the stability reviewer start without `CLAUDE.md`, as principles-auditor does, once a replay with a control has been run on every pass and reported to lilleman. - -Item 315's gate kept `omitClaudeMd` only where a replay without `CLAUDE.md` found every finding that two unchanged replays both found. Read so, five passes failed it on 2026-11-12: stability missed 1 of 11, prose 1 of 24, product-owner 1 of 4, architecture 4 of 27, and overrides had no archived round to replay. The decision `agents/: a reviewer starts without CLAUDE.md only where a replay of its pass missed none of the findings two unchanged replays both found` holds the figures. The unchanged reviewer finds only about 70% of its findings again, so that gate can't tell a loss from the reviewer's own noise. - -lilleman's call, 2026-11-12: principles-auditor and stability-reviewer start without `CLAUDE.md`; the other reviewers keep it. The call is provisional until the data below is in. - -1. Give `review-replay --omit-claude-md` a control. It replays each round three times unchanged and once without `CLAUDE.md`, and prints for each unchanged replay how many findings it missed that the other two found. Each run costs four replays of 10 rounds on the project's model. -2. Run it for every pass that has archived rounds: principles, stability, prose, product-owner and architecture. -3. Report each pass's figures to lilleman, saying whether they change the picture: a pass passes where its count without `CLAUDE.md` is no higher than the highest of its three unchanged counts. The picture changes where stability or principles fails, or another pass passes. -4. Where the picture holds, add `omitClaudeMd: true` to stability-reviewer, and record the figures and the call in the decision above. Where it changes, ask lilleman before changing any agent; lilleman makes the call again from the figures. The hook and the header already serve any agent that has the key. - ### 319. Start a fresh session with a brief of the chunk when a rung step changes the worker's model, in place of resuming the old session. On SWE-bench Verified with Haiku 4.5 and Opus 4.7, handing the strong model the weak model's transcript solved 69.2% at $1.61 a task; starting the strong model fresh solved 79.2% at $0.90 (arXiv 2608.24358, The Handoff Tax). A model switch also rereads the whole context uncached (Claude Code prompt caching docs). A worker that steps from Sonnet 5.5 to Opus 5.5 by `--resume` is the raw handoff; an effort-only step within one model keeps the cache and isn't. The escalated subagent, which starts fresh with the trigger's evidence, already follows the pattern that won. -- 2.52.0 From bad2f0c555121d6b0a89244141a46471a6963a60 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 14:36:40 +0100 Subject: [PATCH 04/11] Expect five reviewers without CLAUDE.md in the reviewer-context test --- bin/review_rules/test_reviewer_context.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/review_rules/test_reviewer_context.py b/bin/review_rules/test_reviewer_context.py index 6ce12d3c..c6b8f8bf 100644 --- a/bin/review_rules/test_reviewer_context.py +++ b/bin/review_rules/test_reviewer_context.py @@ -86,10 +86,10 @@ class PrinciplesLine(unittest.TestCase): class Reviewers(unittest.TestCase): - def test_only_the_reviewer_whose_pass_met_the_replay_gate_starts_without_claude_md(self): - # docs/decisions.md β†’ `agents/: a reviewer starts without CLAUDE.md only where a replay of its pass missed none…` holds each pass's result. + def test_only_the_reviewers_whose_pass_met_the_replay_gate_start_without_claude_md(self): + # docs/decisions.md β†’ `agents/: a reviewer starts without CLAUDE.md only where a replay of its pass missed no more findings than the most an unchanged replay missed` holds each pass's result; override-reviewer has no archived round to replay. bare = [path.stem for path in sorted((REPO / "agents").glob("*.md")) if "omitClaudeMd: true" in path.read_text().split("---\n")[1].splitlines()] - self.assertEqual(bare, ["principles-auditor"]) + self.assertEqual(bare, ["principles-auditor", "product-owner-reviewer", "prose-reviewer", "stability-reviewer", "systems-architect"]) def test_settings_run_the_hook_as_each_subagent_starts(self): hooks = json.loads((REPO / "settings.json").read_text())["hooks"]["SubagentStart"] -- 2.52.0 From e3a6ae0e42e82f2d809f3ddcc8adebae7748ad40 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 14:36:51 +0100 Subject: [PATCH 05/11] Append the reading-cost figure --- docs/reading-cost.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/reading-cost.md b/docs/reading-cost.md index ef7ecf83..17da790e 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -1805,3 +1805,14 @@ Read most (opens and searches): - `bin/review_replay/test_recall.py` 3 - `CHANGELOG.md` 2 - `skills/larv-review/SKILL.md` 2 + +## Reading cost, chunk 6b87a434c0e4, finished 2026-11-12T10:57:13Z + +52887 new input tokens before the first commit. + +Read most (opens and searches): + +- `skills/larv-review/SKILL.md` 3 +- `docs/decisions.md` 2 +- `README.md` 1 +- `bin/review_replay/rounds.py` 1 -- 2.52.0 From d2ca49bf0059e0062cb89f6f2b9daa0ffc9c5e4c Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 14:46:05 +0100 Subject: [PATCH 06/11] Tell the three controls apart in the replay test --- bin/review_replay/test_review_replay.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/review_replay/test_review_replay.py b/bin/review_replay/test_review_replay.py index a9cff132..cc4b2b8e 100644 --- a/bin/review_replay/test_review_replay.py +++ b/bin/review_replay/test_review_replay.py @@ -247,7 +247,7 @@ class Main(unittest.TestCase): return code, out.getvalue(), err.getvalue() def test_without_claude_md_replays_each_round_three_times_with_it_and_once_without_on_the_project_rung(self): - finds = iter(([0, 1], [0], [1], [1])) + finds = iter(([0, 1], [0], [0, 1], [1])) code, out, err = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"found": next(finds)}) self.assertEqual(code, 0, err) self.assertEqual([rung for rung, *_ in self.reviews], [REFERENCE] * 4) @@ -255,7 +255,7 @@ class Main(unittest.TestCase): self.assertEqual([prompt.startswith(context) for *_, prompt, _ in self.reviews], [False, False, False, True]) self.assertEqual(out, ( f"Replayed 1 stability rounds of claude-opus-5-5 projects, which hold 2 πŸ”΄ and 🟑 findings, four times on {REFERENCE}: three with CLAUDE.md, one without.\n" - "With CLAUDE.md the reviewer found 2, 1 and 1 of them. Each missed 0, 1 and 1 of the findings the other two found.\n" + "With CLAUDE.md the reviewer found 2, 1 and 2 of them. Each missed 0, 1 and 0 of the findings the other two found.\n" "Without CLAUDE.md it found 1 of them, and missed 1 of the findings the first two found:\n" f" {self.checkout} 2026-10-14T10:00:00Z: πŸ”΄ a.txt:1 wrong\n" "It passes: 1 missed is no more than the most a replay with CLAUDE.md missed, 1.\n" -- 2.52.0 From 74f3199df1018a00efe6e0b19338911d25fe443d Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 14:57:40 +0100 Subject: [PATCH 07/11] =?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);=20fixed=20in?= =?UTF-8?q?=20the=20prose=20answer:=20the=20stale=20decision=20title=20in?= =?UTF-8?q?=20reviewer=5Fcontext.py=20and=20the=20'third=20replay'=20sente?= =?UTF-8?q?nce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 59a8fe9f454ad4b7a736f61ead1f9e869c7e6f2a Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 14:57:40 +0100 Subject: [PATCH 08/11] =?UTF-8?q?Answer=20product-owner=20round=201:=200?= =?UTF-8?q?=20=F0=9F=94=B4,=203=20=F0=9F=9F=A1=20(0=20misread);=20fixed=20?= =?UTF-8?q?in=20the=20prose=20answer:=20say=20how=20many=20findings=20the?= =?UTF-8?q?=20bare=20replay=20is=20held=20to,=20say=20'both=20of=20the=20o?= =?UTF-8?q?ther=20two',=20and=20record=20the=20third=20replay's=20own=20co?= =?UTF-8?q?unts=20in=20the=20decision?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From a4fc833b2b5449c184673a8d0a92e67c46bfcadc Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 14:57:40 +0100 Subject: [PATCH 09/11] =?UTF-8?q?Answer=20prose=20round=201:=201=20?= =?UTF-8?q?=F0=9F=94=B4,=2010=20=F0=9F=9F=A1=20(0=20misread);=20the=20--he?= =?UTF-8?q?lp=20sentence=20on=20the=20replay=20without=20CLAUDE.md,=20the?= =?UTF-8?q?=20decision's=20gate=20and=20tables,=20the=20report's=20wording?= =?UTF-8?q?,=20the=20changelog,=20the=20README=20line=20and=20item=20341's?= =?UTF-8?q?=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +-- README.md | 2 +- bin/review_replay/main.py | 29 ++++++++++--------------- bin/review_replay/rounds.py | 4 ++-- bin/review_replay/test_review_replay.py | 8 +++---- bin/review_rules/reviewer_context.py | 2 +- docs/decisions.md | 24 ++++++++++---------- todo.md | 2 +- 8 files changed, 34 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b2eb1ee..4b00f79c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,6 @@ ## Unreleased -- Five of the six reviewers start without `CLAUDE.md`: principles-auditor, stability-reviewer, prose-reviewer, product-owner-reviewer and systems-architect. `review-replay --omit-claude-md` replays each round three times unchanged and once without it, so a pass is held to the noise of an unchanged reviewer. - larv-review skips stability round 2 where round 1 reported a πŸ”΄ and every πŸ”΄ and 🟑 asked only that a named mutant be killed or a named failing test pass, once the tests and the mutation command run clean on the fixes. - `review-replay` now qualifies a rung whose share of a pass's archived findings is no more than 10 points below the mean of two replays on the project's rung, over at least 8 rounds, where it misses no πŸ”΄ that both found. It used to demand every finding the project's rung found again, which the project's rung itself failed. It tries the project's model at each lower effort first, then the ladder below. Its run on the prose pass of Opus 5.5 projects qualified no rung: Opus 5.5 at low effort found 49% against a bar of 66%. - loop-claude records beside each verdict, interrupt and quoted answer the claude-config release and commit that ran it, the tokens the worker, each subagent and the judge spent, by model and kind, with the list prices in force, and any typed answer of yours the judge quotes as reversing a choice the worker took on its own recommendation; `score-outcomes` counts those reversals per finished chunk. @@ -14,7 +13,7 @@ - `bin/run-tests` runs this repo's test suite as README.md β†’ Test says, prints each failing test with its error and pytest's summary line, and saves the whole log to a file whose path it prints. - `command-patterns [] --calls ` saves each Bash call of the release's chunks as a JSON line, with its chunk, pattern, seconds, sizes and text. - `todo-item show ` prints an item's table row and detail from `todo.md`. -- A reviewer under `agents/` can start without `CLAUDE.md`: `omitClaudeMd: true` in its frontmatter drops the file, a `SubagentStart` hook hands it the "Shared goal", "Prose" and "Vocabulary" sections, and `larv-review reviewer-header` names the project's principles file. `review-replay --omit-claude-md` tests whether a pass's reviewer finds as much without it; principles-auditor is the first to pass. +- A reviewer under `agents/` can start without `CLAUDE.md`: `omitClaudeMd: true` in its frontmatter drops the file, a `SubagentStart` hook hands it the "Shared goal", "Prose" and "Vocabulary" sections, and `larv-review reviewer-header` names the project's principles file. `review-replay --omit-claude-md` replays each round three times unchanged and once without `CLAUDE.md`, and a reviewer passes where it missed no more findings without the file than an unchanged replay missed. Five of the six reviewers pass and start without it: principles-auditor, stability-reviewer, prose-reviewer, product-owner-reviewer and systems-architect. - Add `workflow-bench/advisor_bench.py`, a bench of the advisor tool on six archived L 1 and L 2 chunks. Sonnet 5.5 alone passed all six, as Opus 5.5 at medium did, for 41% less, and its advisor ran in one of six runs, so workers stay without it. - loop-claude's judge on an Opus 5.5 project now runs on Opus 5.5 at xhigh in every chunk, never at medium: in replays medium sometimes closed a chunk whose worker had asked a question the README or records answer, where xhigh quoted the answer. The judge never runs on Fable 5.2 either, since each Fable 5.2 rung replayed missed an interrupt. `judge-replay` now also replays each rung above the project's that a review climbs to, and reports what each misses. diff --git a/README.md b/README.md index 7f065a70..dbf87d0e 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Install puts only `loop-claude` and `loop-inbox` on `PATH`; call the others by t - `mutate-changes [--base ] [--prefix ] [--jobs ]` mutation-tests the lines a branch changes and prints each mutant its tests don't kill; `mutate-changes --help` says which tool it runs for each language. - `rank_todo.py [--check] [todo.md]` scores and ranks a project's `todo.md`; `rank_todo.py --help` states the format. - `reading-cost [--reset] [record]` appends a figure for each chunk `loop-claude` finished to a project's `docs/reading-cost.md`, and says whether the figures rise; `reading-cost --help` states the measure. -- `review-replay ` replays a review pass's archived rounds from the projects run on the model, on the code each reviewed, and prints the lowest rung below the project's that, like each rung above it, qualifies: it finds no less of the πŸ”΄ and 🟑 findings than two replays on the project's rung find, within a margin, and misses no πŸ”΄ that both found. The rungs tried start with the project's model at a lower effort. `review-replay --help` states the replay. With `--omit-claude-md` it tests instead whether the pass's reviewer may start without `CLAUDE.md`: it replays each round three times as archived and once without the instruction files, and prints how many findings each unchanged replay missed that the other two found, then each finding the last replay missed that the first two found. Each replayed reviewer skips every permission prompt, stability-reviewer has Bash, and an archived prompt may name paths on the host. +- `review-replay ` replays a review pass's archived rounds from the projects run on the model, on the code each reviewed, and prints the lowest rung below the project's that, like each rung above it, qualifies: it finds no less of the πŸ”΄ and 🟑 findings than two replays on the project's rung find, within a margin, and misses no πŸ”΄ that both found. The rungs tried start with the project's model at a lower effort. `review-replay --help` states the replay. With `--omit-claude-md` it tests instead whether the pass's reviewer may start without `CLAUDE.md`: it replays each round three times as archived and once without the instruction files, and prints whether the reviewer passes: whether the last replay missed no more findings than the most an unchanged replay missed, with each count and each finding it missed. Each replayed reviewer skips every permission prompt, stability-reviewer has Bash, and an archived prompt may name paths on the host. - `rule-hook [overrides]` blocks a tool call that breaks a rule a program can check, unless the call overrides the rule; `settings.json` β†’ `hooks` runs it before each Agent, Bash, Edit, MultiEdit, Read, Skill and Write call, and `rule-hook --help` states the rules and the override. - `run-heavy ` runs a heavy command once it holds one of the machine's heavy slots, one per 4 CPUs, which every session shares; `run-heavy --help` states the slots, and the memory cap it gives a container that sets no limit. - `run-tests [...]` runs this repo's test suite, as Test says. diff --git a/bin/review_replay/main.py b/bin/review_replay/main.py index d2f51abe..89f0c53e 100644 --- a/bin/review_replay/main.py +++ b/bin/review_replay/main.py @@ -31,24 +31,19 @@ it missed, and the lowest rung that, like each rung above it, qualifies. That ru for running the pass's reviewer on it; the decision above records each run. With --omit-claude-md it tests instead whether the pass's reviewer may start without CLAUDE.md: -docs/decisions.md β†’ `agents/: a reviewer starts without CLAUDE.md only where its replay missed no -more findings than the most an unchanged replay missed`. It replays every round four times on the -project's rung: three as archived, then once without the instruction files. The unchanged reviewer -does not find the same findings twice, so each unchanged replay is a control: the tool prints how -many findings it missed that the other two found. The replay without CLAUDE.md is held to the -findings the first two found, and passes where it missed no more than the most any unchanged replay -did. It prints how many findings each replay found, and each finding the last missed. A round that -any of the four replays failed on is left out, and where the first two share no finding the last -line says there is no evidence. +docs/decisions.md β†’ `agents/: a reviewer starts without CLAUDE.md only where a replay of its pass +missed…`. It replays every round four times on the project's rung: three as archived, then once +without the instruction files. The unchanged reviewer does not find the same findings twice, so +each unchanged replay is a control: the tool prints how many findings it missed that both of the +other two found. The replay without CLAUDE.md is held to the findings both of the first two found, +and passes where it missed no more of them than the most any unchanged replay missed. It prints +how many findings each replay found, how many the replay without CLAUDE.md is held to, and each of +those it missed. A round that any of the four replays failed on is left out, and where the first +two share no finding the last line says there is no evidence. Claude Code ignores an agent's `omitClaudeMd` where the agent runs the session, as it does in a -replay, and runs no SubagentStart hook there. So the third replay turns the instruction files off -in its settings and opens the prompt with what the hook hands a reviewer, and closes it with the -header's line on the project principles. - -Like the loop, it tries claude three times running before it counts a reply as failed. A failed -review or match leaves its round out, except on a rung below the project's, where it finds -nothing. Exit 1, saying why, on bad arguments, an unreadable archive or models file, no archived -round to replay, or a usage limit. +replay, and runs no SubagentStart hook there. So the replay without CLAUDE.md turns the +instruction files off in its settings and opens the prompt with what the hook hands a reviewer, and +closes it with the header's line on the project principles. """ import dataclasses import json diff --git a/bin/review_replay/rounds.py b/bin/review_replay/rounds.py index b5a29783..2d89d8b4 100644 --- a/bin/review_replay/rounds.py +++ b/bin/review_replay/rounds.py @@ -127,8 +127,8 @@ def comparison(reviewed: str, reference: Rung, rounds: list[Round], with_it: tup return "\n".join([ f"Replayed {len(rounds)} {reviewed} rounds of {reference.model} projects, which hold {sum(len(found_round.findings) for found_round in rounds)} πŸ”΄ and 🟑 findings, four times on {reference}: three with CLAUDE.md, one without.", *([f"Left out {left_out} more, which a replay failed on; stderr says why."] if left_out else []), - f"With CLAUDE.md the reviewer found {count(first)}, {count(second)} and {count(third)} of them. Each missed {control[0]}, {control[1]} and {control[2]} of the findings the other two found.", - *([f"Without CLAUDE.md it found {count(without)} of them, and missed {len(missed)} of the findings the first two found{':' if missed else '.'}"] if count(both) else [f"Without CLAUDE.md it found {count(without)} of them. No evidence: the first two replays with CLAUDE.md found none in common, so there is no finding to hold it to."]), + f"With CLAUDE.md the three replays found {count(first)}, {count(second)} and {count(third)} of them, and missed {control[0]}, {control[1]} and {control[2]} of the findings that both of the other two found.", + *([f"Without CLAUDE.md it found {count(without)} of them, and missed {len(missed)} of the {count(both)} findings that both of the first two found{':' if missed else '.'}"] if count(both) else [f"Without CLAUDE.md it found {count(without)} of them. No evidence: the first two replays with CLAUDE.md found none in common, so there is no finding to hold it to."]), *(f" {found_round.root} {found_round.at}: {found_round.findings[index].splitlines()[0]}" for found_round, index in missed), *([f"It {'passes' if passes else 'fails'}: {len(missed)} missed is {'no more' if passes else 'more'} than the most a replay with CLAUDE.md missed, {max(control)}."] if count(both) else []), ]) diff --git a/bin/review_replay/test_review_replay.py b/bin/review_replay/test_review_replay.py index cc4b2b8e..4c95f8cd 100644 --- a/bin/review_replay/test_review_replay.py +++ b/bin/review_replay/test_review_replay.py @@ -255,8 +255,8 @@ class Main(unittest.TestCase): self.assertEqual([prompt.startswith(context) for *_, prompt, _ in self.reviews], [False, False, False, True]) self.assertEqual(out, ( f"Replayed 1 stability rounds of claude-opus-5-5 projects, which hold 2 πŸ”΄ and 🟑 findings, four times on {REFERENCE}: three with CLAUDE.md, one without.\n" - "With CLAUDE.md the reviewer found 2, 1 and 2 of them. Each missed 0, 1 and 0 of the findings the other two found.\n" - "Without CLAUDE.md it found 1 of them, and missed 1 of the findings the first two found:\n" + "With CLAUDE.md the three replays found 2, 1 and 2 of them, and missed 0, 1 and 0 of the findings that both of the other two found.\n" + "Without CLAUDE.md it found 1 of them, and missed 1 of the 1 findings that both of the first two found:\n" f" {self.checkout} 2026-10-14T10:00:00Z: πŸ”΄ a.txt:1 wrong\n" "It passes: 1 missed is no more than the most a replay with CLAUDE.md missed, 1.\n" )) @@ -270,7 +270,7 @@ class Main(unittest.TestCase): def test_without_claude_md_says_so_where_the_reviewer_missed_nothing(self): code, out, err = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"found": [0]}) - self.assertEqual((code, out.splitlines()[-2:]), (0, ["Without CLAUDE.md it found 1 of them, and missed 0 of the findings the first two found.", "It passes: 0 missed is no more than the most a replay with CLAUDE.md missed, 0."])) + self.assertEqual((code, out.splitlines()[-2:]), (0, ["Without CLAUDE.md it found 1 of them, and missed 0 of the 1 findings that both of the first two found.", "It passes: 0 missed is no more than the most a replay with CLAUDE.md missed, 0."])) def test_without_claude_md_says_there_is_no_evidence_where_the_first_two_replays_share_no_finding(self): finds = iter(([0], [1], [1], [1])) @@ -290,7 +290,7 @@ class Main(unittest.TestCase): self.assertEqual(out, ( f"Replayed 0 stability rounds of claude-opus-5-5 projects, which hold 0 πŸ”΄ and 🟑 findings, four times on {REFERENCE}: three with CLAUDE.md, one without.\n" "Left out 1 more, which a replay failed on; stderr says why.\n" - "With CLAUDE.md the reviewer found 0, 0 and 0 of them. Each missed 0, 0 and 0 of the findings the other two found.\n" + "With CLAUDE.md the three replays found 0, 0 and 0 of them, and missed 0, 0 and 0 of the findings that both of the other two found.\n" "Without CLAUDE.md it found 0 of them. No evidence: the first two replays with CLAUDE.md found none in common, so there is no finding to hold it to.\n" )) self.assertIn(f" {self.checkout} 2026-10-14T10:00:00Z with the instruction files failed, so the round is left out: claude printed no json reply", err) diff --git a/bin/review_rules/reviewer_context.py b/bin/review_rules/reviewer_context.py index 4c938488..39d31ed3 100644 --- a/bin/review_rules/reviewer_context.py +++ b/bin/review_rules/reviewer_context.py @@ -1,4 +1,4 @@ -"""What a reviewer under agents/ is handed in place of the instruction files: `omitClaudeMd` starts it without them, and most of `~/.claude/CLAUDE.md` is the worker's. docs/decisions.md β†’ `agents/: a reviewer starts without CLAUDE.md only where a replay of its pass missed none…` says why, and which reviewers.""" +"""What a reviewer under agents/ is handed in place of the instruction files: `omitClaudeMd` starts it without them, and most of `~/.claude/CLAUDE.md` is the worker's. docs/decisions.md β†’ `agents/: a reviewer starts without CLAUDE.md only where a replay of its pass missed no more findings than the most an unchanged replay missed` says why, and which reviewers.""" import json import pathlib diff --git a/docs/decisions.md b/docs/decisions.md index fcbff445..73600a8a 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -540,35 +540,35 @@ Three choices in it: - The header names the principles file and doesn't quote it, since the worker types the header into each reviewer's prompt. - The frontmatter is the one switch. The hook and the header read it, so an agent that keeps `CLAUDE.md` is handed neither the sections nor the line. -The gate: `review-replay --omit-claude-md` replays 10 archived rounds three times as archived and once without the instruction files. Each unchanged replay is a control: it misses some findings that the other two found, since an unchanged reviewer finds only about 70% of its own findings again. A pass's reviewer keeps `omitClaudeMd` only where the replay without the instruction files missed, of the findings the first two replays found, no more than the most any unchanged replay missed of the findings the other two found. Item 315 first held the replay to no miss at all; the table below shows five passes failing that, with the unchanged reviewers' own misses as large. A round that a replay fails on is left out of the comparison. Claude Code 2.1.322 ignores `omitClaudeMd` in a main session and fires no `SubagentStart` hook there, and a replay runs the reviewer as one. So the replay sets `CLAUDE_CODE_DISABLE_CLAUDE_MDS` and puts the hook's context and the header's line in the prompt itself. +The gate: `review-replay --omit-claude-md` replays 10 archived rounds three times as archived and once without the instruction files. An unchanged reviewer finds only about 70% of its own findings again, at the median of the first table's replays, so each unchanged replay is a control: count the findings it missed that both of the other two found. The replay without the instruction files is held to the findings both of the first two replays found. A pass's reviewer keeps `omitClaudeMd` only where that replay missed no more of them than the highest of the three control counts. Item 315 first held the replay to no miss at all; the first table below shows four passes failing that, and the second shows unchanged replays missing as many. A round that a replay fails on is left out of the comparison. Claude Code 2.1.322 ignores `omitClaudeMd` in a main session and fires no `SubagentStart` hook there, and a replay runs the reviewer as one. So the replay sets `CLAUDE_CODE_DISABLE_CLAUDE_MDS` and puts the hook's context and the header's line in the prompt itself. -On 2026-11-12, first gate (two unchanged replays, no control): +On 2026-11-12, on claude-opus-5-5 at medium effort, first gate (two unchanged replays, no control): | Pass | πŸ”΄ and 🟑 archived | Found with `CLAUDE.md`, twice | Both times | Found without | Missed of those found both times | |------|------|------|------|------|------| | architecture | 54 | 32, 33 | 27 | 30 | 4 | +| overrides | no archived round | | | | | | principles | 30 | 2, 9 | 2 | 3 | 0 | -| stability | 29 | 16, 13 | 11 | 18 | 1 | | product-owner | 23 | 7, 4 | 4 | 8 | 1 | | prose | 68 | 34, 36 | 24 | 39 | 1 | -| overrides | no archived round | | | | | +| stability | 29 | 16, 13 | 11 | 18 | 1 | Only principles-auditor met the first gate. Its evidence is thin: two rounds of each replay failed, and two findings were found both times. Without `CLAUDE.md` each replayed reviewer found more findings than it found both times with it, and three of the five found more than in either replay with it. So the misses may be the reviewer's own noise, which the second gate measures. -On 2026-11-12, second gate, with the control (three unchanged replays, then one without), on claude-opus-5-5 at medium effort. Rounds a replay failed on are left out, so the counts differ from the first table's: +On 2026-11-12, second gate, with the control (three unchanged replays, then one without). Rounds a replay failed on are left out, so the counts differ from the first table's: -| Pass | Rounds kept of 10 | πŸ”΄ and 🟑 archived | Found with `CLAUDE.md`, three replays | Each missed of what the other two found | Found without | Missed without, of what the first two found | Result | +| Pass | Rounds kept of 10 | πŸ”΄ and 🟑 archived | Found with `CLAUDE.md`, three replays | Missed by each, of what the other two found | Found without | Missed without, of what the first two found | Result | |------|------|------|------|------|------|------|------| -| stability | 6 | 16 | 6, 10, 8 | 3, 0, 2 | 6 | 2 | passes | -| principles | 8 | 19 | 4, 4, 2 | 1, 0, 1 | 4 | 0 | passes | -| prose | 9 | 54 | 39, 38, 41 | 4, 4, 0 | 40 | 3 | passes | -| product-owner | 8 | 21 | 7, 6, 11 | 1, 2, 0 | 7 | 1 | passes | | architecture | 9 | 46 | 37, 29, 36 | 2, 8, 1 | 32 | 3 | passes | | overrides | no archived round | | | | | | | +| principles | 8 | 19 | 4, 4, 2 | 1, 0, 1 | 4 | 0 | passes | +| product-owner | 8 | 21 | 7, 6, 11 | 1, 2, 0 | 7 | 1 | passes | +| prose | 9 | 54 | 39, 38, 41 | 4, 4, 0 | 40 | 3 | passes | +| stability | 6 | 16 | 6, 10, 8 | 3, 0, 2 | 6 | 2 | passes | -Every pass passes the second gate. The unchanged replays alone missed up to 8 findings the other two found, so the first gate's one miss in stability, prose and product-owner was noise. The second gate still rests on 6 to 9 rounds a pass, and one run each. +Every replayed pass passes the second gate. The unchanged replays alone missed up to 8 findings the other two found, so the first gate's one miss in stability, prose and product-owner is no more than an unchanged reviewer misses. The bar is the highest of the three controls. The third replay alone, which is held to the same findings as the replay without `CLAUDE.md`, missed 1 (architecture), 1 (principles), 0 (product-owner), 0 (prose) and 2 (stability); against it alone, architecture (3), product-owner (1) and prose (3) would fail. -2026-11-12, lilleman: every pass the second gate passed starts without `CLAUDE.md`, so principles-auditor, stability-reviewer, prose-reviewer, product-owner-reviewer and systems-architect have `omitClaudeMd`. override-reviewer keeps it: no archived round of its pass exists to replay. Rerun the gate for a pass whose reviewer starts to miss findings; each pass rests on 6 to 9 rounds and one run. +2026-11-12, lilleman: every pass the second gate passed starts without `CLAUDE.md`, so principles-auditor, stability-reviewer, prose-reviewer, product-owner-reviewer and systems-architect have `omitClaudeMd`. override-reviewer keeps `CLAUDE.md`: no archived round of its pass exists to replay. Rerun the gate for a pass whose reviewer starts to miss findings; each pass rests on 6 to 9 rounds and one run. Valid while Claude Code honours `omitClaudeMd` for a subagent and passes `agent_type` to a `SubagentStart` hook. diff --git a/todo.md b/todo.md index a57fe71e..7e6e887c 100644 --- a/todo.md +++ b/todo.md @@ -107,7 +107,7 @@ Raised by item 312's research round, 2026-11-12. Over the 53 chunks archived sin loop-claude can hand it as it hands `CLAUDE_CODE_AUTO_COMPACT_WINDOW`, and subagents inherit it, the principles auditors included. The choice of 2026-10-27 that the principles audit reads the project whole holds as long as it pages through what it reads. -The replay: give `review-replay` a way to set the variable, then replay the archived prose, stability, product-owner and principles rounds at 5,000 tokens, beside two unchanged replays of the same rounds. Keeps quality where each pass finds every finding the two unchanged replays both find, or meets item 340's control where that has landed. Keep it only where the replays' Read characters also fall; item 311's stability replay can share the baseline runs. +The replay: give `review-replay` a way to set the variable, then replay the archived prose, stability, product-owner and principles rounds at 5,000 tokens, beside two unchanged replays of the same rounds. Keeps quality where each pass finds every finding the two unchanged replays both find, or misses no more than the most an unchanged replay misses, as `review-replay --omit-claude-md` counts it. Keep it only where the replays' Read characters also fall; item 311's stability replay can share the baseline runs. ### 310. Compact a waiting worker's session shortly before its prompt cache expires, only when the human has not answered an interrupt by then. -- 2.52.0 From 8f8d340c0990653e3648ed61ed7b3f737261850a Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 15:20:34 +0100 Subject: [PATCH 10/11] =?UTF-8?q?Answer=20stability=20round=202:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=201=20=F0=9F=9F=A1=20(0=20misread);=20restore=20t?= =?UTF-8?q?he=20--help=20paragraph=20on=20retries=20and=20exit=20codes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/review_replay/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/review_replay/main.py b/bin/review_replay/main.py index 89f0c53e..c05f0e16 100644 --- a/bin/review_replay/main.py +++ b/bin/review_replay/main.py @@ -44,6 +44,11 @@ Claude Code ignores an agent's `omitClaudeMd` where the agent runs the session, replay, and runs no SubagentStart hook there. So the replay without CLAUDE.md turns the instruction files off in its settings and opens the prompt with what the hook hands a reviewer, and closes it with the header's line on the project principles. + +Like the loop, it tries claude three times running before it counts a reply as failed. A failed +review or match leaves its round out, except on a rung below the project's, where it finds +nothing. Exit 1, saying why, on bad arguments, an unreadable archive or models file, no archived +round to replay, or a usage limit. """ import dataclasses import json -- 2.52.0 From 76348eac2e88abedafd68cb5d8c012d03ebe9cb5 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 15:20:41 +0100 Subject: [PATCH 11/11] =?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=20cha?= =?UTF-8?q?nge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0