Skip to content

Conflict preview & resolution

While a session holds staged changes, the live documents keep moving. The session’s job is to make that visible before commit, not to surprise you at commit time.

Each stage carries its base snapshot. A conflict is computed on demand by comparing three states:

  • base — the document as it was when staging began,
  • head — the live document now,
  • staged — base with the session’s changes applied.

If the head has moved since base in a way that collides with staged changes, the stage is blocked. The three-way preview is available as data — for a diff UI, or for an agent to reason about. Because conflicts are recomputed rather than persisted, a head change that turns out to be disjoint un-blocks the stage by itself.

  • Amend a staged change — rewrite a pending change in place (fix the agent’s typo before committing).
  • Drop a staged change, or a whole stage — discard part of the staged work.
  • Rebase a stage — adopt the current head as the new base and restage on top of it.
  • Discard the session — walk away; live documents were never touched.

commit() is the gate: it refuses while any stage is blocked, and writes all stages atomically once none are.

Sessions can also operate in live-merging modes, where staged work continuously follows the head — auto-merging while changes stay disjoint, or surfacing everything for review. The default is fully detached staging.