feat(sandokan-local): B1.2 — LocalEngine

Primera implementación del trait Engine: orquestación in-process.

- LocalEngine encarna Cards vía arje-incarnate, mantiene un registro
  HashMap<Ulid, Entity> de entidades activas.
- run()       — incarnate + registro; mergea env del contexto.
- stop()      — SIGTERM + período de gracia + SIGKILL + reap.
- list()      — reaping perezoso (waitpid WNOHANG) + handles activos.
- status()    — reaping perezoso + LifecycleState.
- telemetry() — lee /proc/<pid>/status (VmRSS + Threads), sin invocar
                binarios externos.
- Reaping sin task de fondo: cada consulta hace waitpid WNOHANG.

proc.rs: lectura directa de procfs (mem_bytes, thread_count, proc_exists).

4 tests verdes (2 proc + 2 engine: empty list, NotFound paths).
cargo check --workspace verde.

v1: IsolationLevel es advisory (Sealed reservado para cuando el Intent
transporte rootfs spec). CPU% pendiente (requiere 2 samples).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
sergio
2026-05-20 13:57:26 +00:00
parent af5d4a1f22
commit cba3a9dd6e
5 changed files with 325 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
[package]
name = "sandokan-local"
description = "LocalEngine: implementación in-process del orquestador sandokan. Encarna Cards vía arje-incarnate, trackea lifecycle, reaping."
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
publish.workspace = true
[dependencies]
sandokan-core = { path = "../sandokan-core" }
sandokan-lifecycle = { path = "../sandokan-lifecycle" }
arje-incarnate = { path = "../../init/arje-incarnate" }
brahman-card = { path = "../../protocol/brahman-card" }
async-trait = { workspace = true }
tokio = { workspace = true }
nix = { workspace = true }
ulid = { workspace = true }