diff --git a/CLAUDE.md b/CLAUDE.md index 648d096..7b6d652 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -86,3 +86,38 @@ Rules: (`cargo test -p vlog_formatter`). - Update `TODO.md`: check items your feature completes (leave the item text intact). + +## Parallel lanes (the 2-agent loop) + +Up to **two dev/QA lanes may run concurrently** when — and only when — +their features do not collide in `TOPO.md`: no shared edge between them +(no `──▶`, no `◀──▶`, and neither touching the same open handshake in +§2.9), and disjoint file sets. `TOPO.md` is the authority; if the +collision question is not answerable from it, the features are not +proven independent and run serially. Rules for a parallel wave: + +- **The lead plans the lanes** before anything is dispatched: one brief + per lane with an explicit file-ownership list. That list is the merge + contract — a lane touches nothing outside it. A needed change to a + file the other lane owns (or to any unlisted file) is a Handshake + request in the lane's README plus a flag in its report, never a + silent edit; the lead rules on it at merge. +- **Each lane works in its own git worktree** branched from the same + trunk commit. Never two agents in one tree. Trunk stays untouched + while lanes are in flight; the lead merges each lane back only after + that lane's QA verdict and lead review, and re-runs the full gates on + the merged tree before pushing. +- **Roles per lane are unchanged**: one dev (Opus), then one QA + (Sonnet) in the same worktree, then the lead's review — so at most + 2 devs + 2 QA agents exist at once, and a lane's QA starts only when + its own dev is done. A QA rework loops inside its lane without + blocking the other lane. +- **Tracking lives in `TODO.md`**: the lead writes the wave's section + (one subsection per lane, each item naming its files) on trunk before + branching; each lane ticks only its own lines. Shared-by-nature files + (`TODO.md`, `docs/perf/README.md`) may be appended to by both lanes + in their own sections — the lead resolves the trivially-parallel + merge; anything worse than trivially-parallel means the lanes were + not actually independent, which is a planning failure to record. +- After merging, the lead updates `TOPO.md` for any edge a lane added + or amended, so the next wave plans against reality.