Answer stability round 1: 0 🔴, 8 🟡 (1 misread); count every named pass's rounds past the first again, name unreadable tags in larv-review, drop version_of, and test newest_tag, a failed index refresh, the judge cost a ruling archives, a ruling that cannot be archived, and a nested agents folder
This commit is contained in:
+16
-9
@@ -23,14 +23,21 @@ class Findings:
|
||||
|
||||
|
||||
def round_counts(titles: list[str]) -> dict[str, int]:
|
||||
"""Each pass's round count among the branch's `Answer <pass> round <n>:` commit titles: the highest <n>, or the number of such commits where that is more, so a repeated number still counts. A pass with none has 0. A title naming no pass counts for none; rule-hook's `round-cap` refuses its commit. Case is ignored."""
|
||||
highest: dict[str, int] = dict.fromkeys(PASSES, 0)
|
||||
commits: dict[str, int] = dict.fromkeys(PASSES, 0)
|
||||
"""Each pass's round count among the branch's `Answer <pass> round <n>:` commit titles, as named_counts counts them. A pass with none has 0. A title naming no pass counts for none; rule-hook's `round-cap` refuses its commit. Case is ignored."""
|
||||
counted = named_counts(titles)
|
||||
return {name: counted.get(name, 0) for name in PASSES}
|
||||
|
||||
|
||||
def named_counts(titles: list[str]) -> dict[str, int]:
|
||||
"""The round count of each name the round titles give, in lower case, whether or not larv-review has a pass of that name: the highest <n>, or the number of such titles where that is more, so a repeated number still counts."""
|
||||
highest: dict[str, int] = {}
|
||||
commits: dict[str, int] = {}
|
||||
for title in titles:
|
||||
if (named := ROUND.match(title)) and (name := named.group(1).lower()) in PASSES:
|
||||
highest[name] = max(highest[name], int(named.group(2)))
|
||||
commits[name] += 1
|
||||
return {name: max(highest[name], commits[name]) for name in PASSES}
|
||||
if named := ROUND.match(title):
|
||||
name = named.group(1).lower()
|
||||
highest[name] = max(highest.get(name, 0), int(named.group(2)))
|
||||
commits[name] = commits.get(name, 0) + 1
|
||||
return {name: max(highest[name], commits[name]) for name in highest}
|
||||
|
||||
|
||||
def round_pass(title: str) -> str | None:
|
||||
@@ -40,8 +47,8 @@ def round_pass(title: str) -> str | None:
|
||||
|
||||
|
||||
def rounds_past_first(titles: list[str]) -> int:
|
||||
"""Each pass's rounds past its first among the commit titles, as round_counts counts them, summed."""
|
||||
return sum(max(0, count - 1) for count in round_counts(titles).values())
|
||||
"""The rounds past the first of each name the commit titles give, summed. It counts names that are no pass too, so an older title naming two passes, such as `Answer stability and prose round 2:`, still counts."""
|
||||
return sum(max(0, count - 1) for count in named_counts(titles).values())
|
||||
|
||||
|
||||
def lacks_counts(title: str) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user