From 798026d3b3b2f8b022162222b31060e0dda5525b Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 16 Oct 2026 08:48:35 -0700 Subject: [PATCH 1/9] chore: claim grant stats label quest Co-Authored-By: OpenAI Codex From 81aa42c891975b270077577266c3053553c6b3da Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 16 Oct 2026 09:27:51 -0700 Subject: [PATCH 2/9] feat(stats): label live session usage independently Co-Authored-By: OpenAI Codex --- doc/bin/relay/auth.md | 6 +- doc/concept/stats.md | 22 ++-- doc/lib/js/auth.md | 3 +- doc/lib/rs/moq-auth.md | 2 +- js/auth/src/contract.test.ts | 2 + js/auth/src/contract.ts | 17 +++ js/auth/src/interop.test.ts | 3 +- quest/m2/README.md | 1 - quest/m2/grant-label.md | 86 -------------- rs/moq-auth/src/error.rs | 3 + rs/moq-auth/src/grant.rs | 17 ++- rs/moq-net/Cargo.toml | 2 +- rs/moq-net/benches/stats.rs | 35 +++++- rs/moq-net/src/fuzz.rs | 27 +++++ rs/moq-net/src/stats.rs | 189 ++++++++++++++++++++++++++----- rs/moq-relay/src/auth.rs | 14 ++- rs/moq-relay/src/auth/refresh.rs | 3 +- rs/moq-relay/src/cluster.rs | 2 +- rs/moq-relay/src/web.rs | 2 +- 19 files changed, 294 insertions(+), 142 deletions(-) delete mode 100644 quest/m2/grant-label.md diff --git a/doc/bin/relay/auth.md b/doc/bin/relay/auth.md index 9ec90779a2e..1b1c48e0928 100644 --- a/doc/bin/relay/auth.md +++ b/doc/bin/relay/auth.md @@ -28,7 +28,7 @@ token, the declared role, and the verified client certificate. Nothing is parsed on the server's behalf: the `jwt` query parameter is a convention of `moq auth serve`, not of the relay. The grant answers with `publish` and `subscribe` pattern unions and optionally a `root` alias, read-only `mounts`, -`expires`, a `revalidate` cadence, a stats `tier`, and `peer` / `upstream` to +`expires`, a `revalidate` cadence, a stats `tier` and `label`, and `peer` / `upstream` to mark another relay and an [upstream link](/bin/relay/cluster#upstream-links). The fields are documented on `moq_auth::Request` and `moq_auth::Grant` ([Rust](/lib/rs/moq-auth), [TypeScript](/lib/js/auth)). @@ -52,8 +52,8 @@ flowing. A wider grant brings those paths back within the admitted root and SETUP role. A one-shot HTTP `/fetch` ends on a narrower grant instead. A changed `root`, `mounts`, `peer`, or `upstream`, or a 401 or 403, ends that credential's grant, which closes the session unless an -[in-band](#in-band-renewal) credential still holds it. A changed `tier` keeps -the session and moves its stats from then on. Any other failure retries with backoff and the session lives +[in-band](#in-band-renewal) credential still holds it. A changed `tier` or +`label` keeps the session and moves its later stats. Any other failure retries with backoff and the session lives until `expires`, so an outage always has the bound the server chose. A grant with `revalidate` must set `expires` for that reason. A session that reaches `expires` closes as `Expired` rather than `Unauthorized`, which also diff --git a/doc/concept/stats.md b/doc/concept/stats.md index 9f9fd4525ac..c1b6f86ede6 100644 --- a/doc/concept/stats.md +++ b/doc/concept/stats.md @@ -89,8 +89,8 @@ comes in two encodings: | `totals.json` | tier | [Totals](#totals) for the whole group | | `[/]publisher.json` | broadcast path | [Traffic](#traffic) this node sent (egress) | | `[/]subscriber.json` | broadcast path | [Traffic](#traffic) this node received (ingress) | -| `[/]sessions.json` | auth root | [Sessions](#sessions) connected now | -| `[/]presence.json` | tier | [Sessions](#sessions) under one auth root | +| `[/]sessions.json` | stats label | [Sessions](#sessions) connected now | +| `[