From 87024023f422cd86c48c6e2386ea7ad2c4be5b38 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 30 Sep 2026 23:34:15 +0200 Subject: [PATCH 1/2] Record the audit answers: a full-path session with one loop at a time, keeping out of ~/.claude.json, the sandbox's bypassPermissions, and continuous archiving --- AGENTS.md | 3 ++- docs/decisions.md | 12 ++++++++---- todo.md | 4 +++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index d548d9ff..062e2d18 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 +- loop-claude: one session per project, at a fixed id from its full path, and a second loop refuses to start - 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 @@ -30,3 +30,4 @@ Decisions live in `docs/decisions.md`: - rebuild: rebuild's larv-review reviews a chunk into `rebuild` - 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: an unattended worker bypasses permissions inside its sandbox diff --git a/docs/decisions.md b/docs/decisions.md index e29fa9f0..a60744e4 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -8,17 +8,17 @@ 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 +## loop-claude: one session per project, at a fixed id from its full path, and a second loop refuses to start -2026-09-21, lilleman; the rename and mirrored-path costs accepted 2026-09-25 by larv-review. 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 session name, so moving the checkout or changing that name orphans open sessions: they stay in the picker until the human deletes them, migration code not being worth a one-human audience. A checkout outside `~/code` mirroring a path inside it would share its id. Valid while claude takes `--session-id` and resumes by it, and no checkout outside `~/code` mirrors a path inside 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 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 open sessions: they 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's session on its checkout's full path" lands, the id drops the leading `/`, so a checkout outside `~/code` mirroring a path inside it shares its id. Valid while claude takes `--session-id` and resumes by it. ## loop-claude: the trust file is rewritten before an interrupt -2026-09-21, lilleman; the lost-write risk accepted 2026-09-24 by larv-review. Serves goal 4. A write by another claude inside `trust`'s read-modify-write window is lost. Valid while no flag skips the dialog. +2026-09-21, lilleman; the lost-write risk accepted 2026-09-24 by larv-review. Serves goal 4. A write by another claude inside `trust`'s read-modify-write window is lost. Stands until `todo.md`'s "Move what `loop-claude` writes out of `~/.claude.json`" ends it: 2026-09-30, lilleman, Claude Code owns and writes that file, so `loop-claude` keeps out of it, and a case that must stay in it is weighed on its own. ## loop-claude: every worktree of the checkout is trusted before an interrupt -2026-09-24, lilleman. Serves goal 4. `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. Valid while resume re-enters a recorded worktree and trust is kept per path. +2026-09-24, lilleman. Serves goal 4. `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. Stands until `todo.md`'s "Move what `loop-claude` writes out of `~/.claude.json`" ends it. Valid while resume re-enters a recorded worktree and trust is kept per path. ## bin/: the Python floor is README's Install prerequisite @@ -103,3 +103,7 @@ ## review: the architecture pass audits every principle and goal over the whole project, and a release's last chunk fires it 2026-09-30, lilleman. Serves goal 4: `@larvit/log`'s chunks each passed their per-diff reviewers, and a whole-project audit that day still found its functional core and state machines not followed and two semver breaks planned; what grows over many chunks shows in no diff. Valid while the other passes review a diff. + +## loop-claude: an unattended worker bypasses permissions inside its sandbox + +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`. `~/.claude/.credentials.json` holds Claude Code's own credentials, which the worker's claude reads to run. Valid while `loop-claude` runs only inside a sandbox. diff --git a/todo.md b/todo.md index 93dd2dc1..b34a74db 100644 --- a/todo.md +++ b/todo.md @@ -31,6 +31,8 @@ The rebuild lifts every dimension, one chunk per item, until the last item opens - **Test `run_cycle`, `judge_through_interrupts`, `retried`, `archive`, `trust`, `interrupt`, the models file and the worker's arguments.** Only the pure helpers are tested today. - **Give a project's loop state named states and one transition function.** Fresh, resuming, awaiting the human and finished come today from whether a transcript exists, two verdict booleans and an open `while True` in `steps.py`. - **Make a `Verdict` with both `interrupt` and `finished`, or a question without an interrupt, unrepresentable.** `steps.py:49` ignores `finished` when `interrupt` is set. -- **Grant an unattended worker named permissions in place of `bypassPermissions`.** `worker.py:37` and `interrupt.py:23` let it read and write anything the user can, `~/.claude/.credentials.json` included. - **Return a `Stop` when `git` or `os.execv` fails.** `checkout.py:7,15` and `reload.py:52` end in a traceback. - **Narrow `.gitignore`'s `!bin/*` and `skills/*/**` to the files they mean.** A stray log of `loop-claude` output in `bin/` would be committed with transcript text in it. +- **Archive the transcript as each cycle ends, so a failed exit or Ctrl-C loses nothing.** Today only an interrupt or a finish archives, against goal 2. +- **Key a project's session on its checkout's full path, and refuse to start while another session on that id is active.** `checkout.py:22` drops the leading `/`, so `~/code/a` and `/a` share a session, an archive folder and a models entry, and one loop can resume or delete the other's session. +- **Move what `loop-claude` writes out of `~/.claude.json`, and bring each case that must stay to the human.** Claude Code owns and writes that file, and `trust`'s read-modify-write loses a write landing in its window. -- 2.52.0 From d5a85c9b9f8ca4c74165c01c534e3b3c9921a6b8 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 30 Sep 2026 23:36:24 +0200 Subject: [PATCH 2/2] Say what holds until each todo item lands, and what the credentials sentence decides --- docs/decisions.md | 6 +++--- todo.md | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/decisions.md b/docs/decisions.md index a60744e4..3707f1b5 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -10,11 +10,11 @@ ## loop-claude: one session per project, at a fixed id from its full path, and a second loop refuses to start -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 open sessions: they 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's session on its checkout's full path" lands, the id drops the leading `/`, 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 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. ## loop-claude: the trust file is rewritten before an interrupt -2026-09-21, lilleman; the lost-write risk accepted 2026-09-24 by larv-review. Serves goal 4. A write by another claude inside `trust`'s read-modify-write window is lost. Stands until `todo.md`'s "Move what `loop-claude` writes out of `~/.claude.json`" ends it: 2026-09-30, lilleman, Claude Code owns and writes that file, so `loop-claude` keeps out of it, and a case that must stay in it is weighed on its own. +2026-09-21, lilleman; the lost-write risk accepted 2026-09-24 by larv-review. Serves goal 4. A write by another claude inside `trust`'s read-modify-write window is lost. 2026-09-30, lilleman: Claude Code owns and writes that file, so `loop-claude` is to move out of it, bringing each case that must stay to the human. Stands until `todo.md`'s "Move what `loop-claude` writes out of `~/.claude.json`" ends it. ## loop-claude: every worktree of the checkout is trusted before an interrupt @@ -106,4 +106,4 @@ ## loop-claude: an unattended worker bypasses permissions inside its sandbox -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`. `~/.claude/.credentials.json` holds Claude Code's own credentials, which the worker's claude reads to run. Valid while `loop-claude` runs only inside a sandbox. +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. Valid while `loop-claude` runs only inside a sandbox; `todo.md`'s "Name the sandbox `loop-claude` runs in" makes that checkable. diff --git a/todo.md b/todo.md index b34a74db..b4d0a90e 100644 --- a/todo.md +++ b/todo.md @@ -34,5 +34,6 @@ The rebuild lifts every dimension, one chunk per item, until the last item opens - **Return a `Stop` when `git` or `os.execv` fails.** `checkout.py:7,15` and `reload.py:52` end in a traceback. - **Narrow `.gitignore`'s `!bin/*` and `skills/*/**` to the files they mean.** A stray log of `loop-claude` output in `bin/` would be committed with transcript text in it. - **Archive the transcript as each cycle ends, so a failed exit or Ctrl-C loses nothing.** Today only an interrupt or a finish archives, against goal 2. -- **Key a project's session on its checkout's full path, and refuse to start while another session on that id is active.** `checkout.py:22` drops the leading `/`, so `~/code/a` and `/a` share a session, an archive folder and a models entry, and one loop can resume or delete the other's session. +- **Key a project on its checkout's full path — its session, archive folder and models entry — and refuse to start while another session on that id is active.** `checkout.py:22` drops the leading `/`, so `~/code/a` and `/a` share a session, an archive folder and a models entry, and one loop can resume or delete the other's session. - **Move what `loop-claude` writes out of `~/.claude.json`, and bring each case that must stay to the human.** Claude Code owns and writes that file, and `trust`'s read-modify-write loses a write landing in its window. +- **Name the sandbox `loop-claude` runs in under README → Install.** The decision letting the worker bypass permissions rests on it, and nothing says what it is. -- 2.52.0