diff --git a/AGENTS.md b/AGENTS.md index 30b6c9ab..e6d36179 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -32,5 +32,5 @@ Decisions live in `docs/decisions.md`: - review: the architecture pass audits every principle and goal over the whole project, and a release's last chunk fires it - loop-claude: every claude it starts bypasses permissions inside its sandbox - loop-claude: the stats line `todo.md` plans goes in the transcript archive -- workflow changes: under the bench `todo.md` plans, one merges only once three benches rule it better +- workflow changes: one merges only once three runs of the bench `todo.md` plans rule it better - chunk: as large as one purpose allows diff --git a/CHANGELOG.md b/CHANGELOG.md index b794d77c..7a8b4e9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ - `loop-claude` skips a transcript line it cannot parse, exits 1 naming a transcript it cannot read, and counts a `claude` it cannot start as a failed worker run. - `loop-claude`'s judge quotes the transcript for every verdict, and a verdict quoting nothing or interrupting without a question, or a `claude` the judge cannot start, is a failed judge run; a `claude` that cannot start for an interrupt exits 1. - `loop-claude`'s exit-2 message says what the human is needed for. -- `loop-claude` exits 1 saying why when it cannot start `git` or reload itself, and shows the judge's reply when it rejects a verdict. +- `loop-claude` exits 1 saying why when `git`, or python for a reload, cannot start, and shows the judge's reply when it rejects a verdict. - `loop-claude` retries a failed worker within its cycle. - `loop-claude` counts an interrupt reply starting with `<` as typed. - `loop-claude`'s judge sees a reply the human types while claude works, and an interrupt counts one as typed. diff --git a/bin/loop_claude/cycle/judge.py b/bin/loop_claude/cycle/judge.py index 83705188..92258226 100644 --- a/bin/loop_claude/cycle/judge.py +++ b/bin/loop_claude/cycle/judge.py @@ -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 diff --git a/bin/loop_claude/loop/main.py b/bin/loop_claude/loop/main.py index 8ef4241f..858374cc 100644 --- a/bin/loop_claude/loop/main.py +++ b/bin/loop_claude/loop/main.py @@ -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. diff --git a/bin/test_loop_claude_black_box.py b/bin/test_loop_claude_black_box.py index 689434e7..17b438f6 100644 --- a/bin/test_loop_claude_black_box.py +++ b/bin/test_loop_claude_black_box.py @@ -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): diff --git a/docs/decisions.md b/docs/decisions.md index abfce045..c2c91732 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -112,7 +112,7 @@ 2026-10-01, lilleman. Serves goals 3 and 4.4. The numbers show whether a change to the workflow raised quality or only cost. Each line names another project and its chunk, so the file stays off this repo's remote. `loop-claude` writes the line: the tokens, cycles and interrupts it counts, and the review's numbers from the summary larv-review ends with. Valid while the transcript archive stays off the remote. -## workflow changes: under the bench `todo.md` plans, one merges only once three benches rule it better +## workflow changes: one merges only once three runs of the bench `todo.md` plans rule it better 2026-10-01, lilleman. Serves goals 4.1 and 4.4. The 2026-09-30 bench showed one run cannot tell a workflow's effect from the variance between runs. One bench ruling it worse closes the PR, since quality comes first (goal 4.1), and `docs/workflow-learnings.md` keeps what the PR changed and why it lost. Three is a starting number, to be evaluated against the stats. Valid until that evaluation changes the number.