Hand a reviewer the shared goal too, and describe the hook and the replay mode in the README

This commit is contained in:
2026-11-12 05:50:19 +01:00
parent 4c971a7cc4
commit 384b1bbc63
6 changed files with 14 additions and 13 deletions
+3 -2
View File
@@ -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
+1 -1
View File
@@ -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"])
+2 -2
View File
@@ -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 = []
+2 -2
View File
@@ -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:
+4 -4
View File
@@ -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)