From 7a7528fba837e36965e32efa2c9d64d04e38df27 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 02:45:15 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20prose=20round=201:=200=20=F0=9F=94=B4,?= =?UTF-8?q?=204=20=F0=9F=9F=A1=20(0=20misread);=20reword=20the=20exit-2=20?= =?UTF-8?q?heading=20and=20bullet,=20drop=20the=20false=20claim=20of=20six?= =?UTF-8?q?=20runs,=20say=20the=20stop=20needs=20the=20human,=20and=20reco?= =?UTF-8?q?rd=20at=20LoopRun=20why=20its=20fields=20stay=20apart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/loop_claude/loop/main.py | 15 +++++++-------- bin/loop_claude/loop/reload.py | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/bin/loop_claude/loop/main.py b/bin/loop_claude/loop/main.py index 6b960ed1..e384f4a3 100644 --- a/bin/loop_claude/loop/main.py +++ b/bin/loop_claude/loop/main.py @@ -106,13 +106,12 @@ Exit 1, saying why, when: more than 2 minutes past. The judge's reply gives its reset time only as text, so the judge is always retried every 10 minutes. stderr says when the next try is due. -Exit 2, when the human is needed to go on and cannot be asked, or the chunk has gone on too long: +Exit 2, when the human is needed to go on: - stdin or stdout is not a terminal, when a model must be picked or an interrupt answered - the input ends while a model is picked - an interrupt's answer is empty, or the input ends before one is typed - the claude opened for /talk, or for a release ready to cut, ends with nothing typed -- the judge rules a chunk unfinished 6 cycles running; finish the chunk yourself, or rerun to give it - 6 more. A finished chunk restarts the run. +- the judge rules a chunk unfinished 6 cycles running; rerun to give it 6 more Rerunning resumes any open session. """ @@ -149,7 +148,7 @@ from claude_code.session import Session, session_named, session_open, transcript # Seconds routing waits for origin to name its default branch, asked only where the checkout records none; past them, the chunk runs on the project's rung. ORIGIN_TIMEOUT = 60 -# How many unfinished verdicts running end the loop, so a worker and a judge that disagree about a chunk cannot cycle unattended without end. A policy number, not derived from the routing steps: well above the two unfinished verdicts running that archived chunks have reached at most, and low enough that a stuck pair spends six worker and judge runs, not more. It counts every unfinished verdict, including those of cycles where the human answered an interrupt: a rerun is cheap, and a chunk that needs six answers is worth a look. "loop-claude --help" states it. +# How many unfinished verdicts running end the loop, so a worker and a judge that disagree about a chunk cannot cycle unattended without end. A policy number, not derived from the routing steps: well above the two unfinished verdicts running that archived chunks have reached at most, and low enough that a stuck pair is stopped after six cycles. It counts every unfinished verdict, including those of cycles where the human answered an interrupt: a rerun is cheap, and a chunk that needs that many answers is worth a look. UNFINISHED_LIMIT = 6 @@ -213,21 +212,21 @@ def routed(route: Route | None, project: Rung | None, model: str, archived: typi def closed_cycle(loop_run: LoopRun, project: Rung | None, concluded: Concluded, archive_folder: pathlib.Path, session: Session, effects: Effects) -> LoopRun | Stop: - """The loop run after a cycle concluded, with the step-up archived; the stop that asks the human, archived, once the chunk has had UNFINISHED_LIMIT unfinished verdicts running.""" + """The loop run after a cycle concluded, with the step-up archived; the stop that needs the human, archived, once the chunk has had UNFINISHED_LIMIT unfinished verdicts running.""" after = after_verdict(loop_run, project, concluded) if stop := archive_step(archive_folder, session, after.task, concluded.route, after.route, effects): return stop if limit := reached_limit(after): - # An unfinished verdict always leaves a route. It is archived as the next cycle would run on it, so a rerun resumes there. + # An unfinished verdict always leaves a route. The stop is archived with that route, the one the next cycle would run on, so a rerun resumes there. return archived_stop(archive_folder, session, after.task, after.route or concluded.route, limit, limit.reason, effects) return after def reached_limit(loop_run: LoopRun) -> Stop | None: - """The stop that asks the human once the loop run holds UNFINISHED_LIMIT unfinished verdicts running.""" + """The stop that needs the human once the loop run holds UNFINISHED_LIMIT unfinished verdicts running.""" if loop_run.unfinished_run < UNFINISHED_LIMIT: return None - return needs_human("decide whether the chunk is finished", f"the judge ruled it unfinished {loop_run.unfinished_run} cycles running and loop-claude does not go on unasked; finish the chunk yourself, or rerun loop-claude to give it {UNFINISHED_LIMIT} more cycles") + return needs_human("go on with the chunk", f"the judge ruled it unfinished {loop_run.unfinished_run} cycles running; finish the chunk yourself, or rerun loop-claude to give it {UNFINISHED_LIMIT} more cycles") def after_verdict(loop_run: LoopRun, project: Rung | None, concluded: Concluded) -> LoopRun: diff --git a/bin/loop_claude/loop/reload.py b/bin/loop_claude/loop/reload.py index 8c4108a1..f6d8dd53 100644 --- a/bin/loop_claude/loop/reload.py +++ b/bin/loop_claude/loop/reload.py @@ -24,7 +24,7 @@ class LoopRun: unfinished_evidence: str # Set by each unfinished verdict; None before the chunk's first one, and once it finishes. route: Route | None = None - # How many unfinished verdicts the chunk has had running; a finished chunk restarts it, and a rerun starts it at 0. + # How many unfinished verdicts the chunk has had running; a finished chunk and a rerun each set it to 0. It stays apart from route and unfinished_evidence, though all three change together at each verdict: merging or renaming a field stops a running loop at its next reload. unfinished_run: int = 0