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