Skip to content

docs: COLLAB_DESIGN.md — loro CRDT integration design - #14

Merged
juanma-dev merged 1 commit into
mainfrom
docs/collab-design
Sep 5, 2026
Merged

juanma-dev merged 1 commit into
mainfrom
docs/collab-design

Conversation

@juanma-dev

Copy link
Copy Markdown
Owner

Summary

Design-before-code for the biggest remaining roadmap item, in the same spirit as DESIGN_NOTES.md. No implementation in this PR — the document exists to de-risk a ~4–5 week / ~4k LOC build before the first line is written, whether it's built by the maintainer or picked up by a contributor.

Key decisions drafted for review:

  • §3 Architecture: dual-model op bridge. EditorState remains the local source of truth; a shadow LoroDoc owned by a CollabSession is the convergence authority. Local Steps translate to loro ops; remote loro diffs come back as history-exempt Steps through the normal transaction pipeline — adapters, history, and plugins untouched.
  • §4 Mapping. Block structure → LoroTree (movable-tree convergence for splits/joins/wraps); textblock content → LoroText with Peritext mark ranges; a per-Step translation table is the implementation contract.
  • §5 History. Remote edits never enter local undo; map_against turns out unnecessary for convergence under this architecture (loro merges; we never rebase) — the Phase-2 trait bet held, just not the way we expected.
  • §6 Surface. Amends the v0.1 plan: a new taino-edit-collab crate rather than a collab feature on core (dependency discipline, public-API dogfooding, versioning freedom); the umbrella's reserved collab feature still delivers the original UX.
  • §7 Testing. Deterministic host-side convergence simulation (scripted scenarios + seeded property tests) — no browser in the loop, which our DOM-free core makes possible.
  • §8 Open questions gate the first implementation PR (tree granularity for atoms, initial-doc seeding, undo route, loro MSRV vs our 1.80 pin, umbrella feature shape).

🤖 Generated with Claude Code

…tion

Resolves the architecture on paper before any collab code: dual-model
op bridge (EditorState stays the local source of truth; a shadow
LoroDoc is the convergence authority), block tree -> LoroTree +
textblock -> LoroText/Peritext mapping with a per-Step translation
table, a transport-agnostic CollabSession API shipped as a new
taino-edit-collab crate (amending the old core-feature plan, rationale
in §6), deterministic host-side convergence testing, honest 4-5 week
estimate, and five open questions that gate the first implementation
PR. ROADMAP's Up next now links the doc.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@juanma-dev
juanma-dev merged commit 90ba5ed into main Sep 5, 2026
2 checks passed
@juanma-dev
juanma-dev deleted the docs/collab-design branch September 5, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant