soma-som-ring
Standalone ring execution engine for soma(som) — owns the cycle lifecycle (genesis + standard cycles) and provides the registration API for ring extensions.
What is this?
soma-som-ring is the ring execution engine in the soma(som) 2-crate foundation
set. It implements:
- The cycle lifecycle — genesis (boot) + standard cycles (continuous operation)
- The five extension relationships — BEFORE / THROUGH / AFTER / AROUND / WITHIN
- The command gateway —
RingCommandenvelope, dispatch, and schema validation - Boundary attestation — Ed25519-attested
CrossingRecordon every unit transition (canonical signing-input format per OPUS §8) - Federation — ring-to-ring crossing protocol via
FederationBridge - PassthroughProcessor — default no-op unit processor for testing and scaffolding
soma-som-ring sits at the Platform layer. Application-specific behaviour
(governance, command handlers, persistence backends) lives in the
Application layer above it.
Application layer — your ring-native application
│
▼
Platform layer (LGPL-3.0) — soma-som-ring <- THIS CRATE
│
▼
Foundation layer (LGPL-3.0) — soma-som-core
Getting started
[]
= "0.1"
= "0.1"
use TimingConfig;
use UnitId;
use ;
use Quad;
;
// 1. Construct the engine
let mut engine = new;
// 2. Register a processor for each unit
engine.set_processor;
engine.set_processor;
// 3. Run genesis (one-time ring boot)
let genesis_report = engine.genesis.expect;
assert!;
// 4. Run standard cycles
let cycle_report = engine.cycle.expect;
assert!;
The cycle model
Each standard ring cycle processes all units in ring order. For each unit:
| Phase | What happens |
|---|---|
| BEFORE | Registered BeforeRing extensions prepare the unit envelope |
| THROUGH | RingProcessor::process transforms FU.Data |
| AFTER | Registered AfterRing extensions observe the result |
| AROUND | AroundRing extensions wrap the whole unit execution |
| WITHIN | WithinRing extensions operate inside the processor call |
Extensions are registered via engine.register_extension(...). All five
relationships are optional — a ring with only a processor is valid.
Extension registration
use ;
use Tree;
;
// engine.register_before(Box::new(Auditor));
Registering lexicon providers enables vocabulary validation:
use ;
use ;
;
// engine.register_lexicon(Box::new(MyVocab))?;
register_lexicon returns Result<(), RegistrationError> — coordinate
mismatches are caught at registration time, not at runtime.
Public API
| Type | Where | Description |
|---|---|---|
RingEngine |
engine |
Core struct: runs genesis + standard cycles |
RingProcessor |
processor |
Trait: unit execution contract |
PassthroughProcessor |
passthrough |
Default: pass-through for tests + scaffolding |
CycleObserver / NoOpObserver |
engine |
Hook: observe each completed cycle |
GenesisReport |
engine |
Result type for engine.genesis() |
CycleReport |
engine |
Result type for engine.cycle() |
RingEngineError |
error |
Error enum covering all engine failure modes |
RingCommand |
command |
Command envelope: type + payload + actor |
ViewIntent |
command |
Read-side intent (query without mutation) |
CommandDispatcher |
dispatch |
Route commands to registered handlers |
FederationBridge |
federation |
Ring-to-ring crossing |
Architecture
soma-som-ring implements the soma(som) ring protocol. The deep architectural
reading lives in the ARC42 Solitaire Architecture Document at
docs/soma-som-ring-sad.md; the canonical
specification is the soma(som) v1.0 OPUS paper (State of Mind: A Circular Architecture for Human-Machine Integration).
Key design properties:
- Zero application-specific dependencies — no governance policy, no command handlers, no persistence backends. These belong in the Application layer.
soma-som-coreis the only inter-crate dependency — structural primitives live there; execution mechanics live here.- Boundary attestation inlined — crossing records are created inside the engine, not delegated to a separate crate.
- Governance traits injected — the seven §13.1 governance trait interfaces
(
AuthorizationProvider,AutonomyEvaluator, etc.) are defined insoma-som-corewith no-op defaults. Concrete policies live in the Application layer.
Dependencies
soma-som-core --> soma-som-ring --> your application
Runtime dependencies: soma-som-core, blake3, serde, serde_json.
No async runtime, no OS threads, no file I/O, no network. The engine is synchronous by design; the calling application manages concurrency.
Implementing RingProcessor
The RingProcessor trait is the minimum surface the engine drives:
use ;
use Quad;
use UnitId;
;
The input Quad carries the unit's FU.Data in its tree field. The output
Quad becomes the unit's OU.Data (and, for SU, feeds the next cycle's FU.Data).
Spec traceability — OPUS paper
| OPUS reference | What it covers |
|---|---|
| §2, §11 | Structural boundary: foundation primitives vs. execution mechanics |
| §3 | The five ring relationships |
| §8 | Crossing attestation: canonical signing-input format |
| §10 | Genesis protocol |
| §13.1 | The seven pluggable governance trait interfaces |
| Contracts §2.3 | The twelve crossings of the ring |
License
soma-som-ring is licensed under
LGPL-3.0-only.
Copyright 2025–2026 somasom.io
Contributing
See CONTRIBUTING.md and CODE_OF_CONDUCT.md.