Status: Accepted (2026-11-27, revised for ADRs 0019-0020)
A bulk move of 10K nodes, a 1,000-node paste from an agent and 30 Hz cursors from many peers must stay cheap to encode, send and apply.
shared/src/codec.ts (varints, f32 values, type tag per prop, sorted delta-coded id lists). A SET of x+y on one node is ~19 bytes vs ~90 in JSON.ScanBatch) and never builds op objects; accepted ops are re-framed by slicing byte ranges. Every message names a server-assigned room, identical for all subscribers, so each broadcast is encoded once and the same buffer goes to N sockets.hello, subscribe, welcome, synced, errors) - easy to debug.CREATE_BULK with the same columnar node block as snapshots.drag), and receivers draw it with the same GPU preview the local editor uses. Pointer-up commits one batch.PRESENCE_BATCH per room per tick. Large rooms (> 200 subscribers) tick at 5 Hz and relay at most 50 recently active cursors plus an others count; receivers filter by their own viewport and interpolate. Never journaled; dropped first under backpressure.The codec is the contract all packages use; changing it means bumping PROTOCOL_VERSION.