Answer stability round 1: 0 🔴, 2 🟡 (0 misread); tie the help's transcript floor to TRANSCRIPT_FLOOR, split the floor test, and name the shortfall in the judge's failure, with the prose round's wording
This commit is contained in:
@@ -149,22 +149,39 @@ class JudgePrompt(unittest.TestCase):
|
||||
self.assertEqual(grounds.after_mark, "old " + "x" * judge.JUDGE_PROMPT_CHARS + "\n\nnew")
|
||||
self.assertEqual(grounds.quotable, "## Goals\n\n")
|
||||
|
||||
def test_stops_rather_than_show_less_of_the_transcripts_tail_than_its_floor_whatever_the_size_of_the_records(self):
|
||||
entries = [assistant({"type": "text", "text": "old " + "x" * judge.TRANSCRIPT_FLOOR}), assistant({"type": "text", "text": "Merged."})]
|
||||
too_long = self.brief(entries, 0, records="r" * judge.JUDGE_PROMPT_CHARS)
|
||||
self.assertEqual(judge.judge_prompt(too_long), Failure(f"the premises, the records and the task leave the transcript 0 characters of the judge's 400,000, under the {judge.TRANSCRIPT_FLOOR:,} of its tail it must read; the records take 400,000. Shorten them."))
|
||||
self.assertEqual(judge.judge_once("/r", too_long, Rung("judge-model"), FakeEffects(claude=[]).effects()), judge.judge_prompt(too_long))
|
||||
prompt, grounds = judge.judge_prompt(self.brief(entries, 0, records="r" * (judge.JUDGE_PROMPT_CHARS - judge.TRANSCRIPT_FLOOR - 10000)))
|
||||
# A transcript longer than the floor: an old message, then the last one.
|
||||
LONG = [assistant({"type": "text", "text": "old " + "x" * judge.TRANSCRIPT_FLOOR}), assistant({"type": "text", "text": "Merged."})]
|
||||
|
||||
def overhead(self):
|
||||
"""The characters of the judge's prompt that are neither the records nor the transcript."""
|
||||
prompt, grounds = judge.judge_prompt(self.brief(self.LONG, 0, records="r"))
|
||||
return len(prompt) - len(grounds.shown) - 1
|
||||
|
||||
def test_fails_naming_the_shortfall_where_the_records_leave_less_than_the_transcripts_floor(self):
|
||||
failed = judge.judge_prompt(self.brief(self.LONG, 0, records="r" * (judge.JUDGE_PROMPT_CHARS + 1)))
|
||||
self.assertIsInstance(failed, Failure)
|
||||
for fact in ("400,000", "400,001", f"{judge.TRANSCRIPT_FLOOR:,}", f"by at least {judge.TRANSCRIPT_FLOOR + self.overhead() + 1:,}"):
|
||||
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)
|
||||
self.assertLessEqual(len(prompt), judge.JUDGE_PROMPT_CHARS)
|
||||
room = judge.JUDGE_PROMPT_CHARS - (len(prompt) - len(grounds.shown))
|
||||
at_floor = judge.JUDGE_PROMPT_CHARS - 10000 + room - 2 * judge.TRANSCRIPT_FLOOR
|
||||
self.assertEqual(len(judge.judge_prompt(self.brief(entries, 0, records="r" * at_floor))[1].shown), judge.TRANSCRIPT_FLOOR, "a head that leaves exactly the floor still shows it")
|
||||
self.assertIsInstance(judge.judge_prompt(self.brief(entries, 0, records="r" * (at_floor + 1))), Failure)
|
||||
short = [assistant({"type": "text", "text": "Merged."})]
|
||||
_, grounds = judge.judge_prompt(self.brief(short, 0, records="r" * (judge.JUDGE_PROMPT_CHARS - 10000)))
|
||||
self.assertEqual(grounds.shown, "Merged.", "a transcript shorter than the floor needs only its own length")
|
||||
|
||||
def test_shows_the_floor_where_the_records_leave_exactly_that(self):
|
||||
at_floor = judge.JUDGE_PROMPT_CHARS - self.overhead() - judge.TRANSCRIPT_FLOOR
|
||||
self.assertEqual(len(judge.judge_prompt(self.brief(self.LONG, 0, records="r" * at_floor))[1].shown), judge.TRANSCRIPT_FLOOR)
|
||||
self.assertIsInstance(judge.judge_prompt(self.brief(self.LONG, 0, records="r" * (at_floor + 1))), Failure)
|
||||
|
||||
def test_shows_a_transcript_shorter_than_the_floor_whole(self):
|
||||
_, grounds = judge.judge_prompt(self.brief([assistant({"type": "text", "text": "Merged."})], 0, records="r" * (judge.JUDGE_PROMPT_CHARS - 10000)))
|
||||
self.assertEqual(grounds.shown, "Merged.")
|
||||
|
||||
def test_the_judge_prompt_and_schema_call_the_worker_the_worker(self):
|
||||
prompt, _ = judge.judge_prompt(self.brief([assistant({"type": "text", "text": "done"})], 1))
|
||||
|
||||
Reference in New Issue
Block a user