mod wire

module wire

Wire encoding of consensus traffic and decree payloads.

Functions

fn assign_seam_work(members: &[u32], left_basin: u64, right_basin: u64, decree_index: u64) -> Vec<ReplicaAssignment>

Allocate one deterministic wave across both sides of a landscape seam.

With no calibrated directional success probabilities, the minimax allocation balances launches across the two sides. Their seat counts differ by at most one; an odd seat alternates sides across snapshots. Rotating the sorted membership prevents a fixed replica from owning the same role for the whole campaign without introducing another random stream into the replicated state machine. Every assigned replica polls the coordinator’s stratified bridge, when one is commissioned.

fn decode_decree(bytes: &[u8]) -> Result<ExplorationDecree, capnp::Error>

Decode a decree payload.

fn decode_envelope(bytes: &[u8]) -> Result<(NodeId, NodeId, RaftMessage), capnp::Error>

Decode one consensus message.

fn encode_decree(decree: &ExplorationDecree) -> Vec<u8>

Encode a decree payload.

fn encode_envelope(from: NodeId, to: NodeId, message: &RaftMessage) -> Vec<u8>

Encode one consensus message between two brains.

Structs and Unions

struct ExplorationDecree

The decree payload: seam evidence and per-replica assignments.

algebraic_connectivity: f64

Second normalized-Laplacian eigenvalue behind the decree.

seam_conductance: f64

Conductance of the seam behind the decree.

left_basin: u64

Left representative basin.

right_basin: u64

Right representative basin.

assignments: Vec<ReplicaAssignment>

Assignments in replica order.

struct ReplicaAssignment

One replica’s marching orders inside an exploration decree.

replica: u32

Replica identifier.

right_side: bool

Seam side to work: false left, true right.

histogram_classes: Vec<u32>

Class indices of the histogram target.

histogram_masses: Vec<f64>

Normalized masses of the histogram target.

anchor_basin: u64

Anchor basin for boundary transport on the assigned side.

bridge_duty: bool

Whether the replica runs confined bridge segments.

decree_index: u64

Coordinator snapshot version retained under the wire field name.