Name the four kinds of breach, the two level rules and the round title's spelling, and table the step-up rules

This commit is contained in:
2026-11-13 02:45:35 +01:00
parent 1f3349065a
commit e1ca619e96
7 changed files with 50 additions and 11 deletions
+5 -5
View File
@@ -3,7 +3,7 @@ import posixpath
import re
import typing
from review_rules.round_titles import CAP, lacks_counts, RELEASE_REVIEW_CAP
from review_rules.round_titles import CAP, COUNTS, EXAMPLE, lacks_counts, OPENING, RELEASE_REVIEW_CAP
from git_cli.git_command import commits
from run_heavy.capped_docker import finds_this_docker
from rule_hook.heavy_command import heavy
@@ -68,12 +68,12 @@ RULES: dict[RuleName, Rule] = {
# The cap holds with no ask, so no marker waives it.
"round-cap": Rule(
f"a larv-review pass takes at most {CAP} rounds per chunk, and the release review's architecture and principles passes {RELEASE_REVIEW_CAP}, and none after them: the fixes answering its last round merge once the gate passes. A round commit names one of larv-review's passes, so a misspelled one cannot slip past its cap",
"a git commit whose message opens `Answer <pass> round <n>:`, counted with the pass's round commits on the branch since the default branch as last fetched, less the one an --amend replaces",
f"a git commit whose message opens `{OPENING}`, counted with the pass's round commits on the branch since the default branch as last fetched, less the one an --amend replaces",
overridable=False,
),
"round-title-counts": Rule(
"a larv-review round's commit title gives the counts of 🔴 and 🟡 findings the round reported, and how many of them a reviewer marked `[misread]`, at most the two together, such as `Answer stability round 1: 1 🔴, 2 🟡 (1 misread); flag a deleted test`, since score-outcomes counts them",
"a git commit whose message opens `Answer <pass> round <n>:`",
f"a larv-review round's commit title gives the counts of 🔴 and 🟡 findings the round reported, and how many of them a reviewer marked `[misread]`, at most the two together, such as `{EXAMPLE}`, since score-outcomes counts them",
f"a git commit whose message opens `{OPENING}`",
),
"run-heavy": Rule(
"a heavy command, which loads the machine for minutes, runs under ~/.claude/bin/run-heavy, so sessions running at once cannot starve the machine",
@@ -158,7 +158,7 @@ def command_breaches(command: str, simples: list[Simple], home: str) -> list[Bre
elif len(commit.messages) > 1 or any("\n" in message.strip() for message in commit.messages):
breaches.append(Breach("commit-one-line", "pass the message as one -m '<line>', with no heredoc, second -m or newline", commit.directory))
if any(lacks_counts(message) for message in commit.messages):
breaches.append(Breach("round-title-counts", "open the summary after the round's colon with `<k> 🔴, <m> 🟡 (<j> misread);`, where <j> is at most <k> + <m>", commit.directory))
breaches.append(Breach("round-title-counts", f"open the summary after the round's colon with `{COUNTS}`, where <j> is at most <k> + <m>", commit.directory))
return breaches