Have each reviewer write its full report to a file and return the worker only its findings' one-line summaries

This commit is contained in:
2026-10-18 00:11:08 +02:00
parent fdd48bb1cd
commit 9207566328
19 changed files with 111 additions and 30 deletions
+19
View File
@@ -0,0 +1,19 @@
"""Refuse a reviewer's file call other than a Write of its report into the reports folder: skills/larv-review/review-findings.md → "Report"."""
import os
from rule_hook.call import Call
from rule_hook.reviewer_rung import REVIEWERS
from rule_hook.rules import Breach
# Outside every checkout, so no project sees a report. A fixed path, since a headless session has no scratchpad.
REPORTS = "/tmp/larv-review"
def report_breaches(call: Call, path: str) -> list[Breach]:
"""The breach of a file call from a reviewer that is not a Write under REPORTS; none from any other agent."""
if call.agent not in REVIEWERS:
return []
written = os.path.realpath(os.path.join(call.cwd, path))
if call.tool == "Write" and written.startswith(os.path.realpath(REPORTS) + "/"):
return []
return [Breach("reviewer-report", f"{call.agent} would {call.tool.lower()} {written}; write your report with Write to the path your prompt names, under {REPORTS}/", call.cwd)]