diff --git a/AGENTS.md b/AGENTS.md index 16c2a120..4bc067b7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -29,6 +29,7 @@ Decisions live in `docs/decisions.md`: - reading cost: larv-review measures each finished chunk from loop-claude's archive and appends the figure to `docs/reading-cost.md` in the next chunk's PR - reading cost: a rise is the last 5 chunks' median above the 5 before them, and files or refreshes one plan item - rule-hook: a PreToolUse hook enforces each rule a program can check, a `# rule-override : ` marker overrides one, and larv-review's overrides pass rules on each override before merge +- rules/: `CLAUDE.md` holds the rules no file path can scope, and each topic's rules live in a `rules/` file that Claude Code loads by its `paths:` frontmatter ## Working rules diff --git a/CLAUDE.md b/CLAUDE.md index 36defc89..5281c91c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -49,12 +49,12 @@ Everything written — chat, commit messages, comments, docs, code — is in **E ## Topic rules -Claude Code loads each rule file below when a session reads or writes a file that matches its line. After a write it loads only once the write is done, so read the rule file before you create a matching file. +Claude Code loads a rule file when a session reads or writes a file its `paths:` frontmatter matches, and after a write only once the write is done. Read a rule file before you create a file it covers. -- Comments, and what earns a place in a doc: `~/.claude/rules/comments.md` loads with any file. -- Decisions: `~/.claude/rules/decisions.md` loads with `AGENTS.md` or `docs/decisions.md`. -- README goals and audience, and what a README or a package's README holds: `~/.claude/rules/readme.md` loads with `README.md`. -- `todo.md` items, their scores and Exempt reasons: `~/.claude/rules/todo-items.md` loads with `todo.md`. +- Comments, where a choice goes, and what earns a place in a doc: `~/.claude/rules/comments.md`. +- The decision log: `~/.claude/rules/decisions.md`. +- README goals and audience, and what a README or a package's README holds: `~/.claude/rules/readme.md`. +- `todo.md` items, their scores and Exempt reasons: `~/.claude/rules/todo-items.md`. ## Working with the codebase - Always start a new git worktree when doing something in a codebase, and clean it up when done. Unless told otherwise, branch it off a freshly-updated default branch (`git fetch origin`, then base on `origin/main`), not whatever happens to be checked out. diff --git a/agents/prose-reviewer.md b/agents/prose-reviewer.md index 8676942f..8c98c861 100644 --- a/agents/prose-reviewer.md +++ b/agents/prose-reviewer.md @@ -6,7 +6,7 @@ tools: Read, Grep, Glob You read the prose as someone who did not write it: you see only what it says, never what the author meant. -The bar: `~/.claude/CLAUDE.md` → "Prose" and "Public API specs", and every file under `~/.claude/rules/` that governs what the diff changes: `comments.md` always, `readme.md` for a README, `decisions.md` for a decision and `todo-items.md` for `todo.md`. Read them each time — they change. Verdict, severities and rounds: ~/.claude/skills/larv-review/review-findings.md. +The bar: `~/.claude/CLAUDE.md` → "Prose" and "Public API specs", and every file under `~/.claude/rules/` whose `paths:` frontmatter matches a file the diff changes. Read them each time — they change. Verdict, severities and rounds: ~/.claude/skills/larv-review/review-findings.md. ## Checks, in priority order diff --git a/agents/stability-reviewer.md b/agents/stability-reviewer.md index 674dfca8..93c227c4 100644 --- a/agents/stability-reviewer.md +++ b/agents/stability-reviewer.md @@ -110,7 +110,7 @@ Every PR gets at least this sweep. - Is naming precise and unambiguous? - **Does every name in the diff still match its (possibly changed) contents?** When a change meaningfully shifts what a file/folder/package/service/variable does, its name must be updated in the same change — flag a stale name left behind by a content/purpose shift (e.g. a `webhook` test helper reworked into a JWT verifier but still called `webhook`/`WEBHOOK_URL`). The rename belongs in the PR, not "later." - Are magic numbers/strings replaced with named constants? -- **Judge every comment and prose line the diff adds against `~/.claude/rules/comments.md`, plus `readme.md` for a README line and `decisions.md` for a decision line**; report a density breach with the ratio and the files driving it. +- **Judge every comment and prose line the diff adds against every file under `~/.claude/rules/` whose `paths:` frontmatter matches its file**; report a density breach with the ratio and the files driving it. - **Flag a caveat the diff has outlived**, anywhere in the repo: report the sentence's `file:line` and the behaviour that replaced it. - **Flag a pointer standing where a definition belongs** — `~/.claude/rules/comments.md` → "Links and pointers", "A pointer is not a definition". - **Never propose new documentation as a "nice to have".** Suggesting a doc paragraph is proposing bulk someone must maintain. Raise it as a 🟡 only when its absence would actively mislead someone, and say which mistake it prevents; otherwise don't raise it at all. Deleting redundant prose is always the cheaper fix. diff --git a/bin/loop_claude/loop/main.py b/bin/loop_claude/loop/main.py index 2a8348b0..6c97d126 100644 --- a/bin/loop_claude/loop/main.py +++ b/bin/loop_claude/loop/main.py @@ -118,7 +118,7 @@ def run_loop(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launc premises = read_premises(loop_run.root) if isinstance(premises, Stop): return premises - records = read_records(loop_run.root, paths.claude_md) + records = read_records(loop_run.root, paths.claude_md, paths.rules_dir) if isinstance(records, Stop): return records models = get_or_ask_models(key, paths, env, effects) diff --git a/bin/loop_claude/paths.py b/bin/loop_claude/paths.py index 9dd20bb9..293cf0a2 100644 --- a/bin/loop_claude/paths.py +++ b/bin/loop_claude/paths.py @@ -10,6 +10,7 @@ class Paths: home: pathlib.Path model_catalog: pathlib.Path models_file: pathlib.Path + rules_dir: pathlib.Path def paths_from(home: pathlib.Path) -> Paths: @@ -21,4 +22,5 @@ def paths_from(home: pathlib.Path) -> Paths: home=home, model_catalog=claude / "cache" / "model-catalog", models_file=claude / "loop-claude-models.json", + rules_dir=claude / "rules", ) diff --git a/bin/loop_claude/project/records.py b/bin/loop_claude/project/records.py index 5ae8c76e..1146d5ec 100644 --- a/bin/loop_claude/project/records.py +++ b/bin/loop_claude/project/records.py @@ -9,11 +9,10 @@ HUMAN_RULES = "~/.claude/CLAUDE.md" HUMAN_RULES_DIR = "~/.claude/rules/" -def read_records(root: str, claude_md: pathlib.Path) -> str | Stop: +def read_records(root: str, claude_md: pathlib.Path, rules_dir: pathlib.Path) -> str | Stop: """The project's record files, then the human's rules for every project, CLAUDE.md first, each headed by its name; a file that does not exist is left out.""" - rules = claude_md.parent / "rules" sources = [(root, name, name) for name in RECORD_FILES] + [(str(claude_md.parent), claude_md.name, HUMAN_RULES)] - sources += [(str(rules), rule.name, HUMAN_RULES_DIR + rule.name) for rule in sorted(rules.glob("*.md"))] + sources += [(str(rules_dir), rule.name, HUMAN_RULES_DIR + rule.name) for rule in sorted(rules_dir.glob("*.md"))] records = [] for folder, name, heading in sources: if not pathlib.Path(folder, name).exists(): diff --git a/bin/loop_claude/test_loop_claude.py b/bin/loop_claude/test_loop_claude.py index f308f0bf..56cce857 100644 --- a/bin/loop_claude/test_loop_claude.py +++ b/bin/loop_claude/test_loop_claude.py @@ -397,29 +397,29 @@ class Records(unittest.TestCase): def test_heads_each_record_by_its_name_the_humans_rules_last(self): with tempfile.TemporaryDirectory() as root: claude_md = pathlib.Path(root, "home", ".claude", "CLAUDE.md") - self.assertEqual(records.read_records(root, claude_md), "") + self.assertEqual(records.read_records(root, claude_md, claude_md.parent / "rules"), "") claude_md.parent.mkdir(parents=True) claude_md.write_text("# Global\n") - self.assertEqual(records.read_records(root, claude_md), "From ~/.claude/CLAUDE.md:\n# Global") + self.assertEqual(records.read_records(root, claude_md, claude_md.parent / "rules"), "From ~/.claude/CLAUDE.md:\n# Global") pathlib.Path(root, "docs").mkdir() pathlib.Path(root, "docs", "decisions.md").write_text("# Decisions\n") pathlib.Path(root, "AGENTS.md").write_text("\n# Rules\n") - self.assertEqual(records.read_records(root, claude_md), "From AGENTS.md:\n# Rules\n\nFrom docs/decisions.md:\n# Decisions\n\nFrom ~/.claude/CLAUDE.md:\n# Global") + self.assertEqual(records.read_records(root, claude_md, claude_md.parent / "rules"), "From AGENTS.md:\n# Rules\n\nFrom docs/decisions.md:\n# Decisions\n\nFrom ~/.claude/CLAUDE.md:\n# Global") pathlib.Path(claude_md.parent, "rules").mkdir() - pathlib.Path(claude_md.parent, "rules", "todo.md").write_text("# Todo\n") + pathlib.Path(claude_md.parent, "rules", "todo-items.md").write_text("# Todo\n") pathlib.Path(claude_md.parent, "rules", "readme.md").write_text("# Readme\n") pathlib.Path(claude_md.parent, "rules", "notes.txt").write_text("not a rule\n") - self.assertTrue(records.read_records(root, claude_md).endswith("From ~/.claude/CLAUDE.md:\n# Global\n\nFrom ~/.claude/rules/readme.md:\n# Readme\n\nFrom ~/.claude/rules/todo.md:\n# Todo")) + self.assertTrue(records.read_records(root, claude_md, claude_md.parent / "rules").endswith("From ~/.claude/CLAUDE.md:\n# Global\n\nFrom ~/.claude/rules/readme.md:\n# Readme\n\nFrom ~/.claude/rules/todo-items.md:\n# Todo")) def test_stops_on_a_record_it_cannot_read(self): with tempfile.TemporaryDirectory() as root: claude_md = pathlib.Path(root, "home", ".claude", "CLAUDE.md") claude_md.mkdir(parents=True) - self.assertEqual(records.read_records(root, claude_md), Stop(1, f"CLAUDE.md in {claude_md.parent}: Is a directory - the judge cannot read the records.")) + self.assertEqual(records.read_records(root, claude_md, claude_md.parent / "rules"), Stop(1, f"CLAUDE.md in {claude_md.parent}: Is a directory - the judge cannot read the records.")) pathlib.Path(root, "docs", "decisions.md").mkdir(parents=True) - self.assertEqual(records.read_records(root, claude_md), Stop(1, f"docs/decisions.md in {root}: Is a directory - the judge cannot read the records.")) + self.assertEqual(records.read_records(root, claude_md, claude_md.parent / "rules"), Stop(1, f"docs/decisions.md in {root}: Is a directory - the judge cannot read the records.")) pathlib.Path(root, "AGENTS.md").write_bytes(b"# Rules\n\xff\n") - self.assertEqual(records.read_records(root, claude_md), Stop(1, f"AGENTS.md in {root} is not UTF-8 on line 2 - the judge cannot read the records.")) + self.assertEqual(records.read_records(root, claude_md, claude_md.parent / "rules"), Stop(1, f"AGENTS.md in {root} is not UTF-8 on line 2 - the judge cannot read the records.")) def test_stops_on_a_rule_it_cannot_read(self): @@ -427,8 +427,8 @@ class Records(unittest.TestCase): claude_md = pathlib.Path(root, "home", ".claude", "CLAUDE.md") rules = pathlib.Path(claude_md.parent, "rules") rules.mkdir(parents=True) - pathlib.Path(rules, "todo.md").write_bytes(b"\xff\n") - self.assertEqual(records.read_records(root, claude_md), Stop(1, f"todo.md in {rules} is not UTF-8 on line 1 - the judge cannot read the records.")) + pathlib.Path(rules, "todo-items.md").write_bytes(b"\xff\n") + self.assertEqual(records.read_records(root, claude_md, claude_md.parent / "rules"), Stop(1, f"todo-items.md in {rules} is not UTF-8 on line 1 - the judge cannot read the records.")) class JudgePrompt(unittest.TestCase): def test_shows_the_transcripts_tail_and_returns_what_it_showed(self): diff --git a/bin/repo_checks/test_citations.py b/bin/repo_checks/test_citations.py index ce94ab95..97513e2f 100644 --- a/bin/repo_checks/test_citations.py +++ b/bin/repo_checks/test_citations.py @@ -12,6 +12,7 @@ CITATION = re.compile(r'`?(?:~/\.claude/)?(CLAUDE\.md|rules/[\w-]+\.md)`? → (" HEADING = re.compile(r"^#+ (.+?)(?: \(.*\))?$", re.MULTILINE) LEAD = re.compile(r"^(?:- )?\*\*(.+?)(?:\*\*|[:.](?=\*\*| )| —)", re.MULTILINE) NAME = re.compile(r'"([^"]+)"') +RULE_FILE = re.compile(r"(?: ` marker overrides one, and larv-review's overrides pass rules on each override before merge 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. 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. + +## rules/: `CLAUDE.md` holds the rules no file path can scope, and each topic's rules live in a `rules/` file that Claude Code loads by its `paths:` frontmatter + +2026-10-13, lilleman through todo item 95, implemented by claude. Serves goals 1.3 and 1.4. Every session loaded `CLAUDE.md` whole, about 4,200 words. Anthropic's memory docs (code.claude.com/docs/en/memory) say a longer file "reduce[s] adherence", and IFScale (arxiv.org/abs/2507.11538) measures adherence falling as the instruction count grows. A rule goes in `CLAUDE.md` when no file path marks the moment it is needed: the working loop, prose that chat follows, commits, and API spec text, which may sit in code. Every other topic gets a file under `rules/` whose `paths:` name the files that topic is about. + +`rules/comments.md` matches every file. A session that opens no file, such as one answering in chat, leaves it out. A session that writes a file has read one first, since Edit needs a Read, except for a new file written before any read; the "Topic rules" line says to read the rule file first there. + +Claude Code's user-level rules tie this repo to Claude Code, which "Prefer the vendor-neutral option" (`principles/technical-principles.md`) allows here because this repo configures Claude Code itself. The tie buys topic rules that load without a pointer the session must follow. The judge reads every rule file whole, since a quoted answer needs its words. + +Valid while Claude Code loads `~/.claude/rules/*.md` in every project, a path-scoped one when a session reads, writes or edits a matching file, or reads one with a single-file Bash command such as `cat`, and after a write only once the write is done. On 2026-10-13 a smoke test confirmed both triggers: a rule in `~/.claude/rules/` with `paths: ["**/smoke-target.txt"]` held a secret word. `claude -p` in a project under `/tmp` printed the word after reading the target with the Read tool, and after creating it with the Write tool. A control run that opened no file printed none. Per the docs, a path-scoped rule leaves the context at compaction and returns at the next matching read. diff --git a/rules/comments.md b/rules/comments.md index 07e8e759..3bbf5b46 100644 --- a/rules/comments.md +++ b/rules/comments.md @@ -9,6 +9,10 @@ paths: The reader is a competent reader of THIS codebase. A comment or a paragraph earns its place by saying what that reader could not infer and the repo cannot say for itself: a surprising WHY, a footgun, an invariant, an external constraint. Fix a redundant one by deleting it, never by trimming it: two copies drift, and the doc copy is the one nobody updates. GOOD: `// Loud-fail: missing amount used to coerce to '0' = phantom "0 SEK reversal" in api-4.` — records a past prod bug the code can't show. +## Where a choice goes + +**A choice that shapes what the code does, made in one place, is a comment there, with its reason. Made in more than one place, it is a decision, and the decision log owns it.** A decision's rejected alternative, or what it deliberately does not cover, stays out of every call site. A choice found anywhere else — an `AGENTS.md` body, a comment away from the code it governs, or a README section that is neither a goal nor how one is met — moves: to a comment at its one place, or, once made in more than one place, to `docs/decisions.md`, leaving its title in `AGENTS.md`'s list. + ## Comments The rules below govern prose comments; doc comments a tool consumes — docstrings, godoc, JSDoc types — are outside them. diff --git a/rules/decisions.md b/rules/decisions.md index 36db592c..8cffaa71 100644 --- a/rules/decisions.md +++ b/rules/decisions.md @@ -6,6 +6,6 @@ paths: # Decisions: one home, each linked to a goal or a technical principle -**A choice that shapes what the code does, made in one place, is a comment there, with its reason. Made in more than one place, it is a decision, and the decision log owns it.** A decision's rejected alternative, or what it deliberately does not cover, stays out of every call site. **The decision log has one home: `docs/decisions.md`**. A title states the whole decision in one line: what holds at the commit it ships in, in words a reader finds in the code or the plan. `AGENTS.md` lists every title, so a session works by the decisions without loading their background. A session reads the entry under a title only to question, revise or add a decision. The entry holds the background: its date, who made it, the reasoning, and the premise it rests on ("valid while X") so it can expire honestly when that premise dies. A choice found anywhere else — an `AGENTS.md` body, a comment away from the code it governs, or a README section that is neither a goal nor how one is met — moves: to a comment at its one place, or, once made in more than one place, to the log, leaving its title in `AGENTS.md`'s list. +**The decision log has one home: `docs/decisions.md`**. A title states the whole decision in one line: what holds at the commit it ships in, in words a reader finds in the code or the plan. `AGENTS.md` lists every title, so a session works by the decisions without loading their background. A session reads the entry under a title only to question, revise or add a decision. The entry holds the background: its date, who made it, the reasoning, and the premise it rests on ("valid while X") so it can expire honestly when that premise dies. **Every decision links to a goal or a technical principle.** An entry names the goal it serves or the technical principle under `~/.claude/principles/` it applies; one that can do neither is a missing goal, and an entry already in the repo with neither behind it is a finding. Propose the goal, never a reason of your own — `~/.claude/CLAUDE.md` → "Working loop", "Ask, don't guess" says how. An entry working against a goal or a technical principle stands only while it names the `todo.md` item that ends it. diff --git a/skills/larv-review/SKILL.md b/skills/larv-review/SKILL.md index df3dbec3..f2572269 100644 --- a/skills/larv-review/SKILL.md +++ b/skills/larv-review/SKILL.md @@ -82,7 +82,7 @@ Give a reviewer without Bash the branch diff and `git ls-files`'s output in its - **Outside the chunk.** A finding outside the chunk's change, whatever its pass or severity, is scored and filed in `todo.md` per `~/.claude/rules/todo-items.md`. A 🔴 is marked `defect`. A 🟡 against a file under `~/.claude/principles/` is marked `principle`, its detail naming the principle, where no other reason fits. One under the bar and not exempt is named in the summary with its score. A verified security HIGH is handled per "Security". - **Goal or decision.** A fix that would change a goal, or a `docs/decisions.md` entry the repo held before the chunk began, is asked; no user reachable → filed, marked `question`, the goal or decision left as is. -- **🔴.** A 🔴 is fixed, or shown factually wrong, and what disproved it recorded per `~/.claude/rules/decisions.md`: in a comment at the code the finding concerns, or in `docs/decisions.md` when it concerns more than one place. Never declined. +- **🔴.** A 🔴 is fixed, or shown factually wrong, and what disproved it recorded per `~/.claude/rules/comments.md` → "Where a choice goes": in a comment at the code the finding concerns, or in `docs/decisions.md` when it concerns more than one place. Never declined. - **🟡.** A 🟡 is fixed, shown factually wrong like a 🔴, or declined. Decline one only where the reason is sound, consistent with the goals and the technical principles, and confidence is very high; the decline and its reason are recorded the same way. A reason neither speaks to is a gap in the goals: fix the finding, or ask per `~/.claude/CLAUDE.md` → "Working loop", "Ask, don't guess"; no user reachable → fix. Never drop one silently, and never decline one for convenience or the size of the fix. - **🟢 and ❓.** A 🟢 or ❓ is fixed, answered, declined in the summary with its reason, or filed. Answer one where the code, a test, a goal or a decision the repo held before the chunk began settles it, and quote what in the summary. A ❓ only the user can answer is asked; no user reachable → filed, marked `question`. - **🔀.** A 🔀 runs the named reviewer's pass once the current pass is done. diff --git a/todo.md b/todo.md index 13bd0f07..c120c992 100644 --- a/todo.md +++ b/todo.md @@ -6,7 +6,7 @@ `Bar = 9` -`Next ID = 101` +`Next ID = 103` | Goal | W | |---|---| @@ -46,6 +46,7 @@ | 84 | 0.3.0 | | **Check, at each release's scoring run, that seats in a paired ruling agree more often than two scoring runs on near-identical code do, as the paired-ruling decision assumes.** | 2 | 2 | 4 | 5 | 1.4 | 15.1 | | 67 | 0.3.0 | principle | **Point stability-reviewer at the technical principles in place of its own restatement of them.** | 2 | 3 | 4 | 5 | 1.3 | 14.9 | | 66 | 0.3.0 | principle | **Hold systems-architect's method thresholds only while the comprehension panel finds the flagged code hard.** | 3 | 3 | 4 | 5 | 1.1 | 14.2 | +| 101 | 0.3.0 | principle | **Have `larv_review/record.py`'s `read_seats` take the time, the commit check and the history as inputs, so it parses and decides without effects.** | 3 | 3 | 4 | 5 | 1.1 | 14.2 | | 69 | 0.3.0 | principle | **Measure test coverage, so a chunk that lowers it is seen.** | 3 | 4 | 4 | 5 | 1.1 | 13.9 | | 29 | 0.3.0 | | **Make the contributor a standing member of every project's audience, unless its `## Audience` says maintainability does not matter.** | 2 | 2 | 3 | 5 | 1.1, 1.4 | 13.4 | | 68 | 0.3.0 | principle | **Test `workflow-bench/compare.py`'s blinding and `bench.py`'s run plan.** | 2 | 4 | 3 | 5 | 1.1 | 12.9 | @@ -54,6 +55,7 @@ | 73 | 0.3.0 | | **Have each reviewer write its full report to a file and return the worker only its findings' one-line summaries.** | 3 | 4 | 4 | 4 | 1.4 | 11.7 | | 6 | 0.3.0 | decision | **Move what `loop-claude` writes out of `~/.claude.json`, and ask the human about each write that must stay.** | 5 | 5 | 4 | 5 | 1.1 | 11.7 | | 51 | 0.3.0 | principle | **Hand loop-claude's terminal output to an injected effect, so no storage or retry function prints.** | 3 | 5 | 3 | 5 | 1.1 | 11.7 | +| 102 | 0.3.0 | | **Give loop-claude's retry delay an environment override, so the black-box test stops replacing `time.sleep` through `sitecustomize`.** | 2 | 2 | 3 | 4 | 1.1 | 11.4 | | 50 | 0.3.0 | principle | **Grant the bench's runs only the tools a review needs, in place of skipping every permission.** | 2 | 2 | 3 | 4 | 4 | 9.9 | | 81 | 0.3.0 | principle | **Have `workflow-bench/bench.py` return each run's failure as a value, so one failed clone does not hide the later runs' results.** | 2 | 2 | 3 | 4 | 4 | 9.9 | | 4 | 0.3.0 | | **Name each chunk's archive folder by the chunk's start time, so `/` lists chunks in the order they ran.** | 3 | 2 | 4 | 3 | 3 | 9.6 | @@ -182,13 +184,17 @@ DRY, in `principles/technical-principles.md`: `agents/stability-reviewer.md` res KISS, in `principles/technical-principles.md`, which keeps a limit only while readers find the flagged code hard. `agents/systems-architect.md` makes cyclomatic 7 and 24 lines gate rules from the first commit, a 🔴 unless a reason is stated. +### 101. Have `larv_review/record.py`'s `read_seats` take the time, the commit check and the history as inputs, so it parses and decides without effects. + +Found by the principles audit of PR #242, against "Functional core, imperative shell" (`principles/technical-principles.md`). `bin/larv_review/record.py:94` reads `time.time()`, then checks git (`:97`, `commit_exists`) and the history file (`:100`) inside the function that parses the seats file and decides. A test cannot fix the heading's time, and every test of `read_seats` touches the real checkout. + ### 69. Measure test coverage, so a chunk that lowers it is seen. "Test coverage should not decline", in `principles/technical-principles.md`: nothing reports coverage, so a chunk that deletes a test or adds untested code passes unseen. ### 29. Make the contributor a standing member of every project's audience, unless its `## Audience` says maintainability does not matter. -State that in `CLAUDE.md`'s goals-and-audience rule, and have larv-review's comprehension floor name the contributor as the reader it serves. The floor's block then applies to a project whose audience includes the contributor, and a project that drops them skips it. +State that in `~/.claude/rules/readme.md` → "Goals and Audience", and have larv-review's comprehension floor name the contributor as the reader it serves. The floor's block then applies to a project whose audience includes the contributor, and a project that drops them skips it. ### 68. Test `workflow-bench/compare.py`'s blinding and `bench.py`'s run plan. @@ -223,6 +229,10 @@ Claude Code owns that file and writes it. `trust` reads it, changes it and write "Functional core, imperative shell", in `principles/technical-principles.md`: `archive`, `trust`, `retried`, the worker, `interrupt` and `model_choice` print to stderr themselves, and the tests swap the global stream. +### 102. Give loop-claude's retry delay an environment override, so the black-box test stops replacing `time.sleep` through `sitecustomize`. + +Found by the principles audit of PR #242. `bin/loop_claude/test_black_box.py:113-114` swaps the global `time.sleep`, the shape "Functional core, imperative shell" bans. An override of the delay lets the test run the code as production runs it. + ### 50. Grant the bench's runs only the tools a review needs, in place of skipping every permission. "Always grant explicit access to data", in `principles/technical-principles.md`: `workflow-bench/bench.py` starts claude with `--dangerously-skip-permissions`, and no rule confines it to a sandbox, so a run on the host reaches the host's credentials and other checkouts.