From b43f2242c5aa70238b59ae521cb59dc9327ab0df Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 17 Nov 2026 08:26:17 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20product-owner=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=202=20=F0=9F=9F=A1=20(0=20misread);=20refuse=20to?= =?UTF-8?q?=20count=20a=20blocking=20report=20with=20no=20finding=20headin?= =?UTF-8?q?gs,=20and=20say=20to=20count=20by=20hand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/review_rules/review_folder.py | 8 ++++++-- bin/review_rules/test_review_folder.py | 9 +++++++++ bin/rule_hook/round_report.py | 4 ++-- skills/larv-review/SKILL.md | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/bin/review_rules/review_folder.py b/bin/review_rules/review_folder.py index b3fa2ee1..ff1fe0e9 100644 --- a/bin/review_rules/review_folder.py +++ b/bin/review_rules/review_folder.py @@ -44,10 +44,14 @@ def standing_report(folder: pathlib.Path, pass_: str, round_: int) -> pathlib.Pa def findings_in(report: pathlib.Path) -> Findings | Failure: - """The findings a round's report gives, as round_titles.reported counts them.""" + """The findings a round's report gives, as round_titles.reported counts them; a Failure where the report blocks yet heads no finding as review-findings.md โ†’ "Report" asks, since its count would then be wrong.""" try: - return reported(report.read_text(encoding="utf-8")) + text = report.read_text(encoding="utf-8") except FileNotFoundError: return Failure(f"no report at {report}") except (OSError, UnicodeDecodeError) as failure: return Failure(f"could not read {report}: {failure}") + findings = reported(text) + if text.lstrip().startswith("BLOCK") and findings.red + findings.yellow == 0: + return Failure(f"{report} says BLOCK but opens no finding with `### ๐Ÿ”ด` or `### ๐ŸŸก`; count its findings by hand") + return findings diff --git a/bin/review_rules/test_review_folder.py b/bin/review_rules/test_review_folder.py index 0e1cbb55..ceb685ad 100644 --- a/bin/review_rules/test_review_folder.py +++ b/bin/review_rules/test_review_folder.py @@ -40,3 +40,12 @@ class RoundReport(unittest.TestCase): unread = findings_in(standing_report(pathlib.Path(temp), "prose", 1)) self.assertIsInstance(unread, Failure) self.assertTrue(unread.reason.startswith(f"could not read {temp}/prose-round-1.md: "), unread.reason) + + def test_names_a_blocking_report_that_heads_no_finding_as_its_format_asks(self): + with tempfile.TemporaryDirectory() as temp: + (pathlib.Path(temp) / "prose-round-1.md").write_text("BLOCK\n\n## ๐ŸŸก Should fix\n\n### 1. `a.md:1`: worse\n") + unread = findings_in(standing_report(pathlib.Path(temp), "prose", 1)) + self.assertIsInstance(unread, Failure) + self.assertEqual(unread.reason, f"{temp}/prose-round-1.md says BLOCK but opens no finding with `### ๐Ÿ”ด` or `### ๐ŸŸก`; count its findings by hand") + (pathlib.Path(temp) / "prose-round-1.md").write_text("APPROVE\n") + self.assertEqual(findings_in(standing_report(pathlib.Path(temp), "prose", 1)), Findings(0, 0, 0)) diff --git a/bin/rule_hook/round_report.py b/bin/rule_hook/round_report.py index e8dce601..c500135e 100644 --- a/bin/rule_hook/round_report.py +++ b/bin/rule_hook/round_report.py @@ -11,7 +11,7 @@ from project_config.templates import Titles def round_report_breaches(commit: CommitCall, titles: Titles, home: pathlib.Path) -> list[Breach]: - """A breach for each round title whose counts differ from those its round's report gives. The round title is the commit title's summary, as `titles` cuts it. A title without all three counts is title_breaches' to refuse. A round whose report is missing or unreadable goes through, as does every round where git cannot name the commit's checkout within 5 seconds.""" + """A breach for each round title whose counts differ from those its round's report gives. The round title is the commit title's summary, as `titles` cuts it. A title without all three counts is title_breaches' to refuse. A round whose report is missing or unreadable, or says BLOCK without a finding heading, goes through, as does every round where git cannot name the commit's checkout within 5 seconds.""" summaries = [titles.summary(message.strip()) for message in commit.messages] rounds = [(named, counts) for summary in summaries if (named := ROUND.match(summary)) and (counts := title_counts(summary)) and counts.misread is not None] if not rounds: @@ -26,5 +26,5 @@ def round_report_breaches(commit: CommitCall, titles: Titles, home: pathlib.Path report = standing_report(folder, pass_, round_) found = findings_in(report) if not isinstance(found, Failure) and found != counts: - breaches.append(Breach("round-title-counts", f"{report} counts `{round_prefix(pass_, round_, found)}`; open the title with that, which `larv-review round-title {pass_}` prints", commit.directory)) + breaches.append(Breach("round-title-counts", f"{report} counts `{round_prefix(pass_, round_, found)}`; open the title's summary with that, which `larv-review round-title {pass_}` prints", commit.directory)) return breaches diff --git a/skills/larv-review/SKILL.md b/skills/larv-review/SKILL.md index 7418f18d..fcc76733 100644 --- a/skills/larv-review/SKILL.md +++ b/skills/larv-review/SKILL.md @@ -83,7 +83,7 @@ Give a reviewer without Bash `git ls-files`'s output in its prompt, since some h - **Round.** A round is one review by a pass's reviewer: the first and each re-entry. The rerun after the architect returns Stage 0 questions ("Architecture" below) and a relaunch one rung up ("Rung up" below) stay in their round. - **Auto-reviewer.** The external auto-reviewer (ยง4) is a pass of its own, each review it posts, up to the cap, a round. Its count is the number of its reviews on the PR, less its reviews of a `Record the comprehension check:` commit, and `round-count` doesn't list it. A commit that answers one of its rounds takes an ordinary title, not an `Answer round` one, and a round that didn't change anything gets no commit. -- **Count.** Close each round of a pass other than the auto-reviewer with one commit that holds the round's fixes. Title it `Answer round : ๐Ÿ”ด, ๐ŸŸก ( misread); โ€ฆ`: `` is the pass's name in lower case, such as `full scan`, `` and `` are the ๐Ÿ”ด and ๐ŸŸก findings all the round's reviewers reported, and `` is how many of those they marked `[misread]` (review-findings.md โ†’ "Misread"); a reviewer that marks none, such as `/security-review`, adds 0. Example: `Answer stability round 1: 1 ๐Ÿ”ด, 2 ๐ŸŸก (1 misread); flag a deleted test`. For a pass an agent under `~/.claude/agents/` reviews, run `~/.claude/bin/larv-review round-title ` and write only the summary after what it prints: the title up to and including its `;`, counted from the round's report. rule-hook's `round-title-counts` refuses a title whose counts differ from that report's. A round that didn't change anything gets an empty commit (`git commit --allow-empty`). Push the commits when ยง4 runs next, where there is a remote. `~/.claude/bin/larv-review round-count` prints each pass's count and marks a pass at the cap. +- **Count.** Close each round of a pass other than the auto-reviewer with one commit that holds the round's fixes. Title it `Answer round : ๐Ÿ”ด, ๐ŸŸก ( misread); โ€ฆ`: `` is the pass's name in lower case, such as `full scan`, `` and `` are the ๐Ÿ”ด and ๐ŸŸก findings all the round's reviewers reported, and `` is how many of those they marked `[misread]` (review-findings.md โ†’ "Misread"); a reviewer that marks none, such as `/security-review`, adds 0. Example: `Answer stability round 1: 1 ๐Ÿ”ด, 2 ๐ŸŸก (1 misread); flag a deleted test`. For a pass an agent under `~/.claude/agents/` reviews, run `~/.claude/bin/larv-review round-title ` and write only the summary after what it prints: the title up to and including its `;`, counted from the round's report. Where it exits 1 for want of a report it can count, count the findings by hand, and the hook lets the title through. rule-hook's `round-title-counts` refuses a title whose counts differ from that report's. A round that didn't change anything gets an empty commit (`git commit --allow-empty`). Push the commits when ยง4 runs next, where there is a remote. `~/.claude/bin/larv-review round-count` prints each pass's count and marks a pass at the cap. - **Done.** A pass is done when its latest round leaves no ๐Ÿ”ด or ๐ŸŸก standing: none was reported, or each was shown factually wrong, declined, filed, or named under the bar per "Findings", or settled in the PR summary per "Comprehension check" โ†’ "Places", or, for the prose pass and a pass at its cap, fixed. A stability pass whose round's fixes skip the next round per "Re-entry" โ†’ "Mechanical answers" is done once that rule's run is clean. Resolve that round's ๐ŸŸขs and โ“s per "Findings" too. - **Cap.** A pass takes at most two rounds per chunk, and the release review's architecture and principles passes five; don't ask the user for more. Answer its last round's findings per "Findings": those fixes merge once the gate passes, unreviewed by that pass. rule-hook's `round-cap` refuses a round commit that would take a pass past its cap, and no override waives it. A review the auto-reviewer posts after its second isn't a round: fix none of it and rerun no pass for it, but file a security finding it raises per `~/.claude/CLAUDE.md` โ†’ "Working loop", and any other ๐Ÿ”ด in `todo.md`.