Files
buzz/crates
npub1cc3ha7z055mu0rwwu7806t2wt8mj3pvu0uv5mfp2c50dahaqhczshdalg6andTyler Longwell 38640dcfb2 feat(relay/audio): huddle cross-pod join coordinator + HuddleControl protocol
Adds the control plane for cross-pod huddle joins: the counterpart to the
media datagram fan-out in audio/mesh.rs. `resolve_join` decides which pod owns
a huddle (Redis fenced CAS lease is the arbiter; mesh membership is only a
hint) and returns a `JoinOutcome` the handler acts on — LocalOwner (admit
here) or RemoteOwner (register with the owning pod over HuddleControl).

Fencing is enforced on the join hop: a remote-owner outcome is validated
against the live lease via `validate_fenced_header` before routing, mapping
failures to typed MeshError variants (never media-drop semantics). The owner
re-validates on receipt — fencing at every hop.

Defines the HuddleControl payload schema (`HuddleControlMsg`, postcard) carried
opaquely in MeshStreamFrame::Data: RegisterPeer/PeerRegistered/RegisterRejected/
UnregisterPeer, with a fence-rejection taxonomy 1:1 with the media path's.

Dependency-injected via the `HuddleDirectory` trait (impl'd for
SessionDirectory) so the resolver is unit-tested without Redis. No touches to
state.rs/main.rs/routes — the handler.rs hook lands after the startup-wiring
lane adds `state.mesh()`. 8 tests; build + clippy clean.

Co-authored-by: Tyler Longwell <tlongwell@block.xyz>
Signed-off-by: Tyler Longwell <tlongwell@block.xyz>
2026-07-08 14:17:43 -04:00
..