1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! ergo_runtime
//!
//! Purpose:
//! - Define the kernel-owned primitive ontology and the graph pipeline that
//! turns a `ClusterDefinition` into an `ExecutionReport` (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 through `build_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-exports
//! `ExecutionContext` through its wrapper without redefining runtime
//! meaning.
//! - `ergo_supervisor`, which drives `execute_with_metadata` through a
//! `RuntimeInvoker` and 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.
//! - `CorePrimitiveCatalog` and `CoreRegistries` are build-once via
//! `build_core` / `CatalogBuilder` and have no mutation API after
//! construction; the `pub(crate) fn register_*` mutators are reachable
//! only from `build_from_inventory`.
//! - Three of the four primitive traits intentionally omit `Send + Sync`
//! at v1; tightening those bounds is tracked in
//! `docs/ledger/decisions/sdk-threading-send-sync.md` and would propagate
//! structurally through `CoreRegistries`, `RuntimeState`, and every
//! `*RuntimeHandle`.
//! - Primitive `compute` accepts `Option<&mut PrimitiveState>` but the
//! executor always passes `None`; statefulness is detected by
//! capture/replay divergence rather than structural enforcement.
pub const RUNTIME_VERSION: &str = env!;