Architecture Overview
Dokime is a product-specific layer over Harmos. The architecture keeps product meaning independent from runtime machinery and keeps every external interface as an adapter over one runtime authority.
flowchart TB
subgraph Product Meaning
A[dokime-api]
D[dokime]
PL[Product definition crates]
end
subgraph Product Machinery
H[Harmos substrate]
R[dokime-app]
HC[dokime-host]
end
subgraph Interfaces
CLI[dokime-cli]
API[dokime-server]
GUI[dokime-gui]
PY[dokime-python]
end
A --> D
D --> R
A --> R
D --> PL
H --> R
A --> HC
HC --> R
PL --> R
PL -. register from loaded sidecar .-> R
R --> CLI
R --> API
API --> GUI
R --> GUI
R --> PY
Ownership Rules Visible In The Code
Section titled “Ownership Rules Visible In The Code”dokime-apiowns the contracts every party compiles: what a suite declares, what a record or telemetry channel promises, what a prompt asks, what a document lays out, and what an installed artifact contributes. Data and serde only, with no Harmos dependency, no gates, and a wasm32 check to prove it.dokimeis the SDK kit a plugin author compiles: the authoring macros, the execution context, registration, the sidecar wire, and the evaluators over those contracts. It layers ondokime-apiand re-exports every contract module under its original path, and it never depends on the app.dokime-appowns what the application is and how a runtime runs it: the foldedstate/, the closedtransactions/vocabulary that is the only way that state changes, thestreams/it publishes, thetraceability/projections read from it, and capabilities, commands, queries, jobs, storage assembly, sidecar composition, and shutdown. It depends ondokime; the edge never points back.dokime-app::appdeclares Dokime as a HarmosApplicationand holds its entry verbs:builder,launch, and thesim-gatedsimulate. It composes only; every construction lives with the module that owns it.- Interfaces import the runtime and do not own alternate state machines. A shell owns the process side effects the application crate must not: dotenv, the tracing subscriber, the config source, and rendering an error once.
- Plugins and sidecars import
dokimeand, through it,dokime-api— neverdokime-app. The onlydokime-appentries underplugins/are[dev-dependencies], where a test drives a real host. dokime-app::capabilities::installed_artifactsnames trusted builtins and shipped sidecar files in ordinary Rust code; loaded sidecars register their own suites and domains. Dokime has exactly two delivery paths: in-process and sidecar.- Harmos owns the general journal, snapshot, work, series, artifact, installed artifact, and sidecar facilities.
The current persistence architecture is a clean break from the former Keel runtime. Legacy files are intentionally left untouched, not migrated in place.