The Multi-Collaboration kernel addresses a core challenge in server-authoritative collaborative apps: clients submit actions based on stale server versions. A client editing offline may reference anchors that no longer exist, positions that have shifted, or columns that were renamed. The kernel rebases each incoming action through the intervening history, then tries a small ordered candidate set before accepting or rejecting — and proves that rejection happens only when no meaning-preserving interpretation could succeed.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/metareflection/dafny-replay/llms.txt
Use this file to discover all available pages before exploring further.
The problem: stale clients
When multiple clients edit concurrently, a client’s action may arrive with a base version that is behind the server. Naïve rejection is safe but harsh — often the user’s intent can be preserved even when the exact action no longer applies. Naïve acceptance without rebasing is unsafe — it can violate global invariants. The Multi-Collaboration kernel takes a third path: intent-relative reconciliation with a proved reject boundary.ServerState
Anchor-based placement
Instead of fragile positional indices, the domain models placement intent using anchors:Place rather than a raw index. When an anchor card is missing (deleted or moved by another client), the server can fall back to AtEnd or another heuristic without losing the user’s core intent (move to this column).
Domain obligations
The Multi-Collaboration kernel requires domains to prove three groups of obligations:MC1 — Initial state satisfies the invariant
MC1 — Initial state satisfies the invariant
MC2 — Successful transitions preserve the invariant
MC2 — Successful transitions preserve the invariant
MC3 — Rebasing and candidate interface
MC3 — Rebasing and candidate interface
The domain must provide four elements that define how intent is preserved under concurrency:
Rebase(remote, local) — a total function that transforms a local action assuming a remote action happened first. Folded over a suffix to rebase through multiple intervening actions:Candidates(m, a) — a finite ordered list of concrete actions the server will try in order:Explains(orig, cand) — a ghost predicate defining which candidates count as meaning-preserving interpretations of the original request (the “intent envelope”):CandidatesComplete — the completeness lemma that ties the envelope to the candidate set: if an admissible interpretation exists and would succeed, it must appear in Candidates:Dispatch
The server’s dispatch function ties everything together:ChooseCandidate tries candidates in order and returns the first success:
Kernel theorems
MCK1 — Safety: all accepted states satisfy Inv
MCK1 — Safety: all accepted states satisfy Inv
TryStep, and MC2 guarantees that TryStep success preserves Inv. This is the primary safety theorem.MCK2 — Intent-relative minimal rejection
MCK2 — Intent-relative minimal rejection
CandidatesComplete to show that aGood must appear in the candidate list, then ChooseCandidateFindsGood to show that the candidate search will find it.This is a guarantee relative to the domain-defined intent envelope (Explains). The domain chooses what “intent preserved” means; the kernel guarantees that rejection happens only when the envelope is impossible to satisfy.Client-side state
The kernel also provides verified client-side operations for optimistic updates:| Function | Effect on pending |
|---|---|
ClientLocalDispatch(client, action) | Appends action to pending |
ClientAcceptReply(client, newVersion, newPresent) | Removes pending[0], re-applies rest |
ClientRejectReply(client, freshVersion, freshModel) | Removes pending[0], re-applies rest |
HandleRealtimeUpdate(client, serverVersion, serverModel) | Preserves pending exactly |
ReapplyPending re-applies pending actions on top of a new server model to maintain the optimistic view after a realtime update:
Concrete example: Kanban moves
In the Kanban domain, aMoveCard action carries anchor-based placement. The server tries three candidates for each move:
- The rebased placement (original intent after rebasing)
AtEnd— universal fallback (in the intent envelope)Before(first)— heuristic (outside the proof)
Before(first) is redundant: if it succeeds, AtEnd also succeeds (BeforeFirstImpliesAtEnd). This justifies defining Explains to cover only the rebased placement and AtEnd, giving a clean guarantee:
A move is rejected only if neither its intended placement nor the universal fallback AtEnd could be applied without violating invariants.
Integration boundary (trusted)
- Ordering and delivery of realtime updates
- Database atomicity and transactions
- Edge/server orchestration around verified transitions
- Liveness beyond the modeled protocol
The candidate set may include heuristics beyond the intent envelope. These improve UX (e.g., layout stability) without enlarging the proof surface. The proof establishes a lower bound on acceptance; the implementation is free to be more permissive.
Related pages
Effect State Machine
Client-side orchestration layer built on top of Multi-Collaboration.
Multi-Project kernel
Extends Multi-Collaboration to cross-project operations.
CollabTodo app
Full example using Multi-Collaboration with Supabase or Cloudflare.
Guarantees reference
Precise trust boundaries for the Multi-Collaboration kernel.