Skip to content

feat(moq-net,js/net): moq-lite-06-wip announce ids#2160

Open
kixelated wants to merge 4 commits into
devfrom
claude/moq-lite-announcement-compression-0cc276
Open

feat(moq-net,js/net): moq-lite-06-wip announce ids#2160
kixelated wants to merge 4 commits into
devfrom
claude/moq-lite-announcement-compression-0cc276

Conversation

@kixelated

@kixelated kixelated commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements announce ids for moq-lite-06 (negotiated as moq-lite-06-wip, wire code 0xff0dad06), so retracting or restarting an announcement no longer repeats the broadcast path.

  • Every active ANNOUNCE_BROADCAST implicitly assigns the next per-stream ordinal (a counter starting at 0). Both sides derive it from message order on the ordered stream, so the id costs zero bytes on the announce itself.
  • ended (status 0) now carries only the Announce ID (~3 bytes total instead of 3 + len(path) + hops).
  • restart gets its own explicit status (2) carrying the Announce ID + the replacement hop list, replacing the lite-05 duplicate-active idiom. A duplicate active for an already-active path is now a protocol violation on 06.
  • Referencing an unknown or retired id is a protocol violation. Ids are never reused within a stream.
  • Announces that are filtered out (reflected loops, exclude_hop) never assign an id, so their later retraction sends nothing, which the peer can't distinguish from never-announced (previously a dangling ended was sent).

Pre-06 wire behavior is unchanged; all message forms are version-gated at encode/decode.

Like previous wip drafts on dev, moq-lite-06-wip is the preferred default ALPN so the demo/tests exercise it; revisit before promoting to main.

Cross-package sync

  • rs/moq-net: wire format, publisher/subscriber id bookkeeping, Version::Lite06Wip plumbing (client/server ALPN arms, Handshake::Lite05 generalized to LiteSetup).
  • js/net: mirrored (Version.DRAFT_06, ALPN_06_WIP, union-shaped AnnounceBroadcast, publisher/subscriber loops, connect/accept dispatch).
  • doc/concept: no change needed; it documents the announced(prefix) API surface, which is unchanged.
  • Spec: drafts/draft-lcurley-moq-lite.md updated in-repo (the drafts moved into the monorepo via drafts: move IETF drafts into the monorepo with nix + just #2159). Reworked ANNOUNCE_BROADCAST section (per-status bodies), protocol-violation rules, and a lite-06 changelog entry; just drafts check passes.

Public API changes

  • rs/moq-net: lite::Version gains Lite06Wip; lite::Version::has_announce_id() added; lite::AnnounceBroadcast gains EndedId { id } and Restart { id, hops } variants (breaking for exhaustive matches, hence dev).
  • js/net: AnnounceBroadcast reshaped from a class into a discriminated union with encodeAnnounceBroadcast / decodeAnnounceBroadcast[Maybe] functions (breaking); Version.DRAFT_06, ALPN_06_WIP, hasAnnounceId added.

Testing

  • Wire round-trip + cross-version rejection unit tests in both languages (including the 3-byte ended size check).
  • New end-to-end lifecycle tests (initial set, live announce, unannounce, re-announce, restart) in rs/moq-native/tests/broadcast.rs and js/net/src/integration.test.ts, pinned to moq-lite-06-wip.
  • NEWEST_LITE regression guards bumped, so the default-negotiation matrix (QUIC, WebTransport, WebSocket/qmux) now runs on 06-wip.
  • just check passes.

🤖 Generated with Claude Code

kixelated and others added 2 commits July 10, 2026 13:15
Each active ANNOUNCE_BROADCAST implicitly assigns the next per-stream
ordinal; ended and restart reference that id instead of repeating the
broadcast path. Restarts get their own explicit status instead of the
duplicate-active idiom, and an unknown or retired id is a protocol
violation. Announces that were filtered (loops, exclude_hop) never
assign an id, so their retraction sends nothing.

Negotiated via the new moq-lite-06-wip ALPN (wire code 0xff0dad06),
preferred by default like previous wip drafts on dev.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mirror of the Rust change: AnnounceBroadcast becomes a discriminated
union (active / ended / endedId / restart), the publisher assigns and
retracts by ordinal on lite-06, and the subscriber resolves ids back to
paths (an unknown or retired id is a protocol violation).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @kixelated, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

kixelated and others added 2 commits July 10, 2026 18:52
…cement-compression-0cc276

# Conflicts:
#	js/net/src/lite/announce.ts
Mirror the spec change into the in-repo drafts/ (moved here by #2159):
each active ANNOUNCE_BROADCAST implicitly assigns the next per-stream
ordinal, and ended/restart reference that id instead of repeating the
broadcast path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant