One model · one view · two faces
Kinogaki architecture
A Document is the source of truth, a Prism file on disk. A view is a pure function of that Document. The C++ libraries render the view — in a browser as WebAssembly, or in a native window — and Prism is the wire between them. This is the whole system in one page, then the pieces.
The shape in one paragraph
A Document is the source of truth — a Prism file on disk, a set of typed Elements at hierarchical Paths. A view is a pure function of that Document: give it the state, it returns a tree of widgets. The C++ libraries render that view tree, and they render it two ways from one codebase — in a browser as WebAssembly, or in a native window on the device. Between the server that authors the view and the client that draws it, Prism is the wire: the view is a Prism Document, an edit is a Prism Document, and a change is a sparse Prism overlay applied to the last one. Author the model once; render it anywhere; send only what changed.
A Document is a set of Elements indexed by Path, each carrying typed Propertys; a Property is a Value, optionally varying over time.
That sentence is the whole model. Everything on this site builds on it: the libraries that hold and draw it, the loop that ships it over a socket, and the two faces that render it.
The flow
state (a Document) the source of truth — a Prism file
│
│ view(state) a pure function → a view Document
▼
view (a Document) widgets as typed Elements at Paths
│
│ Prism on the wire snapshot, or a sparse overlay of what changed
▼
the client renders C++ kinogaki-ui — WebAssembly or native
│
│ an event (a Document) a press, a form submit — back over the wire
▼
the server re-runs view(state) and the cycle closes
Three things make this small instead of sprawling, and all three come from Prism:
- Path is identity. Prism forbids UUIDs — an Element's Path is its key. So the client reconciles a new view against the old one by Path, with no bookkeeping to invent.
- Overlay is the patch. A change is
overlay(base, layer)— Prism's own sparse, later-wins composition. There is no separate diff format to design; the patch is just a Document. - One codec is the wire. Prism binary on the socket,
.prismatext when you want to read it. The same bytes the model serializes are the bytes that travel.
Where to go next
- The libraries — Core, Platform, UI, and who depends on whom.
- The SDUI loop — the three message kinds and the rule that keeps a diff safe.
- The two faces —
kinogaki serve(web) andkinogaki run(native), one view. - The Python boundary — where Python stops and C++ begins.