Expand description
ergo_runtime
Purpose:
- Define the kernel-owned primitive ontology and the graph pipeline that
turns a
ClusterDefinitioninto anExecutionReport(expand → validate → execute).
Owns:
- The four primitive trait families (source/compute/trigger/action) and their manifest types.
CorePrimitiveCatalog,CoreRegistries, and the stdlib primitive implementations registered throughbuild_core.- Cluster expansion (
cluster::expand), validation (runtime::validate), and synchronous execution (runtime::execute_with_metadata). - Typed runtime errors (
RuntimeError,ExecError,ValidationError).
Does not own:
- The adapter contract, event binding, or runtime invoker handles
(owned by
ergo_adapter). - Episode scheduling, capture, or replay (owned by
ergo_supervisor). - Host orchestration, I/O realization, or product-facing error shaping.
Connects to:
ergo_adapter, which consumes catalogs/registries and re-exportsExecutionContextthrough its wrapper without redefining runtime meaning.ergo_supervisor, which drivesexecute_with_metadatathrough aRuntimeInvokerand records decisions independently of runtime state.
Safety notes:
- The runtime is synchronous and single-threaded by construction. No concurrency primitive appears anywhere in this crate; adding one is a semantic change to the kernel threading model.
CorePrimitiveCatalogandCoreRegistriesare build-once viabuild_core/CatalogBuilderand have no mutation API after construction; thepub(crate) fn register_*mutators are reachable only frombuild_from_inventory.- Three of the four primitive traits intentionally omit
Send + Syncat v1; tightening those bounds is tracked indocs/ledger/decisions/sdk-threading-send-sync.mdand would propagate structurally throughCoreRegistries,RuntimeState, and every*RuntimeHandle. - Primitive
computeacceptsOption<&mut PrimitiveState>but the executor always passesNone; statefulness is detected by capture/replay divergence rather than structural enforcement.