Answer architecture round 2: 0 🔴, 2 🟡; move the pass-list test beside review_passes and read the pass table by one pattern

This commit is contained in:
2026-10-22 20:50:29 +02:00
parent 6de74f0f63
commit cf80a9d925
9 changed files with 45 additions and 26 deletions
+9 -12
View File
@@ -5,16 +5,13 @@ import unittest
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from review_passes import PASSES
from model_routing.ladder import REVIEWERS
from review_passes import PASS_AGENTS, PASSES
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)
# A row of the pass table: its pass and its reviewer cell.
PASS_ROW = re.compile(r"^\| (?!Pass \|)([A-Z][a-z -]+?) \| ([^|]+?) \|", 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]
@@ -22,12 +19,12 @@ PASS_TABLE = LARV_REVIEW.split("## 3. Passes", 1)[1].split("A comment is prose",
class ReviewerLaunches(unittest.TestCase):
"""rule-hook holds a review launch to its rung by recognising it, and `larv-review round-count` counts the passes by name; these fail when what they recognise drifts from what the skills launch."""
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_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_passes_and_their_agents_are_the_ones_larv_review_s_pass_table_names_in_its_order(self):
rows = [(name.lower(), reviewer) for name, reviewer in PASS_ROW.findall(PASS_TABLE)]
self.assertEqual([name for name, _ in rows], list(PASSES))
for name, reviewer in rows:
with self.subTest(name=name):
self.assertEqual(reviewer == PASS_AGENTS[name], PASS_AGENTS[name] is not None)
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"))