Skip to content

feat(spf): speak moqt-22 through @caprid/moq-core - #75

Merged
mmcc merged 3 commits into
feat/moq-worklet-audio-defaultfrom
feat/moq-caprid-core
Oct 27, 2026
Merged

mmcc merged 3 commits into
feat/moq-worklet-audio-defaultfrom
feat/moq-caprid-core

Conversation

@mmcc

@mmcc mmcc commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Stacks on #72 (feat/moq-worklet-audio-default). Retarget to mmcc/moq once #72 merges.

Summary

The MoQ player takes its MOQT codec and session from @caprid/moq-core 0.1.1 instead of its own copy in packages/spf/src/network/moqt/, which is deleted. The package was extracted from that copy, and its UPSTREAM.json asks v10 to migrate rather than keep a divergent implementation. The player now offers moqt-22 first and falls back to moqt-20.

Changes

  • Dependency. @caprid/moq-core ^0.1.1 is added to @videojs/spf, and @caprid/moq-media moves to ^0.1.1.
  • Imports. Every importer of network/moqt/* now imports from @caprid/moq-core: moq-session, track-subscriber, resolve-catalog, subscribe-selected-tracks and their tests. The local modules (bytes, varint, errors, control-messages, object-stream, request-stream, session) and their tests are deleted.
  • Negotiation. The session actor offers MOQT_PROTOCOL_IDS (['moqt-22', 'moqt-20']). The default factory hands the real WebTransport to the core, and the core reads transport.protocol (the WT-Protocol answer) through resolveMoqtProtocol to pick its LOCATION_FILTER codec, the only wire difference between -20 and -22. A browser without WebTransport.prototype.protocol offers moqt-22 only, because it could not report a moqt-20 pick, and the core would misread the filter.
  • Draft-22 behaviour. The player sends only relative-group 0 and relative-group 1 filters. Those encode to the same bytes on -20 and -22, so no player logic changed. Transport section citations in source and the sandbox loopback relay now use draft-22 numbering.
  • Audio regression fixed. @caprid/moq-media 0.1.1 decodes Opus with WebAssembly libopus by default. That decoder is single-stream and ignores the OpusHead channel mapping, so a multistream track (channelConfig above stereo) would decode as noise. The default player factory passes lossConcealment: false, which keeps feat(spf): render MoQ audio through the @caprid/moq-media worklet core #72's WebCodecs path. Codex found and reproduced this.
  • Specs. draft-ietf-moq-transport-22.txt replaces the -20 text in internal/specs/moq/. The README's tables, checksum and "declared in code" sentence now point at @caprid/moq-core.
  • Prose. packages/spf/docs/moq-publishing.md, the sandbox relay templates and both .agents/plans/ MoQ notes are repointed. The draft-20 migration plan is marked superseded on the player.

v10-side helpers kept

  • packages/spf/src/network/tests/helpers/moqt-wire.ts, test-only. The in-memory fake relays need the relay side of the wire: server SETUP, decodeControlMessage, encodeSubscribeOk, encodeRequestError, StreamReader and utf8Encode. The package's public entry doesn't export any of them. The helper re-exports them from the package's own dist/protocol/* by deep relative path instead of re-implementing them, so a release that moves those modules breaks the tests loudly. A public @caprid/moq-core/testing (or wire-codec) entry would let this go.
  • No runtime helpers. Everything the player used (compareLocations, isRetryable*, utf8Decode, REQUEST_ERROR_CODE, PUBLISH_DONE_STATUS and the session types) is exported by 0.1.1.

Testing

  • pnpm -F @videojs/spf test: 132 files and 2305 tests pass, with no type errors.
  • pnpm build:packages, pnpm typecheck (stale types/ and tsbuildinfo cleared first) and pnpm lint all pass.
  • codex review --base feat/moq-worklet-audio-default made one finding, the multistream Opus regression above, which is fixed in 38db34c with a test that fails without the fix.
  • Live, relay.mux.global, 2026-10-27, headless Chromium. A scratch browser test, not committed, publishes a synthetic VP8 640×360 and Opus broadcast with @caprid/moq-core's publish session under huddle/videojs-testing/*. It then plays the broadcast through createMoqEngine with the default WebTransport factory.
    • Both connections offered ["moqt-22","moqt-20"] and the relay selected moqt-22. The player session was ready 107 ms after connect.
    • The relay's upstream SUBSCRIBE decoded on -22 as next-object plus fill relative-group 1. The publisher served it.
    • The catalog resolved and both tracks were selected. The first video frame decoded and the first audio was scheduled 522 ms after the player started.
    • Over 25 s: 739 video frames decoded with 0 dropped, 1212 audio frames scheduled with 0 underruns, and the audio clock advanced 19909 ms over 19990 ms of wall time (0.996×).

Notes for the publisher PR (mmcc/moq-publisher)

  • createMoqtPublishSession replaces publish-session.ts. The publisher has to adapt to:
    • openUniStream(trackAlias);
    • no getStreamCount, since the session counts data and fill streams itself;
    • explicit track properties, so declare TIMESCALE (TRACK_PROPERTY.TIMESCALE) yourself;
    • an orderly close() that waits up to CLOSE_END_ACK_TIMEOUT_MS (2 s) for the relay's FIN;
    • during close, only tracks pending on end({ after }) can open streams.
  • subgroup-writer.ts maps to createSubgroupWriter, and encodeFetchHeader and isEmptyFetchRange are exported. The publisher's tests that use tests/helpers/raw-peer.ts and transport-pair.ts will need the same deep-import approach as moqt-wire.ts, or a testing entry upstream.
  • The publisher should also pass the negotiated protocol through: offer MOQT_PROTOCOL_IDS and construct the session over the real WebTransport.
  • Verified live here: the moq-core publish session answered relay.mux.global's moqt-22 upstream SUBSCRIBEs (LARGEST_OBJECT via getLargestObject, plus a fill) and played cleanly.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DaH4ieYHRP2Agar6P9KSCB


Summary by cubic

The MoQ player now speaks the transport through @caprid/moq-core 0.1.1 instead of its own vendored copy in packages/spf/src/network/moqt/, which is deleted. The session offers moqt-22 first with moqt-20 as fallback, and the core reads the negotiated WebTransport protocol to pick its LOCATION_FILTER codec — the only wire difference between the two — while browsers without WebTransport.prototype.protocol offer moqt-22 only.

Behavior changes

  • @caprid/moq-media moves to ^0.1.1, and its default WebAssembly libopus decoder is disabled (lossConcealment: false) since it decodes multistream Opus as noise; WebCodecs stays the audio path.
  • Test-only moqt-wire.ts re-exports the package's relay-side codec through a deep path into its dist/, so a release that moves those modules fails the tests loudly.
  • The vendored draft-20 spec text is replaced by draft-22 and docs/relay templates are repointed; the publisher still runs the local codec until its own move.

Written for commit 38db34c. Summary will update on new commits.

View guided diff Turn on auto-fix

mmcc added 3 commits October 27, 2026 20:33
The player's MOQT codec and session driver now come from
@caprid/moq-core 0.1.1, the package extracted from network/moqt, and the
local modules and their tests are deleted. The session actor offers
moqt-22 first with moqt-20 as the fallback, and the core reads the
negotiated WebTransport protocol to pick its LOCATION_FILTER codec. A
browser without WebTransport.protocol offers moqt-22 only.

The fake relays in the tests re-export the package's unexported
relay-side codec from one helper instead of keeping a second copy.
Transport section citations follow draft-22 numbering. @caprid/moq-media
moves to ^0.1.1 alongside.

Claude-Session: https://claude.ai/code/session_01DaH4ieYHRP2Agar6P9KSCB
Replaces the vendored draft-20 text with draft-22 and updates the specs
README: revision table, checksum, and the sentence that said the
protocol pin lives in network/moqt. The publishing guide, the sandbox
relay comments and the plans now point at @caprid/moq-core and draft-22.

Claude-Session: https://claude.ai/code/session_01DaH4ieYHRP2Agar6P9KSCB
moq-media 0.1.1 decodes every Opus input with WebAssembly libopus by
default for packet-loss concealment. That decoder is single-stream and
ignores the OpusHead channel mapping, so a multistream track the catalog
allows (channelConfig above stereo, with init data) would decode as
noise. The default player factory turns lossConcealment off, which keeps
the WebCodecs path #72 shipped with.

Claude-Session: https://claude.ai/code/session_01DaH4ieYHRP2Agar6P9KSCB
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T20:43:25.422771Z 38db34c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mmcc
mmcc added this pull request to stack #76 October 27, 2026 20:44
@github-actions

Copy link
Copy Markdown

📦 Bundle Size Report

🎨 @videojs/html

Path Base initial PR initial Initial diff Lazy diff
/media/simple-moq-video 33.13 kB 103.90 kB +70.77 kB (+213.6%) —
Presets (7)
Entry Initial Lazy
/video (default) 64.34 kB 56.03 kB
/video (default + hls) 66.08 kB 56.03 kB
/video (minimal) 64.88 kB 56.03 kB
/video (minimal + hls) 66.49 kB 56.03 kB
/audio (default) 48.22 kB 56.03 kB
/audio (minimal) 48.51 kB 56.03 kB
/background 11.86 kB 56.03 kB
Media (19)
Entry Initial
/media/mux-video 3.03 kB
/media/mux-audio 2.68 kB
/media/background-video 1.16 kB
/media/cloudflare-video 2.90 kB
/media/dash-video 2.63 kB
/media/hls-audio 23.61 kB
/media/hls-background-video 17.49 kB
/media/hls-video 33.89 kB
/media/hlsjs-video 2.63 kB
/media/mux-background-video 17.47 kB
/media/native-hls-video 7.68 kB
/media/shaka-video 2.63 kB
/media/simple-moq-video 103.90 kB
/media/spotify-audio 3.02 kB
/media/tiktok-video 3.12 kB
/media/twitch-video 2.93 kB
/media/vimeo-video 2.90 kB
/media/wistia-video 607 B
/media/youtube-video 2.90 kB
Players (5)
Entry Initial Lazy
/video/player 9.97 kB 56.03 kB
/audio/player 6.14 kB 56.03 kB
/background/player 4.46 kB 56.03 kB
/live-video/player 9.33 kB 56.03 kB
/live-audio/player 6.16 kB 56.03 kB
Skins (29)
Entry Type Initial Lazy
/video/minimal-skin.css css 8.29 kB —
/video/skin.css css 8.00 kB —
/video/minimal-skin js 63.24 kB 56.03 kB
/video/minimal-skin2 js 8.27 kB —
/video/skin js 62.80 kB 56.03 kB
/video/skin2 js 7.99 kB —
/audio/minimal-skin.css css 6.07 kB —
/audio/skin.css css 5.80 kB —
/audio/minimal-skin js 47.00 kB 56.03 kB
/audio/minimal-skin2 js 6.05 kB —
/audio/skin js 46.74 kB 56.03 kB
/audio/skin2 js 5.78 kB —
/background/skin.css css 141 B —
/background/skin js 10.11 kB 56.03 kB
/background/skin2 js 159 B —
/live-video/minimal-skin.css css 6.77 kB —
/live-video/skin.css css 6.69 kB —
/live-video/minimal-skin js 50.81 kB 56.03 kB
/live-video/minimal-skin2 js 6.77 kB —
/live-video/skin js 50.73 kB 56.03 kB
/live-video/skin2 js 6.67 kB —
/live-audio/minimal-skin.css css 4.77 kB —
/live-audio/skin.css css 4.67 kB —
/live-audio/minimal-skin js 36.17 kB 56.03 kB
/live-audio/minimal-skin2 js 4.77 kB —
/live-audio/skin js 36.14 kB 56.03 kB
/live-audio/skin2 js 4.66 kB —
/global.css css 239 B —
/shadow.css css 78 B —
UI Components (62)
Entry Initial Lazy
/ui/airplay-button 11.52 kB 56.03 kB
/ui/alert-dialog 8.98 kB 56.03 kB
/ui/audio-track-radio-group 11.62 kB 56.03 kB
/ui/buffering-indicator 8.84 kB 56.03 kB
/ui/captions-button 11.76 kB 56.03 kB
/ui/captions-radio-group 11.66 kB 56.03 kB
/ui/cast-button 11.51 kB 56.03 kB
/ui/container 9.71 kB 56.03 kB
/ui/controls 9.03 kB 56.03 kB
/ui/controls-backdrop 1.69 kB 56.03 kB
/ui/controls-content 1.67 kB 56.03 kB
/ui/dialog 8.92 kB 56.03 kB
/ui/dialog-backdrop 1.70 kB 56.03 kB
/ui/dialog-close 2.06 kB 56.03 kB
/ui/dialog-description 1.69 kB 56.03 kB
/ui/dialog-popup 1.90 kB 56.03 kB
/ui/dialog-title 1.70 kB 56.03 kB
/ui/error-dialog 12.62 kB 56.03 kB
/ui/fullscreen-button 11.50 kB 56.03 kB
/ui/gesture 9.96 kB 56.03 kB
/ui/hotkey 10.37 kB 56.03 kB
/ui/live-button 10.02 kB 56.03 kB
/ui/menu 19.18 kB 56.03 kB
/ui/menu-checkbox-item 1.97 kB 56.03 kB
/ui/menu-content 7.64 kB 56.03 kB
/ui/menu-group 2.09 kB 56.03 kB
/ui/menu-group-label 1.64 kB —
/ui/menu-item 2.29 kB 56.03 kB
/ui/menu-item-indicator 1.38 kB 56.03 kB
/ui/menu-radio-group 3.02 kB 56.03 kB
/ui/menu-radio-item 2.14 kB 56.03 kB
/ui/menu-separator 1.30 kB 56.03 kB
/ui/mute-button 11.52 kB 56.03 kB
/ui/pip-button 11.48 kB 56.03 kB
/ui/play-button 11.46 kB 56.03 kB
/ui/playback-rate-button 11.56 kB 56.03 kB
/ui/playback-rate-radio-group 11.62 kB 56.03 kB
/ui/popover 8.76 kB 56.03 kB
/ui/poster 9.15 kB 56.03 kB
/ui/quality-radio-group 12.12 kB 56.03 kB
/ui/seek-button 11.50 kB 56.03 kB
/ui/seek-indicator 12.95 kB 56.03 kB
/ui/seek-indicator-value 1.10 kB —
/ui/slider 11.88 kB 56.03 kB
/ui/slider-preview 2.01 kB 56.03 kB
/ui/status-announcer 10.86 kB 56.03 kB
/ui/status-indicator 13.29 kB 56.03 kB
/ui/status-indicator-value 1.10 kB —
/ui/thumbnail 10.58 kB 56.03 kB
/ui/time 11.29 kB 56.03 kB
/ui/time-slider 13.38 kB 56.03 kB
/ui/time-slider-chapter-title 9.04 kB 56.03 kB
/ui/time-slider-chapters 9.88 kB 56.03 kB
/ui/title 8.44 kB 56.03 kB
/ui/tooltip 10.13 kB 56.03 kB
/ui/tooltip-label 1.21 kB —
/ui/tooltip-shortcut 1.18 kB —
/ui/volume-indicator 13.26 kB 56.03 kB
/ui/volume-indicator-fill 1.11 kB —
/ui/volume-indicator-value 1.10 kB —
/ui/volume-popover 15.14 kB 56.03 kB
/ui/volume-slider 12.58 kB 56.03 kB
⚛️ @videojs/react — no changes
Presets (7)
Entry Initial Lazy
/video (default) 58.84 kB 56.03 kB
/video (default + hls) 59.33 kB 56.03 kB
/video (minimal) 58.93 kB 56.03 kB
/video (minimal + hls) 59.39 kB 56.03 kB
/audio (default) 45.68 kB 56.03 kB
/audio (minimal) 45.68 kB 56.03 kB
/background 908 B 56.03 kB
Media (22)
Entry Initial
/media/mux-video/hls-js 1.46 kB
/media/mux-video/spf 1.46 kB
/media/mux-audio/hls-js 1.12 kB
/media/mux-audio/spf 1.13 kB
/media/background-video 513 B
/media/cloudflare-video 1.81 kB
/media/dash-video 1.11 kB
/media/hls-audio 22.36 kB
/media/hls-background-video 17.49 kB
/media/hls-video 32.59 kB
/media/hlsjs-video 1.12 kB
/media/mux-audio 1.12 kB
/media/mux-background-video 17.49 kB
/media/mux-video 1.45 kB
/media/native-hls-video 6.32 kB
/media/shaka-video 1.11 kB
/media/spotify-audio 1.89 kB
/media/tiktok-video 1.81 kB
/media/twitch-video 1.84 kB
/media/vimeo-video 1.79 kB
/media/wistia-video 1.41 kB
/media/youtube-video 1.79 kB
Extensions (2)
Entry Initial
/extensions/google-cast 1.77 kB
/extensions/mux-data 1.80 kB
Players (5)
Entry Initial Lazy
/video/player 8.22 kB 56.03 kB
/audio/player 4.38 kB 56.03 kB
/background/player 2.64 kB 56.03 kB
/live-video/player 7.60 kB 56.03 kB
/live-audio/player 4.40 kB 56.03 kB
Skins (18)
Entry Type Initial Lazy
/video/minimal-skin.css css 8.12 kB —
/video/skin.css css 7.81 kB —
/video/minimal-skin js 58.75 kB 56.03 kB
/video/skin js 58.64 kB 56.03 kB
/audio/minimal-skin.css css 5.88 kB —
/audio/skin.css css 5.60 kB —
/audio/minimal-skin js 45.56 kB 56.03 kB
/audio/skin js 45.60 kB 56.03 kB
/background/skin.css css 97 B —
/background/skin js 518 B —
/live-video/minimal-skin.css css 6.60 kB —
/live-video/skin.css css 6.51 kB —
/live-video/minimal-skin js 48.61 kB 56.03 kB
/live-video/skin js 48.64 kB 56.03 kB
/live-audio/minimal-skin.css css 4.58 kB —
/live-audio/skin.css css 4.47 kB —
/live-audio/minimal-skin js 33.79 kB 56.03 kB
/live-audio/skin js 33.79 kB 56.03 kB
UI Components (39)
Entry Initial Lazy
/ui/airplay-button 11.22 kB 56.03 kB
/ui/alert-dialog 5.20 kB 56.03 kB
/ui/audio-track 8.35 kB 56.03 kB
/ui/audio-track-radio-group 10.78 kB 56.03 kB
/ui/buffering-indicator 8.40 kB 56.03 kB
/ui/captions-button 11.19 kB 56.03 kB
/ui/captions-radio-group 10.88 kB 56.03 kB
/ui/cast-button 11.22 kB 56.03 kB
/ui/controls 8.29 kB 56.03 kB
/ui/dialog 5.19 kB 56.03 kB
/ui/error-dialog 12.61 kB 56.03 kB
/ui/fullscreen-button 11.17 kB 56.03 kB
/ui/gesture 8.60 kB 56.03 kB
/ui/hotkey 8.99 kB 56.03 kB
/ui/live-button 9.53 kB 56.03 kB
/ui/menu 22.01 kB 56.03 kB
/ui/mute-button 11.22 kB 56.03 kB
/ui/pip-button 11.18 kB 56.03 kB
/ui/play-button 11.16 kB 56.03 kB
/ui/playback-rate 8.41 kB 56.03 kB
/ui/playback-rate-button 11.14 kB 56.03 kB
/ui/playback-rate-radio-group 10.85 kB 56.03 kB
/ui/popover 9.12 kB 56.03 kB
/ui/poster 8.61 kB 56.03 kB
/ui/quality 8.77 kB 56.03 kB
/ui/quality-radio-group 11.19 kB 56.03 kB
/ui/seek-button 11.18 kB 56.03 kB
/ui/seek-indicator 12.91 kB 56.03 kB
/ui/slider 14.34 kB 56.03 kB
/ui/status-announcer 10.81 kB 56.03 kB
/ui/status-indicator 13.34 kB 56.03 kB
/ui/thumbnail 9.77 kB 56.03 kB
/ui/time 10.60 kB 56.03 kB
/ui/time-slider 16.17 kB 56.03 kB
/ui/title 7.88 kB 56.03 kB
/ui/tooltip 9.98 kB 56.03 kB
/ui/volume-indicator 13.39 kB 56.03 kB
/ui/volume-popover 15.53 kB 56.03 kB
/ui/volume-slider 12.96 kB 56.03 kB
🧩 @videojs/core — no changes
Entries (76)
Entry Initial Lazy
. 13.41 kB —
/dom 23.48 kB 56.03 kB
/vjsc 1.90 kB —
/i18n 3.21 kB 56.03 kB
/i18n/locales/all 33.91 kB —
/i18n/locales/ar 1.16 kB —
/i18n/locales/az 1.08 kB —
/i18n/locales/bg 1.29 kB —
/i18n/locales/bn 1.25 kB —
/i18n/locales/bs 1.02 kB —
/i18n/locales/ca 1.04 kB —
/i18n/locales/cs 1.10 kB —
/i18n/locales/cy 1.02 kB —
/i18n/locales/da 984 B —
/i18n/locales/de 1.06 kB —
/i18n/locales/el 1.42 kB —
/i18n/locales/en 801 B —
/i18n/locales/es 999 B —
/i18n/locales/et 1.02 kB —
/i18n/locales/eu 1.04 kB —
/i18n/locales/fa 1.21 kB —
/i18n/locales/fi 1.05 kB —
/i18n/locales/fr 1.01 kB —
/i18n/locales/gd 1.09 kB —
/i18n/locales/gl 1017 B —
/i18n/locales/he 1.10 kB —
/i18n/locales/hi 1.25 kB —
/i18n/locales/hr 1.05 kB —
/i18n/locales/hu 1.10 kB —
/i18n/locales/id 953 B —
/i18n/locales/it 1.01 kB —
/i18n/locales/ja 1.16 kB —
/i18n/locales/ko 1.08 kB —
/i18n/locales/lt 1.04 kB —
/i18n/locales/lv 1.09 kB —
/i18n/locales/mr 1.23 kB —
/i18n/locales/nb 990 B —
/i18n/locales/ne 1.23 kB —
/i18n/locales/nl 1.01 kB —
/i18n/locales/nn 983 B —
/i18n/locales/oc 1.05 kB —
/i18n/locales/pl 1.11 kB —
/i18n/locales/pt 1.02 kB —
/i18n/locales/pt-BR 1.02 kB —
/i18n/locales/pt-PT 1.02 kB —
/i18n/locales/ro 1.04 kB —
/i18n/locales/ru 1.36 kB —
/i18n/locales/sk 1.10 kB —
/i18n/locales/sl 1.04 kB —
/i18n/locales/sr 1.05 kB —
/i18n/locales/sv 1.01 kB —
/i18n/locales/te 1.29 kB —
/i18n/locales/th 1.20 kB —
/i18n/locales/tr 1.00 kB —
/i18n/locales/uk 1.37 kB —
/i18n/locales/vi 1.10 kB —
/i18n/locales/zh 1.01 kB —
/i18n/locales/zh-CN 1.01 kB —
/i18n/locales/zh-TW 1.02 kB —
/i18n/text/airplay 101 B —
/i18n/text/buttons 137 B —
/i18n/text/captions 93 B —
/i18n/text/cast 114 B —
/i18n/text/common 90 B —
/i18n/text/container 75 B —
/i18n/text/errors 285 B —
/i18n/text/fullscreen 98 B —
/i18n/text/live 126 B —
/i18n/text/menu 249 B —
/i18n/text/pip 101 B —
/i18n/text/playback 80 B —
/i18n/text/seek 105 B —
/i18n/text/slider 65 B —
/i18n/text/status 222 B —
/i18n/text/time 322 B —
/i18n/text/volume 133 B —
🏷️ @videojs/element — no changes
Entries (2)
Entry Initial
. 1.05 kB
/context 943 B
📦 @videojs/store — no changes
Entries (3)
Entry Initial
. 1.72 kB
/html 703 B
/react 511 B
🔧 @videojs/utils — no changes
Entries (13)
Entry Initial
/array 271 B
/dom 5.25 kB
/events 320 B
/function 414 B
/i18n 249 B
/jwt 176 B
/object 535 B
/predicate 297 B
/percent 281 B
/string 239 B
/style 212 B
/time 1018 B
/number 199 B
📦 @videojs/cdn — no changes
📦 @videojs/cloudflare-video — no changes
📦 @videojs/dash-video — no changes
📦 @videojs/google-cast — no changes
📦 @videojs/hlsjs-video — no changes
📦 @videojs/media — no changes
Entries (3)
Entry Initial
. 1.29 kB
/dom 4.12 kB
/media-tracks 2.05 kB
📦 @videojs/mux — no changes
📦 @videojs/mux-audio — no changes
Entries (2)
Entry Initial
. 136.12 kB
/spf 22.85 kB
📦 @videojs/mux-data — no changes
📦 @videojs/mux-video — no changes
Entries (2)
Entry Initial
. 136.12 kB
/spf 33.00 kB
📦 @videojs/native-hls-video — no changes
📦 @videojs/shaka-video — no changes

📦 @videojs/spf

Path Base initial PR initial Initial diff Lazy diff
/moq 31.56 kB 102.55 kB +70.98 kB (+224.9%) —
Entries (8)
Entry Initial
. 4.55 kB
/dom 7.67 kB
/hls 28.22 kB
/media-tracks 607 B
/moq 102.55 kB
/hls-background-video 16.51 kB
/hls-audio 21.36 kB
/hls-video 31.73 kB
📦 @videojs/spotify-audio — no changes
📦 @videojs/tiktok-video — no changes
📦 @videojs/twitch-video — no changes
📦 @videojs/other — no changes
Entries (3)
Entry Initial Lazy
video.js 71.83 kB 56.03 kB
video.js/package.json 608 B —
video.js/errors 1.03 kB —
📦 @videojs/vimeo-video — no changes
📦 @videojs/wistia-video — no changes
Entries (2)
Entry Initial
. 1.91 kB
/helpers 1.77 kB
📦 @videojs/youtube-video — no changes

ℹ️ How to interpret

Each entry is independently bundled, minified, and brotli-compressed. Initial size includes its static import graph; lazy dynamic chunks are reported separately.

Entries are not additive because their dependency graphs overlap. Preset rows represent realistic combined bundles.

Changes of 300 B or less across initial, lazy, and total size are collapsed, not discarded.

Run pnpm size locally to check current initial sizes.

@cubic-dev-ai cubic-dev-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.

6 issues found across 36 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/spf/package.json">

<violation number="1" location="packages/spf/package.json:82">
P2: `@caprid/moq-core` and `@caprid/moq-media` 0.1.1 declare `engines: node >=24` in the lockfile, but the root `engines` still allows `>=22.19.0`. Either raise the root `engines` floor to match, or confirm that Node 22 consumers of the workspace will not install or build these packages.</violation>
</file>

<file name=".agents/plans/moq-transport-20-migration.md">

<violation number="1" location=".agents/plans/moq-transport-20-migration.md:21">
P3: This migration plan is explicitly superseded, so retaining its draft-20 checklist leaves stale instructions in the repository. Delete `.agents/plans/moq-transport-20-migration.md` before merging.</violation>
</file>

<file name=".agents/plans/moq-engine-implementation.md">

<violation number="1" location=".agents/plans/moq-engine-implementation.md:12">
P3: This temporary implementation plan should not remain in the repository after the implementation lands. Delete `.agents/plans/moq-engine-implementation.md` before merging, as required by `.agents/plans/README.md`.</violation>
</file>

<file name="apps/sandbox/templates/spf-moq-player/loopback-relay.ts">

<violation number="1" location="apps/sandbox/templates/spf-moq-player/loopback-relay.ts:5">
P3: The sandbox UI still says the default loopback relay speaks draft-20, contradicting this draft-22 update. Update `index.html` so the user-facing description matches the relay.</violation>

<violation number="2" location="apps/sandbox/templates/spf-moq-player/loopback-relay.ts:48">
P3: The draft-22 vi64 comment omits the 9-byte, 64-bit form, and `varintByteLength` still caps encodings at 8 bytes. Add draft-22’s 9-byte encoding support before claiming full draft-22 wire coverage.</violation>

<violation number="3" location="apps/sandbox/templates/spf-moq-player/loopback-relay.ts:687">
P3: Section 6.4.2.3 does not define FIN as cancellation; it explicitly distinguishes FIN from RESET_STREAM/STOP_SENDING cancellation. Describe the `done` branch as graceful stream completion and leave cancellation to the catch path.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/spf/package.json
},
"dependencies": {
"@caprid/moq-media": "^0.1.0",
"@caprid/moq-core": "^0.1.1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: @caprid/moq-core and @caprid/moq-media 0.1.1 declare engines: node >=24 in the lockfile, but the root engines still allows >=22.19.0. Either raise the root engines floor to match, or confirm that Node 22 consumers of the workspace will not install or build these packages.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/spf/package.json, line 82:

<comment>`@caprid/moq-core` and `@caprid/moq-media` 0.1.1 declare `engines: node >=24` in the lockfile, but the root `engines` still allows `>=22.19.0`. Either raise the root `engines` floor to match, or confirm that Node 22 consumers of the workspace will not install or build these packages.</comment>

<file context>
@@ -79,7 +79,8 @@
   },
   "dependencies": {
-    "@caprid/moq-media": "^0.1.0",
+    "@caprid/moq-core": "^0.1.1",
+    "@caprid/moq-media": "^0.1.1",
     "@videojs/media": "workspace:*",
</file context>

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Won't fix. The same engines: node >=24 mismatch was accepted for @caprid/moq-media in #72, and moq-core only adds the same constraint.

@@ -18,6 +18,13 @@ the spec text is ambiguous, and calls out each place it does.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: This migration plan is explicitly superseded, so retaining its draft-20 checklist leaves stale instructions in the repository. Delete .agents/plans/moq-transport-20-migration.md before merging.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .agents/plans/moq-transport-20-migration.md, line 21:

<comment>This migration plan is explicitly superseded, so retaining its draft-20 checklist leaves stale instructions in the repository. Delete `.agents/plans/moq-transport-20-migration.md` before merging.</comment>

<file context>
@@ -18,6 +18,13 @@ the spec text is ambiguous, and calls out each place it does.
 
 Temporary implementation notes — delete before merge per `AGENTS.md`.
 
+**Superseded on the player (2026-10-27):** `mmcc/moq` now takes its transport
+from `@caprid/moq-core`, which was extracted from `network/moqt/`. It offers
+`moqt-22` first and falls back to `moqt-20`. The local modules this plan
</file context>

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Won't fix. The MoQ plan files are kept on these integration branches deliberately. This one is marked superseded on the player instead.

@@ -9,7 +9,7 @@ plan, and what Phase 0/5 still owes.
| Plan item | Status | Where |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: This temporary implementation plan should not remain in the repository after the implementation lands. Delete .agents/plans/moq-engine-implementation.md before merging, as required by .agents/plans/README.md.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .agents/plans/moq-engine-implementation.md, line 12:

<comment>This temporary implementation plan should not remain in the repository after the implementation lands. Delete `.agents/plans/moq-engine-implementation.md` before merging, as required by `.agents/plans/README.md`.</comment>

<file context>
@@ -9,7 +9,7 @@ plan, and what Phase 0/5 still owes.
 |---|---|---|
 | §5 type-model change | ✅ | `media/types` — `TrackDeliveryMode` + `LiveOf<T>` (extends `PartiallyResolved<T>`, zero HLS ripple; audit confirmed selection reads only metadata) |
-| Phase 1 wire protocol | ✅ | `network/moqt/` — vi64 varint, control messages, request streams, object streams, session driver; 51 tests incl. spec Table 2 golden vectors |
+| Phase 1 wire protocol | ✅ | Was `network/moqt/` (vi64 varint, control messages, request streams, object streams, session driver; 51 tests incl. spec Table 2 golden vectors). Since 2026-10-27 the player uses `@caprid/moq-core`, the package extracted from it |
 | Phase 2 format layer | ✅ | `media/moq/` — parse-source (msf: fragment), parse-catalog (independent + delta), loc, codec-mapping, timeline; 46 tests |
 | Phase 3 actors/behaviors | ✅ | `playback/actors/{moq-session,track-subscriber}`, `playback/actors/dom/{video,audio}-renderer`, `playback/behaviors/{setup-moq-session,resolve-catalog,subscribe-selected-tracks,sync-latency,track-moq-bandwidth}`, `behaviors/dom/setup-moq-renderers` |
</file context>

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Won't fix, for the same reason: the MoQ plan files are kept on these integration branches deliberately.

*
* There is no public relay that serves draft-ietf-moq-msf-01 catalogs yet (Phase 0 interop is still owed), so this
* stands in for one: it speaks real draft-20 bytes over an in-memory `MoqtTransport` and publishes real
* stands in for one: it speaks real draft-22 bytes over an in-memory `MoqtTransport` and publishes real

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The sandbox UI still says the default loopback relay speaks draft-20, contradicting this draft-22 update. Update index.html so the user-facing description matches the relay.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/sandbox/templates/spf-moq-player/loopback-relay.ts, line 5:

<comment>The sandbox UI still says the default loopback relay speaks draft-20, contradicting this draft-22 update. Update `index.html` so the user-facing description matches the relay.</comment>

<file context>
@@ -2,12 +2,12 @@
  *
  * There is no public relay that serves draft-ietf-moq-msf-01 catalogs yet (Phase 0 interop is still owed), so this
- * stands in for one: it speaks real draft-20 bytes over an in-memory `MoqtTransport` and publishes real
+ * stands in for one: it speaks real draft-22 bytes over an in-memory `MoqtTransport` and publishes real
  * WebCodecs-encoded media, which is enough to drive the whole engine — catalog → selection → subscribe → decode →
  * canvas + AudioContext.
</file context>

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in #77: the sandbox page now says draft-22.

Comment on lines +687 to 688
// Cancellation *is* the stream lifecycle (§6.4.2.3): the subscriber
// aborting its sending direction ends the subscription.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: Section 6.4.2.3 does not define FIN as cancellation; it explicitly distinguishes FIN from RESET_STREAM/STOP_SENDING cancellation. Describe the done branch as graceful stream completion and leave cancellation to the catch path.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/sandbox/templates/spf-moq-player/loopback-relay.ts, line 687:

<comment>Section 6.4.2.3 does not define FIN as cancellation; it explicitly distinguishes FIN from RESET_STREAM/STOP_SENDING cancellation. Describe the `done` branch as graceful stream completion and leave cancellation to the catch path.</comment>

<file context>
@@ -684,7 +684,7 @@ export function createLoopbackRelay({ onLog }: LoopbackRelayOptions = {}): Loopb
 
           const { value, done } = await reader.read();
-          // Cancellation *is* the stream lifecycle (§3.3.3): the subscriber
+          // Cancellation *is* the stream lifecycle (§6.4.2.3): the subscriber
           // aborting its sending direction ends the subscription.
           if (done) break;
</file context>
Suggested change
// Cancellation *is* the stream lifecycle (§6.4.2.3): the subscriber
// aborting its sending direction ends the subscription.
// A FIN means the subscriber sent no further messages; cancellation
// uses RESET_STREAM/STOP_SENDING (§6.4.2.3) and reaches the catch path.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in #77. The comment now says a FIN isn't a cancellation (§6.4.2.2), that this loopback ends the subscription on either, and why that's harmless with this player (moq-core cancels with a reset and FINs only after the publisher).

* The vi64 varint of draft-15+ (§1.4.1) — leading ones on the first byte give the encoded length minus one, so an
* L-byte encoding carries 7L value bits. NOT the QUIC RFC 9000 varint.
* The vi64 varint of draft-15+ (§8.1) — leading ones on the first byte give the encoded length minus one, so an L-byte
* encoding carries 7L value bits. NOT the QUIC RFC 9000 varint.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The draft-22 vi64 comment omits the 9-byte, 64-bit form, and varintByteLength still caps encodings at 8 bytes. Add draft-22’s 9-byte encoding support before claiming full draft-22 wire coverage.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/sandbox/templates/spf-moq-player/loopback-relay.ts, line 48:

<comment>The draft-22 vi64 comment omits the 9-byte, 64-bit form, and `varintByteLength` still caps encodings at 8 bytes. Add draft-22’s 9-byte encoding support before claiming full draft-22 wire coverage.</comment>

<file context>
@@ -31,21 +31,21 @@ const MESSAGE_TYPE = {
- * The vi64 varint of draft-15+ (§1.4.1) — leading ones on the first byte give the encoded length minus one, so an
- * L-byte encoding carries 7L value bits. NOT the QUIC RFC 9000 varint.
+ * The vi64 varint of draft-15+ (§8.1) — leading ones on the first byte give the encoded length minus one, so an L-byte
+ * encoding carries 7L value bits. NOT the QUIC RFC 9000 varint.
  */
 function varintByteLength(value: number): number {
</file context>

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Corrected the comment in #77, but no encoder change. The decoder already reads the 9-byte form, and the 8-byte form's 56 bits cover every integer a JS number represents exactly (2^53), so the encoder never needs 9 bytes.

@mmcc
mmcc merged commit acb8ce9 into mmcc/moq Oct 27, 2026
27 of 29 checks passed
mmcc added a commit that referenced this pull request Oct 27, 2026
fix(spf): pin @caprid/moq-media 0.1.0 and address #75 review
mmcc added a commit that referenced this pull request Oct 28, 2026
Brings in #72 (worklet audio core), #75 (player on @caprid/moq-core,
moqt-22) and #77 (moq-media pinned to 0.1.0).

The publisher keeps its own draft-20 copy of network/moqt until its
publish session moves onto @caprid/moq-core; the player side uses the
package. The cross-engine relay hub now speaks each engine's draft:
draft-20 upstream to the publisher, moqt-22 (via moqt-wire) to the
player, whose Location Filters draft-22 encodes differently. The
cross-engine harness hands the engine a context with `baseContext`, as
the adapter does, so the worklet audio core can start.

Claude-Session: https://claude.ai/code/session_01DaH4ihcQ4LStE1f1zbDuZm
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