Answer stability round 1: 0 🔴, 14 🟡 (0 misread); tests that kill the surviving mutants, with a versioned MemoryStore and appended_to, plan/named_paths.py, TakenIn's docstring and the run-heavy rule naming LAUNCHERS; three places left to item 300
CI / tests (pull_request) Successful in 3m10s

This commit is contained in:
2026-11-16 16:53:36 +01:00
parent 79e0f755e2
commit 31da587415
19 changed files with 96 additions and 19 deletions
+5 -3
View File
@@ -163,9 +163,11 @@ def held_history(home: pathlib.Path) -> tuple[RecordStore, Held] | Failure:
def append(read: str, entry: str, home: pathlib.Path) -> str | Failure:
"""Appends entry and returns the line the tool prints; a Failure where the history already holds an entry on what the seats read."""
read_history = held_history(home)
if isinstance(read_history, Failure):
return read_history
history, held = read_history
return read_history if isinstance(read_history, Failure) else appended_to(*read_history, read, entry)
def appended_to(history: RecordStore, held: Held, read: str, entry: str) -> str | Failure:
"""Writes entry onto held, the history as history's store read it, over held's version; the line the tool prints, or why the entry isn't written."""
if recorded(held.text, read):
return Failure(f"{history.label} already holds an entry on {read}; record each ruling or run once")
written = history.write(appended(held.text, entry), held.version)
+9
View File
@@ -15,6 +15,7 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from larv_review.agreement import agreement_report, ruling_agreement, run_agreement
from review_rules.comprehension_history import appended, entries, HistoryChange, latest_places, Place, recorded, ruling_entry, scoring_entry, ScoringRun, Seat
from larv_review.history_commands import appended_to
from larv_review.plan import checkout_plan, Emptied, EMPTIED_WORDS, landed_towards, plan_reasons, scoring_run_due
from review_rules import comprehension_history
from project_config.test_project_config import configured
@@ -25,6 +26,7 @@ from failure import Failure
from plan_store.todo_md import FilePlan
from record_store.stores import FileStore
from larv_review.scoring import floor_step, means, under_floor
from record_store.held import Held
from test_env import isolated_env
from plan.todo_table import Item, items, NoItemsTable
from release_plan.release_standing import LastCut
@@ -459,6 +461,13 @@ class LandedTowards(unittest.TestCase):
self.assertEqual(landed_towards(plan, LastCut(Failure("fatal: bad object"), "", 3, [])), Failure("could not tell the next release: the default branch's tags cannot be read: fatal: bad object"))
class AppendedTo(unittest.TestCase):
def test_writes_the_entry_over_the_version_the_history_was_read_at(self):
history = MemoryStore(label="history.md", version=5)
self.assertEqual(appended_to(history, Held("", "5"), "PR #2 at abcdef1\n", "## an entry\n"), "Appended to history.md.")
self.assertEqual(history.overs, ["5"])
class Shortfall(unittest.TestCase):
def test_skill_md_names_the_words_that_end_the_reason_a_release_empties(self):
self.assertIn(EMPTIED_WORDS, (pathlib.Path(__file__).resolve().parents[2] / "skills" / "larv-review" / "SKILL.md").read_text(encoding="utf-8"))