Sync / foldkit-durable

The model

sequence:   1      2      3      4
log:       op A   op B   op C   op D
                          ^
                          cursor 3

snapshot at cursor 3 = reduce(reduce(reduce(empty, A), B), C)
NameMeaning
DocumentOne independently ordered stream of operations, a DocumentId.
OperationOne durable change a client submitted. The application defines its shape.
opIdThe operation's stable identity. A retry reuses it.
SequenceThe gap-free position the journal assigns when an operation commits.
CursorA position a reader has reached; "what came after N?"
SnapshotThe reduced state of the committed prefix its cursor names.
EpochThe identity of a document's history; new after a reset.

The log and the snapshot answer different questions. A far-behind or brand-new replica starts from the snapshot; an up-to-date one asks for the log after its cursor.