From 384b1bbc635c2620e39b4b0797462fea1a3413c1 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 05:50:19 +0100 Subject: [PATCH] Hand a reviewer the shared goal too, and describe the hook and the replay mode in the README --- README.md | 4 ++-- bin/larv_review/main.py | 5 +++-- bin/larv_review/test_larv_review.py | 2 +- bin/review_replay/test_review_replay.py | 4 ++-- bin/review_rules/reviewer_context.py | 4 ++-- bin/review_rules/test_reviewer_context.py | 8 ++++---- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index f4115c9b..f3524368 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ Install puts only `loop-claude` and `loop-inbox` on `PATH`; call the others by t - `command-patterns []` prints a table of the shell command patterns a release's archived chunks ran, such as `tea pr create`, for an audit of the release; `command-patterns --help` states its columns. - `deploy-release [--cut] []` moves `~/.claude`, or the checkout named, to the newest release, as Update says; with `--cut`, run in the development clone, it first cuts the next release, as Release says. - `judge-replay ` replays loop-claude's judge on archived verdicts of the projects run on the model, and prints what each rung a review climbs to misses, and the lowest rung below them that, like each candidate above it, returns them; `judge-replay --help` states the replay. -- `larv-review ` holds larv-review's mechanical rules: the chunk's review folder, the paired ruling's base and vote count, each pass's round count, the scoring run's trigger; the comprehension history's format, its latest places and its count of how often seats agree; and each reviewer's prompt header. `larv-review --help` states them. +- `larv-review ` holds larv-review's mechanical rules: the chunk's review folder, the paired ruling's base and vote count, each pass's round count, the scoring run's trigger; the comprehension history's format, its latest places and its count of how often seats agree; and each reviewer's prompt header. `settings.json` → `hooks` runs `larv-review reviewer-context` as each subagent starts: it hands a reviewer under `agents/`, which starts without `CLAUDE.md`, that file's "Shared goal", "Prose" and "Vocabulary" sections. `larv-review --help` states them. - `loop-claude ` runs a project's next chunk cycle after cycle; `loop-claude --help` states its contract. - `loop-inbox` shows the interrupts of every loop-claude on the machine, oldest first, takes each one's answer, `/talk` included, and lists every running loop with the `todo.md` items its chunk takes; `loop-inbox --help` states how. - `mattermost-dm []` sends a message, or else stdin, from the Mattermost bot to the human; `~/.claude/.env` names the server, the bot's token and the human, and `mattermost-dm --help` names its keys. `loop-claude --help` says when loop-claude sends one. @@ -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, finds every 🔴 and 🟡 the project's rung finds again; `review-replay --help` states the replay. 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, finds every 🔴 and 🟡 the project's rung finds again; `review-replay --help` states the replay. With `--without-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. - `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. - `score-outcomes [L E I S]` shows what each finished item's chunk measured beside the scores the item was guessed at, to score a new item by, and code health's two counter-signals per chunk, misread findings and later fixes; `score-outcomes --help` states the report. diff --git a/bin/larv_review/main.py b/bin/larv_review/main.py index 6e7faa27..946cefd2 100644 --- a/bin/larv_review/main.py +++ b/bin/larv_review/main.py @@ -121,8 +121,9 @@ it. It exits 1 when the pass takes no more rounds, or, with --rerun, when the re missing. reviewer-context is the SubagentStart hook. It reads the hook's input on stdin. For an agent under -agents/, which starts without CLAUDE.md, it prints the hook reply that hands the agent the Prose -and Vocabulary sections of ~/.claude/CLAUDE.md; for any other agent it doesn't print anything. +agents/, which starts without CLAUDE.md, it prints the hook reply that hands the agent the Shared +goal, Prose and Vocabulary sections of ~/.claude/CLAUDE.md; for any other agent it doesn't print +anything. Exit 1, saying why, on unknown arguments, an unknown item ID, a seats file it cannot read or that breaks the shape above, a todo.md that fails rank_todo.py after record-scoring records a run, or diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py index f77e39a8..07ad0cbf 100644 --- a/bin/larv_review/test_larv_review.py +++ b/bin/larv_review/test_larv_review.py @@ -1005,7 +1005,7 @@ class LarvReviewTool(unittest.TestCase): self.assertEqual((missing.returncode, missing.stdout), (1, "")) self.assertIn("CLAUDE.md", missing.stderr) (self.checkout.parent / ".claude").mkdir(exist_ok=True) - (self.checkout.parent / ".claude" / "CLAUDE.md").write_text("## Prose\n\nShort.\n\n## Vocabulary\n\nWords.\n") + (self.checkout.parent / ".claude" / "CLAUDE.md").write_text("## Shared goal\n\nHealth.\n\n## Prose\n\nShort.\n\n## Vocabulary\n\nWords.\n") ran = hook("prose-reviewer") self.assertEqual(ran.returncode, 0, ran.stderr) self.assertIn("## Prose\n\nShort.\n\n## Vocabulary\n\nWords.", json.loads(ran.stdout)["hookSpecificOutput"]["additionalContext"]) diff --git a/bin/review_replay/test_review_replay.py b/bin/review_replay/test_review_replay.py index e4459283..fc31fb9b 100644 --- a/bin/review_replay/test_review_replay.py +++ b/bin/review_replay/test_review_replay.py @@ -135,7 +135,7 @@ class Launch(unittest.TestCase): def setUp(self): self.home = pathlib.Path(self.enterContext(tempfile.TemporaryDirectory())) (self.home / ".claude").mkdir() - (self.home / ".claude" / "CLAUDE.md").write_text("## Prose\n\nShort.\n\n## Vocabulary\n\nWords.\n") + (self.home / ".claude" / "CLAUDE.md").write_text("## Shared goal\n\nHealth.\n\n## Prose\n\nShort.\n\n## Vocabulary\n\nWords.\n") self.clone = self.home / "clone" self.clone.mkdir() @@ -208,7 +208,7 @@ class Main(unittest.TestCase): run_git(self.checkout, "remote", "set-head", "origin", "main") for key in ("proj", "other"): self.write_chunk(key, "c1", "2026-10-14T10:00:00Z") - (self.home / ".claude" / "CLAUDE.md").write_text("## Prose\n\nShort.\n\n## Vocabulary\n\nWords.\n") + (self.home / ".claude" / "CLAUDE.md").write_text("## Shared goal\n\nHealth.\n\n## Prose\n\nShort.\n\n## Vocabulary\n\nWords.\n") self.reviews = [] self.agents = set() self.matched_in = [] diff --git a/bin/review_rules/reviewer_context.py b/bin/review_rules/reviewer_context.py index 3d9fa03c..4dcf99f3 100644 --- a/bin/review_rules/reviewer_context.py +++ b/bin/review_rules/reviewer_context.py @@ -5,8 +5,8 @@ import pathlib from failure import Failure from review_rules.review_passes import REVIEWERS -# The sections of ~/.claude/CLAUDE.md a reviewer needs: the words its reports use and the bar its own prose meets. -SECTIONS = ("Prose", "Vocabulary") +# The sections of ~/.claude/CLAUDE.md a reviewer needs, in the file's order: the code-health goal the agents cite, the bar its own prose meets, and the words its reports use. +SECTIONS = ("Shared goal", "Prose", "Vocabulary") def reviewer_context(home: pathlib.Path) -> str | Failure: diff --git a/bin/review_rules/test_reviewer_context.py b/bin/review_rules/test_reviewer_context.py index fb846060..2c21c774 100644 --- a/bin/review_rules/test_reviewer_context.py +++ b/bin/review_rules/test_reviewer_context.py @@ -11,7 +11,7 @@ from review_rules.reviewer_context import hook_reply, principles_line, reviewer_ from review_rules.review_passes import REVIEWERS REPO = pathlib.Path(__file__).resolve().parents[2] -CLAUDE_MD = "# Global\n\n## Working loop\n\nThe worker's.\n\n## Prose\n\nWrite short.\n\n## Git\n\nOne line.\n\n## Vocabulary\n\n- **chunk** — a unit.\n" +CLAUDE_MD = "# Global\n\n## Working loop\n\nThe worker's.\n\n## Shared goal\n\nCode health.\n\n## Prose\n\nWrite short.\n\n## Git\n\nOne line.\n\n## Vocabulary\n\n- **chunk** — a unit.\n" class ReviewerContext(unittest.TestCase): @@ -20,12 +20,12 @@ class ReviewerContext(unittest.TestCase): (self.home / ".claude").mkdir() (self.home / ".claude" / "CLAUDE.md").write_text(CLAUDE_MD) - def test_holds_the_prose_and_vocabulary_sections_and_none_of_the_workers(self): - self.assertEqual(reviewer_context(self.home), "You start without `~/.claude/CLAUDE.md`. These sections of it hold for you:\n\n## Prose\n\nWrite short.\n\n## Vocabulary\n\n- **chunk** — a unit.") + def test_holds_the_shared_goal_prose_and_vocabulary_sections_and_none_of_the_workers(self): + self.assertEqual(reviewer_context(self.home), "You start without `~/.claude/CLAUDE.md`. These sections of it hold for you:\n\n## Shared goal\n\nCode health.\n\n## Prose\n\nWrite short.\n\n## Vocabulary\n\n- **chunk** — a unit.") def test_fails_on_a_missing_section_or_file(self): (self.home / ".claude" / "CLAUDE.md").write_text("## Prose\n\nWrite short.\n") - self.assertEqual(reviewer_context(self.home), Failure(f"{self.home / '.claude' / 'CLAUDE.md'} holds no section Vocabulary")) + self.assertEqual(reviewer_context(self.home), Failure(f"{self.home / '.claude' / 'CLAUDE.md'} holds no section Shared goal, Vocabulary")) (self.home / ".claude" / "CLAUDE.md").unlink() self.assertIsInstance(reviewer_context(self.home), Failure)