Expand description
Git-worktree isolation for flow agent leaves (P5b).
A leaf with Isolation::Worktree runs against ITS OWN git worktree of the
ctx workspace, so parallel file-mutating agents cannot trample each other.
Cleanup policy (the Claude Code semantic): a worktree left CLEAN is pruned;
a DIRTY one has its changes committed onto a hb/<name> branch (work is
never lost), then the directory is removed.
Deviation from the parked design: this shells out to the git CLI
(tokio::process) instead of linking git2 — zero new dependencies, no
!Send libgit2 handles across .await, no C build. Requires git on
PATH at runtime (the dev-workstation audience that wants worktrees has it).
Structs§
- Worktree
Guard - One leaf’s isolated worktree. Create with
WorktreeGuard::create, always finish withWorktreeGuard::cleanup(a sync best-effortDropbackstop force-removes the directory if cleanup never ran — e.g. a panicking task).
Enums§
- Disposition
- What
cleanupdid with the worktree.