Answer principles round 1: 1 🔴, 7 🟡; sort the new imports, test a symlink in the reports folder, own the folder's path in review_folder.py and check SKILL.md names it, redirect stability-replay's reviewer to a copy of the chunk's folder and keep folders after the merge, keep the folder private, override the harness's no-report-files note, and state what a reviewer may write

This commit is contained in:
2026-10-18 00:37:24 +02:00
parent 3adf58c619
commit 3928d84acb
13 changed files with 83 additions and 21 deletions
+13 -2
View File
@@ -241,7 +241,16 @@ class ReviewerReport(unittest.TestCase):
def test_a_reviewer_writes_its_report_into_the_reports_folder(self):
self.assertEqual(self.breached("Write", "/h/.local/state/larv-review/.claude-item-73/prose-round-1.md"), [])
self.assertEqual(self.breached("Write", "prose-round-1.md", cwd="/h/.local/state/larv-review/x"), [], "a relative path resolves against the call's cwd")
def test_a_relative_path_resolves_against_the_calls_cwd(self):
self.assertEqual(self.breached("Write", "prose-round-1.md", cwd="/h/.local/state/larv-review/x"), [])
def test_a_symlink_in_the_reports_folder_is_followed_to_where_it_points(self):
home = pathlib.Path(self.enterContext(tempfile.TemporaryDirectory()))
(home / ".local" / "state" / "larv-review").mkdir(parents=True)
(home / ".local" / "state" / "larv-review" / "out").symlink_to(home)
found = breaches_of(Call("Write", {"file_path": f"{home}/.local/state/larv-review/out/a.md", "content": "x"}, "/r", "prose-reviewer"), str(home), {})
self.assertEqual(rules(found[2]) if found else [], ["reviewer-report"])
def test_a_reviewer_writing_anywhere_else_is_refused(self):
for path in ["/r/README.md", "/h/.local/state/larv-review", "/h/.local/state/larv-review-x/a.md", "/h/.local/state/larv-review/../a.md", "/tmp/larv-review/a.md"]:
@@ -250,6 +259,8 @@ class ReviewerReport(unittest.TestCase):
def test_a_reviewer_edits_no_file_even_in_the_reports_folder(self):
self.assertEqual(self.breached("Edit", "/h/.local/state/larv-review/x/prose-round-1.md"), ["reviewer-report"])
def test_a_reviewers_multiedit_is_refused(self):
self.assertEqual(self.breached("MultiEdit", "/r/a.py", "stability-reviewer"), ["reviewer-report"])
def test_the_worker_and_other_subagents_write_anywhere(self):
@@ -402,7 +413,7 @@ class Hook(unittest.TestCase):
def test_help_lists_every_rule(self):
helped = subprocess.run([str(HOOK), "--help"], capture_output=True, check=True, env=isolated_env(), text=True).stdout
for rule in ["action-pin", "commit-one-line", "ignorefile-sorted", "image-pin", "no-ai-attribution", "reviewer-report", "round-title-counts", "todo-rank-check"]:
for rule in ["action-pin", "commit-one-line", "ignorefile-sorted", "image-pin", "no-ai-attribution", "reviewer-report", "reviewer-rung", "round-title-counts", "todo-rank-check"]:
self.assertIn(f" {rule}\n The rule: ", helped)
self.assertIn("reviewer-report\n The rule: a reviewer writes nothing but its report", helped)
self.assertRegex(helped, r" reviewer-report\n( .*\n){2} Takes no override\.\n")