Answer architecture round 1: 1 🔴, 12 🟡 (0 misread); route every verdict through next_route with one step-up writer, give a release one home in release.py and rename chunk_pick to release_standing, split loop/main.py, delete the unreachable lowered-pass code, render agent-followed Markdown from one list, refuse a round title naming no pass, and rename the clashing names
This commit is contained in:
+13
-8
@@ -23,15 +23,20 @@ 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, and a title naming no known pass adds its name. Case is ignored."""
|
||||
"""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)
|
||||
for title in titles:
|
||||
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}
|
||||
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}
|
||||
|
||||
|
||||
def round_pass(title: str) -> str | None:
|
||||
"""The pass a round title names, in lower case, whether or not larv-review has it; None for any other title."""
|
||||
named = ROUND.match(title)
|
||||
return named.group(1).lower() if named else None
|
||||
|
||||
|
||||
def rounds_past_first(titles: list[str]) -> int:
|
||||
@@ -46,8 +51,8 @@ def lacks_counts(title: str) -> bool:
|
||||
|
||||
def past_cap(title: str, earlier: list[str]) -> bool:
|
||||
"""Whether title is a round title that takes its pass past its cap, as round_counts counts title among the branch's earlier commit titles."""
|
||||
named = ROUND.match(title)
|
||||
return named is not None and round_counts([*earlier, title])[named.group(1).lower()] > cap(named.group(1).lower())
|
||||
name = round_pass(title)
|
||||
return name in PASSES and round_counts([*earlier, title])[name] > cap(name)
|
||||
|
||||
|
||||
def cap(name: str) -> int:
|
||||
|
||||
Reference in New Issue
Block a user