@blockcast/mmt-container 0.4.0-main.c9b538a2feb5 → 0.4.0-main.ca8cf388ed86

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 (82) hide show
  1. package/README.md +3 -2
  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 +376 -64
  7. package/dist/browser-runtime.js.map +3 -3
  8. package/dist/carp-catalog.d.ts +8 -5
  9. package/dist/carp-catalog.d.ts.map +1 -1
  10. package/dist/carp-catalog.js +30 -3
  11. package/dist/carp-catalog.js.map +2 -2
  12. package/dist/catalog-fec-params.js.map +2 -2
  13. package/dist/catalog-network-source.d.ts +1 -1
  14. package/dist/catalog-network-source.d.ts.map +1 -1
  15. package/dist/catalog-network-source.js.map +1 -1
  16. package/dist/fec-manager.d.ts +36 -1
  17. package/dist/fec-manager.d.ts.map +1 -1
  18. package/dist/fec-manager.js +161 -23
  19. package/dist/fec-manager.js.map +3 -3
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js.map +2 -2
  23. package/dist/iso-block-locator.d.ts +29 -0
  24. package/dist/iso-block-locator.d.ts.map +1 -1
  25. package/dist/iso-block-locator.js +97 -17
  26. package/dist/iso-block-locator.js.map +3 -3
  27. package/dist/manifest-auth-plan.js +20 -8
  28. package/dist/manifest-auth-plan.js.map +4 -4
  29. package/dist/mmtp-container-parser.no-modules.js +46 -11
  30. package/dist/mmtp-container-parser.no-modules.js.map +4 -4
  31. package/dist/mmtp-router.d.ts +14 -1
  32. package/dist/mmtp-router.d.ts.map +1 -1
  33. package/dist/mmtp-router.js +11 -0
  34. package/dist/mmtp-router.js.map +2 -2
  35. package/dist/multicast-auth-catalog.js +20 -8
  36. package/dist/multicast-auth-catalog.js.map +4 -4
  37. package/dist/multicast-input.d.ts +1 -1
  38. package/dist/multicast-input.d.ts.map +1 -1
  39. package/dist/multicast-input.js +17 -10
  40. package/dist/multicast-input.js.map +2 -2
  41. package/dist/multicast-manager.d.ts +17 -1
  42. package/dist/multicast-manager.d.ts.map +1 -1
  43. package/dist/multicast-manager.js +189 -23
  44. package/dist/multicast-manager.js.map +3 -3
  45. package/dist/no-modules.js +46 -11
  46. package/dist/no-modules.js.map +4 -4
  47. package/dist/phase14-catalog-override.d.ts +1 -1
  48. package/dist/phase14-catalog-override.d.ts.map +1 -1
  49. package/dist/phase14-catalog-override.js +2 -2
  50. package/dist/phase14-catalog-override.js.map +2 -2
  51. package/dist/repair-fetch.d.ts +58 -5
  52. package/dist/repair-fetch.d.ts.map +1 -1
  53. package/dist/repair-fetch.js +122 -22
  54. package/dist/repair-fetch.js.map +3 -3
  55. package/dist/source-auth.js +442 -1
  56. package/dist/source-auth.js.map +4 -4
  57. package/package.json +5 -5
  58. package/schemas/catalog.schema.json +36 -6
  59. package/src/align.ts +52 -21
  60. package/src/carp-catalog.ts +43 -7
  61. package/src/catalog-network-source.ts +1 -1
  62. package/src/fec-manager.ts +99 -14
  63. package/src/index.ts +3 -0
  64. package/src/iso-block-locator.ts +97 -6
  65. package/src/mmtp-router.ts +24 -0
  66. package/src/multicast-input.ts +21 -17
  67. package/src/multicast-manager.ts +27 -0
  68. package/src/phase14-catalog-override.ts +3 -3
  69. package/src/repair-fetch.ts +204 -25
  70. package/test-vectors/align.json +108 -32
  71. package/test-vectors/bc-provenance-v2.json +1526 -0
  72. package/test-vectors/catalog/README.md +17 -0
  73. package/test-vectors/catalog/negative/init-data-inline-without-data.json +22 -0
  74. package/test-vectors/catalog/negative/mmtp-mode-mpu.json +15 -0
  75. package/test-vectors/catalog/negative/multicast-amt-dns-without-relay.json +37 -0
  76. package/test-vectors/catalog/negative/presentation-anchor-unsafe.json +16 -0
  77. package/test-vectors/catalog/positive/mmt01-12-1-init-ref-anchor.json +29 -0
  78. package/test-vectors/catalog/positive/multicast-amt-discovery-omitted.json +37 -0
  79. package/test-vectors/catalog/positive/multicast-amt-dns-relay.json +38 -0
  80. package/test-vectors/catalog/positive/presentation-anchor-negative.json +27 -0
  81. package/test-vectors/catalog/section-codes.json +4 -0
  82. package/test-vectors/generate-bc-provenance-v2.mjs +252 -0
package/README.md CHANGED
@@ -203,9 +203,10 @@ interface MulticastEndpoint {
203
203
  }
204
204
 
205
205
  // Relay/tuning discovery is catalog-level, not per-endpoint:
206
- // multicast.networkSource: [{ type: "amt", discovery: "driad" | "manual",
206
+ // multicast.networkSource: [{ type: "amt", discovery?: "dns" | "driad" | "manual",
207
207
  // relay?: string, port?: number }]
208
- // `relay` is REQUIRED for discovery: "manual"; "driad" resolves it at runtime.
208
+ // `relay` is REQUIRED for "dns" and "manual"; "driad" resolves it at runtime.
209
+ // An omitted `discovery` with a hostname relay is "dns" (multicast-01 4.2.1).
209
210
  // An endpoint-level `relayAddress` is retired — the schema, moq-rs and
210
211
  // `validateCmsfMmtpCatalog` (`multicast_relay_address`) all reject it.
211
212
 
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,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AAG,OAAO,CAK5C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,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,MAA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AACA,SAAO,gBAAgB,OAAO,QAAQ;AACxC;AAsBO,SAAS,WAAW,UAAkB,QAAkC;AAC7E,MAAI,CAAC,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 ? `timed:${input.movieFragmentSequenceNumber}:${input.sampleNumber}`\n : `non-timed:${input.itemId}`\n}\n"],
5
+ "mappings": ";AA8DO,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;AAAA,IACnF;AAAA,EACF;AACA,SAAQ,QAAQ;AAClB;AAOO,SAAS,UAAU,GAAoB;AAC5C,MAAI,CAAC,OAAO,SAAS,CAAC,GAAG;AACvB,UAAM,IAAI,MAAM,gDAAgD,CAAC,EAAE;AAAA,EACrE;AACA,SAAO;AACT;AAiBO,SAAS,gBACd,OACA,oBACA,0BAA0B,GAClB;AACR,MAAI,CAAC,OAAO,UAAU,KAAK,GAAG;AAC5B,UAAM,IAAI;AAAA,MACR,0DAA0D,KAAK;AAAA,IACjE;AAAA,EACF;AACA,MAAI,CAAC,OAAO,UAAU,kBAAkB,KAAK,sBAAsB,GAAG;AACpE,UAAM,IAAI;AAAA,MACR,+EAA+E,kBAAkB;AAAA,IACnG;AAAA,EACF;AACA,MAAI,CAAC,OAAO,UAAU,uBAAuB,GAAG;AAC9C,UAAM,IAAI;AAAA,MACR,4EAA4E,uBAAuB;AAAA,IACrG;AAAA,EACF;AACA,QAAM,gBAAgB,QAAQ;AAC9B,MAAI,CAAC,OAAO,cAAc,aAAa,GAAG;AACxC,UAAM,IAAI;AAAA,MACR,8DAA8D,aAAa;AAAA,IAC7E;AAAA,EACF;AACA,MAAI,gBAAgB,GAAG;AACrB,UAAM,IAAI;AAAA,MACR,kCAAkC,KAAK,oCAAoC,uBAAuB;AAAA,IACpG;AAAA,EACF;AAC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