@blockcast/mmt-container 0.4.0-main.bbd83cb48eff → 0.4.0-main.bd9f80b4a95e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/README.md +31 -17
  2. package/dist/align.d.ts +24 -18
  3. package/dist/align.d.ts.map +1 -1
  4. package/dist/align.js +23 -4
  5. package/dist/align.js.map +2 -2
  6. package/dist/browser-runtime.js +1409 -395
  7. package/dist/browser-runtime.js.map +4 -4
  8. package/dist/carp-catalog.d.ts +71 -36
  9. package/dist/carp-catalog.d.ts.map +1 -1
  10. package/dist/carp-catalog.js +306 -200
  11. package/dist/carp-catalog.js.map +3 -3
  12. package/dist/catalog-fec-params.d.ts +12 -4
  13. package/dist/catalog-fec-params.d.ts.map +1 -1
  14. package/dist/catalog-fec-params.js +40 -17
  15. package/dist/catalog-fec-params.js.map +3 -3
  16. package/dist/catalog-network-source.d.ts +28 -7
  17. package/dist/catalog-network-source.d.ts.map +1 -1
  18. package/dist/catalog-network-source.js +21 -1
  19. package/dist/catalog-network-source.js.map +2 -2
  20. package/dist/catalog-validator.d.ts +4 -3
  21. package/dist/catalog-validator.d.ts.map +1 -1
  22. package/dist/catalog-validator.js +0 -29
  23. package/dist/catalog-validator.js.map +3 -3
  24. package/dist/cmcd-producer.d.ts +8 -0
  25. package/dist/cmcd-producer.d.ts.map +1 -1
  26. package/dist/cmcd-producer.js +14 -0
  27. package/dist/cmcd-producer.js.map +2 -2
  28. package/dist/delivery-catalog.js +18 -12
  29. package/dist/delivery-catalog.js.map +4 -4
  30. package/dist/fec-manager.d.ts +111 -6
  31. package/dist/fec-manager.d.ts.map +1 -1
  32. package/dist/fec-manager.js +326 -29
  33. package/dist/fec-manager.js.map +3 -3
  34. package/dist/fec-state.d.ts +2 -1
  35. package/dist/fec-state.d.ts.map +1 -1
  36. package/dist/fec-state.js +18 -3
  37. package/dist/fec-state.js.map +3 -3
  38. package/dist/fec-worker-setup.d.ts +10 -0
  39. package/dist/fec-worker-setup.d.ts.map +1 -1
  40. package/dist/fec-worker-setup.js +5 -2
  41. package/dist/fec-worker-setup.js.map +2 -2
  42. package/dist/index.d.ts +5 -5
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +8 -8
  45. package/dist/index.js.map +2 -2
  46. package/dist/iso-block-locator.d.ts +38 -1
  47. package/dist/iso-block-locator.d.ts.map +1 -1
  48. package/dist/iso-block-locator.js +108 -17
  49. package/dist/iso-block-locator.js.map +3 -3
  50. package/dist/manifest-auth-plan.d.ts +26 -25
  51. package/dist/manifest-auth-plan.d.ts.map +1 -1
  52. package/dist/manifest-auth-plan.js +331 -1171
  53. package/dist/manifest-auth-plan.js.map +4 -4
  54. package/dist/mfu-reassembler.js.map +2 -2
  55. package/dist/mmtp-container-parser.js.map +2 -2
  56. package/dist/mmtp-container-parser.no-modules.js +1029 -290
  57. package/dist/mmtp-container-parser.no-modules.js.map +4 -4
  58. package/dist/mmtp-decode-pipeline.js.map +2 -2
  59. package/dist/mmtp-fec-session.d.ts +159 -0
  60. package/dist/mmtp-fec-session.d.ts.map +1 -0
  61. package/dist/mmtp-fec-session.js +531 -0
  62. package/dist/mmtp-fec-session.js.map +7 -0
  63. package/dist/mmtp-router.d.ts +25 -2
  64. package/dist/mmtp-router.d.ts.map +1 -1
  65. package/dist/mmtp-router.js +48 -5
  66. package/dist/mmtp-router.js.map +2 -2
  67. package/dist/multicast-auth-catalog.d.ts +86 -92
  68. package/dist/multicast-auth-catalog.d.ts.map +1 -1
  69. package/dist/multicast-auth-catalog.js +347 -132
  70. package/dist/multicast-auth-catalog.js.map +4 -4
  71. package/dist/multicast-input.d.ts +31 -8
  72. package/dist/multicast-input.d.ts.map +1 -1
  73. package/dist/multicast-input.js +299 -35
  74. package/dist/multicast-input.js.map +3 -3
  75. package/dist/multicast-manager.d.ts +45 -5
  76. package/dist/multicast-manager.d.ts.map +1 -1
  77. package/dist/multicast-manager.js +469 -65
  78. package/dist/multicast-manager.js.map +4 -4
  79. package/dist/multicast-transport.d.ts +6 -0
  80. package/dist/multicast-transport.d.ts.map +1 -1
  81. package/dist/multicast-transport.js +18 -11
  82. package/dist/multicast-transport.js.map +4 -4
  83. package/dist/multicast-unwrap.js.map +2 -2
  84. package/dist/no-modules.d.ts +4 -1
  85. package/dist/no-modules.d.ts.map +1 -1
  86. package/dist/no-modules.js +979 -275
  87. package/dist/no-modules.js.map +4 -4
  88. package/dist/phase14-catalog-override.d.ts +1 -1
  89. package/dist/phase14-catalog-override.d.ts.map +1 -1
  90. package/dist/phase14-catalog-override.js +2 -2
  91. package/dist/phase14-catalog-override.js.map +2 -2
  92. package/dist/repair-fetch.d.ts +81 -6
  93. package/dist/repair-fetch.d.ts.map +1 -1
  94. package/dist/repair-fetch.js +156 -31
  95. package/dist/repair-fetch.js.map +3 -3
  96. package/dist/repair-layers.d.ts +2 -0
  97. package/dist/repair-layers.d.ts.map +1 -1
  98. package/dist/repair-layers.js +19 -2
  99. package/dist/repair-layers.js.map +2 -2
  100. package/dist/signaling.d.ts +2 -2
  101. package/dist/signaling.d.ts.map +1 -1
  102. package/dist/signaling.js +3 -3
  103. package/dist/signaling.js.map +2 -2
  104. package/dist/source-auth.js +2710 -7
  105. package/dist/source-auth.js.map +4 -4
  106. package/dist/switching-set-alignment.d.ts +1 -1
  107. package/dist/switching-set-alignment.js.map +1 -1
  108. package/dist/timestamp-codec.js.map +2 -2
  109. package/dist/wasm-mfu-reassembler.js.map +1 -1
  110. package/dist/wasm-mmtp-container-parser.js.map +2 -2
  111. package/package.json +6 -9
  112. package/schemas/catalog.schema.json +133 -38
  113. package/src/align.ts +52 -21
  114. package/src/carp-catalog.ts +156 -59
  115. package/src/catalog-fec-params.ts +28 -3
  116. package/src/catalog-network-source.ts +49 -7
  117. package/src/catalog-validator.ts +4 -11
  118. package/src/cmcd-producer.ts +17 -0
  119. package/src/fec-manager.ts +346 -19
  120. package/src/fec-state.ts +11 -4
  121. package/src/fec-worker-setup.ts +14 -1
  122. package/src/index.ts +27 -10
  123. package/src/iso-block-locator.ts +109 -7
  124. package/src/manifest-auth-plan.ts +39 -91
  125. package/src/mmtp-fec-session.ts +533 -0
  126. package/src/mmtp-router.ts +90 -2
  127. package/src/multicast-auth-catalog.ts +131 -238
  128. package/src/multicast-input.ts +148 -124
  129. package/src/multicast-manager.ts +124 -14
  130. package/src/multicast-transport.ts +3 -0
  131. package/src/no-modules.ts +7 -1
  132. package/src/phase14-catalog-override.ts +3 -3
  133. package/src/repair-fetch.ts +283 -39
  134. package/src/repair-layers.ts +22 -2
  135. package/src/signaling.ts +2 -2
  136. package/src/switching-set-alignment.ts +1 -1
  137. package/test-vectors/align.json +108 -32
  138. package/test-vectors/bc-provenance-v2.json +1526 -0
  139. package/test-vectors/catalog/README.md +66 -3
  140. package/test-vectors/catalog/negative/fec-block-profile-missing.json +1 -1
  141. package/test-vectors/catalog/negative/fec-block-profile-retired.json +1 -1
  142. package/test-vectors/catalog/negative/fec-block-profile-unknown.json +1 -1
  143. package/test-vectors/catalog/negative/fec-iso-symbol-size-below-floor.json +28 -0
  144. package/test-vectors/catalog/negative/fec-reed-solomon-iso-symbol-size-13.json +28 -0
  145. package/test-vectors/catalog/negative/fec-reed-solomon-k-plus-p-over-255.json +39 -0
  146. package/test-vectors/catalog/negative/fec-reed-solomon-overlay-over-255.json +40 -0
  147. package/test-vectors/catalog/negative/fec-repair-overlay-source-symbols-zero.json +43 -0
  148. package/test-vectors/catalog/negative/fec-repair-symbols-zero.json +28 -0
  149. package/test-vectors/catalog/negative/fec-source-symbols-zero.json +28 -0
  150. package/test-vectors/catalog/negative/fec-symbol-size-zero.json +28 -0
  151. package/test-vectors/catalog/negative/init-data-inline-without-data.json +22 -0
  152. package/test-vectors/catalog/negative/mmtp-mode-mpu.json +15 -0
  153. package/test-vectors/catalog/negative/multicast-amt-dns-without-relay.json +37 -0
  154. package/test-vectors/catalog/negative/multicast-amt-driad-with-relay.json +38 -0
  155. package/test-vectors/catalog/negative/multicast-auth-asm-missing-sender-address.json +77 -0
  156. package/test-vectors/catalog/negative/multicast-auth-duplicate-first-epoch.json +56 -0
  157. package/test-vectors/catalog/negative/multicast-auth-duplicate-kid.json +56 -0
  158. package/test-vectors/catalog/negative/multicast-auth-endpoint-auth-without-object-auth.json +38 -0
  159. package/test-vectors/catalog/negative/multicast-auth-endpoint-missing-auth.json +49 -0
  160. package/test-vectors/catalog/negative/multicast-auth-endpoint-missing-bandwidth.json +55 -0
  161. package/test-vectors/catalog/negative/multicast-auth-manifest-port-equals-port.json +56 -0
  162. package/test-vectors/catalog/negative/multicast-auth-manifest-timer-out-of-range.json +56 -0
  163. package/test-vectors/catalog/negative/multicast-auth-max-auth-delay-above-max.json +56 -0
  164. package/test-vectors/catalog/negative/multicast-auth-max-auth-delay-below-min.json +56 -0
  165. package/test-vectors/catalog/negative/multicast-auth-root-dotted-key.json +55 -0
  166. package/test-vectors/catalog/negative/multicast-auth-sender-address-on-ssm.json +57 -0
  167. package/test-vectors/catalog/negative/multicast-auth-version-1.json +56 -0
  168. package/test-vectors/catalog/negative/multicast-auth-version-3.json +56 -0
  169. package/test-vectors/catalog/negative/multicast-auth-version-missing.json +55 -0
  170. package/test-vectors/catalog/negative/multicast-endpoint-foreign-namespace-track.json +44 -0
  171. package/test-vectors/catalog/negative/multicast-endpoint-protocol-amt.json +38 -0
  172. package/test-vectors/catalog/negative/multicast-endpoint-protocol-atsc3.json +38 -0
  173. package/test-vectors/catalog/negative/presentation-anchor-unsafe.json +16 -0
  174. package/test-vectors/catalog/positive/fec-algorithm-unimplemented.json +29 -0
  175. package/test-vectors/catalog/positive/fec-iso-ssbg1.json +1 -1
  176. package/test-vectors/catalog/positive/fec-multicast.json +1 -1
  177. package/test-vectors/catalog/positive/fec-reed-solomon-layered.json +50 -0
  178. package/test-vectors/catalog/positive/mmt01-12-1-init-ref-anchor.json +29 -0
  179. package/test-vectors/catalog/positive/multicast-amt-discovery-omitted.json +37 -0
  180. package/test-vectors/catalog/positive/multicast-amt-dns-relay.json +38 -0
  181. package/test-vectors/catalog/positive/multicast-amt-manual-relay.json +3 -3
  182. package/test-vectors/catalog/{negative/multicast-endpoint-missing-protocol-and-source.json → positive/multicast-asm-unprotected.json} +10 -5
  183. package/test-vectors/catalog/positive/multicast-auth-asm-sender.json +78 -0
  184. package/test-vectors/catalog/positive/multicast-auth-rotation.json +39 -38
  185. package/test-vectors/catalog/positive/multicast-draft01-4-1-example.json +81 -0
  186. package/test-vectors/catalog/positive/multicast-draft01-7-2-6-example.json +70 -0
  187. package/test-vectors/catalog/positive/presentation-anchor-negative.json +27 -0
  188. package/test-vectors/catalog/section-codes.json +31 -1
  189. package/test-vectors/catalog-multicast-auth-v1.json +38 -20
  190. package/test-vectors/catalog-validation.json +6 -5
  191. package/test-vectors/catalog-validator-public-api.mjs +14 -9
  192. package/test-vectors/generate-bc-provenance-v2.mjs +252 -0
  193. package/dist/fec-codec.d.ts +0 -32
  194. package/dist/fec-codec.d.ts.map +0 -1
  195. package/dist/fec-codec.js +0 -47
  196. package/dist/fec-codec.js.map +0 -7
  197. package/src/fec-codec.ts +0 -61
package/README.md CHANGED
@@ -74,7 +74,6 @@ The package exposes a wide subpath surface so consumers can tree-shake aggressiv
74
74
  | `./multicast-unwrap` | Container-aware MMTP dispatch (LOC vs raw MMTP) |
75
75
  | `./signaling` | Packet-type classifier (`isSignalingPacket`, `isSourcePacket`, `classifyPacket`) |
76
76
  | `./mmtp-container-parser` | `MmtpContainerParser` (the unified, transport-agnostic parser) |
77
- | `./fec-codec` | Algorithm-pluggable codec interface — `NoneCodec`, `ReedSolomonCodec`, `createFecCodec` |
78
77
  | `./cmcd-producer` | `CmcdProducer` — RFC 9559 CMCD with `x-bc-*` vendor keys |
79
78
  | `./cmaf-block-assembler` | `CmafBlockAssembler` — assembles one CMAF segment per FEC source block |
80
79
  | `./cmaf-group-batcher` | `CmafGroupBatcher` — MoQ group → CMAF segment batcher |
@@ -121,7 +120,7 @@ function parseAlFecMessage(buf: Uint8Array): AlFecMessage | null // every FEC
121
120
  function parseMoqRepairFrame(buf: Uint8Array): MoqRepairFrame
122
121
  ```
123
122
 
124
- Constants worth knowing: `MMTP_HEADER_SIZE = 12`, `MPU_HEADER_SIZE = 8`, `MFU_DU_HEADER_SIZE_TIMED = 14`, `PACKET_TYPE_MPU = 0x00`, `PACKET_TYPE_REPAIR = 0x03`, `ALFEC_MESSAGE_ID = 0x0203`, `FEC_CODE_RAPTORQ = 2`.
123
+ Constants worth knowing: `MMTP_HEADER_SIZE = 12`, `MPU_HEADER_SIZE = 8`, `MFU_DU_HEADER_SIZE_TIMED = 14`, `PACKET_TYPE_MPU = 0x00`, `PACKET_TYPE_REPAIR = 0x03`, `ALFEC_MESSAGE_ID = 0x0203`, `FEC_CODE_RAPTORQ = 3`, `FEC_CODE_REED_SOLOMON = 1`.
125
124
 
126
125
  ```ts
127
126
  import { parseMMTPHeader, extractMFUPayload } from "@blockcast/mmt-base"
@@ -158,10 +157,12 @@ The constructor rejects non-null, non-finite, or non-positive deadlines. Reliabl
158
157
 
159
158
  ### CARP / CMSF catalog (`./carp-catalog`)
160
159
 
161
- Validate the published catalog schema through the package API. The schema uses
162
- the package-defined `uniqueMulticastAuthTrackBindings` keyword to reject reused
163
- `(mediaTrack, sourceSymbolFormat)` bindings, so compiling the JSON with a bare
164
- JSON Schema validator is not supported.
160
+ Validate the published catalog schema through the package API, then run
161
+ `validateCmsfMmtpCatalog`: the multicast rules of draft-ramadan-moq-multicast-01
162
+ that JSON Schema cannot state (a repeated `kid` or `firstEpoch` in
163
+ `multicast.auth.keys`, a `manifestPort` that clashes with a port of its
164
+ `(S, G)`, a track declaring a foreign namespace) live only in the runtime
165
+ validator.
165
166
 
166
167
  ```ts
167
168
  import schema from "@blockcast/mmt-container/catalog.schema.json" with { type: "json" }
@@ -173,7 +174,7 @@ if (!validateCatalog(catalog)) {
173
174
  }
174
175
  ```
175
176
 
176
- Implements `draft-law-ramadan-moq-carp-reliability` §3 (FEC), §4 (multicast endpoints), and `draft-ramadan-moq-mmt-00` §4.4.4 (track timing). Plain TypeScript interfaces with type guards — no Zod, no runtime schema dependency. Upstream Zod schemas should derive from these via `z.infer<>`.
177
+ Implements `draft-law-ramadan-moq-carp-reliability` §3 (FEC), §4 (multicast endpoints), and `draft-ramadan-moq-mmt-01` §4.4.2 (track timing). Plain TypeScript interfaces with type guards — no Zod, no runtime schema dependency. Upstream Zod schemas should derive from these via `z.infer<>`.
177
178
 
178
179
  ```ts
179
180
  type FecAlgorithm = "none" | "raptorq" | "reed-solomon"
@@ -187,7 +188,7 @@ interface FecCatalogConfig {
187
188
  interleaveDepthMs?: number // FEC block span in MILLISECONDS, default 0 (single-group blocks)
188
189
  repairTrack: string // §6.1 — required
189
190
  mode?: "interleaved" | "object" // extension; "object" (per-frame object blocks) is retired: @blockcast/mmt-fec refuses it
190
- uep?: { keyRatio: number; deltaRatio: number } // §9.1 — Unequal Error Protection
191
+ uep?: { keyRatio: number; deltaRatio: number } // Unequal Error Protection — Blockcast extension, not in draft-ramadan-moq-fec-01
191
192
  deltaFailWindowBlocks?: number // D-11, base track only
192
193
  deltaProbeIntervalMs?: number // D-13, base track only
193
194
  }
@@ -201,9 +202,10 @@ interface MulticastEndpoint {
201
202
  }
202
203
 
203
204
  // Relay/tuning discovery is catalog-level, not per-endpoint:
204
- // multicast.networkSource: [{ type: "amt", discovery: "driad" | "manual",
205
+ // multicast.networkSource: [{ type: "amt", discovery?: "dns" | "driad" | "manual",
205
206
  // relay?: string, port?: number }]
206
- // `relay` is REQUIRED for discovery: "manual"; "driad" resolves it at runtime.
207
+ // `relay` is REQUIRED for "dns" and "manual"; "driad" resolves it at runtime.
208
+ // An omitted `discovery` with a hostname relay is "dns" (multicast-01 4.2.1).
207
209
  // An endpoint-level `relayAddress` is retired — the schema, moq-rs and
208
210
  // `validateCmsfMmtpCatalog` (`multicast_relay_address`) all reject it.
209
211
 
@@ -247,8 +249,11 @@ DRIAD *and* a named relay — emit both entries, `[{type: "amt", discovery:
247
249
  non-DRIAD AMT entry, so the manual one carries the relay while the DRIAD one
248
250
  keeps the discovery request. An `atsc3` endpoint now
249
251
  requires a `{type: "atsc3", …}` entry and throws `atsc3_requires_tuning`
250
- without one: that entry carries the frequency, PLP, service id and SLS URI,
251
- which is the only tuning information an ATSC3 receiver has, and the schema
252
+ without one: that entry carries the frequency in kHz (REQUIRED) and,
253
+ optionally, the PLP, service id and SLS URI (draft -01 4.2.2/4.2.3) — the only
254
+ tuning information an ATSC3 receiver has (the SLS behind
255
+ `slsUri` describes the MMTP session, MP table included, per A/331:2026-04 7.2,
256
+ and nothing of this profile, so `manifestPort` and keys come from provisioning), and the schema
252
257
  cannot enforce it because `networkSource` is optional there (a native join has
253
258
  none). `version`, `validUntil` and `enabled` are still emitted and still
254
259
  outside `$defs/multicast` (the BLO-3323 freshness model, tracked separately).
@@ -378,7 +383,7 @@ Typed evidence is `RepairLifecycleEvent` version 2 and
378
383
  `MulticastManager.getBlockPolicyStats()`.
379
384
 
380
385
  This package depends on the FEC primitives from:
381
- - **`@blockcast/mmt-fec`** — RaptorQ WASM decoder + OTI codec + `computeFecTimeout`
386
+ - **`@blockcast/mmt-fec`** — RaptorQ WASM decoder + OTI codec + `fecBlockDeadlineMs` / `fecBlockBudgetMs`
382
387
  - **`@blockcast/fec-worker`** — Web Worker host, `FecWorkerClient`, `FecTrackStats`
383
388
 
384
389
  ### MMTP → CMAF demux (`./mmtp-to-cmaf`)
@@ -446,7 +451,7 @@ All string values pass through `sanitize()` (T-06-01) — commas, `\r`, `\n` are
446
451
 
447
452
  ### Multicast transport (`./multicast-transport`)
448
453
 
449
- Thin wrapper around the lowercase `window.multicast` gateway. Calls `globalThis.multicast.subscribe({ group, source, port, consume: 'bytes' })`, listens for `"bytes"` events (`CustomEvent<ArrayBuffer>`) on the returned `EventTarget` subscription, pumps packets to a callback, runs a 5-second watchdog, and fires `onTakeover` once both video and audio are confirmed receiving.
454
+ Thin wrapper around the lowercase `window.multicast` gateway. Calls `globalThis.multicast.subscribe({ group, source, port, consume: 'bytes' })`, listens for `"bytes"` events (`CustomEvent<ArrayBuffer>`) on the returned `EventTarget` subscription, pumps packets to a callback, runs a silence watchdog over the catalog-derived failback window (`setFailbackWindowMs`), and fires `onTakeover` once both video and audio are confirmed receiving.
450
455
 
451
456
  ```ts
452
457
  class MulticastTransport {
@@ -457,12 +462,21 @@ class MulticastTransport {
457
462
  confirmVideo(): void
458
463
  confirmAudio(): void
459
464
  onTakeover(cb: () => void): void
460
- onFailback(cb: () => void): void
465
+ onFailback(cb: (reason: MulticastFailbackReason) => void): void
466
+ setFailbackWindowMs(windowMs: number | null): void
461
467
  dispose(): void
462
468
  readonly stats: { packetsReceived: number; bytesReceived: number }
463
469
  }
464
470
  ```
465
471
 
472
+ **Failover vocabulary.** draft-multicast-01 Section 6 "failover" (multicast to
473
+ unicast) is libmmt's *failback*: `onFailback`, `MulticastManager.onFailback`,
474
+ `failbackAll`, `MediaRouter.failbackToMoq`, `MulticastFailbackReason`, and CMCD
475
+ `x-bc-ct` `mc-to-uc`. libmmt's in-code *failover* (`track-session.ts`) is the
476
+ per-track hop along a track's transport chain. The return to multicast is the
477
+ draft's switch to multicast / join / switch back; CMCD `mc-start` is fired
478
+ host-side.
479
+
466
480
  Direct Sockets is Chrome-IWA-only. Outside an IWA context `isAvailable()` returns false and join() warns + returns false. AMT tunneling and unicast fallback are handled by `@blockcast/mmt-transport`, not by this transport class.
467
481
 
468
482
  ## Track-role convention summary (Phase 14)
@@ -503,11 +517,11 @@ Roles are required by:
503
517
  - **ISO/IEC 14496-12** — ISOBMFF (consumed for fMP4 box construction in `mmtp-to-cmaf.ts`)
504
518
  - **draft-ietf-moq-catalogformat** — CMSF catalog (IETF MOQ WG)
505
519
  - **draft-law-ramadan-moq-carp-reliability** — CARP §3 (FEC) + §4 (multicast endpoints) + §5.1 (interleave units) + §6.1 (repair track)
506
- - **draft-ramadan-moq-mmt-00** — MMT-over-MoQ wire format (§4.4.4 group-duration signaling, §5.3 MMTP→CMAF mapping)
520
+ - **draft-ramadan-moq-mmt-01** — MMT-over-MoQ wire format (§4.4.2 group-duration signaling, §4 MoQ object mapping, §5 MFU mode)
507
521
  - **draft-ramadan-moq-fec** — AL-FEC over MoQ (§5.3 FEC Source Info object extension 0x11: SS_ID(32), fixed 4 bytes)
508
522
  - **RFC 6330** — RaptorQ Forward Error Correction (strict OTI codec in `@blockcast/mmt-fec`)
509
523
  - **RFC 9559** — CMCD (used by `CmcdProducer`)
510
- - **ATSC A/331** — Signaling, Delivery, Synchronization, Error Protection
524
+ - **ATSC A/331:2026-02 (informative for draft-fec-01 / draft-mmt-01; 7.2 SLS/MP table, 8.1.2.1 MMTP session, 8.1.2.5 AL-FEC) and A/331:2026-04 (normative for draft-multicast-01)** — Signaling, Delivery, Synchronization, Error Protection
511
525
 
512
526
  ## Related packages
513
527
 
package/dist/align.d.ts CHANGED
@@ -8,10 +8,14 @@
8
8
  * ──────────────────────────────────────────────────────────────────────────
9
9
  * Contract (integer-ticks form, authoritative):
10
10
  *
11
- * groupId = ticks < 0 ? 0 : floor(ticks / groupDurationTicks)
11
+ * groupId = floor((ticks - presentationAnchorTicks) / groupDurationTicks)
12
12
  *
13
13
  * Where `ticks` is a media timestamp expressed at the catalog's `timescale`
14
- * (Hz), and `groupDurationTicks = groupDurationSec * timescale`.
14
+ * (Hz), `groupDurationTicks = groupDurationSec * timescale`, and
15
+ * `presentationAnchorTicks` is the track's signed catalog anchor
16
+ * (draft-ramadan-moq-mmt-01 Section 4.4.1; zero when the track omits it).
17
+ * There is no clamp: a `ticks` earlier than the anchor is an error the
18
+ * publisher must reject, never group 0.
15
19
  *
16
20
  * Integer math means there is no epsilon and no float rounding to reason
17
21
  * about. The seconds-form wrapper `groupIdFor(Seconds, seconds)` exists for
@@ -30,13 +34,13 @@
30
34
  * sender/relay/receiver is worse than any formula change.
31
35
  *
32
36
  * Canonical implementations:
33
- * Go: Blockcast/multicast `cmd/caddy/sender/group_align.go`
34
- * (commit 104eeff) — sender-side groupId stamping on egress.
35
- * Rust: moqtail/moqtail `apps/relay/src/server/abr.rs`
36
- * (commit 39accbf; experimental branch, may be rebased — rely
37
- * on the SHA, not the branch name) — relay-side check.
38
- * TS: THIS FILE (libmmt) — consumed by moq-lib + moqtail-ts via
39
- * @blockcast/mmt-container.
37
+ * TS: THIS FILE (libmmt) — consumed via @blockcast/mmt-container.
38
+ * Rust: libmmt `mmt-core/src/align.rs` (`group_id_for_ticks`) — consumed
39
+ * by FFmpeg / hang-mmt-fec libmoq, which re-pin to this fixture.
40
+ * Go: Blockcast/multicast `cmd/caddy/sender/group_align.go` is the CMAF
41
+ * (cmafpackaging) sender, not an mmtp implementation; it loads this
42
+ * fixture only when LIBMMT_ALIGN_VECTORS is set and must follow the
43
+ * version-2 vectors before it does.
40
44
  * ──────────────────────────────────────────────────────────────────────────
41
45
  */
42
46
  /**
@@ -67,17 +71,18 @@ export declare function asSeconds(n: number): Seconds;
67
71
  * Deterministic groupId from integer ticks. Authoritative form of the
68
72
  * contract (see module docstring).
69
73
  *
70
- * @param ticks — media presentation time in ticks (integer).
71
- * Negative values clamp to group 0 (matches
72
- * the Go sibling's base-clamp).
73
- * @param groupDurationTicks — group duration in ticks (positive integer).
74
+ * @param ticks — media presentation time in ticks (integer).
75
+ * @param groupDurationTicks — group duration in ticks (positive integer).
76
+ * @param presentationAnchorTicks — catalog `presentationAnchorTicks` (signed
77
+ * integer); defaults to 0, the local origin
78
+ * of a track that omits the field.
74
79
  * @returns non-negative integer groupId.
75
80
  *
76
- * Throws on non-integer/non-finite inputs or non-positive duration. These
77
- * are init-time errors, not packet-hot-path errors — callers ingesting
78
- * wire data should validate once at catalog load, not once per packet.
81
+ * Throws on non-integer/non-finite inputs, non-positive duration, or
82
+ * `ticks < presentationAnchorTicks` (moq-mmt-01 4.4.1: the publisher MUST
83
+ * reject that MPU and MUST NOT clamp it to group 0).
79
84
  */
80
- export declare function groupIdForTicks(ticks: number, groupDurationTicks: number): number;
85
+ export declare function groupIdForTicks(ticks: number, groupDurationTicks: number, presentationAnchorTicks?: number): number;
81
86
  /**
82
87
  * Seconds-form wrapper around `groupIdForTicks`. Kept for backwards
83
88
  * compatibility with existing callers that hold `Seconds` (or a raw
@@ -88,7 +93,8 @@ export declare function groupIdForTicks(ticks: number, groupDurationTicks: numbe
88
93
  * branch of the parameter type is a migration ramp — new code should
89
94
  * pass `Seconds` explicitly (via `secondsFromTicks` or `asSeconds`).
90
95
  *
91
- * @param mediaTimeSec — finite number of seconds; negatives clamp to 0.
96
+ * @param mediaTimeSec — finite non-negative seconds (anchor 0); a
97
+ * negative value throws, it is never clamped.
92
98
  * @param groupDurationSec — positive finite seconds.
93
99
  *
94
100
  * @deprecated Use `groupIdForTicks(ticks, groupDurationTicks)` with
@@ -1 +1 @@
1
- {"version":3,"file":"align.d.ts","sourceRoot":"","sources":["../src/align.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAA;CAAE,CAAA;AAE9D;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAU1E;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAK5C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAajF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,UAAU,CACxB,YAAY,EAAE,OAAO,GAAG,MAAM,EAC9B,gBAAgB,EAAE,MAAM,GACvB,MAAM,CA+BR;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,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EACb,kBAAkB,EAAE,MAAM,EAC1B,uBAAuB,SAAI,GAC1B,MAAM,CA4BR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,UAAU,CACxB,YAAY,EAAE,OAAO,GAAG,MAAM,EAC9B,gBAAgB,EAAE,MAAM,GACvB,MAAM,CAqCR;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;CAAE,GACrD;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAA;AAE9D;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAS7E;AAED,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;CAAE,GACjC;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,2BAA2B,EAAE,MAAM,CAAA;IAC5C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC9B,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3D;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAgBlE"}
package/dist/align.js CHANGED
@@ -16,7 +16,7 @@ function asSeconds(n) {
16
16
  }
17
17
  return n;
18
18
  }
19
- function groupIdForTicks(ticks, groupDurationTicks) {
19
+ function groupIdForTicks(ticks, groupDurationTicks, presentationAnchorTicks = 0) {
20
20
  if (!Number.isInteger(ticks)) {
21
21
  throw new Error(
22
22
  `[align] groupIdForTicks: ticks must be an integer, got ${ticks}`
@@ -27,8 +27,23 @@ function groupIdForTicks(ticks, groupDurationTicks) {
27
27
  `[align] groupIdForTicks: groupDurationTicks must be a positive integer, got ${groupDurationTicks}`
28
28
  );
29
29
  }
30
- if (ticks < 0) return 0;
31
- return Math.floor(ticks / groupDurationTicks);
30
+ if (!Number.isInteger(presentationAnchorTicks)) {
31
+ throw new Error(
32
+ `[align] groupIdForTicks: presentationAnchorTicks must be an integer, got ${presentationAnchorTicks}`
33
+ );
34
+ }
35
+ const relativeTicks = ticks - presentationAnchorTicks;
36
+ if (!Number.isSafeInteger(relativeTicks)) {
37
+ throw new Error(
38
+ `[align] groupIdForTicks: ticks - presentationAnchorTicks = ${relativeTicks} is not a safe integer`
39
+ );
40
+ }
41
+ if (relativeTicks < 0) {
42
+ throw new Error(
43
+ `[align] groupIdForTicks: ticks ${ticks} precede presentationAnchorTicks ${presentationAnchorTicks}; the publisher must reject this MPU (moq-mmt-01 4.4.1)`
44
+ );
45
+ }
46
+ return Math.floor(relativeTicks / groupDurationTicks);
32
47
  }
33
48
  function groupIdFor(mediaTimeSec, groupDurationSec) {
34
49
  if (!Number.isFinite(mediaTimeSec)) {
@@ -41,7 +56,11 @@ function groupIdFor(mediaTimeSec, groupDurationSec) {
41
56
  `[align] groupIdFor: groupDurationSec must be a positive finite number, got ${groupDurationSec}`
42
57
  );
43
58
  }
44
- if (mediaTimeSec < 0) return 0;
59
+ if (mediaTimeSec < 0) {
60
+ throw new Error(
61
+ `[align] groupIdFor: mediaTimeSec ${mediaTimeSec} precedes presentationAnchorTicks 0; the publisher must reject this MPU (moq-mmt-01 4.4.1)`
62
+ );
63
+ }
45
64
  const TS = 1e9;
46
65
  const ticks = Math.round(mediaTimeSec * TS);
47
66
  const durTicks = Math.round(groupDurationSec * TS);
package/dist/align.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/align.ts"],
4
- "sourcesContent": ["/**\n * Shared group-alignment primitive for MMT over MoQ switching sets.\n *\n * Pure math \u2014 no MMT wire parsing, no CMCD, no I/O. Callers wire the output\n * into their own drift-observation plumbing (see media-router.ts for the\n * libmmt wiring).\n *\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n * Contract (integer-ticks form, authoritative):\n *\n * groupId = ticks < 0 ? 0 : floor(ticks / groupDurationTicks)\n *\n * Where `ticks` is a media timestamp expressed at the catalog's `timescale`\n * (Hz), and `groupDurationTicks = groupDurationSec * timescale`.\n *\n * Integer math means there is no epsilon and no float rounding to reason\n * about. The seconds-form wrapper `groupIdFor(Seconds, seconds)` exists for\n * legacy callers but converts to ticks internally.\n *\n * Every sender/receiver that emits or consumes MoQ groups from an MMT or\n * CMAF switching set MUST derive groupId from this formula so that base,\n * delta, and repair tracks agree on the group boundary for a given media\n * timestamp across languages and processes.\n *\n * Test vectors that exercise the contract live at\n * `packages/container/test-vectors/align.json`; the Go and Rust siblings\n * load the same fixture so cross-language agreement is executable, not\n * prose. **Formula changes require updating the fixture AND all three\n * sibling implementations in the same release** \u2014 divergence between\n * sender/relay/receiver is worse than any formula change.\n *\n * Canonical implementations:\n * Go: Blockcast/multicast `cmd/caddy/sender/group_align.go`\n * (commit 104eeff) \u2014 sender-side groupId stamping on egress.\n * Rust: moqtail/moqtail `apps/relay/src/server/abr.rs`\n * (commit 39accbf; experimental branch, may be rebased \u2014 rely\n * on the SHA, not the branch name) \u2014 relay-side check.\n * TS: THIS FILE (libmmt) \u2014 consumed by moq-lib + moqtail-ts via\n * @blockcast/mmt-container.\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n */\n\n/**\n * Branded seconds type. Construct only via `secondsFromTicks(ticks, timescale)`\n * or `asSeconds(n)` (the latter exists solely for tests and bring-up). The\n * brand prevents accidentally passing a raw tick count \u2014 or a Date.now()\n * millisecond \u2014 to an API that expects a media-time in seconds.\n */\nexport type Seconds = number & { readonly __brand: 'Seconds' }\n\n/**\n * Explicit conversion constructor: ticks at `timescale` Hz \u2192 Seconds.\n *\n * Call this at the wire/catalog boundary so the brand flows with the value\n * through the rest of the system. Throws on non-finite inputs or\n * non-positive timescale (CLAUDE.md \u00A7Architectural Principles: error on\n * bad init).\n */\nexport function secondsFromTicks(ticks: number, timescale: number): Seconds {\n if (!Number.isFinite(ticks)) {\n throw new Error(`[align] secondsFromTicks: ticks must be finite, got ${ticks}`)\n }\n if (!Number.isFinite(timescale) || timescale <= 0) {\n throw new Error(\n `[align] secondsFromTicks: timescale must be positive and finite, got ${timescale}`,\n )\n }\n return (ticks / timescale) as Seconds\n}\n\n/**\n * Escape hatch for tests / bring-up code that holds a raw seconds number\n * (e.g. a catalog field that ships as float seconds). Production code\n * should prefer `secondsFromTicks` so the conversion site is explicit.\n */\nexport function asSeconds(n: number): Seconds {\n if (!Number.isFinite(n)) {\n throw new Error(`[align] asSeconds: value must be finite, got ${n}`)\n }\n return n as Seconds\n}\n\n/**\n * Deterministic groupId from integer ticks. Authoritative form of the\n * contract (see module docstring).\n *\n * @param ticks \u2014 media presentation time in ticks (integer).\n * Negative values clamp to group 0 (matches\n * the Go sibling's base-clamp).\n * @param groupDurationTicks \u2014 group duration in ticks (positive integer).\n * @returns non-negative integer groupId.\n *\n * Throws on non-integer/non-finite inputs or non-positive duration. These\n * are init-time errors, not packet-hot-path errors \u2014 callers ingesting\n * wire data should validate once at catalog load, not once per packet.\n */\nexport function groupIdForTicks(ticks: number, groupDurationTicks: number): number {\n if (!Number.isInteger(ticks)) {\n throw new Error(\n `[align] groupIdForTicks: ticks must be an integer, got ${ticks}`,\n )\n }\n if (!Number.isInteger(groupDurationTicks) || groupDurationTicks <= 0) {\n throw new Error(\n `[align] groupIdForTicks: groupDurationTicks must be a positive integer, got ${groupDurationTicks}`,\n )\n }\n if (ticks < 0) return 0\n return Math.floor(ticks / groupDurationTicks)\n}\n\n/**\n * Seconds-form wrapper around `groupIdForTicks`. Kept for backwards\n * compatibility with existing callers that hold `Seconds` (or a raw\n * `number` that semantically represents seconds).\n *\n * Internally converts to ticks using a synthetic 1e9 Hz timescale so the\n * integer-math contract is the single source of truth. The `| number`\n * branch of the parameter type is a migration ramp \u2014 new code should\n * pass `Seconds` explicitly (via `secondsFromTicks` or `asSeconds`).\n *\n * @param mediaTimeSec \u2014 finite number of seconds; negatives clamp to 0.\n * @param groupDurationSec \u2014 positive finite seconds.\n *\n * @deprecated Use `groupIdForTicks(ticks, groupDurationTicks)` with\n * tick-space inputs from the catalog. The seconds wrapper rounds to the\n * nearest nanosecond and throws above ~104 days of media time; the\n * integer-ticks form has no rounding and a much wider safe range.\n *\n * The rounding is not benign: when `groupDurationTicks / timescale` is not\n * ns-exact (33333@90k, 1001@30k, 1024@44.1k \u2014 all real catalog cadences)\n * the quantized duration under-counts and `expected` slips a whole group.\n * See the divergence fixture in `__tests__/align.test.ts`.\n *\n * No non-test caller remains in this package: `MediaRouter` took tick-space\n * inputs from PCL-2211, and its group-alignment observer was then removed\n * outright as unwired telemetry (BLO-34141). Removal of this wrapper is\n * tracked by BLO-21176; the exported `groupIdForTicks` / `driftCheck` stay\n * regardless \u2014 they are the formula shared with the Go sender and the Rust\n * relay, not internals of the deleted observer.\n */\nexport function groupIdFor(\n mediaTimeSec: Seconds | number,\n groupDurationSec: number,\n): number {\n if (!Number.isFinite(mediaTimeSec as number)) {\n throw new Error(\n `[align] groupIdFor: mediaTimeSec must be a finite number, got ${mediaTimeSec}`,\n )\n }\n if (!Number.isFinite(groupDurationSec) || groupDurationSec <= 0) {\n throw new Error(\n `[align] groupIdFor: groupDurationSec must be a positive finite number, got ${groupDurationSec}`,\n )\n }\n if ((mediaTimeSec as number) < 0) return 0\n // 1e9 Hz keeps both operands inside Number.MAX_SAFE_INTEGER (2^53-1)\n // for ~104 days of media time. Beyond that, Math.round returns a\n // non-safe-integer float that Number.isInteger still accepts \u2014 throw\n // explicitly so the caller picks a narrower timescale rather than\n // silently quantizing.\n const TS = 1_000_000_000\n const ticks = Math.round((mediaTimeSec as number) * TS)\n const durTicks = Math.round(groupDurationSec * TS)\n if (durTicks <= 0) {\n throw new Error(\n `[align] groupIdFor: groupDurationSec=${groupDurationSec} rounds to <1 tick at 1e9 Hz; pass groupIdForTicks directly for sub-nanosecond durations`,\n )\n }\n if (!Number.isSafeInteger(ticks)) {\n throw new Error(\n `[align] groupIdFor: mediaTimeSec=${mediaTimeSec} overflows safe-integer ticks at 1e9 Hz (>~104 days); use groupIdForTicks with a narrower timescale`,\n )\n }\n return groupIdForTicks(ticks, durTicks)\n}\n\n/**\n * Result of a drift check between expected and actual groupIds.\n *\n * Discriminated on `kind` so callers must handle both outcomes explicitly\n * (the previous `{ drifted: boolean, deltaGroups: number }` shape let a\n * drifted result slip through with a silent `if (result.drifted)` gate).\n */\nexport type DriftCheckResult =\n | { readonly kind: 'aligned'; readonly deltaGroups: 0 }\n | { readonly kind: 'drifted'; readonly deltaGroups: number }\n\n/**\n * Compare a packet-stamped groupId against the formula-derived expectation.\n *\n * Pure observer \u2014 does not throw on drift, does not mutate anything.\n * Callers decide how to react (e.g. bump a CMCD counter, log, ignore).\n *\n * @param expected \u2014 groupId as derived via `groupIdForTicks` or `groupIdFor`.\n * @param actual \u2014 groupId as stamped on the incoming packet/group.\n */\nexport function driftCheck(expected: number, actual: number): DriftCheckResult {\n if (!Number.isInteger(expected) || !Number.isInteger(actual)) {\n throw new Error(\n `[align] driftCheck: both arguments must be integer groupIds, got expected=${expected} actual=${actual}`,\n )\n }\n const deltaGroups = actual - expected\n if (deltaGroups === 0) return { kind: 'aligned', deltaGroups: 0 }\n return { kind: 'drifted', deltaGroups }\n}\n\nexport type MmtpSubgroupKeyInput =\n | { readonly kind: 'mpu-metadata' }\n | {\n readonly kind: 'timed'\n readonly movieFragmentSequenceNumber: number\n readonly sampleNumber: number\n }\n | { readonly kind: 'non-timed'; readonly itemId: number }\n\n/**\n * Canonical, domain-separated key for MMTP payloads sharing one MoQ subgroup.\n * This is a map/storage key, not the scalar MoQ subgroup ID. MPU metadata is\n * carried in subgroup 0; media identity remains explicit and collision-free.\n */\nexport function subgroupKeyFor(input: MmtpSubgroupKeyInput): string {\n if (input.kind === 'mpu-metadata') return 'metadata:0'\n\n const values =\n input.kind === 'timed'\n ? [input.movieFragmentSequenceNumber, input.sampleNumber]\n : [input.itemId]\n for (const value of values) {\n if (!Number.isInteger(value) || value < 0 || value > 0xffff_ffff) {\n throw new Error(`[align] subgroup key coordinates must be uint32, got ${value}`)\n }\n }\n\n return input.kind === 'timed'\n ? `timed:${input.movieFragmentSequenceNumber}:${input.sampleNumber}`\n : `non-timed:${input.itemId}`\n}\n"],
5
- "mappings": ";AA0DO,SAAS,iBAAiB,OAAe,WAA4B;AAC1E,MAAI,CAAC,OAAO,SAAS,KAAK,GAAG;AAC3B,UAAM,IAAI,MAAM,uDAAuD,KAAK,EAAE;AAAA,EAChF;AACA,MAAI,CAAC,OAAO,SAAS,SAAS,KAAK,aAAa,GAAG;AACjD,UAAM,IAAI;AAAA,MACR,wEAAwE,SAAS;A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C,OAAO,UAAU,QAAQ,KAAK,CAAC,OAAO,UAAU,MAAM,GAAG;AAC5D,UAAM,IAAI;AAAA,MACR,6EAA6E,QAAQ,WAAW,MAAM;AAAA,IACxG;AAAA,EACF;AACA,QAAM,cAAc,SAAS;AAC7B,MAAI,gBAAgB,EAAG,QAAO,EAAE,MAAM,WAAW,aAAa,EAAE;AAChE,SAAO,EAAE,MAAM,WAAW,YAAY;AACxC;AAgBO,SAAS,eAAe,OAAqC;AAClE,MAAI,MAAM,SAAS,eAAgB,QAAO;AAE1C,QAAM,SACJ,MAAM,SAAS,UACX,CAAC,MAAM,6BAA6B,MAAM,YAAY,IACtD,CAAC,MAAM,MAAM;AACnB,aAAW,SAAS,QAAQ;AAC1B,QAAI,CAAC,OAAO,UAAU,KAAK,KAAK,QAAQ,KAAK,QAAQ,YAAa;AAChE,YAAM,IAAI,MAAM,wDAAwD,KAAK,EAAE;AAAA,IACjF;AAAA,EACF;AAEA,SAAO,MAAM,SAAS,UAClB,SAAS,MAAM,2BAA2B,IAAI,MAAM,YAAY,KAChE,aAAa,MAAM,MAAM;AAC/B;",
4
+ "sourcesContent": ["/**\n * Shared group-alignment primitive for MMT over MoQ switching sets.\n *\n * Pure math \u2014 no MMT wire parsing, no CMCD, no I/O. Callers wire the output\n * into their own drift-observation plumbing (see media-router.ts for the\n * libmmt wiring).\n *\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n * Contract (integer-ticks form, authoritative):\n *\n * groupId = floor((ticks - presentationAnchorTicks) / groupDurationTicks)\n *\n * Where `ticks` is a media timestamp expressed at the catalog's `timescale`\n * (Hz), `groupDurationTicks = groupDurationSec * timescale`, and\n * `presentationAnchorTicks` is the track's signed catalog anchor\n * (draft-ramadan-moq-mmt-01 Section 4.4.1; zero when the track omits it).\n * There is no clamp: a `ticks` earlier than the anchor is an error the\n * publisher must reject, never group 0.\n *\n * Integer math means there is no epsilon and no float rounding to reason\n * about. The seconds-form wrapper `groupIdFor(Seconds, seconds)` exists for\n * legacy callers but converts to ticks internally.\n *\n * Every sender/receiver that emits or consumes MoQ groups from an MMT or\n * CMAF switching set MUST derive groupId from this formula so that base,\n * delta, and repair tracks agree on the group boundary for a given media\n * timestamp across languages and processes.\n *\n * Test vectors that exercise the contract live at\n * `packages/container/test-vectors/align.json`; the Go and Rust siblings\n * load the same fixture so cross-language agreement is executable, not\n * prose. **Formula changes require updating the fixture AND all three\n * sibling implementations in the same release** \u2014 divergence between\n * sender/relay/receiver is worse than any formula change.\n *\n * Canonical implementations:\n * TS: THIS FILE (libmmt) \u2014 consumed via @blockcast/mmt-container.\n * Rust: libmmt `mmt-core/src/align.rs` (`group_id_for_ticks`) \u2014 consumed\n * by FFmpeg / hang-mmt-fec libmoq, which re-pin to this fixture.\n * Go: Blockcast/multicast `cmd/caddy/sender/group_align.go` is the CMAF\n * (cmafpackaging) sender, not an mmtp implementation; it loads this\n * fixture only when LIBMMT_ALIGN_VECTORS is set and must follow the\n * version-2 vectors before it does.\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n */\n\n/**\n * Branded seconds type. Construct only via `secondsFromTicks(ticks, timescale)`\n * or `asSeconds(n)` (the latter exists solely for tests and bring-up). The\n * brand prevents accidentally passing a raw tick count \u2014 or a Date.now()\n * millisecond \u2014 to an API that expects a media-time in seconds.\n */\nexport type Seconds = number & { readonly __brand: 'Seconds' }\n\n/**\n * Explicit conversion constructor: ticks at `timescale` Hz \u2192 Seconds.\n *\n * Call this at the wire/catalog boundary so the brand flows with the value\n * through the rest of the system. Throws on non-finite inputs or\n * non-positive timescale (CLAUDE.md \u00A7Architectural Principles: error on\n * bad init).\n */\nexport function secondsFromTicks(ticks: number, timescale: number): Seconds {\n if (!Number.isFinite(ticks)) {\n throw new Error(`[align] secondsFromTicks: ticks must be finite, got ${ticks}`)\n }\n if (!Number.isFinite(timescale) || timescale <= 0) {\n throw new Error(\n `[align] secondsFromTicks: timescale must be positive and finite, got ${timescale}`,\n )\n }\n return (ticks / timescale) as Seconds\n}\n\n/**\n * Escape hatch for tests / bring-up code that holds a raw seconds number\n * (e.g. a catalog field that ships as float seconds). Production code\n * should prefer `secondsFromTicks` so the conversion site is explicit.\n */\nexport function asSeconds(n: number): Seconds {\n if (!Number.isFinite(n)) {\n throw new Error(`[align] asSeconds: value must be finite, got ${n}`)\n }\n return n as Seconds\n}\n\n/**\n * Deterministic groupId from integer ticks. Authoritative form of the\n * contract (see module docstring).\n *\n * @param ticks \u2014 media presentation time in ticks (integer).\n * @param groupDurationTicks \u2014 group duration in ticks (positive integer).\n * @param presentationAnchorTicks \u2014 catalog `presentationAnchorTicks` (signed\n * integer); defaults to 0, the local origin\n * of a track that omits the field.\n * @returns non-negative integer groupId.\n *\n * Throws on non-integer/non-finite inputs, non-positive duration, or\n * `ticks < presentationAnchorTicks` (moq-mmt-01 4.4.1: the publisher MUST\n * reject that MPU and MUST NOT clamp it to group 0).\n */\nexport function groupIdForTicks(\n ticks: number,\n groupDurationTicks: number,\n presentationAnchorTicks = 0,\n): number {\n if (!Number.isInteger(ticks)) {\n throw new Error(\n `[align] groupIdForTicks: ticks must be an integer, got ${ticks}`,\n )\n }\n if (!Number.isInteger(groupDurationTicks) || groupDurationTicks <= 0) {\n throw new Error(\n `[align] groupIdForTicks: groupDurationTicks must be a positive integer, got ${groupDurationTicks}`,\n )\n }\n if (!Number.isInteger(presentationAnchorTicks)) {\n throw new Error(\n `[align] groupIdForTicks: presentationAnchorTicks must be an integer, got ${presentationAnchorTicks}`,\n )\n }\n const relativeTicks = ticks - presentationAnchorTicks\n if (!Number.isSafeInteger(relativeTicks)) {\n throw new Error(\n `[align] groupIdForTicks: ticks - presentationAnchorTicks = ${relativeTicks} is not a safe integer`,\n )\n }\n if (relativeTicks < 0) {\n throw new Error(\n `[align] groupIdForTicks: ticks ${ticks} precede presentationAnchorTicks ${presentationAnchorTicks}; the publisher must reject this MPU (moq-mmt-01 4.4.1)`,\n )\n }\n return Math.floor(relativeTicks / groupDurationTicks)\n}\n\n/**\n * Seconds-form wrapper around `groupIdForTicks`. Kept for backwards\n * compatibility with existing callers that hold `Seconds` (or a raw\n * `number` that semantically represents seconds).\n *\n * Internally converts to ticks using a synthetic 1e9 Hz timescale so the\n * integer-math contract is the single source of truth. The `| number`\n * branch of the parameter type is a migration ramp \u2014 new code should\n * pass `Seconds` explicitly (via `secondsFromTicks` or `asSeconds`).\n *\n * @param mediaTimeSec \u2014 finite non-negative seconds (anchor 0); a\n * negative value throws, it is never clamped.\n * @param groupDurationSec \u2014 positive finite seconds.\n *\n * @deprecated Use `groupIdForTicks(ticks, groupDurationTicks)` with\n * tick-space inputs from the catalog. The seconds wrapper rounds to the\n * nearest nanosecond and throws above ~104 days of media time; the\n * integer-ticks form has no rounding and a much wider safe range.\n *\n * The rounding is not benign: when `groupDurationTicks / timescale` is not\n * ns-exact (33333@90k, 1001@30k, 1024@44.1k \u2014 all real catalog cadences)\n * the quantized duration under-counts and `expected` slips a whole group.\n * See the divergence fixture in `__tests__/align.test.ts`.\n *\n * No non-test caller remains in this package: `MediaRouter` took tick-space\n * inputs from PCL-2211, and its group-alignment observer was then removed\n * outright as unwired telemetry (BLO-34141). Removal of this wrapper is\n * tracked by BLO-21176; the exported `groupIdForTicks` / `driftCheck` stay\n * regardless \u2014 they are the formula shared with the Go sender and the Rust\n * relay, not internals of the deleted observer.\n */\nexport function groupIdFor(\n mediaTimeSec: Seconds | number,\n groupDurationSec: number,\n): number {\n if (!Number.isFinite(mediaTimeSec as number)) {\n throw new Error(\n `[align] groupIdFor: mediaTimeSec must be a finite number, got ${mediaTimeSec}`,\n )\n }\n if (!Number.isFinite(groupDurationSec) || groupDurationSec <= 0) {\n throw new Error(\n `[align] groupIdFor: groupDurationSec must be a positive finite number, got ${groupDurationSec}`,\n )\n }\n // No clamp (moq-mmt-01 4.4.1). Checked before rounding: a tiny negative\n // rounds to -0 ticks, which `groupIdForTicks` would accept as 0.\n if ((mediaTimeSec as number) < 0) {\n throw new Error(\n `[align] groupIdFor: mediaTimeSec ${mediaTimeSec} precedes presentationAnchorTicks 0; the publisher must reject this MPU (moq-mmt-01 4.4.1)`,\n )\n }\n // 1e9 Hz keeps both operands inside Number.MAX_SAFE_INTEGER (2^53-1)\n // for ~104 days of media time. Beyond that, Math.round returns a\n // non-safe-integer float that Number.isInteger still accepts \u2014 throw\n // explicitly so the caller picks a narrower timescale rather than\n // silently quantizing.\n const TS = 1_000_000_000\n const ticks = Math.round((mediaTimeSec as number) * TS)\n const durTicks = Math.round(groupDurationSec * TS)\n if (durTicks <= 0) {\n throw new Error(\n `[align] groupIdFor: groupDurationSec=${groupDurationSec} rounds to <1 tick at 1e9 Hz; pass groupIdForTicks directly for sub-nanosecond durations`,\n )\n }\n if (!Number.isSafeInteger(ticks)) {\n throw new Error(\n `[align] groupIdFor: mediaTimeSec=${mediaTimeSec} overflows safe-integer ticks at 1e9 Hz (>~104 days); use groupIdForTicks with a narrower timescale`,\n )\n }\n return groupIdForTicks(ticks, durTicks)\n}\n\n/**\n * Result of a drift check between expected and actual groupIds.\n *\n * Discriminated on `kind` so callers must handle both outcomes explicitly\n * (the previous `{ drifted: boolean, deltaGroups: number }` shape let a\n * drifted result slip through with a silent `if (result.drifted)` gate).\n */\nexport type DriftCheckResult =\n | { readonly kind: 'aligned'; readonly deltaGroups: 0 }\n | { readonly kind: 'drifted'; readonly deltaGroups: number }\n\n/**\n * Compare a packet-stamped groupId against the formula-derived expectation.\n *\n * Pure observer \u2014 does not throw on drift, does not mutate anything.\n * Callers decide how to react (e.g. bump a CMCD counter, log, ignore).\n *\n * @param expected \u2014 groupId as derived via `groupIdForTicks` or `groupIdFor`.\n * @param actual \u2014 groupId as stamped on the incoming packet/group.\n */\nexport function driftCheck(expected: number, actual: number): DriftCheckResult {\n if (!Number.isInteger(expected) || !Number.isInteger(actual)) {\n throw new Error(\n `[align] driftCheck: both arguments must be integer groupIds, got expected=${expected} actual=${actual}`,\n )\n }\n const deltaGroups = actual - expected\n if (deltaGroups === 0) return { kind: 'aligned', deltaGroups: 0 }\n return { kind: 'drifted', deltaGroups }\n}\n\nexport type MmtpSubgroupKeyInput =\n | { readonly kind: 'mpu-metadata' }\n | {\n readonly kind: 'timed'\n readonly movieFragmentSequenceNumber: number\n readonly sampleNumber: number\n }\n | { readonly kind: 'non-timed'; readonly itemId: number }\n\n/**\n * Canonical, domain-separated key for MMTP payloads sharing one MoQ subgroup.\n * This is a map/storage key, not the scalar MoQ subgroup ID. MPU metadata is\n * carried in subgroup 0; media identity remains explicit and collision-free.\n */\nexport function subgroupKeyFor(input: MmtpSubgroupKeyInput): string {\n if (input.kind === 'mpu-metadata') return 'metadata:0'\n\n const values =\n input.kind === 'timed'\n ? [input.movieFragmentSequenceNumber, input.sampleNumber]\n : [input.itemId]\n for (const value of values) {\n if (!Number.isInteger(value) || value < 0 || value > 0xffff_ffff) {\n throw new Error(`[align] subgroup key coordinates must be uint32, got ${value}`)\n }\n }\n\n return input.kind === 'timed'\n ? `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