Skip to main content
System model | Entity RuntimeHow the kernel, providers, command surfaces and generated interfaces fit together, which parts are specified in ESS, and where each model stops.Entity Runtimeexplanationentity-runtimeexplanationadopterdeveloperreference

System model

Entity Runtime is a workspace of Rust libraries and one command around a deterministic kernel. It executes an adopter's entity definitions and derives interfaces from them. The crate list names every package; this page shows how they fit.

An entity's version: 1 is its definition version. It is independent of the runtime release (0.27.0) and of any storage format.

Subsystems and boundaries​

Arrows show inputs and calls. Storage IO stays in the selected provider; authentication, trusted time and external effects belong to the application.

Pan the full-size diagram: swipe or scroll, or focus the canvas and use the arrow keys.

DiagramA visual explanation of the surrounding documentation.
SubsystemTypesWhat it owns
Definition inputEntityDefinition, Registry, ValidatedDefinitionSchemas, lifecycles, rules, operation arguments, templates, references and projections
Decision kernelRuntime, DecisionCommand, Decision, CoreErrorCreation and named operations; a deterministic result or a typed refusal
RecordingDecisionRecord, Recording, Envelope, RecordedCommitReplay evidence and caller-supplied provenance
PersistenceStore, StateProvider, HistoryProvider, AtomicBatchStoreExpected revisions, accepted state with its history, and batches where the provider supports them
Recorded executionentity-executor, entity-eventlog (EventlogRecordedStore)Asynchronous complete-record storage, exact retries, recorded refusals, forks and merge
ReadsDocumentQueryProviderOptional filtered document pages
Remote and hybridTransport, RemoteStore, HybridA caller-selected transport, declared authority, offline behaviour and recorded divergences
Command surfacesentity (entity-cli), StoredRuntime (entity-shell), entity-mcpInput decoding, provider calls, results and tool schemas
Projectionsentity-graph, entity-surface, the Rust CLI generatorDiagrams, documentation, API contracts and definition-specific commands

No provider, command surface or generated contract starts a hosted service by itself.

What a definition covers, and what the host keeps​

ConcernDeclared or checked hereLeft to the host
Entity stateField schemas, identity, definition version, lifecycle state, revisionLoading canonical instances; public Rust fields are not an access-control boundary
CommandsCreation and named operations, typed arguments, transitions, preconditions, assignmentsAuthentication and delegation
Domain eventsCreation and operation event templatesA broker, subscriptions, delivery and the side effects themselves
RulesPreconditions and invariants with true, false and unknown resultsFacts enter as data; the kernel cannot look anything up
ReferencesTarget entity types, inverse labels and acyclic declarationsWhether a referenced instance exists, and graph-wide constraints
HistoryDecision records, recording envelopes, observations, legacy boundariesProvenance records what the caller supplied; it does not authenticate it
PersistenceProvider traits, revision checks, record conflicts, provider transactionsAtomicity is the provider's: File Store commits one subject at a time
QueriesContainment queries with continuation cursorsNo general search service, SQL interface or background projection worker

"The entity is modelled" means its declared fields, operations, rules and events are checked. It does not mean every surrounding service has a definition; an adopter decides which parts of a system cross this boundary.

Commands, decisions, events and observations​

ValueMeaningMoves the subject's revision?
CommandA request to create an entity or execute a named operationOnly if accepted and committed
DecisionThe complete accepted result: instance, record and eventsProposes revision 1 or the next one; the kernel persists nothing
DomainEventAn event template materialized from an accepted decisionShares the decision's revision; a decision may emit none, one or several
RecordedCommitA decision sealed with a record id, a time and an actorPersists the revision when the provider commits it
RecordedObservationProvenance-bearing evidence about a subjectNo
Typed refusalThe request could not be acceptedNo, and no events

A decision record keeps the normalized command and the definition snapshot even when an operation emits no event, so reading events is not reading the full history. HistoryProvider returns recorded decisions and observations; replay re-executes complete decisions. Storage and replay has the details.

For example, the getting-started refund is created at revision 1, submitted at revision 2 and approved at revision 3 with RefundApproved. That event records a policy decision. A payment provider has not refunded money because the event exists.

Pan the full-size diagram: swipe or scroll, or focus the canvas and use the arrow keys.

DiagramA visual explanation of the surrounding documentation.

This is the stored path StoredRuntime runs for the entity command's stored verbs, a generated CLI and the MCP tools. An exact retry of an accepted request returns the original result before a new decision is made. Publishing events happens only after a successful commit and needs the host's own delivery and deduplication.

What is derived from the definitions​

Pan the full-size diagram: swipe or scroll, or focus the canvas and use the arrow keys.

DiagramA visual explanation of the surrounding documentation.
SurfaceDerived from the definitionsWritten by hand
entity commandNothing: it reads any definition set at run timeIts verbs, in Rust with clap derive (crates/entity-cli/src/cli.rs); entity skill prose
Generated domain CLIEntity names, operation subcommands, embedded definitionsGenerator templates; stored execution through StoredRuntime
MCP serverTool names and input schemasProtocol handling and dispatch through StoredRuntime
OpenAPI and AsyncAPIRequest shapes and event payload schemasProjection rules; an adopter implements the HTTP facade and the event transport
Entity pages and graphsFields, transitions, rules, events, references, diagramsRenderers and templates

Which parts are specified in ESS​

Five libraries — entity-core, entity-store, entity-executor, entity-shell and entity-query — are held to an executable specification written for ESS (GitHub). The composition is ess/ess-inputs.yaml. task check runs a standalone Rust checker that executes every scenario against the real libraries and refuses an unreviewed change to a scenario's assertions. A separate contract, ess/provider-tracking, covers the SQLite read-verification policy and runs on Rust 1.91.

The libraries are hand-written Rust held to those contracts; they are not generated from them. The other crates — the providers, the command, MCP, the graph and surface projections — are held by their own tests. The checker is isolated from production dependencies: no shipped crate depends on ESS.

Entity definitions are a different format from ESS documents. An Entity Runtime definition is headed by entity: and version:; an ESS specification describes systems, domains, commands and components. ESS's own ess-entity-runtime lowering turns one component of a specification into Entity Runtime definitions, and ESS documents which constructs it can lower. This repository ships no ESS importer.