Answer architecture round 1: 1 🔴, 5 🟡; track bin/model_routing, hand over the route by its rung, share the R + C mapping, record the routing item, and have the judge report R + C plainly

This commit is contained in:
2026-10-14 22:56:03 +02:00
parent a387e62e78
commit c75e576773
15 changed files with 258 additions and 111 deletions
+6 -6
View File
@@ -390,10 +390,10 @@ class Cycles(unittest.TestCase):
("claude-opus-5-5", "high"),
])
self.assertEqual({(argument(call, "--model"), argument(call, "--effort")) for call in run.calls if call["role"] == "judge"}, {("judge-model", None)})
self.assertIn("loop-claude runs you on claude-opus-5-5 at high effort, the rung item 4's R + C of 11 picks.", argument(workers[0], "-p"))
self.assertIn("loop-claude runs you on claude-opus-5-5 at high effort, the rung item 4's R + C of 11 picks. When the chunk takes in another todo.md item, say so, naming that item and its R + C.", argument(workers[0], "-p"))
outcomes = sorted(verdict.removeprefix(f"Task: {TASK}\n\n") for verdict in checkout.archived().values())
self.assertIn("<UTC> Verdict: unfinished\n\nWorker: claude-opus-5-5 at xhigh effort\n\nEvidence:\n> three\n", outcomes)
self.assertIn("<UTC> Verdict: finished\n\nWorker: claude-fable-5-1 at max effort\n\nEvidence:\n> four\n", outcomes)
self.assertIn("<UTC> Verdict: unfinished\n\nWorker: claude-opus-5-5 at xhigh effort, routed by item 4's R + C of 11\n\nEvidence:\n> three\n", outcomes)
self.assertIn("<UTC> Verdict: finished\n\nWorker: claude-fable-5-1 at max effort, routed by item 4's R + C of 11\n\nEvidence:\n> four\n", outcomes)
def test_exits_1_when_the_transcript_cannot_be_archived_and_resumes_on_the_next_run(self):
checkout = Checkout(self)
@@ -474,7 +474,7 @@ class Cycles(unittest.TestCase):
self.assertIn("LATE", run.calls[1]["stdin"])
self.assertEqual(len(run.calls[1]["stdin"]), 400000)
self.assertLess(run.calls[1]["stdin"].count("early"), 80000)
self.assertTrue(run.calls[1]["stdin"].rstrip().endswith("routed the chunk on; 0 otherwise."))
self.assertTrue(run.calls[1]["stdin"].rstrip().endswith("0 when it states none."))
def test_skips_a_malformed_transcript_or_stream_line(self):
checkout = Checkout(self)
@@ -716,12 +716,12 @@ class Reload(unittest.TestCase):
self.assertEqual(run.roles(), ["worker", "judge"] * 5)
self.assertIn("keeping the running script", run.stderr)
reloads = [json.loads(argv[1]) for argv in run.starts if argv[:1] == ["--reloaded"]]
self.assertEqual(reloads, [{"cycle_number": cycle, "root": str(checkout.root), "task": TASK, "unfinished_evidence": "working", "rung": -1, "unfinished": 0} for cycle in (2, 3, 4)])
self.assertEqual(reloads, [{"cycle_number": cycle, "root": str(checkout.root), "task": TASK, "unfinished_evidence": "working", "route": None} for cycle in (2, 3, 4)])
self.assertIn("=== cycle 5,", run.stdout)
outside = checkout.temp / "outside"
outside.mkdir()
state = {"cycle_number": 3, "root": str(checkout.root), "task": TASK, "unfinished_evidence": "", "rung": -1, "unfinished": 0}
state = {"cycle_number": 3, "root": str(checkout.root), "task": TASK, "unfinished_evidence": "", "route": None}
run = checkout.run([worker()], argv=["--reloaded", json.dumps(state)], cwd=outside)
self.assertEqual((run.code, run.roles()), (130, ["worker", "judge"]))
self.assertEqual(run.calls[0]["cwd"], str(checkout.root))