# runtime/ — Infraestructura de ejecución **Propósito.** Servicios cross-cutting que el Init y los módulos consumen: bus IPC interno, content-addressed storage, sandbox WASM, rule engine + audit log, y un ente de smoke test. ## Crates | crate | tipo | rol | | ------------- | ---- | ----------------------------------------------------------- | | `ente-bus` | lib | Unix SOCK_STREAM + postcard framing. Announce/Invoke/List | | `ente-cas` | lib | Content-addressed storage SHA-256: blobs Wasm + audit log | | `ente-wasm` | lib | Encarna `Payload::Wasm` vía `wasmi` en thread dedicado | | `ente-brain` | lib | Rule engine + observer estadístico + audit chain con CAS | | `ente-echo` | bin | Ente prueba — provee `Capability::Endpoint(echo)` | ## Dependencias - `ente-bus` ← `tokio` + `postcard`. Consumido por `init/ente-zero`. - `ente-cas` ← `sha2` + `sled`. Consumido por `ente-brain` (audit log) y `ente-wasm` (blobs). - `ente-brain` ← `ente-bus`, `ente-cas`. Consumido por Init para observabilidad estadística + reglas declarativas. ## Invariantes - Bus: framing length-prefixed, sin re-orden; un cliente=una sesión. - CAS: addresses inmutables; un blob = sha256(content) único. - Audit: cada evento del bus se hash-encadena al log en CAS. ## Estado LOC ~3.4K, tests parciales. Brain tiene 11 TODOs (reglas declarativas complejas pendientes). Ver `docs/changelog/runtime.md`.