Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Fabric: mesh/

Reference · the fabric tier, crate by crate

Routing and registration: the daemon, the port protocol it speaks, the embedded hub it wraps, the Rust client, and the broadcast, health, schema and basket crates around them. The vocabulary crates the fabric registers against (the Lexicon, the context and capability registries) are the standard’s, under its pulse/ tier. See also mesh/README.md in the tree.

CratePurpose
mesh-basketBasket — SQLite-backed capture of every envelope the daemon publishes, with a small query DSL (channel, time-window, type and origin filters, aggregations, pagination) and a retention sweep. Queried by the pms-mcp tools and by tools/pms-query, and re-exported as dev_functions::basket so the dev ring keeps its historical path.
mesh-broadcastBroadcastRegistry — an in-process listener registry that fans out envelopes to callbacks matching a (NodeId, ListenFilter) pair, indexed by node and by type for fast dispatch.
mesh-clientThe Rust client for the daemon: Mesh, a synchronous handle over the Universal Port Protocol with endpoint discovery, timed calls, bounded queues in events and bytes, and callbacks on a thread of its own. It depends on mesh-port-protocol and the async stack only, so a program that only talks to a daemon compiles none of the daemon.
mesh-healthHealthRegistry — per-node heartbeat tracking with miss-count escalation: heartbeat() resets the miss counter, tick() advances it and returns transitions through Healthy → Warning → Restarting → Isolated. Degraded is a separate side-channel state, set explicitly via record_drift().
mesh-hubThe local daemon — binary name mesh-hub. Terminates the Universal Port Protocol over a Unix domain socket and WebSocket, bridging connections to mesh-hub-runtime::PulseHub. Runs until SIGINT/SIGTERM with graceful shutdown; it creates its shared-memory ring and store afresh at start and unlinks them at exit. Its flags are The mesh-hub daemon.
mesh-hub-runtimeThe embedded event bus the daemon wraps. PulseHub combines an EnvelopeStore (content-addressed persistence), a PulseRing (signaling), a SchemaRegistry + BroadcastRegistry (routing), and a HealthRegistry (liveness). Envelopes cross processes through the store: a hub that broadcasts an envelope stores it under its identifier and publishes a Pulse that names it.
mesh-module-hubPre-integration (ADR-0014): the daemon runs no module hub yet. ModuleHub — bridges a node’s internal processing to a parent PulseHub: collects inbound envelopes from a parent hub listener and provides an outbox for emitting results back upstream.
mesh-port-protocolThe Universal Port Protocol v0 wire types (ClientMessage, ServerMessage, FilterSpec, AckFields, ErrorCode and the default endpoints), shared by the daemon and the client so the protocol is defined exactly once and every type serialises in both directions. It also holds the port’s golden fixtures, fixtures/client.json and fixtures/server.json, written by the Rust types and held against the thin clients. Chapter 7 is its normative text.
mesh-schemaThe Schema Registry — a runtime ACL layer tracking which nodes may produce or consume which envelope types, and the check the hub runtime puts every broadcast envelope through: a schema governs the numeric type it is registered for, and a type name routes an envelope whose type has none. A sibling of the standard’s mesh-lex: mesh-lex is the published, content-addressed catalog; mesh-schema is one mesh’s runtime validation layer, which can be stricter or looser than what the catalog publishes.

mesh-hub is the only crate in this tier with a binary. Everything else here is a library, consumed either directly by the daemon (via mesh-hub-runtime) or by the dev ring’s dev-hub.