From 60a00ce54fc295c9eb8af66e9ef8a591a66204af Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 9 Oct 2026 11:27:20 +0200 Subject: [PATCH] Answer stability round 1: name the base rule's two conditions, skip the plan for a moved Mean run, and test the floor that blocks nothing --- bin/larv_review/main.py | 2 +- bin/larv_review/rules.py | 4 +++- bin/test_larv_review.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/larv_review/main.py b/bin/larv_review/main.py index 406168ea..8b10c5fc 100644 --- a/bin/larv_review/main.py +++ b/bin/larv_review/main.py @@ -245,7 +245,7 @@ def record_scoring(default: str, seats_file: pathlib.Path, ids: list[int]) -> Fa recorded = chunk_history(default) if isinstance(recorded, Failure): return recorded - blocking = due_reasons(default, ids, []) + blocking = [] if given.moved_mean else due_reasons(default, ids, []) if isinstance(blocking, Failure): return blocking if not (blocking or given.moved_mean or pending_fall(recorded)): diff --git a/bin/larv_review/rules.py b/bin/larv_review/rules.py index db86ef6d..8c3d9ff3 100644 --- a/bin/larv_review/rules.py +++ b/bin/larv_review/rules.py @@ -131,7 +131,9 @@ def measured_commit(changes: list[HistoryChange]) -> str | None: added = [entry for entry in entries(change.after) if entry.heading not in held] rulings = sorted((entry for entry in added if entry.paired), key=lambda entry: entry.time) last = rulings[-1] if rulings else None - if last and last.ruling == "better" or any(not entry.paired for entry in added) and not (last and last.fell): + ruled_better = last is not None and last.ruling == "better" + scored_without_fall = any(not entry.paired for entry in added) and not (last and last.fell) + if ruled_better or scored_without_fall: return change.commit return None diff --git a/bin/test_larv_review.py b/bin/test_larv_review.py index f121841a..3f1bd9de 100644 --- a/bin/test_larv_review.py +++ b/bin/test_larv_review.py @@ -315,6 +315,7 @@ class LarvReviewTool(unittest.TestCase): seats = "".join(f"\n{seat}: {line}\n" for seat in ("Junior A", "Mid A", "Maintainability senior", "Inherited architect")) scored = self.run_tool("record-scoring", self.seats_file(f"PR #2 at {self.start}\n" + seats)) self.assertIn("Ratchet: the paired ruling counts as worse, as Locality fell and Locality is 6.50, under the floor of 7.0.", scored.stdout) + self.assertIn("blocking nothing on a run due for no reason besides a fall: Locality 6.50.", scored.stdout) self.assertIn("\n\nRatchet: the paired ruling counts as worse", (self.checkout / "docs" / "comprehension-history.md").read_text()) self.assertTrue(self.run_tool("needs-scoring-run", "2").stdout.startswith("No scoring run due.\nStill standing: Ratchet:"))