open-standards/joule-code/joule-code-rs/crates/joule-moq-relay/src/lib.rs
Transaction Science e3f79fa2be Merge TKD #420 (wai.media.takedown) into train/live-room
Relay, by meaning: the DVR store's module text keeps both the minors' room
(AGE) and the takedown (TKD) paragraphs; a session's object loop keeps CO4b's
floor and audience-input filtering and TKD's takedown track feeding the store;
tests/dvr.rs lists both rules. Shared lists kept both sides (workflow step
and path, CHANGELOG, REGISTRY, SPEC §5, live-conformance index and
provenance line, features, registry constants, lib.rs); export regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 03:43:14 -04:00

64 lines
3.3 KiB
Rust

//! **joule-moq-relay**: a MOQT relay for `draft-ietf-moq-transport-22`.
//!
//! - **Transports** ([`transport`]): native QUIC with ALPN `moqt-22` and WebTransport over
//! HTTP/3 (ALPN `h3`, the draft chosen by `WT-Available-Protocols`) on one UDP port;
//! and a WebSocket fallback that carries the same MOQT streams as
//! `draft-ietf-webtrans-http2-15` capsules, one to each message, for paths with no UDP.
//! - **Relay behaviour** ([`relay`], [`session`]): SETUP, namespace publication and
//! discovery (PUBLISH_NAMESPACE, SUBSCRIBE_NAMESPACE with NAMESPACE and
//! NAMESPACE_DONE), PUBLISH, SUBSCRIBE served from an upstream subscription the relay
//! holds or makes, RENDEZVOUS_TIMEOUT, FETCH and fills served from the cache or
//! upstream, TRACK_STATUS, REQUEST_UPDATE, GOAWAY on shutdown, Request ID rules and
//! MAX_REQUEST_UPDATES, request concurrency by stream limits, the authorization-token
//! alias cache ([`auth`]).
//! - **Fan-out** ([`sched`]): each downstream session's objects go out in §5.1.2's order
//! (subscriber priority, publisher priority, group order), with each subscriber's
//! delivery timeouts applied at this hop. Receipts tracks carry no timeout, so the
//! receipts of every dropped object still reach a subscriber of its receipts track.
//! - **Receipts at the door** ([`door`]): optional per namespace, with `joule-moq`'s
//! verifier.
//! - **Session summaries** ([`summary`]): bytes and objects per subscriber, signed by the
//! relay at session end; its own energy is reported as unmetered, since no meter backs
//! it.
//! - **Per-hop session records** ([`metering`]): WAI's `WMH1` record of a room
//! (`live-metering.md` §3), signed by the relay from its summaries: per track the
//! objects and bytes in and out and the drops by reason, its subscribers' time by layer
//! class, the events it delivered, and a ledger of the room grants its sessions ran under.
//! With a DVR store it signs version 2, with the store's figures (§3.9).
//! - **DVR** ([`dvr`]): a window of the tracks under each configured prefix, with their
//! receipts, on disk, served to FETCH below the live edge (WAI `live-recording.md` §8):
//! evicted oldest first by whole group, kept across a restart with every object checked
//! again against its receipt, decisions of the room's moderators (read from its events
//! tracks, [`events`]) withholding what they deny or redact, and a FETCH that seeks back
//! served only to a grant with the seek power (WAI `live-rooms.md` §10.6).
//! - **The floor** ([`floor`]): each room's turn schedules and handovers, read from its
//! events tracks; a media object published out of turn under a schedule that refuses is
//! not forwarded (WAI `co-performance.md` §6).
//!
//! [`server::RelayServer`] binds the listeners; [`client::Client`] is a small client for
//! the tests and for tools.
pub mod auth;
pub mod cache;
pub mod cert;
pub mod client;
pub mod config;
pub mod door;
pub mod dvr;
pub mod events;
pub mod floor;
pub mod metering;
pub mod ratings;
pub mod relay;
pub mod sched;
pub mod server;
pub mod session;
pub mod summary;
pub mod takedown;
pub mod transport;
pub mod wire;
pub use config::RelayConfig;
pub use relay::{Relay, RelayStats};
pub use server::RelayServer;
pub use summary::{SessionSummary, SignedSessionSummary};