diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..8a5c165 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,152 @@ +# Changelog + +Registro cronológico de cambios sustantivos en el monorepo Brahman. Cada +entrada lista las acciones concretas tras un commit; para detalles de +ratio/diff ver `git show `. + +## 2026-05-08 + +### `8a83a26` feat(handshake): notificación push de matches +- Frame `MatchEvent { kind: Available | Lost, ... }` añadido al protocolo. +- `Session::run_post_handshake` usa `tokio::select!` para multiplexar + reads del cliente y un canal `mpsc` push del server. +- Server: `SessionTxTable` (Arc>>>) + y `LastMatches` para diff por sesión. `broadcast_match_diffs` corre + tras cada `register` y `unregister`, emite sólo los cambios. +- Capacity del canal push: 32 (ephemeral, `try_send` non-blocking). +- Client: `VecDeque` interno, `take_event()` (non-blocking) + y `await_event(timeout)`. `ping()` ahora drena MatchEvents intermedios + hasta encontrar el Pong. +- Example `crates/core/brahman-handshake/examples/subscriber.rs`. +- Test `match_event_pushed_on_producer_arrival` (handshake integ 6→7). + +### `70a7a0d` feat: segundo módulo (nakui) + admin API + brahman-status +- Crate nuevo `crates/shared/brahman-sidecar` (DRY del thread + tokio + + ping loop). API: `spawn(card)` / `spawn_with_handle(config)`. +- `nakui` cmd_run llama `brahman_sidecar::spawn` antes de `run_server`. + Card: lifecycle Daemon, supervision Restart, flow `command` (json) / + `report` (json). +- Crate nuevo `crates/core/brahman-admin` con `StatusSnapshot` JSON + line-delim, `AdminServer` y `client::query`. +- ente-zero levanta también el AdminServer en `primordial_loop`. +- Example `crates/shared/brahman-sidecar/examples/presence.rs` + (módulo dummy long-lived parametrizable por label). +- Example `crates/core/brahman-admin/examples/brahman-status.rs` + (CLI que pretty-printa el snapshot). +- `brahman-broker`: `BrokeredCard` ahora incluye `lifecycle`. `Endpoint` + y `Match` derivan `Serialize`/`Deserialize`. Nuevo `Broker::cards()` + iterador. +- `brahman-card`: `pub use ::ulid` para que módulos no dependan de ulid. +- yahweh-shell migrado al sidecar compartido (96→53 LOC). + +### `595f68e` feat(yahweh-shell): primer módulo brahman vivo +- yahweh-shell spawnea sidecar antes de `Application::new()`. +- Card declarada: label `brahman.ui_engine`, lifecycle Widget, + supervision Delegate, payload Virtual, flow input `render-data` + (json) / output `user-intent` (json). +- Sidecar en thread aparte con tokio current_thread runtime, + desacoplado del runtime GPUI. + +### `df9d10c` feat(ente-zero): enchufa el handshake server al Init real +- ente-zero levanta `brahman_handshake::server::Server::bind` en + `primordial_loop` después del ente-bus, con degradación grácil + si bind falla (mismo patrón que uevents). +- Nuevo módulo `brahman-handshake/src/transport.rs`: helper + `default_socket_path()` con resolución `BRAHMAN_INIT_SOCKET` → + `XDG_RUNTIME_DIR` → `TMPDIR`. +- Example `crates/core/brahman-handshake/examples/probe.rs`. +- Validación end-to-end manual: probe contra ente-zero vivo + imprime `HelloAck: session=... init_attached=true`. + +### `07d77a3` feat(handshake): integra el broker con el ciclo de sesiones +- `ServerConfig` acepta `Option>>`. +- `register_session` indexa la Card en el broker y la `SessionRegistry` + antes de emitir HelloAck. +- `Session::handle` refactor a `do_handshake → run_post_handshake → + cleanup` con cleanup unificado (broker + sessions). +- Tests integ nuevos: `broker_registers_and_unregisters_with_session` + y `broker_matches_two_live_modules`. +- Fix colateral: `brahman-card::TypeRef` pasa de internally-tagged + (`#[serde(tag = "kind")]`) a externally-tagged. Postcard no soporta + internally-tagged en formatos no self-describing. JSON cambia de + `{"kind":"primitive","name":"x"}` a `{"primitive":{"name":"x"}}`. + +### `5091106` feat(core): brahman-broker — matching híbrido +- Crate nuevo `crates/core/brahman-broker`. +- 3 estrategias de matching: `Exact`, `Structural`, `ExactThenStructural` + (default). Devuelven `Match::via` con la estrategia que ganó. +- Override `pin_to`: el consumer pide un productor por label; si la + pista no resuelve, cae en type-search. +- Tiebreak por `Card.priority` desc, luego `label` asc (estable y + determinista). +- API: `register`, `unregister`, `find_producer_for`, `all_matches`, + `cards`, `sessions`, `len`, `is_empty`. +- 11 tests (matching, pin_to, priority, no-self-loops, all-matches). + +### `814390f` feat(core): brahman-handshake — protocolo runtime +- Crate nuevo `crates/core/brahman-handshake` con server y client + Rust↔Rust sobre Unix socket. +- Frames length-prefixed (4 bytes LE) + cuerpo postcard. +- Mensajes: `Hello`, `HelloAck`, `Ping`, `Pong`, `Farewell`, `Error`. +- `MAX_FRAME_BYTES = 4 MiB` para evitar reservas absurdas. +- Tradeoff: drop `extensions`/`extra` de Card por incompat + postcard ↔ `serde_json::Value`. Forward-compat queda en + `schema_version` + `protocol_version` negotiation. +- 4 tests integ + 1 unit en codec. + +### `ed0e973` refactor(arje): migra ente-card a re-export de brahman-card +- `ente-card/src/lib.rs` reescrito como crate-shim de re-export + (327 LOC → 25 LOC). +- `EntityCard` ≡ `brahman_card::Card` por type alias. +- `ente-card/Cargo.toml`: deps reducidas a `brahman-card`. +- `Card` impl `Default` (Ulid::nil(), label vacío) para que + `..Default::default()` funcione en struct-literals. +- 4 sitios en `ente-zero/src/seed.rs` actualizados con + `..Default::default()` para los campos aditivos. +- Los 21 consumidores arje compilan sin tocar fuente. + +### `0feba74` feat(core): brahman-card — Tarjeta canónica híbrida +- Crate nuevo `crates/core/brahman-card`. +- Hereda de arje: `id: Ulid`, `lineage`, `Capability` tipado, + `Payload::{Wasm, Native, Virtual, Legacy}`, `SomaSpec` + (namespaces, cgroups, rlimits, cpu_affinity), `Supervision` + (Restart con backoff, OneShot, Delegate), `genesis` recursivo. +- Aditivo brahman: `Permissions` enumerados (`NetworkingPolicy`, + `FsPolicy`, `IpcPolicy`), `Lifecycle` ortogonal a Supervision, + `Priority` de scheduling, `Flows` con `TypeRef` discriminado + (Primitive | Wit), `pin_to` opcional. +- `TrustLevel` derivado de `Permissions` (no declarado). +- `ResolvedCard { card, wit: Option, trust }`. +- Soporta JSON (canónico) + TOML (auto-detectado por extensión). +- 8 tests incluido `arje_seed_format_compatible` que valida que + el JSON de arje sigue parseando con defaults para los aditivos. + +### `4d50bfc` chore: absorbe nakui (ERP matemático) en modules/nakui +- `~/nakui` → `crates/modules/nakui/{core,modules}`. +- `core/`: el crate `nakui-core` con 4 bins (nakui, demo, + inventory_demo, sales_demo) y tests. +- `modules/{inventory,sales,treasury}/`: data declarativa + (`nsmc.json`, `schema.k`, `morphisms/`) que el crate consume. + No son crates Cargo. +- Deps directas (no `workspace = true`): thiserror v1, surrealdb, + rhai, petgraph. No conflicto con el resto del workspace. + +### `53dbdf0` chore: monorepo inicial con arje + minga + yahweh absorbidos +- 45 crates absorbidos en 4 ejes: + - `crates/core/`: 24 crates de arje (Init systemd-compatible: + `ente-card`, `ente-zero`, `ente-kernel`, `ente-bus`, `ente-cas`, + `ente-soma`, `ente-wasm`, `ente-snapshot`, `ente-brain`, + `ente-echo`, `ente-policy-provider`, + 12 `*-compat`). + - `crates/modules/semantic_dht/`: 5 crates de minga (`minga-core` + con AST/CAS/MST, `minga-p2p` con libp2p Kad, `minga-store`, + `minga-vfs`, `minga-cli`). + - `crates/modules/ui_engine/`: 11 crates de yahweh (libs/{core, + theme, bus, providers}, widgets/{tree, splitter, tabs, tiled, + container_core, text_input}). + - `crates/apps/`: 5 crates de yahweh (file_explorer, + database_explorer, text_viewer, image_viewer, yahweh-shell). +- `shared_wit/protocol.wit` con handshake/lifecycle inicial. +- `Cargo.toml` unificado: thiserror bumped a 2 (transparente para + arje), tokio "full", paths intra-workspace de yahweh redirigidos. +- `cargo check --workspace`: 0 errores (sólo dead-code warnings + preexistentes en ente-zero).