running_process/broker/mod.rs
1//! v1 broker module — schemas are FROZEN FOREVER once v1.0 ships.
2//!
3//! Phase 0 of #228: this module exposes the prost-generated wire types
4//! (envelope, manifest, service definition) for every later phase to
5//! depend on. No consumers ship yet — Phases 1+ wire them in.
6//!
7//! See `proto/broker_v1_*.proto` and the parent issue for the rationale
8//! behind every field number and `reserved` range.
9
10pub mod adopt;
11pub mod backend_handle;
12pub mod backend_lib;
13pub mod backend_lifecycle;
14pub mod backend_sdk;
15pub mod broker_http_discovery;
16pub mod broker_http_port;
17pub mod broker_http_server;
18pub mod broker_owned_bind;
19pub mod brokered_backend;
20pub mod builders;
21pub mod capabilities;
22pub mod client;
23pub mod client_v2;
24pub mod doctor;
25pub mod fs_health;
26pub mod get_http_endpoint_dispatch;
27pub mod host_identity;
28pub mod http_endpoint_registry;
29pub mod lifecycle;
30pub mod manifest;
31pub mod protocol;
32pub mod protocol_v2;
33pub mod secure_dir;
34pub mod server;
35
36/// Framing byte for every v1 broker connection. Wire layout:
37/// `[u8 framing_version=1][u32 LE body_length][prost body]`.
38///
39/// THIS BYTE is the truly-frozen-forever invariant — see #228
40/// "Frozen-forever commitments" section. A v2 client connecting to a
41/// v1 broker writes `[1][len][v2-shaped Hello]`; the v1 broker reads
42/// the framing byte and decides whether to decode or `Refused` with
43/// `ERROR_VERSION_UNSUPPORTED`.
44pub const FRAMING_VERSION_V1: u8 = 1;
45
46/// Hard ceiling on any single broker frame. Broker disconnects on
47/// overflow. See #228 "Wire-level commitments".
48pub const MAX_FRAME_SIZE_BYTES: usize = 16 * 1024 * 1024;
49
50/// Hard ceiling on the Hello envelope specifically. Broker returns
51/// `Refused` on overflow. See #228 "Wire-level commitments".
52pub const MAX_HELLO_SIZE_BYTES: usize = 64 * 1024;
53
54/// Upper bound on a LifecycleEvent's prost-encoded size, set to the
55/// minimum POSIX `PIPE_BUF` so atomic-append into the event log is
56/// guaranteed on every platform. Linux raises this to 4096 in practice,
57/// but the cross-platform floor is 512.
58pub const LIFECYCLE_EVENT_PIPE_BUF_FLOOR: usize = 512;