Skip to content

feat(huh): Sections 4-5 (on-demand tracks and live discovery) - #304

Merged
kixelated merged 3 commits into
mainfrom
quest/m2/huh/tracks-and-discovery
Nov 26, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m2/huh/tracks-and-discovery

Conversation

@kixelated

@kixelated kixelated commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Adds Sections 4 and 5 to /huh, finishing quest/m2/huh/tracks-and-discovery.md. /huh stays behind the dev/staging gate (UNRELEASED in astro.config.ts) until Sections 6–8 land.

Changes

  • Section 4, Tracks: Media & Arbitrary Data on Demand (src/components/huh/tracks.tsx, model in rack.ts): a track rack for one hang broadcast (video/1080p, video/480p, a second camera, audio, captions, controls.json). You can toggle each track or pick a viewer preset (TV, Phone, Both cameras, Audio only, Bot, Nobody). Tracks nobody subscribes to sit at idle · 0 kbps with an empty wire. An uplink meter compares the current uplink with what pushing every track would cost, and a live catalog.json view highlights the entries being pulled. The E2EE toggle is labeled as the moq-e2ee project draft, not part of hang or moq-transport. It swaps the broadcast path and track names the relay sees for opaque ones.
  • Section 5, Broadcasts & Live Discovery (discovery.tsx, model in gossip.ts): five sessions on a three-relay mesh. alice, bob, and carol each publish room/<name> and watch room/*, cam-1 publishes boat/cam-1, and harbor watches boat/*. Taking a publisher online or offline animates the announce or withdraw message through the relays, and matching rosters update when it arrives. Each card shows a session both publishing and watching, which makes the bidirectional sessions visible.
  • Badges: a section now takes a list of badges, so each section shows its IETF part and its project-draft part separately. Section 4 gets Standard · IETF MoQ plus + hang, and Section 5 gets Standard · IETF MoQ plus + cluster. Sections 1–3 are unchanged.
  • Tests: rack.test.ts parses the displayed catalog.json with @moq/hang's real RootSchema, so the page can't show a catalog hang would reject. That's why @moq/hang is now a devDependency; it's a workspace package that was already installed. gossip.test.ts covers prefix matching, withdrawals, and step-size independence. It also runs a seeded property test: 50 random toggle sequences, each checked against an oracle of who is online.
  • Both diagrams follow MotionToggle and prefers-reduced-motion through the shared clock.ts. With motion paused, a toggle in Section 5 jumps straight to the settled rosters.
  • Deletes the quest and removes it from routing-and-timestamps.md's Required list.

Choices made without asking

  • Second camera as a sibling broadcast: hang treats video renditions in one catalog as alternatives of a single source, and a player picks one. Independent sources are published as sibling broadcasts. So the second camera is studio/rear.hang, listed under the catalog's contributions map, which hang opens only when a viewer picks it. That matches hang and still shows on-demand behavior. The alternative was a video/rear rendition, which hang would treat as an alternative of the front camera.
  • Mesh simplification: the relays form a full mesh and use split horizon: a relay forwards only its own clients' announcements to the other relays. The page says so and points to the cluster draft's hop lists for how real relays avoid loops. Modeling hop lists here would mean re-teaching Section 6.
  • Wire names: the diagram labels messages generically as announce and withdraw. The copy gives the IETF names, PUBLISH_NAMESPACE and SUBSCRIBE_NAMESPACE.
  • Copy: the page text is technical explainer prose in the style of Sections 1–3, checked against moq/doc/concept/{standard,hang,moq-lite,index}.md and the hang and cluster drafts. Edit it freely.

Public API / wire impact

None. Site-only; /huh is still unreleased.

Validation

  • just check (biome, tsc, quest check) and just test (91 pass) pass locally.
  • src/lib/landing.test.ts now also server-renders Sections 4 and 5, so a crash in either diagram fails the smoke test.
  • After review round 1: rechecked in Chrome with Both cameras and E2EE on. The rear row routes to studio/rear.hang / video/720p, and the relay column shows only opaque names.
  • Exercised in just dev in Chrome at 1280×1100 and 390×844:
    • Section 4: presets, per-track toggles, and E2EE all update the rack, the relay column, the uplink meter, the catalog highlighting, and the live-region text.
    • Section 5: taking carol online and alice offline animates announce and withdraw messages across the mesh and updates every roster. With motion paused, a toggle lands immediately.
    • Mobile wraps both figures cleanly. The page logged no console errors.

Follow-ups

None.

Models

  • Size: M
  • Implementer: claude, claude-opus-5-5, high

🤖 Generated with Claude Code

(Written by Claude Opus 5.5 with high)

Review

Rewritten by quest review after each round.

  • Head: d9fbf3c

  • Base: origin/main at 07d3921

  • Risk: medium, the base has no RISK.md to name what is always high or customer-facing, so every change is medium

  • Classified: medium by default

  • Reviewer: Codex, gpt-6.2-sol, high effort

  • Session: 01a21634-6526-72d1-bc56-8e81c1316b39, round 2

  • Score: 10/10, The discovery rosters stay live when visible, the relay labels and tooltips show the correct routes in both encryption modes, and the follow-up introduces no new findings.

  • Rounds: 2; first round 2 (medium 2); findings 2 (medium 2): fixed 2, refuted 0, open 0

  • Findings: none

  • The last round's findings, at 665508e:

    • Fixed: medium, src/components/huh/discovery.tsx:46: Keep discovery running while the rosters are visible; The clock now observes the wrapper at `src/components/huh/discovery.tsx:98`, which contains both the SVG and the session rosters.
    • Fixed: medium, src/components/huh/tracks.tsx:164: Show the correct routes in the relay view; The rear camera routes to `studio/rear.hang` and `video/720p` at `src/components/huh/rack.ts:34`, and the relay label and tooltip at `src/components/huh/tracks.tsx:166` both use that route and display opaque names with E2EE enabled.

kixelated and others added 2 commits November 25, 2026 20:37
Section 4 is a track rack for one hang broadcast: pull tracks or pick a
viewer preset, and only the pulled tracks' encoders run, with the
uplink meter and live catalog.json following. An E2EE toggle, labeled
as the moq-e2ee project draft, swaps what the relay sees for opaque
names. The displayed catalog is checked against @moq/hang's own schema.

Section 5 is a three-relay announce mesh: publishers come online and
offline, and the rosters of sessions watching room/* or boat/* update
as the gossip lands, with a seeded property test against an oracle.

Sections now take a list of badges, so a standard feature and its
project-draft extension each get their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Add /huh Sections 4–5 (on-demand tracks and broadcast discovery gossip) feat(huh): Sections 4-5 (on-demand tracks and live discovery) Nov 26, 2026
The relay column now names the rear camera's own broadcast and
rendition, and E2EE hides both in the label and tooltip. Discovery's
clock watches the rosters too, so they keep updating on a phone after
the diagram scrolls away. The E2EE note says who holds the credential
and what the relay still sees, the uplink meter skips its transition
with motion off, and the /huh smoke test covers Sections 4 and 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 26, 2026 05:00
@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e4f84491-44af-46d7-bfeb-7ed1efe73886
Commits

Reviewing files that changed from the base of the PR and between 07d3921 and d9fbf3c.

Files ignored due to path filters: 1

  • bun.lock is excluded by !**/*.lock
Files selected for processing: 12

  • package.json
  • quest/m2/huh/routing-and-timestamps.md
  • quest/m2/huh/tracks-and-discovery.md
  • src/components/huh/discovery.tsx
  • src/components/huh/gossip.test.ts
  • src/components/huh/gossip.ts
  • src/components/huh/rack.test.ts
  • src/components/huh/rack.ts
  • src/components/huh/section.astro
  • src/components/huh/tracks.tsx
  • src/lib/landing.test.ts
  • src/unreleased/huh.astro
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@kixelated
kixelated merged commit b37c911 into main Nov 26, 2026
4 checks passed
@kixelated
kixelated deleted the quest/m2/huh/tracks-and-discovery branch November 26, 2026 05:18
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