Answer the product-owner review's first round

This commit is contained in:
2026-10-01 22:39:51 +02:00
parent 2f3b2f0f6c
commit be2d96a808
6 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ def run_judge(root, args, prompt, transcript) -> Verdict | Failure:
return Failure(proc.stderr.strip() or f"the judge exited {proc.returncode}")
verdict = verdict_from(structured_output(proc.stdout))
if isinstance(verdict, Failure):
return Failure(f"{verdict.reason}; it replied: {proc.stdout.strip()}")
return Failure(f"{verdict.reason}; it replied: {proc.stdout.strip() or 'nothing'}")
if not grounded(verdict, transcript):
return Failure(f"the judge quoted {verdict.evidence!r}, nothing in the transcript" + (f", for the question: {verdict.question}" if verdict.interrupt else ""))
return verdict
+5 -5
View File
@@ -12,11 +12,11 @@ Cycles continue until an exit below or Ctrl-C. Words: ~/.claude/CLAUDE.md → "V
Exit 1: no task, git cannot start or finds no checkout, no premises, a models file it cannot read or
write, claude leaves no transcript or one it cannot read or archive, claude cannot start for an
interrupt, a reload that cannot start or reads unreadable state, or the worker or the judge fails
three times running, retried a minute apart within the cycle. A worker fails when claude cannot
start, exits non-zero, is killed, or ends without a result event; a judge when claude cannot start
or exits non-zero, or its verdict misses or mistypes a field, interrupts without a question, or
quotes nothing in the transcript.
interrupt, python cannot start for a reload, a reload with unreadable state, or the worker or the
judge fails three times running, retried a minute apart within the cycle. A worker fails when claude
cannot start, exits non-zero, is killed, or ends without a result event; a judge when claude cannot
start or exits non-zero, or its verdict misses or mistypes a field, interrupts without a question,
or quotes nothing in the transcript.
Exit 2: the human is needed, to pick the model or answer an interrupt, and stdin or stdout is not a
terminal, the input ends, or the interrupt ended with nothing typed. Rerunning resumes any
open session.
+2 -2
View File
@@ -377,12 +377,12 @@ class Cycles(unittest.TestCase):
self.assertEqual(run.code, 130)
self.assertEqual(run.sleeps, [60, 60, 60, 60])
run = checkout.run([worker(), judge(exit=1, stderr="judge down"), judge(stdout="{}"), judge(verdict={"interrupt": False})])
run = checkout.run([worker(), judge(exit=1, stderr="judge down"), judge(stdout=""), judge(verdict={"interrupt": False})])
self.assertEqual(run.code, 1)
self.assertEqual(run.roles(), ["worker", "judge", "judge", "judge"])
self.assertEqual(run.sleeps, [60, 60])
self.assertIn("retrying the judge in a minute: judge down", run.stderr)
self.assertIn("retrying the judge in a minute: the judge returned no verdict; it replied: {}\n", run.stderr)
self.assertIn("retrying the judge in a minute: the judge returned no verdict; it replied: nothing\n", run.stderr)
self.assertEqual(run.stderr.strip().splitlines()[-1], 'the judge failed three times running: the judge\'s verdict has no evidence of type string; it replied: {"structured_output": {"interrupt": false}}')
def test_retries_the_judge_alone_when_its_verdict_quotes_nothing_in_the_transcript(self):