List larv-review's passes in one place that round_titles and the ladder derive from, and check the pass table against it

This commit is contained in:
2026-10-22 20:25:37 +02:00
parent e2033abbaf
commit 6cff688951
5 changed files with 21 additions and 17 deletions
+12 -8
View File
@@ -5,27 +5,31 @@ import unittest
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from round_titles import PASSES
from model_routing.ladder import REVIEWERS
from model_routing.ladder import PASS_AGENTS, PASSES, REVIEWERS
from repo_checks.test_python_floor import ROOT
from rule_hook.reviewer_rung import SEAT, SECURITY_OPENER
OPENING = re.compile(r"^## Opening\n+```\n([^\n]+?\.)(?: |\n)", re.MULTILINE)
# A row of the pass table: its pass.
PASS_ROW = re.compile(r"^\| (?!Pass \|)([A-Z][a-z-]+(?: [a-z]+)?) \|", re.MULTILINE)
# A row of the pass table whose reviewer is an agent: its pass and that agent.
REVIEWED_ROW = re.compile(r"^\| ([A-Z][a-z-]+) \| ([a-z]+(?:-[a-z]+)*-(?:reviewer|architect|auditor)) \|", re.MULTILINE)
LARV_REVIEW = (ROOT / "skills" / "larv-review" / "SKILL.md").read_text(encoding="utf-8")
PASS_TABLE = LARV_REVIEW.split("## 3. Passes", 1)[1].split("A comment is prose", 1)[0]
class ReviewerLaunches(unittest.TestCase):
"""rule-hook holds a review launch to its rung by recognising it; these fail when what it recognises drifts from what the skills launch."""
def test_the_reviewers_are_the_passes_and_agents_larv_review_s_pass_table_names_in_its_order(self):
passes = LARV_REVIEW.split("## 3. Passes", 1)[1].split("A comment is prose", 1)[0]
self.assertEqual({name.lower(): agent for name, agent in REVIEWED_ROW.findall(passes)}, REVIEWERS)
self.assertEqual([name.lower() for name, _ in REVIEWED_ROW.findall(passes)], list(REVIEWERS))
def test_the_passes_are_the_ones_larv_review_s_pass_table_names_in_its_order(self):
self.assertEqual([name.lower() for name in PASS_ROW.findall(PASS_TABLE)], list(PASSES))
def test_each_reviewed_pass_is_a_pass_the_round_titles_count(self):
self.assertEqual([name for name in PASSES if name in REVIEWERS], list(REVIEWERS))
def test_the_reviewers_are_the_passes_and_agents_larv_review_s_pass_table_names_in_its_order(self):
self.assertEqual({name.lower(): agent for name, agent in REVIEWED_ROW.findall(PASS_TABLE)}, REVIEWERS)
self.assertEqual([name.lower() for name, _ in REVIEWED_ROW.findall(PASS_TABLE)], list(REVIEWERS))
def test_the_reviewers_are_the_passes_that_have_an_agent(self):
self.assertEqual(REVIEWERS, {name: agent for name, agent in PASS_AGENTS.items() if agent})
def test_the_seat_opening_is_the_sentence_that_opens_every_seat_prompt(self):
opening = OPENING.search((ROOT / "skills" / "comprehension-panel" / "seat-prompts.md").read_text(encoding="utf-8"))