Files
harness-tools/skills/develop/develop-workflow/references/git-and-integration.md
T
2026-09-04 10:47:04 -04:00

41 lines
2.4 KiB
Markdown

# 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:
1. Fetch the latest source branch when a remote exists.
2. Rebase the feature branch onto the latest source commit.
3. Rerun affected checks and full required verification whenever rebase changes the effective tree or resolves conflicts.
4. Record the review base, product HEAD, clean status, tree hash, and commit list.
5. Generate exact review bytes:
```bash
git diff --binary --full-index --find-renames <base>...<product-head> --
```
6. 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:
1. Confirm the source branch still equals the final rebase base. Return to synchronize, verify, and review if it advanced.
2. Confirm the source checkout exists, is clean, and is safe to update. Stop when dirty or missing.
3. Fast-forward the source branch to the reviewed feature branch; create no merge commit.
4. In the source checkout, update only the workflow record with bound review and integration evidence.
5. Prove the closure diff touches only that record, run applicable documentation checks, and create one metadata-only closure commit.
6. Run a cheap final sanity check.
7. Prove the product and closure commits reachable from the source branch.
8. 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.