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 next time someone deploys from main, and it looks like the fix un-fixed itself.
When to run it
At the end of every session that touched code, not only at the end of a project. Definition of Done is a bar for each session, not a milestone you pass once.
The play
- Before starting new work, check for an existing branch or worktree that already solves the same problem. Continuing it beats duplicating it.
- Merge to main through the real review path (a pull request or equivalent). Never call work finished while it sits unmerged on a branch.
- Push. A merge that exists on one machine only is one lost disk away from not existing.
- If the work is used elsewhere (a submodule, a shared package, a dependent repo), bump the pointer in the parent immediately. The parent does not know your commit exists until you tell it.
- Deploy only from main, never from a worktree or a feature branch. Work that is deployed but not merged silently reverts on the next real deploy.
- Remove the worktree or branch once it has landed. A pile of stale worktrees is where the next session gets confused about what is 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.