Supplements the root AGENTS.md Collaboration server section. This is the client CRDT library; server persistence gotchas live in packages/collab-server/AGENTS.md. Collab-specific footguns:
- IFCX is the canonical wire. This package emits it via
snapshotToIfcx+serializeIfcx(src/snapshot/to-ifcx.ts) and seeds aY.DocviaseedFromIfcx(src/snapshot/from-ifcx.ts); the recipient'sparseIfcxViewerModellives inapps/viewer(src/hooks/ingest/viewerModelIngest.ts), not here. Any CRDT/IFCX shape change must preserve the seed, snapshot, re-seed round-trip (test/round-trip.test.ts). - Transaction origins are load-bearing (
src/doc/schema.ts): local edits useLOCAL_ORIGIN, seedingSEED_ORIGIN, undoUNDO_ORIGIN.UndoManagertracks only[LOCAL_ORIGIN], so writing to the doc with the wrong origin breaks undo. (The server adds aload-from-diskorigin; see the collab-server notes.) - No placement-specific code path. There is no
placementBaselinein-tree (that delta-render logic is viewer-side); in the CRDT a placement is just a plain namespaced IFCX attribute (setAttribute(doc, path, 'usd::xformOp::translate', value)). Do not special-case it here. - Preserve the file-level IFCX header round-trip.
header/imports/schemasare stashed into the doc meta map on seed and re-emitted on snapshot (from-ifcx.tsstashes,to-ifcx.tsre-emits); drop them and snapshots lose their header. - New public entry points go in the
exportsmap.@ifc-lite/collabpublishes subpaths (./snapshot,./providers/indexeddb,./providers/websocket,./awareness,./snapshot/worker); add topackage.jsonexportsor consumers cannot import it even though tsc emits the file. - collab and collab-server are one unit. Test both with
pnpm test:collab(runs vitest in both packages), not justturbo test; a CRDT schema change usually needs test updates in both.