CLAUDE.md: small edits by a Haiku or Sonnet agent in the main checkout (owner decision 2026-10-24)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
This commit is contained in:
2026-10-24 10:56:39 +02:00
parent c13be3bbfd
commit cddeac159f
+4 -4
View File
@@ -28,7 +28,7 @@ docs/spikes/, docs/validation/ what the device and the data showed (reports ar
android/ the Android app: one Gradle project (settings.gradle.kts, gradle/libs.versions.toml), modules as in SPEC §14.7
server/ the Rust backend: one Cargo workspace, crates kvitt-domain, kvitt-server, kvitt-import (SPEC §14.7)
web/ the web client: one npm project (Vite, React, TypeScript), served by the server under /app/ (SPEC §15)
infra/ docker compose stack for the Pi (caddy, server, cert-sync, backup), image build scripts, ops runbooks
infra/ docker compose stack for the Pi (server, backup; TLS by Nginx Proxy Manager on the Home Assistant Pi, D-120), image build scripts, ops runbooks
tools/ gradle-serial.sh, clean-builds.sh, install-git-hooks.sh, git-hooks/, dependency-report/latest.py
```
@@ -38,13 +38,13 @@ Who owns which directory during parallel work is in SPEC §14.7. An agent edits
## ORCHESTRATION: HOW WORK IS RUN
The owner talks to one **orchestrator** session. The orchestrator plans, briefs, lands, gates, installs and answers; it **never writes code or repository changes itself**, however small (docs and config included). Every change goes through an **Opus** implementation agent. If the orchestrator slips and edits something, it keeps the work and hands it to an agent to own; it never reverts or redoes it.
The owner talks to one **orchestrator** session. The orchestrator plans, briefs, lands, gates, installs and answers; it **never writes code or repository changes itself**, however small (docs and config included). Every change goes through an implementation agent: **Opus** in a worktree for real work, a smaller model directly in the main checkout for small edits (below). If the orchestrator slips and edits something, it keeps the work and hands it to an agent to own; it never reverts or redoes it.
* **One Opus agent per task, in its own git worktree** (`.claude/worktrees/agent-<id>`, branch of the same name). The agent's first step is `git reset --hard main`, then copying `android/local.properties`, `android/app/google-services.json` and anything in `infra/secrets/` it needs (all git-ignored) from the main checkout. It commits on its branch, rebases on `main`, runs the gate, and reports; it never lands, pushes or removes its worktree.
* **The orchestrator lands:** `git merge --ff-only <branch>` in the main checkout, re-runs the gate on `main`, installs on the phone if attached, removes the worktree (`git worktree remove --force --force`, falling back to `rm -rf` + `git worktree prune`) and deletes the branch. No merge commits. Never rebase `main`.
* **Briefs are the whole context an agent has.** A brief states: the goal, what to read first (file paths), what is already established, the exact numbers it may use (next free decision, spec version, schema), the setup steps, the gate, what to report. If the orchestrator cannot write a clear brief, it does not understand the task yet.
* **Agents' reports are not shown to the owner.** The orchestrator extracts the decision: one line per finding, fixed or not, and relays every owner step in chat.
* **Subagents are Opus.** Haiku or Sonnet only for a read-only scan the owner explicitly asks for that way.
* **Subagents are Opus** for every task that runs a gate. **Small edits** (a few lines in docs, config, `.gitignore`, a stale sentence; nothing that needs a build or test) go to a **Haiku or Sonnet agent working directly in the main checkout**: no worktree, no branch, the agent does not commit, and the orchestrator commits the result on `main` (owner decision 2026-10-24). Haiku or Sonnet also for a read-only scan the owner asks for that way.
* **Numbering** (decisions, spec versions, schema versions, contract requests) is handed out by the orchestrator in the brief. Two parallel agents get disjoint ranges; the second to land renumbers to be contiguous on rebase. **Implementation agents never edit `SPEC.md` or `docs/decisions.md`:** they put proposed decision entries and spec text, numbered from their range, in their report, and the orchestrator has them recorded by a docs agent, landed together with the implementation.
* **The UX sprint** (U1, U2) runs in the owner's own Claude session in `~/orca/workspaces/kvitt/UX-sprint` on branch `UX-sprint`, with no orchestrator. Its results reach the main line only through `docs/ux/proposed-decisions.md` (owner answers, proposed decisions and spec text, no numbers): the orchestrator numbers them and has a docs agent record them in `SPEC.md` and `docs/decisions.md` (SPEC v0.8 recorded UX-1 to UX-8 as D-047 to D-054).
* **Parallel agents** each have their own worktree, build through `tools/gradle-serial.sh` (one Gradle build at a time on this machine), and take turns on the phone: **one agent on the phone at a time**, named in the brief.
@@ -151,7 +151,7 @@ Enforced by an architecture check inside `check` where possible. Fill in from SP
* **Stay in scope:** each plan has an "Out of scope" list. Respect it; note ideas in the plan's report instead of building them.
* **Stay inside the repository.** Nothing outside it without an explicit allowance from the owner (the user-level Gradle init script was one).
* **Stop and ask** when: a step could disturb the owner's real data or another app on the phone, the build needs a tool the owner has not installed, a licence is not cleared, or the spec is ambiguous in a way that changes a decision.
* **Always commit** finished work once the gate is green. Never commit mid-change or over a failing check. Never commit on `main`; one branch per task.
* **Always commit** finished work once the gate is green. Never commit mid-change or over a failing check. Never commit on `main`; one branch per task, except the orchestrator's commits of small edits made by a Haiku or Sonnet agent in the main checkout.
* **Push and pull requests need an explicit ask.**
* **Reports are deliverables:** `docs/spikes/`, `docs/validation/`, complete, aggregates only, with a "Results (owner's phone)" section when a measurement is still to come.
* **Navigation:** `git ls-files` to discover, `git grep` to search; never `ls -R`, never `find` without `-maxdepth`.