Answer stability round 1: 1 🔴, 1 🟡 (0 misread); refuse to count a report whose headings hold a mark in another form, and test the hook's report lookup
CI / tests (pull_request) Successful in 3m12s

This commit is contained in:
2026-11-17 08:30:22 +01:00
parent b43f2242c5
commit cb6dd6d3a7
5 changed files with 41 additions and 8 deletions
+9
View File
@@ -1071,6 +1071,15 @@ class Hook(unittest.TestCase):
self.assertEqual(commit("Answer stability round 1: 1 🔴, 1 🟡 (1 misread); fix").returncode, 0)
self.assertEqual(commit("Answer prose round 1: 0 🔴, 3 🟡 (0 misread); fix").returncode, 0, "a round whose report is missing goes through")
self.assertEqual(commit("Answer stability round 1: 1 🔴, 2 🟡 (0 misread); fix # rule-override round-title-counts: the reviewer wrote its findings as a list").returncode, 0)
self.assertEqual(commit("Answer Stability round 1: 1 🔴, 2 🟡 (0 misread); fix").returncode, 2, "a capitalised pass reads its report")
elsewhere = tempfile.mkdtemp()
self.addCleanup(subprocess.run, ["rm", "-rf", elsewhere])
moved = hook({"cwd": elsewhere, "tool_input": {"command": f"git -C {self.repo} commit -m 'Answer stability round 1: 1 🔴, 2 🟡 (0 misread); fix'"}, "tool_name": "Bash"}, elsewhere, {"HOME": home})
self.assertEqual(moved.returncode, 2, "the report is the commit's checkout's, not the hook's working directory's")
outside = hook({"cwd": elsewhere, "tool_input": {"command": "git commit -m 'Answer stability round 1: 1 🔴, 2 🟡 (0 misread); fix'"}, "tool_name": "Bash"}, elsewhere, {"HOME": home})
self.assertEqual((outside.returncode, outside.stderr), (0, ""), "outside a checkout no report is read")
(folder / "stability-round-1-rerun.md").write_text("BLOCK\n\n### 🔴 `a.py:1`: wrong\n\n### 🟡 `b.py:2`: worse\n\n### 🟡 `c.py:3`: worse\n")
self.assertEqual(commit("Answer stability round 1: 1 🔴, 2 🟡 (0 misread); fix").returncode, 0, "the rerun's report stands in place of the round's")
def test_a_round_commit_past_round_2_is_refused_and_offers_no_override(self):
ran = self.round_commit("Answer stability round 3: 0 🔴, 1 🟡 (0 misread); fix # rule-override round-cap: the human said yes")