From 897fe3ed1ab6be3c9d020b754521cb83a804b7ce Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 18 Nov 2026 15:37:08 +0100 Subject: [PATCH] Kill the surviving mutants of the replay comparison and the transcript-read rule --- bin/review_replay/change_comparison.py | 4 ++-- bin/rule_hook/test_rule_hook.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/review_replay/change_comparison.py b/bin/review_replay/change_comparison.py index df02a473..fc0d450d 100644 --- a/bin/review_replay/change_comparison.py +++ b/bin/review_replay/change_comparison.py @@ -14,12 +14,12 @@ def compared(reviewed: str, project: Rung, chosen: list[Round], change: Change, """Replays chosen three times unchanged and once with change, as found_on(round, change or None) finds, and reports the comparison of the rounds no replay failed on; the Limited where claude hit its usage limit.""" runs: list[list[set[int] | Failure]] = [] for applied in (None, None, None, change): - label = (applied or change).changed if applied else change.unchanged + label = change.changed if applied else change.unchanged def replay_one(one: Round, _: Rung, applied: Change | None = applied, label: str = label) -> set[int] | Failure | Limited: found = found_on(one, applied) if isinstance(found, Failure): - print(f" {one.root} {one.at} {label} failed, so the round is left out: {found.reason}", file=sys.stderr, flush=True) + print(f" {one.root} {one.at} {label} failed, so the round is left out: {found.reason}", file=sys.stderr) return found found: list[set[int] | Failure] | Limited = replayed_on(chosen, project, replay_one, f"{reviewed} rounds {label}") diff --git a/bin/rule_hook/test_rule_hook.py b/bin/rule_hook/test_rule_hook.py index 07dd31aa..49edea62 100644 --- a/bin/rule_hook/test_rule_hook.py +++ b/bin/rule_hook/test_rule_hook.py @@ -1513,6 +1513,10 @@ class TranscriptRead(unittest.TestCase): found = breaches_of(Call("Read", {"file_path": self.TRANSCRIPT}, "/r"), self.HOME, {}) self.assertEqual([breach.detail for breach in found[2] if breach.rule == "transcript-read"], [f"the call reads {self.TRANSCRIPT}, a session transcript that holds every tool result of its session; print only the lines you need with grep or jq"]) + def test_the_refusal_is_logged_in_the_checkout_of_the_working_directory(self): + found = breaches_of(Call("Read", {"file_path": self.TRANSCRIPT}, "/r"), self.HOME, {}) + self.assertEqual([breach.directory for breach in found[2] if breach.rule == "transcript-read"], ["/r"]) + def test_a_read_of_a_long_result_claude_code_saved_to_a_file_or_of_a_memory_file_passes(self): for path in ("/home/h/.claude/projects/-home-h-code-acme/abc-123/tool-results/b3ij9u144.txt", "/home/h/.claude/projects/-home-h-code-acme/memory/MEMORY.md"): with self.subTest(path):