Primitive / Composition Architecture

How the editor UI admits, inserts, edits, saves, previews, and publishes recipe-backed compositions. Current through the June 30, 2026 action treatment token split.

Shared substrate Editor side Public side Data contract
used by used by writes hydrates reads 1 · DEFINITION LAYER Composition Definitions recipes for 9 composition families pure data + defaults 2 · SHARED RUNTIME Recipe walker · Layout · Scope · State · Shell turns a recipe tree into React path helpers + primitive renderers 10 · EDITOR PLANNER Plans · Regions · Grooves classifies slots into roles + regions derived each render, never persisted 3 · EDITOR COMPOSITION UI NodeViews · Controls · Chrome generic shell + frame scope policy 4 · ADMISSION & INSERTION Adapters · Slash metadata which compositions enter Write mode 5 · DOCUMENT WORKSPACE UI Route shell · Tiptap · serializer Write mode edits ContentNode[] 7 · PREVIEW & PUBLIC Renderer Registry Read mode + public routes recipe-backed output family visuals allowed 6 · PERSISTENCE Content Documents content_documents.data.nodes drafts + frozen versions 8 · EXTRACT VALIDATION Extracts · import · migration recipe-walk validation canonical nested slots 9 · CONTRACT TESTS Guardrails registries · shell · golden data fail when surfaces drift