| Authority | CANONICAL |
|---|---|
| Version | v1 |
| Last Updated | 2026-03-16 |
| Owner | Sebastian (Architect) |
| Scope | Current v1 system architecture, authored artifacts, and runtime roles |
| Change Rule | Operational log |
This document explains the current v1 system design directly.
Read this file when you want to understand what Ergo is today without reconstructing the model from decision records.
Users author five semantic artifact kinds inside a project that also
contains Cargo.toml, ergo.toml, fixtures, and captures:
- Implementations Concrete Source, Compute, Trigger, and Action implementations.
- Graphs Cluster/graph compositions that wire implementations together.
- Adapters Declarative contracts for context, events, and accepted effect kinds.
- Ingress channels Prod boundary code that delivers external events into host execution.
- Egress channels Prod boundary code that receives effect intent from host and performs true external I/O.
Projects may also contain fixtures and capture artifacts, but those are operational inputs/outputs rather than authored semantic components.
The intended primary product surface is the Rust SDK layer over host + loader.
In practice that means:
- a production Ergo application is a Rust crate
- user code registers custom primitives in-process
- filesystem named profiles live in
ergo.toml, and the SDK also supports named in-memory profiles - CLI remains supporting tooling for validation, replay, and explicit path-based runs
The SDK crate itself now lives at
crates/prod/clients/sdk-rust, and the engine architecture exposes it
cleanly through the host + loader library boundaries. ergo init
provides Rust-crate scaffolding and generated sample-project UX on top
of that surface.
Ergo's current execution model distinguishes five runtime-facing roles:
- Action Emits effect intent from graph execution.
- Adapter Declares the accepted external contract.
- Host Runs canonical orchestration, drains post-episode effects, and manages capture/replay.
- Ingress channel Brings external events into host execution.
- Egress channel Takes effect intent out of host execution to real external systems.
The important separation is:
- Adapters are declarative contracts
- Host is the orchestration and dispatch locus
- Ingress and egress channels are prod I/O realizations
The live canonical path is:
ingress channel -> host -> graph executes -> host dispatches -> egress channel
In more detail:
- An ingress channel produces
HostedEvent. - Host validates/binds the event through the adapter contract when the run is adapter-bound.
- The graph executes through kernel/runtime semantics.
- Actions emit effect intent.
- Host drains buffered effects after the episode.
- Host realizes host-internal effects locally and routes external effect kinds to egress channels.
- Egress channels return durable-accept acknowledgments for dispatched external intents.
- Host writes a capture artifact for replay and audit.
Action effects now have two distinct projections:
- Host-internal projection
effects.writesandmirror_writesproject into the host-internalset_contexteffect kind. - External projection
effects.intentsproject into real external effect kinds such asplace_order.
One Action may therefore emit:
- only
set_context - only external intent kinds
- both internal and external projections in the same attempt
When both exist, host-internal set_context projection precedes
external intent projection.
Replay is capture-driven.
- Host-internal effects may be replay-realized when needed for deterministic reconstruction.
- Truly external effects are re-derived and verified against captured effect/intention integrity.
- Truly external effects are not re-executed against live systems during replay.
Adapter and runtime provenance are replay-strict.
Egress provenance is currently audit-only for replay: it is stored for traceability but does not gate strict replay success.
The current v1 shape still has a few explicit limits:
- Canonical host run intentionally supports one ingress channel per run. Projects that need many live feeds must multiplex them upstream into one ingress channel.
- Egress routing is configured through
EgressConfigand current path-based runs often pass--egress-config; project-mode resolution now exists through the shared loader + SDK surface. - Rust-crate scaffolding now exists through
ergo init; optional future CLI project conveniences remain secondary to the SDK-first path. - The scaffolded sample ingress and egress channel programs now target
Python 3 instead of POSIX shell. Projects still need a local
python3command available for the generated live-profile examples.
These are current product-surface limits, not hidden semantic gaps.