From 471b86db5ef24f517d5ad9bb119fe75132bdb89e Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 1 Oct 2026 22:32:44 +0200 Subject: [PATCH 1/6] Title each decision by what holds now, and make the small fixes filed against bin/, the README, .gitignore and stability-reviewer --- .gitignore | 7 ++++--- AGENTS.md | 8 ++++---- CHANGELOG.md | 3 ++- CLAUDE.md | 2 +- README.md | 2 +- agents/stability-reviewer.md | 2 +- bin/loop_claude/cycle/judge.py | 4 +++- bin/loop_claude/loop/main.py | 16 +++++++++------- bin/loop_claude/loop/reload.py | 20 +++++++++++++------- bin/loop_claude/outcome.py | 2 +- bin/loop_claude/project/checkout.py | 10 ++++++++-- bin/test_loop_claude.py | 15 ++++++++++++++- bin/test_loop_claude_black_box.py | 8 ++++++-- docs/decisions.md | 10 +++++----- todo.md | 10 +--------- 15 files changed, 73 insertions(+), 46 deletions(-) diff --git a/.gitignore b/.gitignore index ba2981f2..ae8d17f1 100644 --- a/.gitignore +++ b/.gitignore @@ -18,15 +18,16 @@ !agents/ !agents/*.md !bin/ -!bin/* +!bin/loop-claude !bin/loop_claude/**/ !bin/loop_claude/**/*.py +!bin/test_*.py !docs/ !docs/*.md !principles/ !principles/*.md !skills/ !skills/comprehension-panel/ -!skills/comprehension-panel/** +!skills/comprehension-panel/*.md !skills/larv-review/ -!skills/larv-review/** +!skills/larv-review/*.md diff --git a/AGENTS.md b/AGENTS.md index 4103ee82..30b6c9ab 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,7 +6,7 @@ Decisions live in `docs/decisions.md`: - larv-review: a project under the comprehension floor is fixed at the capping dimension - loop-claude: a judge decides interrupts, not the worker's self-report -- loop-claude: one session per project, at a fixed id from its full path, and a second loop refuses to start +- loop-claude: one session per project, at a fixed id from its path - loop-claude: the trust file is rewritten before an interrupt - loop-claude: every worktree of the checkout is trusted before an interrupt - bin/: the Python floor is README's Install prerequisite @@ -23,7 +23,7 @@ Decisions live in `docs/decisions.md`: - loop-claude: the judge is retried alone, on its own counter - loop-claude: the judge loads `CLAUDE.md` - loop-claude: the archive keeps the raw transcript, and a failed archive stops the loop -- loop-claude: a loop running main's script stops once at the cut-over +- loop-claude: a loop started on main's script stops at its first reload into the rebuild's - rebuild: a chunk into `rebuild` takes no comprehension scoring run - loop-claude: a `claude` that cannot start is a failed worker run, retried - bin/: mypy checks `loop_claude`'s types in the tests @@ -31,6 +31,6 @@ Decisions live in `docs/decisions.md`: - review: an ask no user answers leaves the PR unmerged - 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 -- stats: a chunk's cost and review numbers are kept in the transcript archive -- bench: a workflow change merges only once three benches rule it better +- 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 - chunk: as large as one purpose allows diff --git a/CHANGELOG.md b/CHANGELOG.md index 155beca6..b794d77c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,13 @@ - Run `loop-claude` only in a sandbox with no direct access to production: every claude it starts skips every permission prompt. - First release: `README.md` states what the checkout holds and needs, `loop-claude --help` what `loop-claude` does. -- `settings.json`, the agents and the status line run on any machine unedited; the status line shows reset times in the machine's own time zone. +- `settings.json`, the agents and the status line run unedited on any machine with README → Install's prerequisites; the status line shows reset times in the machine's own time zone. - `loop-claude`'s no-premises exit names what is wrong: `README.md` unopenable or not UTF-8, a `## Goals` or `## Audience` heading missing or repeated, or nothing under one. - `loop-claude` says why when it cannot read or write `~/.claude.json` before an interrupt, naming a `projects` entry that is not an object, and the interrupt then lands in Claude Code's trust dialog. - `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` 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/CLAUDE.md b/CLAUDE.md index 3b46773e..b7cb63b2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -79,7 +79,7 @@ Prose describing the code as it stands — a comment, a README, an `AGENTS.md`, ### Decisions: one home, each linked to a goal or a technical principle -**A decision record owns what a call site may not say.** A rejected alternative, or what something deliberately does not cover, is banned beside the code precisely because the decision record holds it — a standing choice a future reader would otherwise relitigate, where a `CHANGELOG` holds what changed in a release. **The decision log has one home: `docs/decisions.md`**, or `docs/decisions/` split by area once it outgrows one file. `AGENTS.md` carries a one-line index of the titles, so a session or a reviewer sees that a decision exists without loading its reasoning. An entry states the decision, its date, who made it, and the premise it rests on ("valid while X") so it can expire honestly when that premise dies. A decision found anywhere else — an `AGENTS.md` body, a comment, or a README section that is neither a goal nor how one is met — moves there and leaves its index line behind. A goal stays a goal in the README; the log records only what the goal leaves open. +**A decision record owns what a call site may not say.** A rejected alternative, or what something deliberately does not cover, is banned beside the code precisely because the decision record holds it — a standing choice a future reader would otherwise relitigate, where a `CHANGELOG` holds what changed in a release. **The decision log has one home: `docs/decisions.md`**, or `docs/decisions/` split by area once it outgrows one file. `AGENTS.md` carries a one-line index of the titles, so a session or a reviewer sees that a decision exists without loading its reasoning. A title states what holds at the commit it ships in, in words a reader finds in the code or the plan. An entry states the decision, its date, who made it, and the premise it rests on ("valid while X") so it can expire honestly when that premise dies. A decision found anywhere else — an `AGENTS.md` body, a comment, or a README section that is neither a goal nor how one is met — moves there and leaves its index line behind. A goal stays a goal in the README; the log records only what the goal leaves open. **Every decision links to a goal or a technical principle.** An entry names the goal it serves or the technical principle under `~/.claude/principles/` it applies; one that can do neither is a missing goal, and an entry already in the repo with neither behind it is a finding. Propose the goal, never a reason of your own — "Ask, don't guess" under "Working loop" says how. An entry working against a goal or a technical principle stands only while it names the `todo.md` item that ends it. diff --git a/README.md b/README.md index 1750f014..dbecd577 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Me, on my own machines, which take tagged releases. Nobody else depends on it. ## Install -Check out the latest tag in `~/.claude`, with Python 3.11 or newer as `python3` on `PATH`. Link the tool onto `PATH`: `ln -s ~/.claude/bin/loop-claude ~/.local/bin/loop-claude`. Run it only in a sandbox with no direct access to a production environment, such as a dedicated VM: every claude it starts, the interrupt included, skips every permission prompt. +Check out the latest tag in `~/.claude`, with Python 3.11 or newer as `python3` on `PATH`, and `jq` and GNU `date` for `statusline.sh`. Link the tool onto `PATH`: `ln -s ~/.claude/bin/loop-claude ~/.local/bin/loop-claude`. Run it only in a sandbox with no direct access to a production environment, such as a dedicated VM: every claude it starts, the interrupt included, skips every permission prompt. ## Release diff --git a/agents/stability-reviewer.md b/agents/stability-reviewer.md index 7db07782..c3a4ade0 100644 --- a/agents/stability-reviewer.md +++ b/agents/stability-reviewer.md @@ -11,7 +11,7 @@ You are an elite stability-focused code reviewer with deep expertise in defensiv 1. **Scope the change.** You review every PR; a fresh invocation has no prior context, so determine the diff yourself. Diff the PR branch against its base (`gh pr diff`, or `git merge-base HEAD` then `git diff`), and review the changed lines **plus enough surrounding code and callers** to judge correctness — read the whole changed file when practical; a diff alone hides whether a caller breaks. Read the PR description and, when the project uses an issue tracker (project-specific — check its docs) and the change references a ticket, that ticket: the diff is judged against its stated intent, and a scope mismatch in either direction is a finding — claimed-but-unimplemented, and implemented-but-unasked (#2). 2. **Read every file in the shared principles** at `~/.claude/principles/` — not just `technical-principles.md`, also `frontend.md`, `logging.md`, and `rest-apis.md`. These are mandatory org guidelines; all code MUST comply. Map the relevant file(s) to the change (frontend PR → `frontend.md`; API PR → `rest-apis.md`; etc.). Re-read each time — they change. Flag violations prominently. 3. **Read README.md, AGENTS.md and `docs/decisions.md`** in the current project for project-specific conventions, build instructions, tooling, and the accepted trade-offs a reviewer should honor rather than re-flag. Note the documented test, lint, and static-analysis commands — you will run them. -4. **Verify, don't just read.** Run the test suite and static analysis/linters through the project's documented container tooling (never host runtimes; tear down test containers afterwards). A full-suite run catches broken callers that diff-reading misses. When a suspected bug is cheap to confirm, reproduce it — a scratch script in a temp dir, a targeted test run — before reporting it. Leave the working tree exactly as you found it. Anything you could not run goes in Coverage & Verification, never silently skipped. +4. **Verify, don't just read.** Run the test suite and static analysis/linters as the project's README and decisions say, through its container tooling unless a decision puts them on the host; tear down test containers afterwards. A full-suite run catches broken callers that diff-reading misses. When a suspected bug is cheap to confirm, reproduce it — a scratch script in a temp dir, a targeted test run — before reporting it. Leave the working tree exactly as you found it. Anything you could not run goes in Coverage & Verification, never silently skipped. 5. **Two passes minimum, then hunt absences.** - *Breadth:* every hunk in every changed file, no skimming. Track which files you have covered; batch large diffs, never truncate the review. - *Depth:* trace the riskiest data paths end-to-end (input → logic → persistence/response), the interactions between changed pieces, and between the change and config (timeout hierarchies, retries × idempotency, queue worker counts, env parity). diff --git a/bin/loop_claude/cycle/judge.py b/bin/loop_claude/cycle/judge.py index d20f6457..83705188 100644 --- a/bin/loop_claude/cycle/judge.py +++ b/bin/loop_claude/cycle/judge.py @@ -67,7 +67,9 @@ def run_judge(root, args, prompt, transcript) -> Verdict | Failure: if proc.returncode != 0: return Failure(proc.stderr.strip() or f"the judge exited {proc.returncode}") verdict = verdict_from(structured_output(proc.stdout)) - if isinstance(verdict, Verdict) and not grounded(verdict, transcript): + if isinstance(verdict, Failure): + return Failure(f"{verdict.reason}; it replied: {proc.stdout.strip()}") + 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 273d9f56..8ef4241f 100644 --- a/bin/loop_claude/loop/main.py +++ b/bin/loop_claude/loop/main.py @@ -10,12 +10,13 @@ on the terminal, every worktree first marked trusted in ~/.claude.json. An unfin its session next cycle; the next chunk starts a fresh session. Cycles continue until an exit below or Ctrl-C. Words: ~/.claude/CLAUDE.md → "Vocabulary". -Exit 1: no task, not inside a 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 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 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. 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. @@ -63,7 +64,8 @@ def run_loop(argv, env, paths, launcher, cwd) -> Stop: project = project_name(state.root, paths.code) session = session_for(project, paths) while True: - exec_if_edited(launcher, baseline, state) + if stop := exec_if_edited(launcher, baseline, state): + return stop state = dataclasses.replace(state, cycle_number=state.cycle_number + 1) premises = read_premises(state.root) if isinstance(premises, Stop): diff --git a/bin/loop_claude/loop/reload.py b/bin/loop_claude/loop/reload.py index 2f5949a8..7aa7c48a 100644 --- a/bin/loop_claude/loop/reload.py +++ b/bin/loop_claude/loop/reload.py @@ -6,6 +6,8 @@ import subprocess import sys import typing +from loop_claude.outcome import Stop + RELOAD_FLAG = "--reloaded" T = typing.TypeVar("T") @@ -42,11 +44,15 @@ def fingerprint(launcher) -> str: return digest.hexdigest() -def exec_if_edited(launcher, baseline, state) -> None: +def exec_if_edited(launcher, baseline, state) -> Stop | None: if fingerprint(launcher) == baseline: - return - trial = subprocess.run([sys.executable, launcher, "--help"], capture_output=True, text=True) - if trial.returncode != 0: - print(f"keeping the running script: {trial.stderr.strip() or f'exit {trial.returncode}'}", file=sys.stderr) - return - os.execv(sys.executable, [sys.executable, str(launcher), RELOAD_FLAG, json.dumps(dataclasses.asdict(state))]) + return None + try: + trial = subprocess.run([sys.executable, launcher, "--help"], capture_output=True, text=True) + if trial.returncode != 0: + print(f"keeping the running script: {trial.stderr.strip() or f'exit {trial.returncode}'}", file=sys.stderr) + return None + os.execv(sys.executable, [sys.executable, str(launcher), RELOAD_FLAG, json.dumps(dataclasses.asdict(state))]) + except OSError as failure: + return Stop(1, f"could not reload loop-claude: {failure.strerror}; rerun loop-claude ") + return None diff --git a/bin/loop_claude/outcome.py b/bin/loop_claude/outcome.py index e6a90142..95fa3451 100644 --- a/bin/loop_claude/outcome.py +++ b/bin/loop_claude/outcome.py @@ -3,7 +3,7 @@ import dataclasses @dataclasses.dataclass(frozen=True) class Failure: - """A step failed and its caller decides: `retried` reruns a worker or judge run until it fails three times running; anything else becomes a Stop or a warning.""" + """A step failed, for reason; its caller decides what follows.""" reason: str diff --git a/bin/loop_claude/project/checkout.py b/bin/loop_claude/project/checkout.py index 3400e389..7c700b89 100644 --- a/bin/loop_claude/project/checkout.py +++ b/bin/loop_claude/project/checkout.py @@ -4,7 +4,10 @@ from loop_claude.outcome import Stop def checkout_root(cwd) -> str | Stop: - found = subprocess.run(["git", "rev-parse", "--show-toplevel"], capture_output=True, cwd=cwd, text=True) + try: + found = subprocess.run(["git", "rev-parse", "--show-toplevel"], capture_output=True, cwd=cwd, text=True) + except OSError as failure: + return Stop(1, f"could not start git: {failure.strerror}") if found.returncode != 0: return Stop(1, found.stderr.strip()) return found.stdout.strip() @@ -12,7 +15,10 @@ def checkout_root(cwd) -> str | Stop: def checkouts(root) -> list[str]: found = [root] - listing = subprocess.run(["git", "worktree", "list", "--porcelain"], capture_output=True, cwd=root, text=True) + try: + listing = subprocess.run(["git", "worktree", "list", "--porcelain"], capture_output=True, cwd=root, text=True) + except OSError: + return found if listing.returncode == 0: found += [line.split(" ", 1)[1] for line in listing.stdout.splitlines() if line.startswith("worktree ")] return sorted(set(found)) diff --git a/bin/test_loop_claude.py b/bin/test_loop_claude.py index c15b17d0..004a4ab1 100644 --- a/bin/test_loop_claude.py +++ b/bin/test_loop_claude.py @@ -5,6 +5,7 @@ import pathlib import sys import tempfile import unittest +from unittest import mock sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent)) @@ -13,7 +14,7 @@ from loop_claude.claude_code import formats, transcript from loop_claude.cycle import judge from loop_claude.loop import main, reload from loop_claude.outcome import Failure, Stop -from loop_claude.project import premises +from loop_claude.project import checkout, premises CWD = pathlib.Path("/c") @@ -133,6 +134,18 @@ class LoopState(unittest.TestCase): self.assertEqual(reload.decode_state('{"count": 1, "name": "n"}', Stringly), Stringly(1, "n")) self.assertIsNone(reload.decode_state('{"count": "1", "name": "n"}', Stringly)) + def test_stops_when_the_reload_cannot_start_python(self): + with tempfile.TemporaryDirectory() as root, mock.patch("os.execv", side_effect=OSError(2, "No such file or directory")): + launcher = pathlib.Path(root, "loop-claude") + launcher.write_text("") + self.assertEqual(reload.exec_if_edited(launcher, "stale", main.LoopState(1, "/r", "do it")), Stop(1, "could not reload loop-claude: No such file or directory; rerun loop-claude ")) + + +class Checkouts(unittest.TestCase): + def test_lists_the_root_alone_when_git_cannot_start(self): + with tempfile.TemporaryDirectory() as empty, mock.patch.dict(os.environ, {"PATH": empty}): + self.assertEqual(checkout.checkouts(empty), [empty]) + class ReplaceFile(unittest.TestCase): diff --git a/bin/test_loop_claude_black_box.py b/bin/test_loop_claude_black_box.py index 318d6138..689434e7 100644 --- a/bin/test_loop_claude_black_box.py +++ b/bin/test_loop_claude_black_box.py @@ -300,6 +300,10 @@ class Premises(unittest.TestCase): run = checkout.run([worker()]) self.assertEqual((run.code, run.calls), (1, [])) self.assertEqual(run.stderr.strip(), f"README.md in {checkout.root}: Is a directory - no premises.") + (checkout.temp / "fake-bin" / "git").unlink() + run = checkout.run([worker()]) + self.assertEqual((run.code, run.calls), (1, [])) + self.assertEqual(run.stderr.strip(), "could not start git: No such file or directory") def test_names_the_session_by_the_checkout_relative_to_code_or_else_to_the_root(self): checkout = Checkout(self) @@ -378,8 +382,8 @@ class Cycles(unittest.TestCase): 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", 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") + self.assertIn("retrying the judge in a minute: the judge returned no verdict; it replied: {}\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): checkout = Checkout(self) diff --git a/docs/decisions.md b/docs/decisions.md index 0c97b487..abfce045 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -8,7 +8,7 @@ 2026-09-21, lilleman. Serves goal 4. Asked to name the goal behind each choice, the worker cites a real goal for a choice that goal does not settle, and under-reports its own decisions; the judge's bar is whether the README discriminates between the alternatives. Valid while the worker's self-report stays unreliable. -## loop-claude: one session per project, at a fixed id from its full path, and a second loop refuses to start +## loop-claude: one session per project, at a fixed id from its path 2026-09-21, lilleman; revised 2026-09-30 by lilleman. Serves goal 4. One fixed id per project keeps the session picker at one entry per project and makes any transcript under that id loop-claude's own to delete. The id derives from the checkout's full path, so no two checkouts share one, and `loop-claude` refuses to start while another session on that id is active. Moving the checkout orphans its open sessions, archive folder and models entry: sessions stay in the picker until the human deletes them, migration code not being worth a one-human audience. Until `todo.md`'s "Key a project on its checkout's full path" lands, the id is the checkout's path relative to `~/code`, or to `/` outside it, and a second loop is not refused, so a checkout outside `~/code` mirroring a path inside it shares its id. Valid while claude takes `--session-id` and resumes by it. @@ -76,9 +76,9 @@ 2026-09-28, lilleman, for the rebuild. Serves goals 2 and 4: saving each transcript locally is the first step of backing it up, and it shows afterwards what an unattended run did. A copy of the `.jsonl`, deduplicated by content hash, with the verdict beside it; a rendering drops tool results, and a second-resolution stamp names two states within one second as one file. A failed archive exits 1, since a loop that loses its record silently fails the backup goal. Valid while transcripts stay small enough to copy whole. -## loop-claude: a loop running main's script stops once at the cut-over +## loop-claude: a loop started on main's script stops at its first reload into the rebuild's -2026-09-29, lilleman. Serves goal 4. The rebuild's `LoopState` lacks main's failure count, so a loop running main's script exits 1 at its first reload into the rebuild, telling the human to rerun `loop-claude `. No code exists only for the cut-over: one rerun costs a one-human audience less. Valid until the rebuild merges. +2026-09-29, lilleman. Serves goal 4. The rebuild's `LoopState` lacks main's failure count, so a loop running main's script exits 1 at its first reload into the rebuild, telling the human to rerun `loop-claude `. No code exists only for that reload: one rerun costs a one-human audience less. Valid until the rebuild merges. ## rebuild: a chunk into `rebuild` takes no comprehension scoring run @@ -108,11 +108,11 @@ 2026-09-30, lilleman. Applies "Always grant explicit access to data": the sandbox `loop-claude` runs in is where access is granted, so the worker and the interrupt run with `bypassPermissions`. The worker may read `~/.claude/.credentials.json`: it holds Claude Code's own credentials, which claude reads to run anyway. Its one seam to production is the forge: what it pushes or merges can publish through CI. Valid while `loop-claude` runs only in the sandbox README → Install names. -## stats: a chunk's cost and review numbers are kept in the transcript archive +## loop-claude: the stats line `todo.md` plans goes in the transcript archive 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. -## bench: a workflow change merges only once three benches rule it better +## workflow changes: under the bench `todo.md` plans, one merges only once three benches 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. diff --git a/todo.md b/todo.md index 65a0a745..e8277fb1 100644 --- a/todo.md +++ b/todo.md @@ -6,19 +6,11 @@ The sketches, the judges' verdicts and what to take from each: `~/code/claude-handoffs/claude-config_2026-09-28.md`. -The first five items are the places the panel on `rebuild` at 8585257 named under Self-sufficiency and Locality, the dimensions under the floor (scores: `docs/decisions.md` → "comprehension floor"). +The first three items are the places the panel on `rebuild` at 8585257 named under Self-sufficiency and Locality, the dimensions under the floor (scores: `docs/decisions.md` → "comprehension floor"). -- **Title each `AGENTS.md` index line by what holds at the commit it ships in.** Three seats searched `bin/` for the full-path id and the refused second loop, which wait on items below. "cut-over", "stats" and "bench" name nothing a reader can find. - **Name a project's loop states and give them one transition function.** Every seat had to keep two facts in mind: a run resumes only if its transcript exists (`steps.py:27`), and a reload carries its state through argv (`reload.py:45`). - **Split `written_by_human`'s boolean into one named check per entry shape.** `formats.py:42` packs three tests into one line, one seat learnt the cases only from `HumanTurns` in the tests, and another could not confirm them without `HumanTurns`. Three seats named it the unit they least wanted to modify, and the architect named it where the project rots first. -- **Have stability-reviewer's step 4 run tests where the project's decisions say.** It says never host runtimes, and two seats found README's tests run on the host by decision. - **Annotate the parameter types in `bin/loop_claude/`.** Whether `root` or `path` is a `str` or a `Path` is learnt by tracing callers back to `bin/loop-claude`. -- **Make the small fixes filed against `bin/`, the README and `.gitignore`.** Goals 1, 3 and 4.1. - - Name `jq` and GNU `date` under README → Install, or stop `statusline.sh` needing them. Without `jq` the status line aborts. Under BSD `date` the reset times vanish. Either way CHANGELOG's "runs on any machine unedited" is false. - - Narrow `.gitignore`'s `!bin/*` and `skills/*/**` to the files they mean. Today a stray log of `loop-claude` output in `bin/` would be committed, transcript text included. - - Show the judge's reply when its verdict is rejected. Its stdout is discarded today, so a judge that failed three times running leaves nothing to diagnose. - - Return a `Stop` when `git` or `os.execv` fails. `checkout.py:7,15` and `reload.py:52` end in a traceback today. - - `outcome.Failure`'s docstring: say what a failure is, without naming `retried`. A value type does not name its consumer. - **Archive the transcript as each cycle ends.** Today only an interrupt or a finished chunk archives it, so a failed exit or Ctrl-C loses the transcript. Goal 2. - **Key a project on its checkout's full path, and refuse to start while another session uses that key.** The key names the project's session, archive folder and models entry. `checkout.py:22` drops the leading `/`, so `~/code/a` and `/a` share all three, and one loop can resume or delete the other's session. Goal 4.1. - **Give principles-auditor and prose-reviewer a way to list the project's files.** In the 2026-09-30 audit run their `tools: Read, Grep, Glob` gave them only Read. Each read the files that imports and `.gitignore` named, and listed the files it could not reach. Goal 4.1. -- 2.52.0 From 2f3b2f0f6c9d8ea63661f4d23c1a42dc502132fc Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 1 Oct 2026 22:35:22 +0200 Subject: [PATCH 2/6] Un-ignore bin/loop_claude/ itself, and test that no tracked file is ignored --- .gitignore | 1 + bin/test_gitignore.py | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 bin/test_gitignore.py diff --git a/.gitignore b/.gitignore index ae8d17f1..9cdc73f7 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ !agents/*.md !bin/ !bin/loop-claude +!bin/loop_claude/ !bin/loop_claude/**/ !bin/loop_claude/**/*.py !bin/test_*.py diff --git a/bin/test_gitignore.py b/bin/test_gitignore.py new file mode 100644 index 00000000..42f730e3 --- /dev/null +++ b/bin/test_gitignore.py @@ -0,0 +1,10 @@ +import subprocess +import unittest + +from test_python_floor import ROOT + + +class Gitignore(unittest.TestCase): + def test_ignores_no_tracked_file(self): + ignored = subprocess.run(["git", "ls-files", "-ci", "--exclude-standard"], capture_output=True, check=True, cwd=ROOT, text=True).stdout + self.assertEqual(ignored, "") -- 2.52.0 From be2d96a808a7da7a3a89af3bb3f9ae8b0a6263b3 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 1 Oct 2026 22:39:51 +0200 Subject: [PATCH 3/6] Answer the product-owner review's first round --- AGENTS.md | 2 +- CHANGELOG.md | 2 +- bin/loop_claude/cycle/judge.py | 2 +- bin/loop_claude/loop/main.py | 10 +++++----- bin/test_loop_claude_black_box.py | 4 ++-- docs/decisions.md | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) 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. -- 2.52.0 From f118809d858dbc08f8f306c2db1e975c3d715b20 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 1 Oct 2026 22:44:09 +0200 Subject: [PATCH 4/6] Answer the prose review's first round --- AGENTS.md | 6 +++--- CHANGELOG.md | 3 ++- CLAUDE.md | 2 +- agents/stability-reviewer.md | 2 +- docs/decisions.md | 8 ++++---- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index e6d36179..bd1fb206 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,7 +6,7 @@ Decisions live in `docs/decisions.md`: - larv-review: a project under the comprehension floor is fixed at the capping dimension - loop-claude: a judge decides interrupts, not the worker's self-report -- loop-claude: one session per project, at a fixed id from its path +- loop-claude: one session per project, at a fixed id from its checkout's path - loop-claude: the trust file is rewritten before an interrupt - loop-claude: every worktree of the checkout is trusted before an interrupt - bin/: the Python floor is README's Install prerequisite @@ -31,6 +31,6 @@ Decisions live in `docs/decisions.md`: - review: an ask no user answers leaves the PR unmerged - 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: one merges only once three runs of the bench `todo.md` plans rule it better +- loop-claude: the planned stats line goes in the transcript archive +- workflow changes: a change merges only once three planned benches rule it better - chunk: as large as one purpose allows diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a8b4e9f..33bc8696 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,8 @@ - `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 `git`, or python for a reload, cannot start, 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. +- `loop-claude` shows the judge's reply when it rejects the judge's 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/CLAUDE.md b/CLAUDE.md index b7cb63b2..f4554bf6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -104,7 +104,7 @@ Prose describing the code as it stands — a comment, a README, an `AGENTS.md`, ## Working with the codebase - Always start a new git worktree when doing something in a codebase, and clean it up when done. Unless told otherwise, branch it off a freshly-updated default branch (`git fetch origin`, then base on `origin/main`), not whatever happens to be checked out. - Keep the project's main checkout (e.g. `~/code/log`, never a worktree) current: when it is behind `origin` — a merge landed, or a fetch shows it — run `git pull --ff-only` there instead of reporting the lag, never with `--autostash`: a dirty checkout is a finding to report, not to carry along. -- Run a project's language runtime, package manager, and task runner through its container/tooling setup, never directly on the host. Example: `docker compose run --rm app …`. +- Run a project's language runtime, package manager, and task runner through its container/tooling setup, never directly on the host unless a decision puts them there. Example: `docker compose run --rm app …`. - Tear down test containers after a run. - Check `README.md` first for build, test, install, and codegen commands; one that misbehaves is fixed per "A false claim is a bug". Refresh `README.md` whenever you change what it describes ("Refresh `README.md` to match"). - Sort wherever order carries no meaning (`~/.claude/principles/technical-principles.md`) — attributes, array and object keys, enum members, imports, table rows, and line-based file lists such as `.gitignore`/`.dockerignore`. Exception: `id` goes first. diff --git a/agents/stability-reviewer.md b/agents/stability-reviewer.md index c3a4ade0..e0f82235 100644 --- a/agents/stability-reviewer.md +++ b/agents/stability-reviewer.md @@ -11,7 +11,7 @@ You are an elite stability-focused code reviewer with deep expertise in defensiv 1. **Scope the change.** You review every PR; a fresh invocation has no prior context, so determine the diff yourself. Diff the PR branch against its base (`gh pr diff`, or `git merge-base HEAD` then `git diff`), and review the changed lines **plus enough surrounding code and callers** to judge correctness — read the whole changed file when practical; a diff alone hides whether a caller breaks. Read the PR description and, when the project uses an issue tracker (project-specific — check its docs) and the change references a ticket, that ticket: the diff is judged against its stated intent, and a scope mismatch in either direction is a finding — claimed-but-unimplemented, and implemented-but-unasked (#2). 2. **Read every file in the shared principles** at `~/.claude/principles/` — not just `technical-principles.md`, also `frontend.md`, `logging.md`, and `rest-apis.md`. These are mandatory org guidelines; all code MUST comply. Map the relevant file(s) to the change (frontend PR → `frontend.md`; API PR → `rest-apis.md`; etc.). Re-read each time — they change. Flag violations prominently. 3. **Read README.md, AGENTS.md and `docs/decisions.md`** in the current project for project-specific conventions, build instructions, tooling, and the accepted trade-offs a reviewer should honor rather than re-flag. Note the documented test, lint, and static-analysis commands — you will run them. -4. **Verify, don't just read.** Run the test suite and static analysis/linters as the project's README and decisions say, through its container tooling unless a decision puts them on the host; tear down test containers afterwards. A full-suite run catches broken callers that diff-reading misses. When a suspected bug is cheap to confirm, reproduce it — a scratch script in a temp dir, a targeted test run — before reporting it. Leave the working tree exactly as you found it. Anything you could not run goes in Coverage & Verification, never silently skipped. +4. **Verify, don't just read.** Run the test suite and static analysis/linters through the project's container tooling, unless a decision puts them on the host; tear down test containers afterwards. A full-suite run catches broken callers that diff-reading misses. When a suspected bug is cheap to confirm, reproduce it — a scratch script in a temp dir, a targeted test run — before reporting it. Leave the working tree exactly as you found it. Anything you could not run goes in Coverage & Verification, never silently skipped. 5. **Two passes minimum, then hunt absences.** - *Breadth:* every hunk in every changed file, no skimming. Track which files you have covered; batch large diffs, never truncate the review. - *Depth:* trace the riskiest data paths end-to-end (input → logic → persistence/response), the interactions between changed pieces, and between the change and config (timeout hierarchies, retries × idempotency, queue worker counts, env parity). diff --git a/docs/decisions.md b/docs/decisions.md index c2c91732..c5959e4d 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -8,9 +8,9 @@ 2026-09-21, lilleman. Serves goal 4. Asked to name the goal behind each choice, the worker cites a real goal for a choice that goal does not settle, and under-reports its own decisions; the judge's bar is whether the README discriminates between the alternatives. Valid while the worker's self-report stays unreliable. -## loop-claude: one session per project, at a fixed id from its path +## loop-claude: one session per project, at a fixed id from its checkout's path -2026-09-21, lilleman; revised 2026-09-30 by lilleman. Serves goal 4. One fixed id per project keeps the session picker at one entry per project and makes any transcript under that id loop-claude's own to delete. The id derives from the checkout's full path, so no two checkouts share one, and `loop-claude` refuses to start while another session on that id is active. Moving the checkout orphans its open sessions, archive folder and models entry: sessions stay in the picker until the human deletes them, migration code not being worth a one-human audience. Until `todo.md`'s "Key a project on its checkout's full path" lands, the id is the checkout's path relative to `~/code`, or to `/` outside it, and a second loop is not refused, so a checkout outside `~/code` mirroring a path inside it shares its id. Valid while claude takes `--session-id` and resumes by it. +2026-09-21, lilleman; revised 2026-09-30 by lilleman. Serves goal 4. One fixed id per project keeps the session picker at one entry per project and makes any transcript under that id loop-claude's own to delete. The id is the checkout's path relative to `~/code`, or to `/` outside it, and a second loop is not refused, so a checkout outside `~/code` mirroring a path inside it shares its id. `todo.md`'s "Key a project on its checkout's full path" derives the id from the full path, so no two checkouts share one, and has `loop-claude` refuse to start while another session on that id is active. Moving the checkout orphans its open sessions, archive folder and models entry: sessions stay in the picker until the human deletes them, migration code not being worth a one-human audience. Valid while claude takes `--session-id` and resumes by it. ## loop-claude: the trust file is rewritten before an interrupt @@ -108,11 +108,11 @@ 2026-09-30, lilleman. Applies "Always grant explicit access to data": the sandbox `loop-claude` runs in is where access is granted, so the worker and the interrupt run with `bypassPermissions`. The worker may read `~/.claude/.credentials.json`: it holds Claude Code's own credentials, which claude reads to run anyway. Its one seam to production is the forge: what it pushes or merges can publish through CI. Valid while `loop-claude` runs only in the sandbox README → Install names. -## loop-claude: the stats line `todo.md` plans goes in the transcript archive +## loop-claude: the planned stats line goes in the transcript archive 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: one merges only once three runs of the bench `todo.md` plans rule it better +## workflow changes: a change merges only once three planned benches 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. -- 2.52.0 From e39f7c3eeb10827226c66c2da76a283f66086b09 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 1 Oct 2026 22:44:56 +0200 Subject: [PATCH 5/6] Point todo.md's line references at the lines this chunk moved --- todo.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/todo.md b/todo.md index e8277fb1..e975986a 100644 --- a/todo.md +++ b/todo.md @@ -8,11 +8,11 @@ The sketches, the judges' verdicts and what to take from each: `~/code/claude-ha The first three items are the places the panel on `rebuild` at 8585257 named under Self-sufficiency and Locality, the dimensions under the floor (scores: `docs/decisions.md` → "comprehension floor"). -- **Name a project's loop states and give them one transition function.** Every seat had to keep two facts in mind: a run resumes only if its transcript exists (`steps.py:27`), and a reload carries its state through argv (`reload.py:45`). +- **Name a project's loop states and give them one transition function.** Every seat had to keep two facts in mind: a run resumes only if its transcript exists (`steps.py:27`), and a reload carries its state through argv (`reload.py:47`). - **Split `written_by_human`'s boolean into one named check per entry shape.** `formats.py:42` packs three tests into one line, one seat learnt the cases only from `HumanTurns` in the tests, and another could not confirm them without `HumanTurns`. Three seats named it the unit they least wanted to modify, and the architect named it where the project rots first. - **Annotate the parameter types in `bin/loop_claude/`.** Whether `root` or `path` is a `str` or a `Path` is learnt by tracing callers back to `bin/loop-claude`. - **Archive the transcript as each cycle ends.** Today only an interrupt or a finished chunk archives it, so a failed exit or Ctrl-C loses the transcript. Goal 2. -- **Key a project on its checkout's full path, and refuse to start while another session uses that key.** The key names the project's session, archive folder and models entry. `checkout.py:22` drops the leading `/`, so `~/code/a` and `/a` share all three, and one loop can resume or delete the other's session. Goal 4.1. +- **Key a project on its checkout's full path, and refuse to start while another session uses that key.** The key names the project's session, archive folder and models entry. `checkout.py:28` drops the leading `/`, so `~/code/a` and `/a` share all three, and one loop can resume or delete the other's session. Goal 4.1. - **Give principles-auditor and prose-reviewer a way to list the project's files.** In the 2026-09-30 audit run their `tools: Read, Grep, Glob` gave them only Read. Each read the files that imports and `.gitignore` named, and listed the files it could not reach. Goal 4.1. - **Make `loop-claude`'s loop a tested state machine with its side effects injected.** Functional core, imperative shell. Goal 4.1. - Inject the side effects: `time.sleep`, `subprocess`, `input()`, `isatty` and `os.execv`. Split `project_model` and `interrupt` into decisions and effects. @@ -31,7 +31,7 @@ The first three items are the places the panel on `rebuild` at 8585257 named und - `comprehension-panel`: cut the run history and the restated description. They carry nothing the instructions need. - `systems-architect.md`: cut the "one home" line, and break Reasonability Review's steps 4 and 5 into shorter points each. - **Sort `bin/`'s imports on their first binding, and say in `principles/technical-principles.md` → "Deterministic order" how case sorts and which groups Python has.** Today they sort by path, so moving a module reorders unchanged lines. The principle's "host packages" names no Python group. Goal 4.1. -- **Judge a cycle on more than the transcript's last 40,000 characters.** `judge.py:80` cuts the transcript there. The session spans every cycle of the chunk, so a decision made early in a long run is never judged, and the human is not interrupted for it. Larger chunks make runs longer. Goal 4.2. +- **Judge a cycle on more than the transcript's last 40,000 characters.** `judge.py:82` cuts the transcript there. The session spans every cycle of the chunk, so a decision made early in a long run is never judged, and the human is not interrupted for it. Larger chunks make runs longer. Goal 4.2. - **Record each finished chunk's cost and review numbers on one stats line.** Goal 4.4. - Have `loop-claude` write the line to one file at the root of the transcript archive. The line names the project, the commit the chunk started from and the archived transcript's hash. It holds the worker's tokens from the transcript, the judge's from its JSON output, and the chunk's cycles and interrupts, which the loop counts. - End larv-review with a machine-readable summary, and have `loop-claude` copy it from the transcript onto the line: agents launched and rounds per pass; findings per pass by severity, inside the chunk's diff and outside it; and the comprehension scores when the panel ran. -- 2.52.0 From 4e71611e59d43caf13d7a1f2198c78bbdf91486e Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 1 Oct 2026 22:46:10 +0200 Subject: [PATCH 6/6] Answer the prose review's second round --- docs/decisions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/decisions.md b/docs/decisions.md index c5959e4d..063fe69e 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -10,7 +10,7 @@ ## loop-claude: one session per project, at a fixed id from its checkout's path -2026-09-21, lilleman; revised 2026-09-30 by lilleman. Serves goal 4. One fixed id per project keeps the session picker at one entry per project and makes any transcript under that id loop-claude's own to delete. The id is the checkout's path relative to `~/code`, or to `/` outside it, and a second loop is not refused, so a checkout outside `~/code` mirroring a path inside it shares its id. `todo.md`'s "Key a project on its checkout's full path" derives the id from the full path, so no two checkouts share one, and has `loop-claude` refuse to start while another session on that id is active. Moving the checkout orphans its open sessions, archive folder and models entry: sessions stay in the picker until the human deletes them, migration code not being worth a one-human audience. Valid while claude takes `--session-id` and resumes by it. +2026-09-21, lilleman; revised 2026-09-30 by lilleman. Serves goal 4. One fixed id per project keeps the session picker at one entry per project and makes any transcript under that id loop-claude's own to delete. The id is the checkout's path relative to `~/code`, or to `/` outside it, and a second loop is not refused, so a checkout outside `~/code` mirroring a path inside it shares its id. Once `todo.md`'s "Key a project on its checkout's full path" lands, the id comes from the full path, so no two checkouts share one, and `loop-claude` refuses to start while another session on that id is active. Moving the checkout orphans its open sessions, archive folder and models entry: sessions stay in the picker until the human deletes them, migration code not being worth a one-human audience. Valid while claude takes `--session-id` and resumes by it. ## loop-claude: the trust file is rewritten before an interrupt -- 2.52.0