Blueprint
Data model: the Kit Data Model (KDM)
The Kit Data Model (KDM): one mergeable data model the kits share, where every change has an author and a history.
Updated
In Kition, a document is not a file. It is a mergeable history of changes, each with an author. The .docx, .psd or .kboard on disk is how a document is saved and shared, not the document itself.
The kits build their documents on the same data model, the Kit Data Model (KDM). Underneath is the CRDT library Loro, but kits depend only on KDM, not on Loro, so it can be swapped later.
One schema defines a document
Each kit ships a schema that spells out which objects and fields make up its documents:
{
"kit": "kit.slide",
"root": "SlideFile",
"types": {
"SlideFile": { "fields": { "pages": { "kind": "list", "of": "Page" } } },
"Page": { "fields": { "layout": { "kind": "ref", "of": "Layout" }, "shapes": { "kind": "list", "of": "Shape" } } },
"Paragraph": { "fields": { "text": { "kind": "text", "marks": ["bold", "italic", "color"] } } }
}
}(An excerpt of model/schema.json, illustrative, with fields simplified.) The schema is the single source of truth: AI tool parameters, object model types, validation and conformance tests are all generated from it.
Field types decide how changes merge
When designing a schema, a kit answers two questions for every field: which properties will different people change at the same time, and which must change together? Split the first; group the second.
| Type | Used for | When two people edit at once |
|---|---|---|
Text (text) | Body text, text boxes, cell text | Merged character by character, keeping both people’s typing; formatting merges by range |
List (list) | Pages, paragraphs, layers, tracks | Both insertions are kept; moving the same item at once never duplicates it |
Tree (tree) | Shape groups, layer groups, outlines | Concurrent moves never create a cycle |
Map (map) | Cells, style properties, settings | Different keys are all kept |
| Single value (number, string, reference, asset) | Color, position, toggles | Last write wins; the other stays in history |
Every object has a stable ID
- Every object has a globally unique ID, so two devices creating objects at once never collide.
- Table rows and columns are objects with IDs too, and formulas reference them by ID; A1 is just how they’re displayed. So when two people insert and delete rows and columns at once, formula references and merged cells stay correct, and a reference to a deleted row becomes
#REF!on every replica.
Repair after merging
Two changes that are each valid can be invalid together: a merged cell spans a deleted column, or two clips on a timeline overlap. Each kit writes a repair rule:
- A repair must be a deterministic function of the merged state, so every device computes the same result.
- Whatever can’t be repaired and needs judgment becomes a conflict object, and the interface asks a person to choose.
Nothing gets lost
- Transactions are validated before they apply: a failed command never leaves a half-applied change, and never “rolls back” over someone else’s work.
- Unrecognized content is kept as is: parts a kit doesn’t understand on import are stored as read-only objects and written back on save.
- Unknown fields are kept: fields added by a newer version are left untouched when an older version opens the file.
Measured
(Figures from October 2026 experiments, native Rust on a heavily loaded machine, so treat them as upper bounds.)
- The Rust and TypeScript replicas are byte-for-byte identical (about 800,000 floating-point values, zero differences).
- A 500-page slide file with 20 shapes per page: about 1 ms to open the snapshot, about 19 ms to apply 1,000 remote changes.
- A 100,000-row table: about 7 ms to open the snapshot, about 118 ms to apply 1,000 remote changes.
- Shared convergence tests: 2–5 replicas, CJK input methods and emoji, paragraph splits and joins, duplicate delivery, crash recovery and randomized tests.
The protocol itself, the Kit Harness Protocol (KHP), lives at kitharness.org.