The rule
Work is done only when it is merged to main, pushed, any parent pointer that references it is bumped, and the branch or worktree that built it is removed. Anything short of that reverts itself the moment someone deploys from main — and looks like the fix un-fixed itself.
When to run it
At the end of every session that touched code, not just at project completion. Definition of Done is a per-session bar, not a milestone you hit once and move past.
The play
1. Before starting new work, check for an existing branch or worktree that already solves the same problem — continuing it beats duplicating it. 2. Merge to main through the real review path (PR or equivalent). Never call work finished while it's sitting unmerged on a branch. 3. Push. A merge that lives only on one machine is one lost disk away from not existing. 4. If the work is consumed elsewhere — a submodule, a shared package, a dependent repo — bump the pointer in the parent immediately. The parent has no idea your commit exists until you tell it. 5. Deploy only from main, never from a worktree or a feature branch. Deployed-but-unmerged work silently reverts on the next real deploy. 6. Remove the worktree or branch once it has landed. A graveyard of stale worktrees is where the next session goes to get confused about what's actually current.
Where it breaks
Calling it done at "tests pass" or "PR opened" instead of "merged and pushed." And letting an urgent hotfix skip the pointer bump — it works today and reverts silently in a week, which costs more trust than the original bug did.