Kill the mutants that survived on the lines the release review changed

This commit is contained in:
2026-11-19 13:44:12 +01:00
parent 2edbde8071
commit 2806a8edc9
19 changed files with 452 additions and 6 deletions
+28
View File
@@ -20,6 +20,7 @@ from text_files.file_writes import replace_file
from model_routing.route import Route
from agent_cycle import run
from claude_code import session
from agent_cycle.stop import Stop
OPUS_PROJECT = ProjectRung(read_ladder(SHIPPED), Rung("claude-opus-5-5", "medium"))
@@ -71,6 +72,33 @@ class Steps(unittest.TestCase):
stop = chunk_run.closed_cycle(chunk_run.ChunkRun(cycle_number=1, task="Do it.", unfinished_evidence=""), OPUS_PROJECT, run.Concluded(Unfinished("working", taken_in=TakenIn(highest_likelihood=4)), before), blocked, "a-driver", a_loop(FakeEffects().effects(), session=opened))
self.assertEqual((stop.code, stop.reason.split(":")[0]), (1, "could not archive the transcript"))
def outcomes_after(self, unfinished_run: int, taken_in: TakenIn) -> tuple[object, str]:
"""What closed_cycle answers for a-driver's chunk `Do it.`, after an unfinished verdict that follows unfinished_run others, and the outcomes it archived for a transcript not archived before."""
with tempfile.TemporaryDirectory() as home:
opened = session.session_named("A proj a-driver", pathlib.Path(home, "projects"))
archive = pathlib.Path(home, "archive")
transcript = pathlib.Path(home, "projects", "-fake", f"{opened.id}.jsonl")
transcript.parent.mkdir(parents=True)
transcript.write_text(json.dumps({"type": "queue-operation", "timestamp": "1"}) + "\n")
before = Route(self.FABLE_LOW, 3, 3, 4)
with contextlib.redirect_stderr(io.StringIO()):
closed = chunk_run.closed_cycle(chunk_run.ChunkRun(cycle_number=1, task="Do it.", unfinished_evidence="", unfinished_run=unfinished_run), OPUS_PROJECT, run.Concluded(Unfinished("working", taken_in=taken_in), before), archive, "a-driver", a_loop(FakeEffects().effects(), session=opened))
return closed, "".join(file.read_text() for file in archive.rglob("*") if file.is_file() and file.suffix != ".jsonl")
def test_a_step_up_archived_first_for_its_transcript_names_the_chunks_task(self):
closed, outcomes_kept = self.outcomes_after(0, TakenIn(highest_likelihood=4))
self.assertEqual(closed.route.rung, self.FABLE_MEDIUM)
self.assertIn("Do it.\n", outcomes_kept)
def test_the_sixth_unfinished_verdict_running_stops_for_the_human_naming_the_driver_to_rerun_and_archives_why_with_the_task(self):
reason = "the human is needed to go on with the chunk, but the judge ruled it unfinished 6 cycles running; finish the chunk yourself, or rerun a-driver to give it 6 more cycles"
closed, outcomes_kept = self.outcomes_after(5, TakenIn())
self.assertEqual(closed, Stop(2, reason))
self.assertIn("Do it.\n", outcomes_kept)
self.assertIn(f"Stopped: {reason}\n", outcomes_kept)
closed, outcomes_kept = self.outcomes_after(4, TakenIn())
self.assertEqual((closed.unfinished_run, outcomes_kept), (5, ""))
def test_archives_a_higher_e_plus_i_taken_in_so_a_rerun_keeps_it(self):
with tempfile.TemporaryDirectory() as home:
opened = session.session_named("A proj a-driver", pathlib.Path(home, "projects"))