Learn / Who changes state

What a reader sees while a change is in flight

Both foldkit-remote and foldkit-sync show optimistic changes immediately before the server confirms them. Remote layers optimistic patches over its normalized cache; Sync replays pending durable operations over its committed replica slice. Because both share the same model, both use the same four terms:

visible = confirmed / committed + pending

ConceptIn foldkit-remoteIn foldkit-sync
Authority's last wordData.confirmed(projection)mounted.committed
Pending, unanswered workOptimistic layers and overlaysDurable operations in the outbox
What views renderThe projection itselfThe replica's shared slice
Settled either waysettled (applied or failed)Exchange rebased the operation

Two rules follow from separating visible from confirmed state:

  • Views read the visible state. Passing a Projection to foldkit-remote or reading a foldkit-sync slice gives you the optimistic view by default, because that is what screens want.
  • Reporters wait for the confirmed state. Any check confirming a write to an outside caller — such as an Agent.when completion predicate — must read Data.confirmed(projection) (Remote) or mounted.committed (Sync). That way it waits for the server instead of trusting a local edit.

Remote and Sync keep separate implementations instead of hiding behind one shared overlay abstraction, because a single wrapper would obscure which authority a reader is waiting on. Where server-owned rows are edited offline through a journal (foldkit-sync/entity), the application lays pending journal edits over Remote rows by row revision; see Editing server data through a journal.