# Instar Upgrade Guide — NEXT

<!-- bump: patch -->

## What Changed

**Mesh registry conflicts now auto-merge deterministically (multi-machine
robustness).** When two machines concurrently update the shared mesh state — e.g.
one bumps the awake-lease while another joins — their `machines/registry.json`
commits can collide on rebase. GitSync's conflict resolver previously had no case
for the registry, so such a conflict fell to LLM/manual and the mesh could stay
split (one machine seeing a different roster than the other). New `mergeRegistry`
merges them losslessly: union the machines (fresher `lastSeen` wins per machine,
revocations sticky), keep the higher-epoch lease. Both machines compute the
identical result, so the mesh converges on its own.

## What to Tell Your User

- Running your agent across two machines is now more robust: if both machines
  record a change to the shared roster at the same moment, they'll automatically
  reconcile to the same view instead of disagreeing about who's awake or which
  machines are in the mesh. Nothing for you to do — it just self-heals.

## Summary of New Capabilities

| Capability | How to Use |
|-----------|-----------|
| `mergeRegistry(ours, theirs)` | Internal — deterministic semantic merge of two mesh registries (union machines, higher-epoch lease). |
| GitSync registry conflict auto-resolve | Automatic — a `machines/registry.json` rebase conflict now merges deterministically instead of escalating to LLM/manual. |

## Evidence

**Small, precise fix — NOT the spec's drafted sync() rewrite (sync() is already
mature; the real gap was a missing conflict-resolution case).** Unit test
`tests/unit/mergeRegistry.test.ts` (6 cases) covers the exact 2026-05-27
divergence (concurrent lease-bump + join → both machines + higher epoch survive),
order-independence, same-epoch tiebreak, sticky revocation, missing lease, and
syncSequence tiebreak. `tsc --noEmit` + destructive-lint clean. The fix slots into
GitSync's existing Tier-0 `tryAutoResolve` (same wiring as relationships/jobs/
evolution) and is try/catch fail-safe (falls back to the prior LLM/manual tier on
any error). Side-effects review:
`upgrades/side-effects/mesh-git-substrate-auto-reconcile.md`. Spec: Track D of
`docs/specs/MULTI-MACHINE-BOOTSTRAP-ROBUSTNESS-SPEC.md`.
