Show every waiting loop-claude in loop-inbox and take each one's answer there

This commit is contained in:
2026-10-28 23:24:29 +01:00
parent d13c4fb0db
commit a7fe878631
24 changed files with 938 additions and 81 deletions
+16 -1
View File
@@ -50,12 +50,14 @@ The cap is 5, `bin/todo_table.py`'s `BUNDLE_MAX_R`, from the same chunks: by the
2026-10-17, lilleman, todo item 168. The human answers an interrupt on loop-claude's terminal, and the worker resumes headless with the answer in a `-p` prompt. The judge reads that answer as a `[human]` line, not a `[loop]` one, so it holds the chunk open until the answer is recorded, as it does for an answer typed in claude.
## loop-claude: before it opens claude on the terminal, it marks the checkout and each of its worktrees trusted in `~/.claude.json`
## loop-claude: before it or loop-inbox opens claude on a terminal, it marks the checkout and each of its worktrees trusted in `~/.claude.json`
2026-09-21, lilleman. Serves goal 1. `claude --resume` re-enters the worktree the worker last entered, recorded in the transcript's `worktree-state` entry, and Claude Code asks trust per path, so trusting the checkout alone still lands the human in the dialog. Trusting every worktree `git worktree list` names spares reading which one from the transcript. Since the human answers an interrupt on loop-claude's own terminal (todo item 168), claude opens there only for `/talk`, a release ready to cut and the routing calls, and the trust is marked only then. Valid while resume re-enters a recorded worktree and trust is kept per path.
2026-09-30, lilleman. A write by another claude inside `trust`'s read-modify-write window is lost, a risk larv-review accepted on 2026-09-24. Claude Code owns and writes `~/.claude.json`, so `loop-claude` is to move out of it, bringing each case that must stay to the human. Stands until `todo.md` item 6 ends it.
2026-10-28, lilleman, todo item 243. `/talk` from loop-inbox opens claude in loop-inbox's terminal, so loop-inbox marks the trust itself, with the same code, just before. It adds a second writer to `~/.claude.json`, under the same risk, until item 6 ends it.
## loop-claude: each project's model lives in `~/.claude/loop-claude-models.json`, which only loop-claude writes
2026-09-26, lilleman. Serves goal 1. Claude Code rewrites the user settings' `model` whenever one is picked inside a session, so a loop reading settings runs whatever was picked last; `~/.claude/loop-claude-models.json` has loop-claude as its one writer, and every claude it starts gets that model as `--model`. The file is per machine, outside the synced allowlist, since a tracked file the loop writes would dirty the checkout. 2026-10-02, lilleman: goal 2 shares the setup across machines, and a project's model is each machine's own choice, so a new machine asks once per project, which is not asking the same thing twice (goal 1.2). Valid while Claude Code keeps rewriting the settings' model from inside a session.
@@ -99,6 +101,19 @@ Hours. A chunk ran a median 0.7 hours from its first message to its last, one in
Valid while cache reads cost a twentieth of input and Claude Code's compaction keeps the worker's task.
## loop-inbox: a waiting loop-claude lists its question as one file per session under `~/.local/state/loop-claude/`, and takes the first answer, from its terminal or from loop-inbox, that names that question
2026-10-28, lilleman, todo item 243. Serves goal 1. With several loops running, each asked on its own terminal, and the human searched the terminals for the ones that waited. loop-inbox lists them all, oldest first, and answers each one there. `bin/loop_claude/waiting.py` holds the protocol:
- Files, read by polling, need no daemon and only the standard library, and a loop with no loop-inbox running is answered on its terminal as before.
- An answer reaching the wrong loop is the worst failure. Each answer names the question it answers by a fresh id, so an answer meant for an earlier question, or sent as the terminal answered, never answers a later one.
- `/talk` from loop-inbox waits for the loop to stop reading its terminal before claude opens, so only one claude holds the worker's session.
- While claude holds the session, as for a release ready to cut or a `/talk` typed on the loop's terminal, loop-inbox lists the loop but takes no answer for it.
- loop-inbox runs the claude command the loop wrote, `bypassPermissions` included, so it runs in the same sandbox as the loop. The folder is private to the user.
A bench of three readers seated as the README's audience picked the name `loop-inbox`, 3–0, and a block per loop: its checkout's path, how long it has waited, and the question's first two lines.
Valid while every loop and loop-inbox run on one machine under one user's home.
## machine load: a heavy command waits for one of the machine's heavy slots, one for every 4 CPUs, which every session shares, and loop-claude starts a worker only while at least a quarter of the machine's memory is available
2026-10-23, lilleman. Serves goal 1.5. On 2026-10-22 ai-sandbox, with 8 CPUs and 16 GiB, thrashed for hours: four to six loops ran mutation tests, full gates, `docker build`s and QEMU-booting e2e tests at once, and nothing told one loop how busy the machine was. lilleman chose both limits; no standard sets either, and GNU parallel's `--memfree`, which does the memory wait's job, has no default. A slot is a file lock, so a session that dies frees its slot. The memory wait reads `/proc/meminfo` only, and off Linux a worker starts at once. `bin/machine_load/` holds the slots and the memory share, `bin/run-heavy` takes a slot, `CLAUDE.md` → "Working with the codebase" has every session use it, and loop-claude's worker waits for the share. rule-hook's rule `run-heavy` blocks a `docker build`, and a run of a mutation tool stability-reviewer names, outside run-heavy, whether direct or inside a container. No program can tell a gate script from a light one, so only `CLAUDE.md` asks a session to run a gate under run-heavy. Valid while one machine runs several loops at once.
+4
View File
@@ -919,3 +919,7 @@ Read most (opens and searches):
Read most (opens and searches):
- `rules/todo-items.md` 1
## Reading cost, chunk cfd9ab4f5b1b, finished 2026-10-28T22:00:08Z
64114 new input tokens before the first commit.