Document engine
Collaboration
OT transform/rebase, authoritative server, changeId, and reconnect.
Lextrix syncs with operational transformation on ChangeSets — not CRDTs.
Clients submit ChangeSets. An authoritative server decides accept order and Version ids, so concurrent edits converge without every client inventing its own history.
Client → transport (WebSocket) → DocumentServerSession
→ DocumentHandle → Version → persistenceTransform:
A.transform(B, priority) → B′Rebase moves a proposal from an older base to a newer HEAD by transforming through the accepted chain.
import { rebaseProposal } from 'lextrix-change/document';| Package | Role |
|---|---|
lextrix-change | Transform, wire, collab ports |
lextrix-collab | Server/client sessions |
lextrix-server | WebSocket host + Postgres |
Each submit includes a client changeId. Retries must reuse it so a lost ACK does not create a second Version. On reconnect: sync, rebase pending work, resubmit with the same ids.
Presence frames exist for things like cursors. They are ephemeral, do not become Versions, and cannot block accept. Building the cursor UI is still your app.
See also Persistence.