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.