354f992c63
Cierra el ciclo brahman-card-wit ↔ runtime: un módulo que tenga su .wit lo parsea, lo manda en Hello, y aparece como "consciente" en el broker y en brahman-status. Cambios coordinados (un solo commit por la cadena de tipos): - brahman-card::WitInterface deriva Serialize/Deserialize/Eq. - brahman-handshake::Hello lleva wit: Option<WitInterface> (#[serde(default)] para tolerar Hellos antiguos en formato JSON aunque postcard exige presencia explícita). - Server's register_session enruta a ResolvedCard::from_conscious cuando viene wit; from_agnostic cuando no. - Client::connect queda como wrapper de connect_with(path, card, wit: Option<WitInterface>) — backward-compatible. - Broker::register acepta Option<WitInterface> como tercer arg; BrokeredCard guarda el wit. 25 sitios de tests actualizados con `, None` (vía perl). - brahman-sidecar::SidecarConfig.wit + helpers SidecarConfig::with_wit y spawn_conscious(card, wit). Log attached reporta conscious=true|false. - brahman-status pretty-print con 🧠 + sección wit (package/world + imports + exports) por sesión consciente. - Example nuevo presence-conscious: parsea protocol.wit y se presenta consciente. Validación end-to-end manual: $ ente-zero & $ presence-conscious demo.conscious shared_wit/protocol.wit & $ brahman-status Sessions (1): 01K... demo.conscious 🧠 lifecycle=Daemon wit: brahman:protocol@0.1.0 / module imports: types, handshake, lifecycle exports: run Tests: 32/32 (broker 11 + card 8 + handshake codec+transport 2 + integ 7 + admin 0 + card-wit 4). Workspace: 0 errores. CHANGELOG.md actualizado. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
10 KiB
10 KiB
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 <sha>.
2026-05-08
feat(sidecar): WIT al sidecar — módulos conscientes vivos
brahman-card::WitInterfacederivaSerialize,Deserialize,PartialEq,Eqpara cruzar el wire postcard.brahman-handshake::Hellollevawit: Option<WitInterface>. Server usaResolvedCard::from_consciouscuando viene presente,from_agnosticcuando no.brahman-handshake::Client::connectqueda como wrapper agnóstico deconnect_with(path, card, wit: Option<WitInterface>).brahman-broker::Broker::registerahora tomaOption<WitInterface>como tercer arg.BrokeredCardguarda el wit. 25 sitios de tests actualizados con, None.brahman-sidecar::SidecarConfigcon campowit. Helpers nuevos:SidecarConfig::new(card).with_wit(wit)yspawn_conscious(card, wit). El logattachedreportaconscious=true|false.brahman-statusmuestra marker 🧠 + secciónwit:(package/world, imports, exports) por sesión consciente.- Example nuevo
crates/shared/brahman-sidecar/examples/presence-conscious.rs: toma label + path .wit (defaultshared_wit/protocol.wit), parsea con brahman-card-wit, spawna sidecar consciente. - Validado end-to-end:
$ presence-conscious demo.conscious shared_wit/protocol.wit & $ brahman-status Sessions (1): 01K... demo.conscious 🧠 lifecycle=Daemon wit: brahman:protocol@0.1.0 / module imports: types, handshake, lifecycle exports: run
feat(core): brahman-card-wit — extractor opcional de contratos WIT
- Crate nuevo
crates/core/brahman-card-witconwit-parser = "0.230". - API:
parse_wit(source)yparse_wit_file(path)devuelvenVec<WitInterface>(uno porworlddeclarado). - Interfaces importadas/exportadas (no sólo funciones) se resuelven
por nombre via
resolve.interfaces[id].name. - Example
crates/core/brahman-card-wit/examples/brahman-wit-info.rsCLI:brahman-wit-info shared_wit/protocol.wit→ lista paquete, worlds, imports y exports. - 4 tests: inline, archivo real (
shared_wit/protocol.wit), parse error, world vacío. - Validado contra
protocol.wit: detecta worldsmoduleyadmin-hostcon sus imports/exports correctos.
7b589b8 chore: agrega CHANGELOG.md retroactivo
CHANGELOG.mden la raíz con los 11 commits previos documentados acción por acción. A partir de este punto, cada cambio sustantivo actualiza también este archivo en el mismo commit.
8a83a26 feat(handshake): notificación push de matches
- Frame
MatchEvent { kind: Available | Lost, ... }añadido al protocolo. Session::run_post_handshakeusatokio::select!para multiplexar reads del cliente y un canalmpscpush del server.- Server:
SessionTxTable(Arc<Mutex<HashMap<SessionId, Sender>>>) yLastMatchespara diff por sesión.broadcast_match_diffscorre tras cadaregisteryunregister, emite sólo los cambios. - Capacity del canal push: 32 (ephemeral,
try_sendnon-blocking). - Client:
VecDeque<MatchEvent>interno,take_event()(non-blocking) yawait_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). nakuicmd_run llamabrahman_sidecar::spawnantes derun_server. Card: lifecycle Daemon, supervision Restart, flowcommand(json) /report(json).- Crate nuevo
crates/core/brahman-adminconStatusSnapshotJSON line-delim,AdminServeryclient::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:BrokeredCardahora incluyelifecycle.EndpointyMatchderivanSerialize/Deserialize. NuevoBroker::cards()iterador.brahman-card:pub use ::ulidpara 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 inputrender-data(json) / outputuser-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::bindenprimordial_loopdespué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: helperdefault_socket_path()con resoluciónBRAHMAN_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
ServerConfigaceptaOption<Arc<Mutex<Broker>>>.register_sessionindexa la Card en el broker y laSessionRegistryantes de emitir HelloAck.Session::handlerefactor ado_handshake → run_post_handshake → cleanupcon cleanup unificado (broker + sessions).- Tests integ nuevos:
broker_registers_and_unregisters_with_sessionybroker_matches_two_live_modules. - Fix colateral:
brahman-card::TypeRefpasa 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). DevuelvenMatch::viacon 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.prioritydesc, luegolabelasc (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-handshakecon 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 MiBpara evitar reservas absurdas.- Tradeoff: drop
extensions/extrade Card por incompat postcard ↔serde_json::Value. Forward-compat queda enschema_version+protocol_versionnegotiation. - 4 tests integ + 1 unit en codec.
ed0e973 refactor(arje): migra ente-card a re-export de brahman-card
ente-card/src/lib.rsreescrito como crate-shim de re-export (327 LOC → 25 LOC).EntityCard≡brahman_card::Cardpor type alias.ente-card/Cargo.toml: deps reducidas abrahman-card.CardimplDefault(Ulid::nil(), label vacío) para que..Default::default()funcione en struct-literals.- 4 sitios en
ente-zero/src/seed.rsactualizados 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,Capabilitytipado,Payload::{Wasm, Native, Virtual, Legacy},SomaSpec(namespaces, cgroups, rlimits, cpu_affinity),Supervision(Restart con backoff, OneShot, Delegate),genesisrecursivo. - Aditivo brahman:
Permissionsenumerados (NetworkingPolicy,FsPolicy,IpcPolicy),Lifecycleortogonal a Supervision,Priorityde scheduling,FlowsconTypeRefdiscriminado (Primitive | Wit),pin_toopcional. TrustLevelderivado dePermissions(no declarado).ResolvedCard { card, wit: Option<WitInterface>, trust }.- Soporta JSON (canónico) + TOML (auto-detectado por extensión).
- 8 tests incluido
arje_seed_format_compatibleque 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 cratenakui-corecon 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-corecon AST/CAS/MST,minga-p2pcon 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.witcon handshake/lifecycle inicial.Cargo.tomlunificado: 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).