Repository navigation
refactor!: rebuild on moq main with moq-ext crates and access policies - #94
Merged
Merged
Conversation
This was referenced Nov 12, 2026
Moves the moq family (hang, moq-net, moq-mux, moq-json, moq-audio, moq-video, moq-auth, moq-relay, moq-tokio, kio) from the crates.io releases to moq-dev/moq main at rev 6aa4f9c1c, and iroh to 1.4.1, with egui and eframe at 0.37. The rev is pinned in the workspace manifest and Cargo.lock, with no [patch] block. Adds moq-transport-iroh, the first piece of the replacement for iroh-moq: a moq-net session over an iroh connection, with no knowledge of nodes, policies or media. Higher layers build on it in the following commits. The old crate stack (iroh-moq, iroh-rooms, moq-media, moq-media-egui, moq-media-android) cannot build against moq main, so it and its dependents (iroh-live, iroh-live-cli, iroh-live-relay and the demos) leave the workspace here and come back as each one is ported. Breaking: the moq dependency is a git rev rather than a release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds moq-ext-access, which says who may do what on a moq node without linking a transport or iroh: a Grant of subscribe and publish patterns, the SessionRequest a peer opens with, an Audience generic over the peer id, the Layout path convention, and composable policies (Open, Closed, from_fn, filter, Queue for application decisions, Verify for tokens). The optional jwt and rcan features add token verifiers and a token writer. Keeping this apart from the node lets relays and other tools share the same rules, and keeps the JWT and crypto stack out of default builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds iroh-live-node, the successor to iroh-moq. A Node publishes broadcasts at paths and subscribes to paths over one route table fed by every link it has: direct iroh sessions with peers and moq relays it is attached to. A path resolves to its cheapest route, and when that route dies moq moves to another route of the same instance without ending the subscription. The node also covers admission through a moq-ext-access policy (with re-authorization at token expiry), presets for the iroh endpoint (MoqPreset), tickets, latest-value JSON tracks, and the link rate signals the player adapts to. Also adds moq-ext-adaptive, which the node's network samples feed: pure state machines for rendition choice (Bound, choose), decoder backoff and decoder handover, with no I/O, so tests drive them with a fake clock. Breaking: replaces the iroh-moq API. Applications choose paths and policies explicitly; there are no per-session grants or admission modes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds iroh-live-rooms, the successor to iroh-rooms, built on iroh-live-node. A room is a gossip topic whose members announce themselves and the broadcasts they publish; Rooms::join returns a Room with its membership as a watched RoomState. Room::publish places a broadcast at rooms/<topic>/<member>/<name>, visible to the members only through the RoomsLayout grant, and Room::subscribe reads a member's broadcast on demand. The room module is split into service, handle and actor. Breaking: chat moves out of the rooms library, RoomPeer is now RoomMember, and room tickets use the room2 kind, so old tickets do not parse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Splits the publish half of moq-media into two crates on top of moq-video and moq-audio, neither of which depends on iroh. moq-ext-sources holds the media sources upstream moq lacks: cameras, screens, microphones (with optional echo cancellation), files and test patterns, each producing raw frames on its own thread. A VideoSource feeds several encoders at once and offers a latest-wins preview; an AudioSource fans PCM out to every broadcast that reads it. moq-ext-publisher's LocalBroadcast encodes a video and an audio source into renditions and writes them into a moq broadcast a transport hands it, so readers get the media without a copy. Hardware encoders (VAAPI, NVIDIA, V4L2, rpicam) are behind features. Breaking: replaces moq-media's publish API; the catalog is hang's, behind an Arc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moq-ext-player is the subscribe half of moq-media, on top of moq-video and moq-audio and without iroh. A RemoteBroadcast is built from a moq-net broadcast consumer or a resolved route; the Player reads its catalog, picks the rendition the link carries through moq-ext-adaptive (ranked with hang and honouring the caller's preference), switches renditions without a blank picture, and keeps audio and video in step. Recording to a file is behind the record feature. moq-ext-egui, the successor to moq-media-egui, draws a player's video frames in egui and adds a debug overlay. Breaking: replaces moq-media's subscribe API and moq-media-egui. Player::video is now video_frames, and wait_for_rendition, SwitchError and the height limit are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d ones Rewrites iroh-live as a facade over the crates added so far and removes iroh-moq, iroh-rooms, moq-media and moq-media-egui, which they replace. The facade re-exports the node as iroh_live::node, moq-net as iroh_live::moq_net, the media crates as iroh_live::media and the rooms crate as iroh_live::rooms, the last two behind the media and rooms features (full turns on the usual app set). On top it adds LiveLayout, the default path convention (<root>/<peer>/<name>, each peer publishing only under its own id), BroadcastTicket, Node::subscribe_ticket, which grants a ticket's publisher its one path, the Call convention built on the layout grant, and EndpointConfig for endpoint setup. The tests cover calls, latency, latest-value tracks, source switching and the patchbay network simulations. Breaking: Live, LiveBuilder, CallOffer and the free config functions are gone; build a Node with a layout config instead. Broadcasts move from bare names to live/<endpoint id>/<name>, LiveTicket (iroh-live:...) is replaced by BroadcastTicket (ilv1:...), and nodes do not interoperate with the previous version on the wire. HungUp is now HangUpReason and secret_key_file is load_or_create_secret_key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings iroh-live-relay back into the workspace on iroh-live-node and moq-transport-iroh. The relay serves one moq-relay cluster to browsers over WebTransport and to iroh nodes over iroh sessions; a publisher pushes its broadcasts with a relay link, or the relay pulls a broadcast from its publisher when a session names its ticket, without a copy into the cluster. Pulls now happen only for authorized sessions, within limits, and only for the peer that owns the ticket's path. Under --auth-key, browsers are decided with moq-auth's reference policy, and iroh clients' JWTs are checked by moq-ext-access's verifier, rereading the key file when it changes. The web client's npm install runs only when its lockfile changed. Breaking: IrohSessions::mount replaces router, pull::PullState is now Pulls, and run and the key loading return the crate's Error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings iroh-live-cli back into the workspace on the new iroh-live facade. publish, watch, record, call, room, run and devices keep their roles; call and scan are split into modules, room chat moves here from the rooms library on a chat track of its own, and the first Ctrl+C shuts down gracefully (leaving rooms, closing broadcasts, then the endpoint) with a second one or a watchdog exiting at once. Every backend feature is now on by default. The Linux-only backends compile to nothing elsewhere and macOS and Windows reach their frameworks through target_os gating, so a plain cargo install gets each backend its platform can reach. Rendering is unconditional. Breaking: irl record --latency is now --max-age, and the render feature is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moves the pi-zero and android demo crates onto the iroh-live facade and brings them back into the workspace. Their duplicated GLES2 YUV shader, texture and draw code moves into demos/gles-yuv, a small shared crate, and moq-media-android is folded into the Android demo crate, its only user, so the workspace no longer carries a published-looking crate for one app. Breaking: moq-media-android is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…actions Adds CI and cargo-make steps that build iroh-live-relay and iroh-live without media on their own, since a workspace build unifies features and the CLI turns media back on, runs the doctests (nextest skips them) and cargo doc with -D warnings, and points the patchbay task at the full feature set. The release and aarch64 jobs build irl with its default features, now all of them, and macOS releases move to macos-15. The pinned actions move to their latest releases. Also updates the browser end-to-end tests for the relay's authorized pulls, replaces LICENSE-MIT's stray Apache text with the MIT license, and swaps non-ASCII rules in the scripts for ASCII. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cker Replaces the old guide pages with a book under docs/: an introduction, a getting-started path, concept pages, how-to guides, reference pages (including the irl CLI), troubleshooting, a glossary and a migration guide from the previous release. The Rust programs of the getting-started and how-to pages compile as doctests of iroh-live, so a guide program cannot drift from the API, and scripts/check-links.py, run in CI, checks every relative link and anchor in the Markdown. The architecture pages, the root README and DEVELOPMENT.md are brought up to date with the crate split. Together with the commits before it, this completes the restructure of iroh-live onto moq main and iroh 1.4: - moq-transport-iroh: moq-net over an iroh connection. - moq-ext-access: the transport-free access model and token verifiers. - iroh-live-node and moq-ext-adaptive: the node with its route table, sessions, relay links and admission, and the rendition state machines. - iroh-live-rooms: media-free rooms on the node. - moq-ext-sources, moq-ext-publisher, moq-ext-player, moq-ext-egui: the media stack, without iroh. - iroh-live: the facade with LiveLayout, tickets and calls. - iroh-live-relay, iroh-live-cli and the pi-zero and android demos on top of it. Breaking: iroh-moq, iroh-rooms, moq-media, moq-media-egui and moq-media-android are removed, and the Live API is replaced by Node and a layout; docs/migration.md maps the old API to the new one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Frando
force-pushed
the
Frando/cleanup-auth
branch
from
November 14, 2026 00:15
ca11cd1 to
fa7c55f
Compare
A member that crashes, or loses its network, stays listed until its gossip
lease runs out, about two minutes later. Apps keep retrying its broadcasts
during that time.
RoomMember now carries a MemberConnection, read from the node's direct
sessions and published on the watched RoomState. A member is Connected while
a dialed or accepted session with it is open. It turns Disconnected { since }
when the last one closes, and a new session makes it Connected again. A
member that this node had no direct session with while it was listed, such
as one reached only through a relay, stays Unknown. Gossip expiry and leave()
still remove members as before.
The wire announcement gets its own private type, with the same postcard
encoding, so RoomMember no longer derives Serialize and Deserialize.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moves every moq crate from 6aa4f9c1c to e8075629a, moq main as of 2026-11-16, and adapts the workspace to what changed upstream. Upstream changes that reach us: - Groups are addressed by their start (#8638). A frame needs a timestamp, `append_group` takes the start, `group.sequence` is `group.start`, `Timestamp::now` is gone, `as_micros` and the conversion to `Duration` are fallible, and moq-json's producers take a `Timed` value. - The send-stream trait reports acknowledgment through `Offset` and `poll_acked` (#8845). - The reconnect loop no longer judges errors by kind (#8618), so `Verdict::from(&Error)` and `Verdict::Refused`/`Fatal` are gone. - The network stack always compiles (#8852), and the media crates drop their compile-trim features (#8851): moq-relay's `quic`/`websocket`, moq-tokio's `net`/`quic`, moq-audio's `aac` and `aec` no longer exist. - `Sink::due` no longer takes the jump to skip; the sink snaps onto the clock past its stretch window by itself (#8722, #8675). - `Source::Display` takes a `DisplaySelection` (#8742). - Our own PRs are on main: VA-API H.264 releases pictures at the reorder limit (#8636), `sync::Consumer::changed` waits for schedule moves (#8639), and the video decoder reports each picture's arrival (#8640, #8720). Our adaptations: - moq-transport-iroh: `SendStream` has `Offset = ()` and keeps the default `poll_acked`, which answers `Unsupported`, since iroh does not report acknowledged bytes. - iroh-live-node: a failed relay handshake settles the address walk on an auth rejection and retries otherwise, as moq-tokio judges its dials. - The latest-value tracks of `Node::publish_value` and `LocalBroadcast::value_track` count milliseconds, so an update carries `Timestamp::from(moq_net::time::Instant::now())`. A value that starts a new group must be stamped later than the group before, so the tests count their stamps up. The docs, examples and migration guide show it. - moq-ext-player drops its arrival watcher, which read every video track a second time beside the decoder, and reads the decoder's own `arrival`. `PlayerConfig::record_arrivals` and `with_recorded_arrivals` are gone, and `FrameTiming::arrived` is set for every picture the decoder matches. - The playout clock waits on `sync::Consumer::changed` instead of its own `Notify`, which every schedule move had to ring. - The speaker's anchor is the due instant alone; the jump it computed is gone with the `Sink::due` argument. - The `aec` features keep their meaning without moq-audio's feature. - The relay bridge tests write millisecond tracks, as the relay ages groups by time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ubscriptionExt
The relay needed the facade only for `LiveLayout` and `EndpointConfig`,
and a subscription's media was a free function that was hard to find.
This moves both into the node crate, so iroh-live-relay now depends on
iroh-live-node and iroh-live-rooms alone, and reads a subscription as
media through a method.
- `iroh_live::media::SubscriptionExt::remote_broadcast` replaces
`media::remote_broadcast(&subscription)`. The trait is sealed and
implemented for `Subscription` only. The docs of `Subscription` and
`Subscription::broadcast` point to it.
- `layout` (with `LiveLayout`), `EndpointConfig`, `Mdns` and
`load_or_create_secret_key` move from iroh-live to iroh-live-node. The
facade re-exports them under the same names. The `Layout` trait is
reachable as `iroh_live_node::layout::Layout` only, not also at the
crate root.
- `EndpointConfig::from_env` and `bind` return a new
`iroh_live_node::EndpointError` (`SecretKey`, `Bind`), which the facade
wraps as `iroh_live::Error::Endpoint` and the relay as `Error::Bind`.
The node's own `Error` keeps to the node and its handles.
- `iroh_live::media` lists its re-exports instead of globbing the three
media crates, so a new item in one of them is a choice, not an accident.
- The facade's docs name which crate's error each call returns,
including `media::Error` and `rooms::Error`, and show a match on
`Error::Endpoint(EndpointError::Bind { .. }, _)`, whose second field is
the error's metadata.
The migration guide lists the moved and renamed items.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since the moq bump, AudioSource::microphone and LocalBroadcast::set_audio return the same error type, so the `.into()` was a useless conversion and clippy -D warnings failed on the Android target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moq-transport-iroh returned no send groups, so moq-net ranked every group stream of a session in one queue, where the older of two equal-priority subscriptions goes first. Under a held bandwidth cap a rendition switch never landed: the replacement's first group waited behind the incumbent's backlog, which never drained. `Transport::send_group` now returns a `SendGroup`. iroh schedules a stream by an i32 priority, so the group priority and each stream's dense rank by order within its group are packed into it (group * 16 + 15 - tier), with ungrouped streams at 2^29 and up, above every group. The heads of equal-priority groups share one priority, and noq sends streams of one priority round robin while send fairness is on, its default, so they share the bytes. A group's older streams wait for its head, and a higher group outranks every tier of a lower one. A stream joining, leaving or moving reranks its group, which reaches the other streams through a shared handle. Unlike moq-quic's deficit round robin, fairness is per stream and only within a tier: a group whose head is idle does not hand its share to its backlog. With send fairness turned off the older group goes first again; RFC 9218's incremental flag, which n0-computer/noq#859 adds, would remove that dependency. On noq 1.4 a priority change only reaches data a stream already has queued at the stream's next turn, at its old urgency. A lowered priority applies after one more turn; a raised one may wait until the link frees up. New streams, and so rendition switches, are not affected. The docs say so; requeueing on a priority change needs noq. `a_switch_lands_while_the_link_stays_capped` is no longer ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebuild iroh-live on moq's
mainbranch and iroh 1.4, split the codeinto crates by whether they need iroh, and add an access model so a
node decides which peers may connect and what each may read and
publish. Every library crate changes its public API, and nothing stays
wire-compatible with
main. The book indocs/is rewritten to match.This replaces #87 and contains all of it.
Why
On
main, iroh-live builds on the crates.io releases of moq, whichleaves three problems:
Moq::publishannounces every broadcast to everypeer that connects, so a call or a room cannot keep its broadcasts
to its members.
at an allocation per operation and a copy per write, and a node
cannot attach to a MoQ relay.
mainnow has route selection and failover,rendition selection, A/V sync, capture, codecs and audio output, much
of which
moq-mediaandiroh-moqreimplement.The goal is to use upstream moq for everything it does, keep in
iroh-live only what needs iroh, and put the rest in
moq-ext-*crateswith no iroh dependency so each can move upstream on its own. The
facade imposes no path layout, endpoint setup or router.
Crates
moq-transport-iroh: a moq-net session over an iroh connection,implementing moq-net's poll transport directly on iroh streams.
moq-ext-access: grants, policies, audiences, layouts, and theoptional JWT and rcan verifiers. No iroh.
moq-ext-adaptive: rendition choice, decoder backoff and handover aspure state machines with no I/O.
iroh-live-node: theNodewith its route table, publications,sessions, relay links, admission, tickets, link stats,
MoqPreset,EndpointConfigandLiveLayout.iroh-live-rooms: gossip membership and members-only broadcasts.moq-ext-sources,moq-ext-publisher,moq-ext-player,moq-ext-egui: capture, the encodingLocalBroadcast, the decodingRemoteBroadcastandPlayer, and egui views. No iroh.iroh-live: the facade, withCalls,SubscriptionExt, oneErrorand re-exports.
iroh-live-relayandiroh-live-cli(irl): the applications.The media crates know nothing of the network, so one player runs over
a direct session, a relay link or another MoQ transport.
How a broadcast flows
A publisher binds an endpoint with
EndpointConfig, creates aNodewith a policy, mounts it on its own router, publishes a
LocalBroadcastat a path, and shares aBroadcastTicket. A viewercalls
Node::subscribe_ticketand plays the result throughSubscriptionExt::remote_broadcast, which attaches the serving link'smeasurements so the
Playeradapts with nothing more to wire.Node::publishcreates the broadcast inside the route table, andsessions read it from there without a copy. Encoders run only while
someone reads a rendition. Every session and relay link feeds the
viewer's route table, a path resolves to its cheapest route, and moq
moves a subscription to another route of the same publisher when its
route dies. A node serves only its own publications and never forwards
a route it learned from another link.
Access
A policy decides each session:
Policy::decidereturns aGrant, twosets of path patterns for subscribe and publish, with an optional
expiry, or a rejection. The node decides again on expiry and on
Node::reauthorize. Policies compose (Open,Closed,from_fn,filter,Queuefor asking the user,VerifywithJwtVerifierorRcanVerifier).A layout is the path convention.
LiveLayoutputs broadcasts atlive/<endpoint id>/<name>and lets each peer publish only under itsown id, and
RoomsLayoutdoes the same underrooms/<topic>/. Apublication's
Audiencenarrows the grant per broadcast:Grantedreaches every session whose grant covers the path,
Peers(set)onlythe named peers.
docs/concepts/access.mddescribes the model.Calls and rooms
A call is a broadcast with
Audience::Peersover a set that ringingadds to and hanging up removes from. A room is an iroh-gossip topic
whose members announce their broadcasts.
Room::state()returns awatched
RoomState, andRoomMember::connectionreports when the lastdirect session to a member closes. Chat moved out of the library into
irl.Relays
The iroh-live relay runs one
moq_relay::Clusterthat browsers reachover WebTransport and iroh nodes over
moq-transport-iroh. It gets abroadcast by push, when a publisher attaches a relay link, or by pull,
when a session names a ticket and the relay dials the publisher. Pulls
require a token that grants the ticket's path (or
--open-pulls), arecapped and rate-limited per client, and only work for paths the
ticket's publisher owns under a layout. With
--auth-key, JWTs grantmore to iroh clients and browsers alike, and the key reloads on change.
A relay link (
Node::attach_relay) runs moq-net'sReconnectwithbackoff and GOAWAY migration over
https://oriroh://, with tokensthat can be replaced on a live link.
Transport
Raw QUIC has no request URI, so the path and token travel in the MoQ
SETUP.
export_keying_materialforwards iroh's TLS exporter formoq-lite-07 route key proofs.
moq-net opens one send group per subscription, while iroh has one
i32urgency per stream.Transport::send_groupreturns aSendGroupthat packs the group's priority and each stream's rank into that
urgency, so a group's newest stream goes first and equal-priority
groups share bytes round robin. A replacement rendition therefore does
not wait behind the old one's backlog, and a switch lands on a link
held at its cap.
docs/architecture/transport.mdhas the details.After a simultaneous dial, only the oldest session with a peer
announces, since moq-lite-06 carries no publisher instance.
Notable decisions
mainat reve8075629aby git, with no[patch]block. It includes fix(moq-video): list a PipeWire webcam once, prefer it, and share a running one moq-dev/moq#8561, #8562, #8636, #8639 and #8640.
iroh-live cannot publish to crates.io until moq releases from
main.to what the peer presented on that session. A dial also asks the
policy.
Node::publishtakesany path, and
BroadcastTicketholds a full path.publisher's PROBE delivery estimate, steps down on 10% loss and to
the lowest rung on 20%, and holds 500 ms before a downgrade and 4 s
before an upgrade. Upgrades decode in parallel and swap once caught
up.
MoqPresetuses BBR3.pipewire, Linux defaults to the shareable PipeWire camera andthe portal screen picker.
irlenables every backend by default,while
iroh-livehas no default features and afullfeature.#[non_exhaustive]withDefaultandwith_*builders, so fields can be added without a breaking release.
Breaking changes
Nothing is wire-compatible with
main; upgrade every node, the relayand the Android app together.
iroh-moqbecomesiroh-live-nodeandmoq-transport-iroh,iroh-roomsbecomesiroh-live-rooms, andmoq-mediasplits intothe
moq-ext-*crates.LiveandLiveBuilderare gone in favour ofEndpointConfig,Nodeand an application-owned router.live/<endpoint id>/<name>.LiveTicketbecomesBroadcastTicket(ilv1:), room tickets use kindroom2, and oldtickets do not parse.
VideoTrack,AudioTrackandMediaTracksbecome onePlayer.RoomEventbecomes the watchedRoomState,RoomPeerbecomesRoomMember, and chat leaves the library.--open-pulls, andirl record --latencyis now--max-age.docs/migration.md lists every rename and removal with before and after
code.
Testing
Beyond what
maincovered, CI now checks the Android JNI crate withcargo-ndk, builds the relay and the facade without media on their own,
runs doctests and
cargo docwith warnings denied, compiles the guideprograms in
docs/as doctests, and checks the book's links. Newintegration tests cover grants, re-authorization, tokens, relay pull
limits and calls, and the patchbay scenario for a switch on a capped
link, ignored on
main, now runs.Known limitations
stream's next turn. New streams are unaffected, so switches are too.
its default. feat(transport): mark send group streams incremental (needs noq#859) #97 removes that dependency once feat: add per-stream incremental scheduling noq#859 is
released.
expiry; the client redials with a fresh token.
viewers.
rpicam_h264publishes one hardware-encoded rendition that does notadapt.
carries the publisher instance.
🤖 Generated with Claude Code