iiRecord
Agentic AI Atlas · GAP-TOOLS-017: Git Worktree Isolation for Parallel Effect Execution
page:docs-harness-features-backlog-gaps-tools-capabilities-gap-tools-017a5c.ai
II.
Page reference

page:docs-harness-features-backlog-gaps-tools-capabilities-gap-tools-017

Reading · 2 min

GAP-TOOLS-017: Git Worktree Isolation for Parallel Effect Execution reference

Enable parallel effect execution with git worktree isolation so that concurrent code-modifying tasks do not conflict. When the orchestrator dispatches multiple code tasks in parallel (via ctx.parallel.all()), each task should operate in an isolated worktree to prevent merge conflicts and file contention.

Pagewiki/docs/harness-features-backlog/gaps/tools-capabilities/GAP-TOOLS-017.mdOutgoing · 0Incoming · 1

GAP-TOOLS-017: Git Worktree Isolation for Parallel Effect Execution

FieldValue
Categorytools-capabilities
PriorityHigh
EffortL
StatusMissing

Description

Enable parallel effect execution with git worktree isolation so that concurrent code-modifying tasks do not conflict. When the orchestrator dispatches multiple code tasks in parallel (via ctx.parallel.all()), each task should operate in an isolated worktree to prevent merge conflicts and file contention.

Current State

Parallel effects (ctx.parallel.all(), ctx.parallel.map()) execute concurrently but share the same working directory. Code-modifying tasks that run in parallel risk file conflicts, dirty working trees, and non-deterministic results. No worktree management exists in the SDK.

Target State

A worktree manager that: creates isolated git worktrees for parallel code tasks, tracks worktree lifecycle tied to effect IDs, merges worktree results back to the main working tree on effect resolution, cleans up worktrees on task completion or failure. Integrated with the parallel execution model and harness invocation.

Dependencies

Key Files

ComponentPath
Parallelizationpackages/sdk/src/runtime/
Harness invokerpackages/sdk/src/harness/invoker.ts
Storagepackages/sdk/src/storage/
Task batchingpackages/sdk/src/tasks/batching.ts

Recommendation

Phase 3 implementation. Build a WorktreeManager module that creates/tracks/merges worktrees. Integrate with buildParallelBatch to auto-provision worktrees for code tasks. Add worktree cleanup to effect resolution lifecycle.