feat: Coordinate worktree shards and workspace leases #320

Closed
opened 2026-07-13 19:46:12 +02:00 by dries · 0 comments
Owner

Parent

#311

What to build

Give mutating workflow nodes safe access to a bounded pool of worktree shards. Support exclusive leases for safety and path-scoped leases for high-throughput non-overlapping edits, while centralizing repository-wide Git mutation.

Acceptance criteria

  • A single-repository run can declare a bounded worktree shard pool and shards are created through existing host/worktree services.
  • Exclusive leases are the default and prevent other mutators from sharing the shard.
  • Path leases normalize and compare declared scopes; overlapping scopes cannot run concurrently.
  • Non-overlapping path leases can share a shard up to configured resource/concurrency limits.
  • Path-leased agent/command attempts cannot execute stash, reset, checkout, commit, push, or other configured repository-wide mutations.
  • Coordinator nodes can acquire exclusive or serialized per-shard commit capacity.
  • Lease and shard ownership is durable, linked to attempts, and visible in the run UI.
  • Cancellation/failure releases leases only after the underlying attempt settles.
  • Records allow an optional host identity, but the first scheduler uses only the local host.
  • Tests cover path normalization, ancestor overlap, exact overlap, disjoint paths, Git restrictions, cleanup, and shard exhaustion.

Blocked by

## Parent #311 ## What to build Give mutating workflow nodes safe access to a bounded pool of worktree shards. Support exclusive leases for safety and path-scoped leases for high-throughput non-overlapping edits, while centralizing repository-wide Git mutation. ## Acceptance criteria - [ ] A single-repository run can declare a bounded worktree shard pool and shards are created through existing host/worktree services. - [ ] Exclusive leases are the default and prevent other mutators from sharing the shard. - [ ] Path leases normalize and compare declared scopes; overlapping scopes cannot run concurrently. - [ ] Non-overlapping path leases can share a shard up to configured resource/concurrency limits. - [ ] Path-leased agent/command attempts cannot execute stash, reset, checkout, commit, push, or other configured repository-wide mutations. - [ ] Coordinator nodes can acquire exclusive or serialized per-shard commit capacity. - [ ] Lease and shard ownership is durable, linked to attempts, and visible in the run UI. - [ ] Cancellation/failure releases leases only after the underlying attempt settles. - [ ] Records allow an optional host identity, but the first scheduler uses only the local host. - [ ] Tests cover path normalization, ancestor overlap, exact overlap, disjoint paths, Git restrictions, cleanup, and shard exhaustion. ## Blocked by - #319
dries closed this issue 2026-07-16 00:56:09 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dries/ocman#320
No description provided.