From b40893bc70742b84e5118b963ddadaaeec5c7713 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 28 Sep 2026 16:46:18 +0200 Subject: [PATCH] Retire the section-headers decision, reject an interrupt without a question, and name file_writes by what it does --- AGENTS.md | 1 - bin/loop_claude/cycle.py | 2 +- bin/loop_claude/{private_file.py => file_writes.py} | 0 bin/loop_claude/interrupt.py | 2 +- bin/loop_claude/judge.py | 3 ++- bin/loop_claude/main.py | 5 +++-- bin/loop_claude/models.py | 2 +- bin/loop_claude/trust.py | 4 ++-- docs/decisions.md | 4 ---- 9 files changed, 10 insertions(+), 13 deletions(-) rename bin/loop_claude/{private_file.py => file_writes.py} (100%) diff --git a/AGENTS.md b/AGENTS.md index 4f7aa2eb..e6eb6094 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,7 +12,6 @@ Decisions live in `docs/decisions.md`: - bin/: the Python floor is README's Install prerequisite - bin/: host python, no container - comprehension floor: every dimension and the overall at 7.0 or above, and 0.1.0 waits on it -- loop-claude: the section headers stay - vocabulary: the concept words are defined under `CLAUDE.md` → "Vocabulary" and cited by a bare link - larv-review: a re-entered loop takes a fresh round cap - loop-claude: a reload into an older file is unsupported diff --git a/bin/loop_claude/cycle.py b/bin/loop_claude/cycle.py index b9d11697..247c8011 100644 --- a/bin/loop_claude/cycle.py +++ b/bin/loop_claude/cycle.py @@ -6,7 +6,7 @@ from loop_claude.checkout import project_name from loop_claude.interrupt import interrupt from loop_claude.judge import judge from loop_claude.outcome import Continue, Failure, Retry, Stop -from loop_claude.private_file import make_private +from loop_claude.file_writes import make_private from loop_claude.session import delete_session, session_for, transcript_file from loop_claude.transcript import read, render from loop_claude.worker import run_worker, worker_args diff --git a/bin/loop_claude/private_file.py b/bin/loop_claude/file_writes.py similarity index 100% rename from bin/loop_claude/private_file.py rename to bin/loop_claude/file_writes.py diff --git a/bin/loop_claude/interrupt.py b/bin/loop_claude/interrupt.py index fbe7e7d3..31145aad 100644 --- a/bin/loop_claude/interrupt.py +++ b/bin/loop_claude/interrupt.py @@ -27,5 +27,5 @@ def interrupt(root, session_id, model, path, question, paths): if isinstance(entries, Failure): return Stop(1, f"could not tell whether you typed anything: {entries.reason}") if human_turns(entries) <= before: - return human.needed(TO, "the interrupt ended without you typing anything") + return human.needed(TO, "the interrupt ended with nothing typed") return None diff --git a/bin/loop_claude/judge.py b/bin/loop_claude/judge.py index 4140ccda..39617957 100644 --- a/bin/loop_claude/judge.py +++ b/bin/loop_claude/judge.py @@ -85,9 +85,10 @@ def judge_prompt(task, premises, transcript): def complete(verdict): - return isinstance(verdict, dict) and all( + typed = isinstance(verdict, dict) and all( isinstance(verdict.get(name), bool if JUDGE_SCHEMA["properties"][name]["type"] == "boolean" else str) for name in JUDGE_SCHEMA["required"] ) + return typed and not (verdict["interrupt"] and not verdict["question"].strip()) def grounded(verdict, transcript): diff --git a/bin/loop_claude/main.py b/bin/loop_claude/main.py index 432d208c..3802c6ba 100644 --- a/bin/loop_claude/main.py +++ b/bin/loop_claude/main.py @@ -14,9 +14,10 @@ Exit 1: no task, not inside a checkout, no premises, a models file it cannot rea leaves no transcript or one it cannot read, claude cannot start for an interrupt, a reload with unreadable state, or the worker or the judge fails three times running. 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 a field or quotes nothing in the transcript. +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 without them typing anything. Rerunning resumes any +terminal, the input ends, or the interrupt ended with nothing typed. Rerunning resumes any open session. Each project has one session, "A loop-claude", being the checkout relative to ~/code, diff --git a/bin/loop_claude/models.py b/bin/loop_claude/models.py index 851bd0ba..ae1bb6f7 100644 --- a/bin/loop_claude/models.py +++ b/bin/loop_claude/models.py @@ -5,7 +5,7 @@ import sys from loop_claude import human from loop_claude.checkout import project_name from loop_claude.outcome import Stop -from loop_claude.private_file import replace_json +from loop_claude.file_writes import replace_json @dataclasses.dataclass(frozen=True) diff --git a/bin/loop_claude/trust.py b/bin/loop_claude/trust.py index 299201cb..ab73f25b 100644 --- a/bin/loop_claude/trust.py +++ b/bin/loop_claude/trust.py @@ -1,7 +1,7 @@ import json import sys -from loop_claude.private_file import replace_json +from loop_claude.file_writes import replace_json def trust(config, roots): @@ -15,7 +15,7 @@ def trust(config, roots): if not isinstance(projects, dict): print(f"could not read {config}: not an object whose \"projects\" is an object", file=sys.stderr) return - if wrong := next((path for path, record in projects.items() if not isinstance(record, dict)), None): + if (wrong := next((path for path, record in projects.items() if not isinstance(record, dict)), None)) is not None: print(f"could not read {config}: projects[{json.dumps(wrong)}] is not an object", file=sys.stderr) return untrusted = [path for path in roots if not projects.get(path, {}).get("hasTrustDialogAccepted")] diff --git a/docs/decisions.md b/docs/decisions.md index 148c4a48..598eb123 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -32,10 +32,6 @@ 2026-09-27, lilleman, restating the 2026-09-24 target and extending it to the overall. Serves goal 4. The 2026-09-28 run, Junior A, Mid A, the maintainability senior and the inherited architect at depth 1 over every non-test file, blind to `todo.md` and this log, scored Navigation 7.25, Locality 6.0, Shape 6.5, Self-sufficiency 6.25, overall 6.25; on 2026-09-26 they were 7.75, 6.25, 7.0, 6.75, 6.75. Every seat scored Locality 6, and three of four named `run_cycle`'s three-way return and larv-review's re-entry rules, split across the passes on 2026-09-28. The rebuild planned in `todo.md` under 0.1.0 answers the places named, and a later chunk may not lower any dimension. Valid until the next scoring run, which uses the same four seats. -## loop-claude: the section headers stay - -2026-09-26, larv-review, declining a prose-pass deletion under `CLAUDE.md` → "Comments and documentation". Serves goal 4. Two seats of the 2026-09-26 panel credit Navigation 8 to the headers in what is now `bin/loop_claude/cycle.py`, which index it by the file or format each group touches. Valid while `cycle.py` holds more than one group; a header leaves with its group, as `# The transcript file` did into `transcript.py`. - ## vocabulary: the concept words are defined under `CLAUDE.md` → "Vocabulary" and cited by a bare link 2026-09-24, larv-review. Serves goal 4. Three seats of the 2026-09-24 panel found the words only in the changelog; a definition at each rule lands one reader and misses the next, so the section is the one landing place and each file using the words links it once, and `bin/test_citations.py` fails on a citation no heading or bold lead answers, so the pointer's rot is visible. `loop-claude --help` restates chunk, cycle, interrupt and premises, since a terminal reader has no link to follow. Valid until the next scoring run.