Hand a reviewer the shared goal too, and describe the hook and the replay mode in the README
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user