interplane.Get Omega
Read in your language

synapse

A component of the AienOS ecosystem.

Brought by drakestapleton

branch main Branches Tags History

synapse / crates / synapse-wire / src / lib.rs

34 lines · 1735 bytes Raw Blame History
1//! Synapse wire protocol (ADR 0003 section 8 crate `synapse-wire`, step G1).
2//!
3//! * [`frame`]: length-prefixed binary frames (hello, have, want, chunk, submit, accepted,
4//! refused) with one canonical encoding each, and an untrusted-input decoder that checks
5//! every declared length against a cap before it allocates or reads, and refuses anything
6//! else with a typed [`frame::WireRefusal`].
7//! * [`transport`]: framed connections over any reliable byte stream (Unix socket, TCP).
8//! * [`ring`]: a shared-memory ring for local agents (step G3, experiment X5): two
9//! single-producer, single-consumer rings in a sealed shared region, safe against a hostile
10//! peer, joined into a byte stream that carries the same frames.
11//! * [`session`]: have-want chunk negotiation (only blobs the server lacks cross the wire)
12//! and change submission authorised by a capability chain (step F1), admitted by the
13//! group-commit store and acknowledged once durable.
14//! * [`fuzz`]: the in-repository coverage-guided fuzzer for the frame decoder, with
15//! [`probe`] supplying the edge feedback.
16//! * [`testkit`]: deterministic fixtures for tests, the fuzz seed corpus, and benchmarks.
17
18pub mod frame;
19pub mod fuzz;
20pub mod probe;
21pub mod ring;
22pub mod session;
23#[cfg(all(target_os = "linux", target_pointer_width = "64"))]
24mod shm;
25pub mod testkit;
26pub mod transport;
27
28pub use frame::{
29 decode_frame, encode_frame, Frame, FrameBody, FrameKind, WireLimits, WireRefusal,
30 DEFAULT_MAX_FRAME_BODY, FRAME_HEADER_LEN,
31};
32pub use ring::{RingConfig, RingReceiver, RingRefusal, RingRegion, RingSender, RingStream, Side};
33pub use session::{ServerConfig, SubmitReport, WireClient, WireServer};
34pub use transport::FrameConn;