write the worktree lifecycle contract into the design doc #89

Closed
opened 2026-08-24 09:38:54 +01:00 by naps62-yolo · 1 comment
Collaborator

Six Spawn v2 review rounds each re-decided the worktree lifecycle, and five of them had their worst finding in it. There is no written contract for this area: DESIGN.md covers the web visual system, and CLAUDE.md describes the architecture without saying what happens to a worktree.

Write it down. Either a new section in CLAUDE.md or a docs/WORKTREES.md that CLAUDE.md points at — whichever the person landing this judges better, but it must be reachable from CLAUDE.md, since that is what an agent reads first.

It should state, in the repo's terse register:

  • Nothing is ever adopted; a collision is sidestepped with a numeric suffix (#77).
  • Where worktrees are placed, and what the worktree_root override changes.
  • What blocks a kill, and explicitly that ignored files do not (#79).
  • That --force ends the session and keeps the tree, and why those are two separate acts (#81).
  • What a natural exit does (#82).
  • What the retained store is for, and that it is not an ownership record (#78).
  • What reclaim does and does not touch — the directory, never the branch (#80).

Write the reasoning for the non-obvious rules, not just the rules. The decisions that got re-litigated were the ones whose justification lived only in a review comment.

Depends on: #77, #78, #79, #81, #82, #80

Six Spawn v2 review rounds each re-decided the worktree lifecycle, and five of them had their worst finding in it. There is no written contract for this area: DESIGN.md covers the web visual system, and CLAUDE.md describes the architecture without saying what happens to a worktree. Write it down. Either a new section in CLAUDE.md or a `docs/WORKTREES.md` that CLAUDE.md points at — whichever the person landing this judges better, but it must be reachable from CLAUDE.md, since that is what an agent reads first. It should state, in the repo's terse register: - Nothing is ever adopted; a collision is sidestepped with a numeric suffix (#77). - Where worktrees are placed, and what the `worktree_root` override changes. - What blocks a kill, and explicitly that ignored files do not (#79). - That `--force` ends the session and keeps the tree, and why those are two separate acts (#81). - What a natural exit does (#82). - What the retained store is for, and that it is not an ownership record (#78). - What reclaim does and does not touch — the directory, never the branch (#80). Write the reasoning for the non-obvious rules, not just the rules. The decisions that got re-litigated were the ones whose justification lived only in a review comment. Depends on: #77, #78, #79, #81, #82, #80
naps62-yolo added this to the Worktree lifecycle milestone 2026-08-24 09:38:54 +01:00
naps62-yolo added the type/docsdifficulty/easy labels 2026-08-24 09:38:54 +01:00
naps62-yolo added a new dependency 2026-08-24 09:39:01 +01:00
naps62-yolo added a new dependency 2026-08-24 09:39:01 +01:00
naps62-yolo added a new dependency 2026-08-24 09:39:01 +01:00
Author
Collaborator

Landed first, on blitz/worktree-lifecycle as 35c75f9, rather than last.

The dependency edges said this issue needed every implementation issue to exist before it could describe them. That ordering is what let six Spawn v2 review rounds each re-decide the same rules — there was no shared written model for a worker to read, so each one inferred a slightly different one from the code in front of it.

Inverting it: docs/WORKTREES.md now states the contract, CLAUDE.md points at it, and every worker on this milestone reads it before implementing. The issues become the schedule for making the code match a document that already exists.

If implementation turns up a rule the document gets wrong, the document is what gets amended — in the same commit as the code, not afterwards.

Landed first, on `blitz/worktree-lifecycle` as 35c75f9, rather than last. The dependency edges said this issue needed every implementation issue to exist before it could describe them. That ordering is what let six Spawn v2 review rounds each re-decide the same rules — there was no shared written model for a worker to read, so each one inferred a slightly different one from the code in front of it. Inverting it: `docs/WORKTREES.md` now states the contract, CLAUDE.md points at it, and every worker on this milestone reads it before implementing. The issues become the schedule for making the code match a document that already exists. If implementation turns up a rule the document gets wrong, the document is what gets amended — in the same commit as the code, not afterwards.
naps62-yolo removed a dependency 2026-08-24 10:30:00 +01:00
naps62-yolo removed a dependency 2026-08-24 10:30:00 +01:00
naps62-yolo removed a dependency 2026-08-24 10:30:00 +01:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: naps62/maestro#89