Files
brahman/Cargo.toml
T
Sergio b3c3c00cf2 feat(nouser): Phase D — proveedor Nous mock + cliente remoto
Cierra el patrón "Nous como módulo aparte intercambiable": el contrato
del proveedor de embeddings vive en su crate, el mock determinístico
implementa ese contrato sirviéndolo por Unix socket, y nouser-core
sabe consumirlo remotamente. El switch mock↔real (futuro) será vía
priority_contexts en el broker.

Crates nuevos:

- crates/modules/nouser/nous: contrato compartido.
  - EmbedRequest { kind: { EmbedFile | EmbedText | Ping }, payload }.
  - EmbedFilePayload (path, ext, size, mtime), EmbedTextPayload.
  - EmbedResponse (embedding, model, elapsed_ms), PingResponse,
    ErrorResponse.
  - Wire: line-delimited JSON sobre Unix socket, single-shot.
  - Constants FLOW_EMBED_REQUEST, FLOW_EMBED_RESULT, FLOW_TYPE_NAME.
  - transport::default_socket_path con env NOUSER_NOUS_SOCKET.

- crates/modules/nouser/nous-mock: bin nouser-nous-mock.
  - Sidecarea a brahman-init con Card kind=Ente declarando los flows
    embed-request/embed-result + priority_contexts.test = +1.
  - Bind del socket Nous + accept loop tokio.
  - EmbedFile delega a nouser_core::embed::embed (Phase C).
  - Modelo: "mock-pseudo-32d".

Cambios:

- nouser-core: dep nueva nouser-nous. Subcomando attract --remote
  abre un UnixStream blocking, envía EmbedRequest, lee response.
  Imprime "embed: local|remote" para ver cuál ruta corrió.

Bug encontrado y corregido:
- ContextBias tenía #[serde(skip_serializing_if = ...)] en sus campos.
  Postcard NO soporta skip-condicional en formatos no self-describing:
  el serializer omitía bytes que el deserializer esperaba, rompiendo
  la wire de cualquier Card con priority_contexts poblada.
  Síntoma: "postcard decode: Hit the end of buffer" en el server,
  "early eof" en el cliente.
- Fix: removidos los skip_serializing_if de ContextBias. JSON pretty
  ahora emite {"pin_to": null, "priority_offset": 0} pero el wire
  funciona. Trade-off aceptado.
- Test wirecard_postcard_with_priority_contexts en brahman-card que
  ejercita el roundtrip postcard con biases poblados.

Validación end-to-end:
  $ ente-zero & nouser-nous-mock & nouser daemon crates/core
  $ brahman-status
  Sessions (7):
    [ente] nouser.nous_mock      flows: embed-request, embed-result
    [ente] brahman.nouser_engine
    [data] src   summary: 6 archivos en crates/core/brahman-handshake/src
    [data] graph summary: 7 archivos en crates/core/ente-zero/src/graph
    ...
  $ nouser attract --remote crates/core <archivo>.rs
    embed: remote
    🧲  0.9058  src  ...
  (mock log: embed_file path=...)

Tests: 75. cargo check --workspace: 0 errores, 0 warnings.

Próximo natural: Phase D-2 — real-nous con ONNX/Llama text-embedding.
Declara la misma Card con priority_contexts.prod = +1 y el swap es
transparente para el consumer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 18:49:25 +00:00

195 lines
6.5 KiB
TOML

[workspace]
resolver = "2"
members = [
# ============================================================
# core/ — Init y compat (arje absorbido)
# ============================================================
"crates/core/brahman-card",
"crates/core/brahman-card-wit",
"crates/core/brahman-handshake",
"crates/core/brahman-broker",
"crates/core/brahman-admin",
"crates/shared/brahman-sidecar",
"crates/core/ente-card",
"crates/core/ente-bus",
"crates/core/ente-cas",
"crates/core/ente-kernel",
"crates/core/ente-soma",
"crates/core/ente-wasm",
"crates/core/ente-snapshot",
"crates/core/ente-brain",
"crates/core/ente-zero",
"crates/core/ente-echo",
"crates/core/ente-policy-provider",
"crates/core/ente-logind-compat",
"crates/core/ente-hostnamed-compat",
"crates/core/ente-timedated-compat",
"crates/core/ente-localed-compat",
"crates/core/ente-journald-compat",
"crates/core/ente-resolved-compat",
"crates/core/ente-polkit-compat",
"crates/core/ente-machined-compat",
"crates/core/ente-tmpfiles-compat",
"crates/core/ente-systemd1-compat",
"crates/core/ente-notify-compat",
"crates/core/ente-binfmt-compat",
"crates/core/ente-timer-compat",
# ============================================================
# modules/semantic_dht/ — DHT semántico (minga absorbido)
# ============================================================
"crates/modules/semantic_dht/minga-core",
"crates/modules/semantic_dht/minga-store",
"crates/modules/semantic_dht/minga-p2p",
"crates/modules/semantic_dht/minga-vfs",
"crates/modules/semantic_dht/minga-cli",
# ============================================================
# modules/ui_engine/ — Motor de widgets (yahweh libs+widgets)
# ============================================================
"crates/modules/ui_engine/libs/core",
"crates/modules/ui_engine/libs/theme",
"crates/modules/ui_engine/libs/bus",
"crates/modules/ui_engine/libs/providers/fs",
"crates/modules/ui_engine/libs/providers/sqlite",
"crates/modules/ui_engine/widgets/tree",
"crates/modules/ui_engine/widgets/container_core",
"crates/modules/ui_engine/widgets/splitter",
"crates/modules/ui_engine/widgets/tabs",
"crates/modules/ui_engine/widgets/tiled",
"crates/modules/ui_engine/widgets/text_input",
# ============================================================
# modules/nakui/ — ERP matemático (nakui absorbido)
# ============================================================
"crates/modules/nakui/core",
# ============================================================
# modules/nouser/ — explorador de Mónadas (nuevo)
# ============================================================
"crates/modules/nouser/card",
"crates/modules/nouser/core",
"crates/modules/nouser/nous",
"crates/modules/nouser/nous-mock",
# ============================================================
# apps/ — apps que consumen el protocolo (yahweh modules+shell)
# ============================================================
"crates/apps/file_explorer",
"crates/apps/database_explorer",
"crates/apps/text_viewer",
"crates/apps/image_viewer",
"crates/apps/yahweh-shell",
]
[workspace.package]
version = "0.1.0"
edition = "2021"
rust-version = "1.80"
license = "MIT OR Apache-2.0"
authors = ["Brahman Contributors"]
publish = false
repository = "https://example.invalid/brahman"
[workspace.dependencies]
# === Serialización ===
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde-big-array = "0.5"
postcard = { version = "1", features = ["use-std"] }
toml = "0.8"
bincode = "1"
base64 = "0.22"
# === Errores ===
thiserror = "2" # bump uniforme; arje (era 1) puede requerir ajustes menores
anyhow = "1"
# === Async ===
tokio = { version = "1", features = ["full"] }
tokio-util = { version = "0.7", features = ["compat"] }
async-trait = "0.1"
futures = "0.3"
# === Observabilidad ===
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
# === Linux primitives (arje) ===
nix = { version = "0.29", features = ["signal", "process", "sched", "mount", "fs", "socket", "net", "user"] }
libc = "0.2"
# === IDs / Hash / Crypto ===
ulid = { version = "1", features = ["serde"] }
uuid = { version = "1", features = ["v4"] }
sha2 = "0.10"
blake3 = "1.5"
ed25519-dalek = "2"
aes-gcm = "0.10"
argon2 = "0.5"
rand = "0.8"
# === WASM (arje) ===
wasmi = "0.40"
wat = "1"
# === Storage / DB ===
sled = "0.34"
rusqlite = { version = "0.31", features = ["bundled", "blob"] }
# === P2P (minga) ===
libp2p = { version = "0.56", features = ["tokio", "tcp", "noise", "yamux", "macros", "kad", "identify"] }
libp2p-stream = "=0.4.0-alpha"
# === Code parsing (minga) ===
tree-sitter = "0.24"
tree-sitter-rust = "0.23"
# === FS notify ===
notify = "6.1"
# === CLI / auth (minga) ===
clap = { version = "4", features = ["derive"] }
rpassword = "7"
# === D-Bus (arje compat) ===
zbus = { version = "4", default-features = false, features = ["tokio"] }
# === Tests ===
tempfile = "3"
# === GPUI (yahweh) ===
gpui = "0.2"
# === Filesystem helpers ===
directories = "5"
# ============================================================
# Intra-workspace deps de yahweh (referenciadas por workspace = true)
# ============================================================
yahweh-core = { path = "crates/modules/ui_engine/libs/core" }
yahweh-theme = { path = "crates/modules/ui_engine/libs/theme" }
yahweh-bus = { path = "crates/modules/ui_engine/libs/bus" }
yahweh-provider-fs = { path = "crates/modules/ui_engine/libs/providers/fs" }
yahweh-provider-sqlite = { path = "crates/modules/ui_engine/libs/providers/sqlite" }
yahweh-widget-tree = { path = "crates/modules/ui_engine/widgets/tree" }
yahweh-widget-container-core = { path = "crates/modules/ui_engine/widgets/container_core" }
yahweh-widget-splitter = { path = "crates/modules/ui_engine/widgets/splitter" }
yahweh-widget-tabs = { path = "crates/modules/ui_engine/widgets/tabs" }
yahweh-widget-tiled = { path = "crates/modules/ui_engine/widgets/tiled" }
yahweh-widget-text-input = { path = "crates/modules/ui_engine/widgets/text_input" }
yahweh-file-explorer = { path = "crates/apps/file_explorer" }
yahweh-database-explorer = { path = "crates/apps/database_explorer" }
yahweh-text-viewer = { path = "crates/apps/text_viewer" }
yahweh-image-viewer = { path = "crates/apps/image_viewer" }
[profile.release]
lto = "thin"
codegen-units = 1
strip = "symbols"
panic = "abort"
[profile.dev]
opt-level = 0
debug = true