Step the worker up as the judge interrupts when the run also cites an escalation trigger

This commit is contained in:
2026-10-17 21:57:11 +02:00
parent 4474182174
commit 1c503e8818
14 changed files with 142 additions and 57 deletions
@@ -50,7 +50,7 @@ class Outcomes(unittest.TestCase):
def test_reads_back_the_worker_of_each_outcome_that_closes_a_cycle(self):
kept = "Task: Do it.\n\n" + "\n".join(f"{utc(NOW + offset)} {outcome}\n" for offset, outcome in enumerate([
outcomes.unfinished("w1", "Worker: not this", "j", ""),
outcomes.interrupted("Which one?\nWorker: nor this", "e", "j"),
outcomes.interrupted("Which one?\nWorker: nor this", "e", "j", ""),
outcomes.stopped("w2", "the judge failed\nthree times"),
outcomes.finished("w3", "merged", "j"),
]))
@@ -60,6 +60,10 @@ class Outcomes(unittest.TestCase):
self.assertEqual(outcomes.unfinished("w", "e", "j", "round 2: 🔴"), "Verdict: unfinished\n\nEvidence:\n> e\n\nEscalation:\n> round 2: 🔴\n\nJudge: j\nWorker: w")
self.assertEqual(outcomes.unfinished("w", "e", "j", ""), "Verdict: unfinished\n\nEvidence:\n> e\n\nJudge: j\nWorker: w")
def test_archives_the_escalation_an_interrupt_quotes_beside_its_evidence(self):
self.assertEqual(outcomes.interrupted("q?", "e", "j", "round 2: 🔴"), "Verdict: interrupt\n\nq?\n\nEvidence:\n> e\n\nEscalation:\n> round 2: 🔴\n\nJudge: j")
self.assertEqual(outcomes.interrupted("q?", "e", "j", ""), "Verdict: interrupt\n\nq?\n\nEvidence:\n> e\n\nJudge: j")
def test_reads_no_worker_from_an_outcome_written_before_the_worker_line(self):
kept = f"Task: Do it.\n\n{utc(NOW)} Stopped: Ctrl-C\n\n{utc(NOW)} Verdict: unfinished\n\nEvidence:\n> Worker: no\n"
self.assertEqual(outcomes.workers(kept), [])