Agentic changes that “almost merge” are still failures. This episode starts with the mechanism that makes landing the default: exclusive leases — closed by merge-replay.
Try it. See leases decide who writes in the coordination demo, then watch merge-replay catch what optimistic concurrency still misses. Pair with semantic impact when the break is outside the claimed paths.
More. How the territory map projects leases live, how fleet coordination wraps your harnesses, and the docs for grant / heartbeat / release.
The overnight PR pile
You have seen the pattern. Overnight, five agents open PRs that all touch the same package. By morning, three are blocked on textual conflicts, one rebased into a semantic breakage, and one somehow landed while invalidating the others. The agents did their jobs. The system did not.
Leases are the turn-taking protocol
An exclusive lease is a short, explicit claim: this agent may edit these paths until it releases or the lease expires. Everyone else sees the claim and picks different work — or waits with eyes open. No vibes. No “hopefully they are not editing auth.”
Mechanics that matter in production
A grant is scoped: path globs, optional inclusive line ranges, exclusions that carve out shared-read surfaces, and an idempotency key so retries do not double-book territory. Heartbeats keep the lease alive while the agent runs; a missed heartbeat frees the map for the next worker instead of leaving a zombie claim overnight.
Overlap detection is the same math the allocator uses everywhere else — path, range, hotspot, and semantic collision checks — so a “granted” answer means the fleet already agreed this slice is free.
Why leases beat optimistic concurrency alone
Git’s optimistic model assumes humans will serialize carefully. Agents do not. They parallelize by default and apologize in the merge conflict. Leases move serialization to the moment of intent, which is where fleets actually need it.
Merge-replay closes the loop
A lease prevents two writers from editing the same lines at once. Merge-replay asks a sharper question: given the branches that already exist, would this change still land? The verifier runs git merge-tree against co-active work and records whether the collision was a scope miss, a lease violation, or a structural conflict — so you fix the mechanism, not the symptom. Leases reduce stomps; they do not license an unqualified “no conflicts” claim on their own.
Laptop, CI, and cloud speak one protocol
A lease only works if every runner honors it. Managent’s lease layer is the shared contract across interactive IDE agents, CI bots, and cloud workers — so a local refactor cannot quietly stomp a CI migration mid-run.
Advisory scope prediction
Before an agent asks for a lease, optional scope prediction can suggest likely paths from the task description. It is advisory only: it does not grant, expand, or enforce. The lease remains the source of truth for who may write.
What to try
- In the demo, follow a grant → heartbeat → release cycle and watch the waiting agent pick different work.
- Force the interesting case in merge-replay: lease held, still a merge-tree conflict against a sibling branch.
- Compare semantic impact when the textual claim looked fine.
What “actually land” means
Landing is not “opened a PR.” Landing is a clean merge that survives review and does not invalidate sibling work. Leases get you closer by preventing concurrent writes on the same lines; merge-replay keeps you honest about what still merges when the lease drops.
What comes next
Episode 2 will dig into territory maps and how fleets choose work when half the tree is already claimed — preview that story in Introducing the Territory Map. For now: if your agents ship changes that do not land, start with leases, then verify with merge-replay.
Ready to coordinate your fleet?
