Answer stability round 1: 1 🔴, 5 🟡 (0 misread); imports sorted, the replay cuts the task and the rules from its grounds and fails on a missing heading, outcome parameters keyword-only, the mtime order dropped

This commit is contained in:
2026-11-17 01:13:39 +01:00
parent b5afb4c36a
commit 2600fbb254
11 changed files with 93 additions and 39 deletions
@@ -11,8 +11,8 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from transcript_archive.project_key import checkout_of, project_key
from failure import Failure
from transcript_archive import outcomes, read, write
from transcript_archive.judge_run import JudgeRun
from transcript_archive import outcomes, read, write
from transcript_archive.location import project_archive
from text_files.utc_stamp import utc
@@ -66,6 +66,18 @@ class JudgeRuns(unittest.TestCase):
run = JudgeRun("Prompt é.", {"a": 1})
self.assertEqual(run.content(), b'{\n "prompt": "Prompt \xc3\xa9.",\n "reply": {\n "a": 1\n }\n}')
def test_reads_a_file_that_is_no_run_as_a_failure(self):
with tempfile.TemporaryDirectory() as root:
for text in ("not json", '{"prompt": "P"}', '{"prompt": 1, "reply": {}}', '{"prompt": "P", "reply": []}'):
with self.subTest(text=text):
path = pathlib.Path(root, "run.json")
path.write_text(text)
self.assertRegex(JudgeRun.read(path).reason, f"^could not read the archived judge run {path}: ")
def test_reads_no_path_that_leaves_the_judge_folder_from_an_outcome(self):
outcome = f"{utc(NOW)} Verdict: finished\n\nJudge run: judge/../../secret.json\n"
self.assertIsNone(outcomes.judge_run_at(outcome, utc(NOW)))
def test_names_the_run_on_each_kind_of_outcome_that_has_a_judge(self):
named = f"Judge: j\nJudge run: {self.judged.file}\n"
kept = [