watershed Collaborative data structures for Gleam

← watershed · Runtime

Runtime
behavior.

The atlas shows what each structure is and the models page shows how it converges. These pages cover the runtime behavior shared by every structure: optimism, reconnection, duplicate safety, the ephemeral tier that never touches converged state, and the mesh that lets a document run with no sequencer joined at all.

Runtime behaviors

Five sheets. Read in order, or choose the behavior you need to investigate.

  1. 01 Optimistic edits Show a local edit the instant it happens, reconcile it when the server sequences it, and unwind it cleanly if it loses. apply · pending → ack_local → sequenced
  2. 02 Reconnect & resync Drop the link and rejoin the flow. A returning client rehydrates from a summary (the same path a fresh client boots from). from_summary · replay · catch-up
  3. 03 Idempotent re-delivery Why a re-sent delta lands as a non-event: the runtime's sequence-number check drops it, or an idempotent merge absorbs it. re-deliver · dedupe · absorb
  4. 04 Presence & ripples The ephemeral tier beside your state: throwaway broadcasts, and the roster built on them (connection-backed where the server offers it, heartbeat-and-TTL where it does not). submit_ripple · sessions · server or heartbeat
  5. 05 Peer-to-peer over WebRTC A document that runs on a WebRTC mesh with no sequencer at all. Eligible structures merge instead of ordering, and a relay can attach later for durability without changing the document's state or handles. CrdtDocument · Auto / SequencedOnly / P2pOnly · crdt_relay_v1

Ready to build on these? The build guide puts them to work, including a hands-on presence step that wires the ephemeral tier into a working board.