Sync / Replicated state
How visible state rebases over committed state
The server stores committed operations (A, B, C) in one canonical order, while each device holds its uncommitted local operations (D, E) in its outbox. What the user sees on screen is always the committed base replayed with pending edits on top: replay(A, B, C, D, E).
When another device commits an edit first, the server advances the committed base and the device replays its pending edits on top. When the server rejects D, the replica drops D and replays E. Every update follows that same rebase rule with no separate undo stack or shadow store.
Each edit moves through three milestones:
| Milestone | Where it lives | How UI observes it |
|---|---|---|
visible | In Model immediately | Rendered by view |
saved | In browser outbox | onPersistenceFailure if write fails |
committed | In server journal | replica.status.pending / mounted.committed |