diff --git a/bin/agent_cycle/test_judge.py b/bin/agent_cycle/test_judge.py index 064d8dec..fdf8ffb3 100644 --- a/bin/agent_cycle/test_judge.py +++ b/bin/agent_cycle/test_judge.py @@ -161,17 +161,18 @@ class JudgePrompt(unittest.TestCase): failed = judge.judge_prompt(self.brief(self.LONG, 0, records="r" * (judge.JUDGE_PROMPT_CHARS + 1))) self.assertIsInstance(failed, Failure) for fact in ("leave 0 of the judge's 400,000", "400,001", f"{judge.TRANSCRIPT_FLOOR:,}", f"by at least {judge.TRANSCRIPT_FLOOR + self.overhead() + 1:,}"): - self.assertIn(fact, failed.reason) + with self.subTest(fact=fact): + self.assertIn(fact, failed.reason) def test_judge_once_returns_that_failure_without_starting_claude(self): failed = judge.judge_once("/r", self.brief(self.LONG, 0, records="r" * judge.JUDGE_PROMPT_CHARS), Rung("judge-model"), FakeEffects(claude=[]).effects()) self.assertIsInstance(failed, Failure) self.assertIn(f"{judge.TRANSCRIPT_FLOOR:,}", failed.reason) - def test_shows_more_than_the_floor_of_the_transcripts_tail_where_the_records_leave_room(self): - prompt, grounds = judge.judge_prompt(self.brief(self.LONG, 0, records="r" * (judge.JUDGE_PROMPT_CHARS - judge.TRANSCRIPT_FLOOR - 10000))) - self.assertTrue(grounds.shown.endswith("\n\nMerged.")) - self.assertGreaterEqual(len(grounds.shown), judge.TRANSCRIPT_FLOOR) + def test_shows_the_whole_of_a_transcript_longer_than_the_floor_where_the_records_leave_room_for_it(self): + whole = "old " + "x" * judge.TRANSCRIPT_FLOOR + "\n\nMerged." + prompt, grounds = judge.judge_prompt(self.brief(self.LONG, 0, records="r" * (judge.JUDGE_PROMPT_CHARS - self.overhead() - len(whole)))) + self.assertEqual(grounds.shown, whole) self.assertLessEqual(len(prompt), judge.JUDGE_PROMPT_CHARS) def test_shows_the_floor_where_the_records_leave_exactly_that(self):