2.4 KiB
Git and local integration
Isolation
Record the source branch and exact base before creating ./.worktrees/<feature> on feature/<feature>. Prove every shell location with explicit cd or git -C; verify git rev-parse --show-toplevel before mutation. Block on collisions, unmerged paths, unexpected ownership, or an unignored worktree root. Never rename, reset, clean, stash, copy source changes, or remove an orphan silently.
A dirty source checkout requires bounded status/path evidence and explicit approval because its changes are omitted. Preserve that evidence in the record.
Synchronize and pin review
After focused commits and verification:
- Fetch the latest source branch when a remote exists.
- Rebase the feature branch onto the latest source commit.
- Rerun affected checks and full required verification whenever rebase changes the effective tree or resolves conflicts.
- Record the review base, product HEAD, clean status, tree hash, and commit list.
- Generate exact review bytes:
git diff --binary --full-index --find-renames <base>...<product-head> --
- Hash those bytes with SHA-256 and record the command and digest. Regenerate from the durable commits rather than committing a duplicate patch.
Ask before conflict resolution changes approved behavior, history rewrite of shared work, force operations, or non-fast-forward integration.
Fast-forward integration
After both review axes approve the exact fingerprint:
- Confirm the source branch still equals the final rebase base. Return to synchronize, verify, and review if it advanced.
- Confirm the source checkout exists, is clean, and is safe to update. Stop when dirty or missing.
- Fast-forward the source branch to the reviewed feature branch; create no merge commit.
- In the source checkout, update only the workflow record with bound review and integration evidence.
- Prove the closure diff touches only that record, run applicable documentation checks, and create one metadata-only closure commit.
- Run a cheap final sanity check.
- Prove the product and closure commits reachable from the source branch.
- Remove the completed worktree, then delete its feature branch.
Treat cleanup in step 8 as pre-authorized only after every preceding clean-state and reachability proof. Ask before any other destructive cleanup. Pushing, publishing, deployment, and production access remain separate user actions.