Expand description
Chat over the SocialWebNet mesh — bridge the chat-graph engine to peer tunnels.
Chat already has a serializable message (RelayEnvelope), a
signer, and a transport-agnostic apply path
(apply_incoming_envelope). Today those ride the
HTTP relay; this module routes them over the mesh instead — peer-to-peer, no relay server.
It composes two lower layers:
crate::mesh_channel::ReliableEndpoint— per-peer at-least-once delivery + dedup over the (lossy) datagram transport.- CBOR-encoded
RelayEnvelopeas the CHAT-port payload.
Like mesh_channel, ChatMeshBridge is a pure state machine: it produces frames to send
and envelopes delivered, but performs no socket I/O and touches no storage. The caller moves the
frames with SocialWebNet::send_datagram(peer, ports::CHAT, ports::CHAT, frame) and applies each
delivered envelope with crate::chat_relay::apply_incoming_envelope. This keeps the routing
logic deterministically testable (two bridges exchanging a real envelope, with loss) and decoupled
from the live mesh runtime, which lives in qualia-core-db.
Structs§
- Chat
Mesh Bridge - Per-peer reliable chat routing over the mesh. One bridge per node; it holds a
ReliableEndpointper peer DID. - Inbound
Chat - The result of feeding one inbound frame to the bridge.
- OutFrame
- A reliable-channel frame destined for a specific peer. The caller frames it as a mesh datagram on
ports::CHATand sends it topeer_did.
Functions§
- decode_
envelope - Decode a CHAT-port payload back into a chat envelope.
Noneif it is not a valid CBOR envelope. - encode_
envelope - CBOR-encode a chat envelope for the CHAT-port payload.