Skip to content

feat!: grants are path prefixes again - #9251

Queued
kixelated wants to merge 13 commits into
mainfrom
quest/m2/prefix-grants
Queued

kixelated wants to merge 13 commits into
mainfrom
quest/m2/prefix-grants

Conversation

@kixelated

@kixelated kixelated commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Claims and completes quest/m2/prefix-grants.md.

Summary

Every grant is a set of path prefixes again, as before moq-dev/moq#3746. Each prefix covers its whole subtree. This backs out the grant half of #3746 and the pattern-valued scopes of moq-dev/moq#3672. A route a grant admits now always serves whole subtrees, so a claim's reach can ride the path it is presented at. That unblocks lite07-claim-reach-routes.

  • New types: moq-pattern and @moq/pattern gain Prefix, Prefixes, and InvalidPrefix.
    • Prefixes is a reduced, sorted set in segment order, so two sets covering the same paths compare equal.
    • Collecting sorts once and sweeps. A query binary-searches each ancestor of the path it asks about, of which there are at most 33.
    • Parsing is strict: a leading, trailing, or doubled / is an error, so a typo cannot widen a grant.
    • A * anywhere is refused first, with the prefix to write instead (`anon/**` is a wildcard: grants are prefixes, and `anon` covers `anon` and every path beneath it).
  • What carries prefixes:
    • tokens and key scopes (moq-auth, @moq/auth)
    • moq auth serve rules and the relay's public* config
    • the auth server's Grant JSON
    • Permit and origin scopes (Producer::scope, Consumer::scope, allowed) in moq-net and js/net
    • moq-ffi and every binding
    • lite-07's AUTH_OK
  • Releases before 0.22 keep reading the same grants (TEMPORARY). Those releases read a bare foo as one exact path. So tokens, key scopes, and the auth server's Grant JSON spell each prefix as the subtree pattern they read, foo/** or **, and read that spelling back as the prefix. Every other wildcard is refused there. Config, CLI flags, env, origin APIs, and AUTH_OK take bare prefixes alone. The alias is wire::alias in moq-auth and wire.ts in @moq/auth. Both are marked TEMPORARY MIGRATION and come out in two version migrations (quest/m4/grant-alias-delete.md).
  • Discovery filters stay patterns. A new Consumer::filter(&Pattern) (Rust) and the filter argument of announced() and routes() (JS) narrow what a handle lists, apart from what it may reach. A scoped handle lists what its prefixes and its filter both admit. Consumer::reaches_any is gone, since a prefix test does its job.
  • Wire (lite-07, unpublished): AUTH_OK carries Publish and Subscribe Prefixes. A wildcard or malformed prefix is a PROTOCOL_VIOLATION. The region rule's regions are the scope's prefixes not lying within another. The draft's Path Pattern section is now Path Prefix.
  • Legacy put/get tokens read as the same prefixes they always meant. Every token writes publish and subscribe, as since moq-dev/moq#9001.
  • Docs: doc/concept/moq-lite.md gains a "Grants and filters" section. Also updated: the relay auth and config pages, the library pages, the CLI page, the upgrade guide, demo configs, scripts, and the interop harness.

Decisions

  • Grants are prefixes (maintainer, 2026-11-20). This replaces the quest's "Syntax, recommended" bullet. A member anon covers anon and everything beneath it, and the empty member covers everything. Wildcards are refused loudly wherever a grant is made: moq auth serve rules, relay config (CLI, TOML, and env), signing (with_publish, Key.sign, and the CLI flags), origin scope APIs, and AUTH_OK. The one exception is the migration spelling below, which applies where a grant is read from a token, a key scope, or Grant JSON.
  • A temporary alias in both directions (maintainer, 2026-11-20: "temporary read alias, but please check release to figure out what we need to support"). ✅ Read foo/** and ** as their prefix, and write each prefix as foo/**, or ** for the empty prefix. Rejected: shipping strict, which upgrades an auth server and the relays it answers together. The release check turned up the need for the write half:
    • Relay 0.17.17 and CLI 0.14.17 read a bare foo as one path and "" as the root path alone.
    • So a new issuer or auth server writing bare prefixes would narrow every grant an older relay or verifier reads. One writing foo/** is read as the same subtree.
    • It comes out in two steps, so no pair of releases a deployment runs side by side narrows or refuses a grant. The first version migration after 0.22 writes bare prefixes. The one after it deletes the read, once tokens and key scopes minted with /** have expired or been re-minted.
  • The alias stays in the wire layer. Choices I made under the decision above:
    • moq_auth::wire::alias wraps Claims, Scope, and Grant serde, and Access gains crate-private serialize_as and deserialize_as for it. Access's own serde stays strict, so moq auth serve rules still refuse foo/**.
    • A capped role ({"path": [...], "rate": ...}) is spelled the same way.
    • A prefix 32 segments deep writes as its literal, which every release reads as that one path, since nothing lies beneath it.
    • In JS, JSON.stringify is the serializer, so the parsed value carries the written spelling.
      • GrantSchema.parse outputs it, so an auth server answering with GrantSchema.parse(grant) is read alike by every relay. Parsing that output again yields the same JSON. A typed Grant still holds bare prefixes.
      • So does ScopeSchema, and with it every parsed key. Key.public also spells a scope typed by hand, so Key.public and KeySet.public always publish the spelling the key's tokens carry. Scope.allows reads either spelling. This came from the local review, which found that a published key's bare video would make a released verifier refuse the key's own video/** tokens.
      • Strict PrefixListSchema and AccessSchema stay the API input for Key.sign and ClaimsFieldsSchema. The token and JWK schemas use WirePrefixListSchema and WireAccessSchema.
    • The JS CLI's --publish and --subscribe stay strict, like Rust's.
  • Any upgrade order works for grants. This replaces the rollout-order decision:
    • Released issuers write a subtree as put/get or foo/**, which 0.22 reads alike.
    • 0.22 writes foo/**, which a released verifier and relay read as the same subtree.
    • A pre-existing request-side break still orders an auth server before its relays: moq-dev/moq#5293's "transport": "webtransport", which a released moq auth serve answers with 422. The upgrade guide already says so, and this PR doesn't change it.
  • Discovery filters keep their patterns. Each one kept a consumer:
    • the moq-ffi announced filter and libmoq's announced
    • @moq/room, @moq/watch, and @moq/stats in JS
    • moq-gst's watch
    • the relay's ?path= sessions filter and moq auth sessions --path
    • the CLI's tests
  • Roots normalize like broadcast paths. Prefix::rooted and rebase drop empty segments in the root, as Pattern did, so with_root("/project/live/") scopes the same as project/live. The prefix itself stays strict.
  • The empty prefix needs no new syntax. It is "" in JSON and TOML, --auth-public '' on the CLI, and MOQ_AUTH_PUBLIC= in the environment, which the relay reads as set.
  • lite-07 narrows a claim to the scope's region. A claim at room told through a scope granting room/lobby.chat arrives at room/lobby.chat. So a **/*.chat listing at the far end lists it, where older versions tell the claim at room and the listing omits it (relays_route_a_covering_claim_that_listings_omit).
  • quest/m5/peer-grant-bound.md shrinks to [S]. Prefixes remove the Orthogonal Vectors bound and the received-grant type question it planned around. What remains is measuring the prefix rows in Chromium and sweeping deep members. This PR adds the Rust prefix rows (collect, covers, intersect), mirroring the JS ones.
  • A lookup answers to the scope alone (from the local review). Consumer::path_routes starts from the scope's subtrees, not the handle's discovery filters, so follow and request reach a path the filter leaves out (a_filter_never_narrows_a_lookup, which fails on the previous head). JS takes filters per call, so it had no counterpart.
  • Harnesses keep the published relays' syntax. Published relays from 0.15.0 through 0.17.17 read pattern grants and refuse public = "" at startup. I confirmed this against the 0.17.17 binary.
    • smoke.sh hands such a relay test/smoke/smoke-patterns.toml (public = "**"). This came from the local review.
    • interop.sh's compat mode wrote public = "" for a released relay, so it failed at startup. It now probes the relay's help the same way. Both are delete-marked for when release reads prefixes.

Validation

  • quest gate just check passes on ec05d1b, which holds all of the code. That covers 11228 Rust tests (nextest, every selected crate and feature) and 283 @moq/auth tests, plus the other JS, Python, C, C++, Go, Kotlin, Dart, docs, drafts, and quest checks.
    • Its py, c, and cpp steps failed at startup with failed to create directory .../target, while the build cache re-pointed the checkout's target symlink. Rerun alone (just py check, just c check, just cpp check), they pass.
    • The head, 367233d, adds only the follow-up quest's edit, whose markdown and quest checks pass.
    • The js/auth API report changed only in schema internals: each member is a string pipe, and ScopeSchema gains a final transform. The Scope type and every input and output type are unchanged.
  • quest gate just test interop --all passes on 367233d, after a rerun of the go client's cells.
    • The full run passed 162 cells. The 21 cells with the go client never ran: its staging hit the same target swap, and uniffi-bindgen-go found no libmoq_ffi.so, though the build had just produced it.
    • Rerun as the go column (--publishers rust,python,go,cpp,js --subscribers go) and the go row (--publishers go against every other subscriber), each with --timeout 30, the 35 go cells pass, the denied and finish lanes included. Both runs report all checks passed.
  • quest gate just test wire-compat passes on ec05d1b against moq-cli 0.14.17, moq-relay 0.17.17, and @moq/auth 0.2.3. Its token lane:
    • Each key comes from three sources:
      • the current CLI, with --publish video --subscribe ''
      • the released CLI, with 'video/**' and '**'
      • the current library, new in this PR: Key.parse of a typed scope video and "", verified through the half Key.public writes (compat/client.ts generate)
    • Each token is signed by current Rust, released Rust, current JS, and released JS. Each is verified by both CLIs and both JS packages, each reading the subtree it should (PASS token signed by ... for all four signers).
    • A released token mixing video/** with a bare audio reads in current Rust and JS as the prefixes audio and video (PASS released pattern token read as prefixes).
    • In the session lanes, 66 cells ran, including each one with the released relay, and 48 lite-07-wip cells were skipped as the planned break.
  • Pinned against released bytes in rs/moq-auth/tests/released_token.rs:
    • What 0.22 writes for tokens and key scopes.
    • That {"root":"compat","publish":["bob","video/**"]}, the exact payload 0.14.17 signs for a mixed grant, reads as bob and video.
    • Legacy put/get tokens.
    • The refusal of every other wildcard.
  • The shared corpus (rs/moq-auth/tests/corpus.json), replayed by Rust and JS, gains accepted cases for each subtree spelling. Its refused cases include a/*/**, **/a, /**, a\/**, a key scope holding */room, and a grant member lobby/*.
  • Real surface, the current build beside released moq 0.14.17 and moq-relay 0.17.17:
    • Current moq auth sign --root compat --publish video --subscribe '' writes {"root":"compat","publish":["video/**"],"subscribe":["**"]}. Released moq auth verify reads it as Patterns([video/**]) and Patterns([**]).
    • Current moq auth sign --publish 'video/**' still refuses the flag, naming video as the prefix to write.
    • Current moq auth generate --root compat --publish video --subscribe '' writes the scope {"root":"compat","publish":["video/**"],"subscribe":["**"]}. The released signer signs within that scope and refuses audio/** as exceeding it.
    • A token the released CLI signs with */chat is refused by current verify, which says it holds a wildcard.
    • A key from the lane's new generate publishes {"root":"compat","publish":["video/**"],"subscribe":["**"]}. The released signer signs within it. Tokens from the current CLI, the released CLI, and current JS all verify through that public half: released verify reads Pattern("video/**"), and current verify reads Prefixes(["video"]). The previous head's public half, publish: ["video"], makes released verify refuse the key's own token with token capabilities exceed the key scope.
  • Each relay and auth-server pairing ran with the auth server granting video. The broadcasts were video/nested-cam, video/root-cam, and audio/outside, and I compared what the subscriber listed. The script lives in .tmp and is not committed. In no run was audio/outside listed.
    • Released relay with current moq auth serve: lists both video/ broadcasts.
    • Released relay with a stand-in answering bare {"publish":["video"],"subscribe":["video"]}: lists nothing. That is the narrowing the write half prevents.
    • Current relay with released moq auth serve: refused with 422 on "transport": "webtransport", the request-side break fix(auth): distinguish WebTransport from native QUIC #5293 already documents. Behind a proxy that renames it to quic, the released server answers {"publish":["video/**"],"subscribe":["video/**"]}, and the current relay lists both video/ broadcasts.
    • Current relay with current auth server: lists both video/ broadcasts.
  • Not run: a released @moq/auth GrantSchema reading what the current JS auth server answers. Two checks stand in for it. The cross-language grant vector (interop.test.ts) pins that JS output and Rust's are the same bytes. Released relays read those bytes in the pairings above.
  • The previous head's runs still hold:
    • moq-relay's 478 tests, including a_public_prefix_admits_its_whole_subtree.
    • The pattern-algebra prefix rows: at 64 KiB, collect took 0.27 ms and covers 2.8 ms, against 40 ms for the old mask shape.

Impact

Breaking public API, in Rust, JS, and the bindings. Wire: lite-07 AUTH_OK (unpublished, so nothing stays compatible with its pattern form).

Migration:

  • Config and flags: these refuse wildcards at startup or parse. Rewrite foo/** as foo and ** as the empty prefix "" in:
    • moq auth serve rules
    • relay public* rules (CLI, TOML, and env)
    • moq auth sign and moq auth generate's --publish and --subscribe, in Rust and JS
  • Tokens, key scopes, and auth server grants need no rewrite, and any upgrade order works for them:
  • Rust
    • moq-auth: Claims, Scope, Grant, Permissions, and Access.path hold Prefixes. with_publish and with_subscribe take Prefix items. The crate re-exports InvalidPrefix, Prefix, and Prefixes instead of the pattern types, and its error variant is Error::Prefix.
    • moq-net: Producer::scope and Consumer::scope take &Prefixes, and allowed() returns Prefixes. Grant and Permit hold Prefixes.
      • Build Patterns::from(Pattern::subtree("foo")) as Prefixes::from("foo".parse::<Prefix>()?).
      • Build Pattern::all() as Prefixes::all().
      • A scope that only narrowed a listing, such as **/*.chat, moves to Consumer::filter(&pattern).
    • moq-relay: auth.public, public_publish, and public_subscribe are Vec<Prefix>.
  • JS
    • @moq/auth: every role in Claims, a key's Scope, and a Grant is a list of prefixes.
      • Key.sign refuses a member holding a *, with the prefix to write instead. Verification and GrantSchema read foo/** and ** as their prefix and refuse every other wildcard.
      • GrantSchema.parse outputs each prefix as foo/** or **, so answer a relay with its output rather than a raw Grant.
      • A parsed key's scope, Key.public, and KeySet.public spell each prefix the same way, so write a key you scope by hand through Key.parse or Key.public.
      • Claims.authorize returns Prefixes in each role.
      • The package re-exports InvalidPrefix, Prefix, and Prefixes instead of the pattern types. patterns() is prefixes(), and PatternListSchema is PrefixListSchema.
    • @moq/net: Grant.publish and Grant.subscribe are Path.Prefixes, and Producer.scope(root, prefixes) takes Path.Prefixes.
      • Build new Path.Patterns([Path.Pattern.subtree("foo")]) as Path.Prefixes.parse(["foo"]).
      • Build Path.Pattern.all() as Path.Prefixes.all().
      • announced(filter?) and routes(filter?) still take any Path.Pattern; the parameter was named scope.
    • @moq/room: claims(room, identity) returns subscribe: [""] and publish: [identity] instead of ** and identity/**. Mint new tokens with it.
  • moq-ffi and the bindings: MoqGrant members are prefixes, with "" granting everything. Signatures are unchanged.
  • Behavior: a relay public rule anon admits anon/room as well as anon. On lite-07, a claim told through a scope narrower than it arrives at the scope's region.

Follow-ups

  • quest/m4/grant-alias-delete.md (new, S) deletes the alias in two version migrations: first it writes bare prefixes, then it deletes the read. Two open decisions:
    • The maintainer opens the API or wire phase of the cycle after 0.22 before step 1 lands, so step 1 never ships in a 0.22 patch.
    • Step 2 needs a rule for a /** spelling nothing re-mints, such as a key scope or a token with no exp. Recommended: delete the read everywhere, with a migration note to regenerate or edit such keys and re-mint unbounded tokens.
  • quest/m4/js-listing-rebuild.md (new, M): @moq/net's origin listing rebuilds every route against every scope member on each update. It measured 22 ms per update at 128 routes and 128 members, the same as with pattern scopes before this PR. The fix rebuilds only touched paths and looks members up through the sorted set. No open decisions.
  • quest/m5/peer-grant-bound.md (rewritten here, L to S): measure the prefix rows in Chromium, sweep deep members, and decide whether the mask and chain rows still earn their place. No open decisions.
  • quest/m4/regrant-route-recheck.md (aligned here): a member is a prefix, so the routes it can change are those at, beneath, or above it. No open decisions.
  • quest/m2/lite07-claim-reach-routes.md (unblocked here): its Required link to this quest is removed.

Models

Size: L
Implementer: Claude Code, claude-opus-5-5, unknown effort
Implementer: Claude Code, claude-opus-5-5, unknown effort (iterate, L)

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

Review

Rewritten by quest review after each round.

  • Head: 8a43f46

  • Base: origin/main at 444a1c5

  • Risk: high, Changing authorization from patterns to prefixes can broaden token access or reject existing grants and relay configurations for consumers and operators; reverting restores code but cannot undo unauthorized data access.

  • Classified: high by Codex, gpt-6.1-sol, low effort, session 01a1fbc5-b682-7823-b1f6-010cd52e77d8

  • Reviewer: Codex, gpt-6.1-sol, xhigh effort

  • Session: 01a1fb88-d45a-7370-b21d-098a87e2440d, round 2

  • Score: 10/10, The incremental fix correctly excludes unrepresentable grant prefixes, preserves the earlier compatibility fix, and adds focused regression coverage; no actionable issues were found, and builds and tests were not run as instructed.

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

  • Findings: none

kixelated and others added 6 commits November 20, 2026 12:12
Quest-Claim: 781e240164415fb4
A grant (token, moq auth serve rule, relay public rule, origin scope, and
lite-07 AUTH_OK) is a set of path prefixes, each covering its whole
subtree. Every wildcard is refused where a grant is parsed or made.
Discovery filters keep their patterns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rop harness

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…egion

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title A grant is a set of path prefixes again feat!: grants are path prefixes again Nov 20, 2026
…lays' syntax

A filtered consumer's follow and request start from the scope's subtrees,
not the handle's filters, so a path the filter leaves out still resolves.
Published relays from 0.15 read pattern grants and refuse a public rule
without a wildcard, so smoke.sh hands them smoke-patterns.toml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated and others added 3 commits November 20, 2026 15:49
…tions pass

Releases before 0.22 read a grant member as a pattern, so a bare `foo` is one
path to them. Tokens, key scopes, and auth server grants now write each prefix
as `foo/**` or `**`, and read that spelling back as the prefix, in moq-auth and
@moq/auth alike. Config, flags, origin scopes, and AUTH_OK stay strict. Both
aliases are TEMPORARY MIGRATION, deleted by quest/m4/grant-alias-delete.md.

The wire-compat token lane signs and verifies under scoped keys each CLI
generates, and the compat relay keeps `public = "**"` for released relays,
which refuse the empty prefix at startup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated and others added 2 commits November 20, 2026 16:23
A parsed scope, Key.public, and KeySet.public spell each prefix as the
subtree pattern releases before 0.22 read, as GrantSchema does, so a
released verifier no longer reads a published scope narrower than the
tokens the key signs. Scope.allows reads either spelling. The wire-compat
token lane adds a key the library scopes, verified by its public half.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No blocking issues found — one small JS/Rust mismatch is inline, and one upgrade edge case should be named in the docs.

Approach: sound. Moving grants back to prefixes makes authorization O(n log n) on every shape and lets a claim ride the path it is presented at. Discovery keeps patterns (Consumer::filter). The temporary foo/** wire alias in wire.rs and wire.ts lets old and new issuers, verifiers, and relays upgrade in any order. The alias stays in the serde layer, and Access's own serde stays strict, which is where it belongs.

Reviewed changes. I read the prefix algebra, the auth alias and claims, moq-net's origin, permit, and request coverage, and the relay, CLI, FFI, and config surfaces. I also checked parity for lite-07 AUTH_OK, regions, and the origin listing between Rust, JS, and the draft.

  • Prefix/Prefixes (moq-pattern, @moq/pattern): a sorted, reduced set that refuses any * and malformed slashes.
    • Rust covering binary-searches each ancestor; JS #covering checks the last member at or before the path. Both are correct for a reduced, sorted set.
    • Both reject the same inputs, and AUTH_OK decoding turns a bad prefix into a PROTOCOL_VIOLATION on both sides, as the draft says.
  • Auth wire alias: tokens, key scopes, and Grant JSON write foo/** or **, and the deepest prefix as its literal. Only those two spellings read back. "/**", "a\/**", "foo/*/**", and every other wildcard are refused identically in both languages.
  • Legacy put/get: read as the same prefixes, with slashes normalized.
  • Origin scope vs. listing: OriginScope.allowed is Prefixes. The new Consumer.listed is the scope ∩ filters and feeds only the announced/routes cursors. path_routes answers to the scope alone, which matches JS, where follow takes no filter.
  • reach(): gives the whole claim when the scope covers the prefix, and otherwise the scope's members beneath it. This matches JS's claimed.
  • Permits: Permit::within replaces beneath, and regions() intersects the grant and the limit. PublishNamespace uses the same prefix test as Publish.
  • Config and CLI: moq auth serve rules, the relay's public* settings, and the sign/generate flags refuse wildcards and name the prefix to write instead. The empty prefix is "" across the CLI, TOML, and env. The Nix module maps publicPath exactly as before. The relay's lease and refresh changes are mechanical.

ℹ️ A released bare "" widens from the root path alone to everything

The upgrade note says a bare member minted since #3746 widens from one broadcast to its subtree. The extreme case is the bare empty member. Under released pattern semantics, "" granted exactly the root path (claims.rs on main: "the empty pattern grants exactly the path"). alias::read and readPrefix now read it as Prefix::all().

Take a released key scope minted with moq auth generate --publish ''. It jumps from signing only the root path to unrestricted signing, which runs against Scope's promise that a scoped key can never sign more than it already could. A released token, or a released auth server's answer, holding "" widens the same way. This follows from the decision you documented and is probably rare in the wild. But it is the one widening that reaches everything, so it deserves its own sentence in doc/setup/upgrade.md and the Impact section.

Technical details
# Bare `""` from a release before 0.22 now grants everything

## Affected sites
- rs/moq-auth/src/wire.rs:409-420 (`alias::read`) — `""` falls through to `head.parse()` → `Prefix::all()`
- js/auth/src/wire.ts:48-52 (`readPrefix`) — same
- doc/setup/upgrade.md:44-47 — names the `alice` widening but not the `""` → everything case

## Required outcome
- Operators learn that a key scope, token, or auth-server grant minted before 0.22 with a bare `""` member now grants everything under its root, and know to re-mint it.

## Open questions for the human
- Is a docs note enough? The alternative is refusing a bare `""` on read until the step-1 migration starts writing bare prefixes. 0.22 itself always writes `**`, so a bare `""` in 0.22 can only come from an older issuer.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread js/net/src/lite/routed.ts Resolved
@moq-bot
moq-bot Bot disabled auto-merge November 21, 2026 01:17
@moq-bot

moq-bot Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

quest land watch: ended this pull request's pick, disarming its auto-merge, since its head 367233d is held by finding by pullfrog[bot]: This casts every gained prefix to Path.Valid without checking it. Rust's Permit::beyond drops a prefix that `Path::n (#9251 (comment)). Push a fix, or answer each by a thread reply or a comment linking its review or decision, then land it again.

(written by quest land watch)

`gained()` cast every new grant prefix to a path, so a prefix longer than a
path can be marked every synced reader at or above it behind. Rust's
`Permit::beyond` drops such a prefix, since it covers nothing a peer could
name; JS now does the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes. This run covers the one commit since the last review, which fixes the inline finding on gained().

  • gained() filter: js/net/src/lite/routed.ts now drops any gained prefix that Path.check rejects. This matches Rust's Permit::beyond, so a grant that gains a prefix too long to be a path no longer unsyncs any reader.
  • Regression test: the new subscriber.test.ts case grants a prefix of MAX_BYTES+ bytes and asserts that a root routes() reader stays synced.

The earlier body note on a released bare "" widening to everything is not yet in doc/setup/upgrade.md. Whether it needs its own sentence is your call. It does not block merging.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 21, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 21, 2026
@moq-bot

moq-bot Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

quest land watch: the merge queue removed this pull request at 8a43f46 because its merge_group build failed (failed_checks).

The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs.

Queue / Queue (job) failure at step Check:

… installed [204.00ms]
$ wrangler deploy --dry-run

 ⛅️ wrangler 4.162.0 (update available 4.166.0)
───────────────────────────────────────────────

Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md
Total Upload: 1.44 KiB / gzip: 0.73 KiB
Your Worker has access to the following bindings:
Binding                  Resource       
env.GO (go-moq-dev)      R2 Bucket      

--dry-run: exiting now.
bun test v1.4.4 (38afee6c8)

##[group]src/worker.test.ts:
(pass) serves each GOPROXY file with its type and cache lifetime [1.36ms]
(pass) HEAD returns the headers without a body [0.09ms]
(pass) a missing version, @latest, or a non-GOPROXY key is an uncached 404 [0.20ms]
(pass) only a GOPROXY path reads the bucket [0.07ms]
(pass) refuses writes [0.04ms]

##[endgroup]

 5 pass
 0 fail
 35 expect() calls
Ran 5 tests across 1 file. [6.00ms]
bun install v1.4.4 (38afee6c8)

+ wrangler@4.158.0

37 packages installed [134.00ms]
bun install v1.4.4 (38afee6c8)

+ @cloudflare/workers-types@5.20261108.1
+ typescript@7.0.2
+ wrangler@4.158.0

40 packages installed [152.00ms]
$ wrangler deploy --dry-run

 ⛅️ wrangler 4.158.0 (update available 4.166.0)
───────────────────────────────────────────────

Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md
Total Upload: 7.71 KiB / gzip: 3.03 KiB
No bindings found.
--dry-run: exiting now.
bun install v1.4.4 (38afee6c8)

+ @cloudflare/workers-types@5.20261108.1
+ typescript@7.0.2
+ wrangler@4.158.0

40 packages installed [156.00ms]
$ wrangler deploy --dry-run

 ⛅️ wrangler 4.158.0 (update available 4.166.0)
───────────────────────────────────────────────
Total Upload: 2.18 KiB / gzip: 0.97 KiB
Your Worker has access to the following bindings:
Binding                           Resource       
env.RELEASE (nix-moq-dev)         R2 Bucket      
env.CI (nix-ci-moq-dev)           R2 Bucket      

--dry-run: exiting now.
bun test v1.4.4 (38afee6c8)

##[group]src/worker.test.ts:
(pass) bucket reads > RELEASE service error 10001 makes GET and HEAD a non-cacheable miss [0.77ms]
(pass) bucket reads > RELEASE service error 10043 makes GET and HEAD a non-cacheable miss [0.07ms]
(pass) bucket reads > RELEASE preserves Error: get: Unauthorized (10002) [0.12ms]
(pass) bucket reads > RELEASE preserves Error: get: Access denied (10003) [0.01ms]
(pass) bucket reads > RELEASE preserves Error: get: No such bucket (10006)
(pass) bucket reads > RELEASE preserves Error: get: Invalid object name (10020)
(pass) bucket reads > RELEASE preserves Error: get: Unknown failure (0)
(pass) bucket reads > RELEASE preserves Error: unrelated 10001 [0.06ms]
(pass) bucket reads > RELEASE preserves TypeError: bad binding [0.01ms]
(pass) bucket reads > CI service error 10001 makes GET and HEAD a non-cacheable miss [0.05ms]
(pass) bucket reads > CI service error 10043 makes GET and HEAD a non-cacheable miss [0.04ms]
(pass) bucket reads > CI preserves Error: get: Unauthorized (10002) [0.05ms]
(pass) bucket reads > CI preserves Error: get: Access denied (10003)
(pass) bucket reads > CI preserves Error: get: No such bucket (10006) [0.02ms]
(pass) bucket reads > CI preserves Error: get: Invalid object name (10020)
(pass) bucket reads > CI preserves Error: get: Unknown failure (0)
(pass) bucket reads > CI preserves Error: unrelated 10001
(pass) bucket reads > CI preserves TypeError: bad binding [0.01ms]
(pass) bucket reads > a missing binding is a configuration error [0.20ms]
(pass) bucket reads > a release miss checks CI and preserves the object's headers and body [0.50ms]
(pass) bucket reads > a release service error still serves the path from CI [0.21ms]
(pass) bucket reads > a plain miss stays cacheable [0.09ms]
(pass) bucket reads > cache metadata needs no bucket read [0.10ms]

##[endgroup]

 23 pass
 0 fail
 78 expect() calls
Ran 23 tests across 1 file. [6.00ms]
bun install v1.4.4 (38afee6c8)

+ @cloudflare/workers-types@5.20261108.1
+ typescript@7.0.2
+ wrangler@4.158.0

40 packages installed [154.00ms]
$ wrangler deploy --dry-run

 ⛅️ wrangler 4.158.0 (update available 4.166.0)
───────────────────────────────────────────────
Total Upload: 2.08 KiB / gzip: 0.89 KiB
Your Worker has access to the following bindings:
Binding                    Resource       
env.RPM (rpm-moq-dev)      R2 Bucket      

--dry-run: exiting now.
##[endgroup]
ci: check large_files started
ci: check large_files passed in 1s
##[group]check large_files
changed: base 9b22abb233127027ddf5c055deab282c313a4958
##[endgroup]
ci: check text started
ci: check text passed in 0s
##[group]check text
##[endgroup]
ci: check coverage_tables started
ci: check shell failed in 3s
##[group]check shell
open infra/nix/node_modules/.bun-tmp-57a271e920280c3f/dist/src: no such file or directory

In bench/browser/run.sh line 20:
source "$WORKSPACE/test/lib/harness.sh"
       ^-- SC1091 (info): Not following: ../../test/lib/harness.sh was not specified as input (see shellcheck -x).


In bench/browser/run.sh line 97:
    bun micro.ts --bench "$benchmark" --rounds 1 --out "$HARNESS_RUN/$benchmark.json" \
                                                        ^----------^ SC2153 (info): Possible misspelling: HARNESS_RUN may not be assigned. Did you mean HARNESS_RUNS?

For more information:
  https://www.shellcheck.net/wiki/SC1091 -- Not following: ../../test/lib/har...
  https://www.shellcheck.net/wiki/SC2153 -- Possible misspelling: HARNESS_RUN...
##[endgroup]
ci: check coverage_tables cancelled in 0s
ci: check go cancelled in 81s
##[group]check coverage_tables
##[endgroup]
##[group]check go
bash ../sh/go/check.sh
go check: gofmt -l...
go check: go vet modzip...
go stage: building moq-ffi for x86_64-unknown-linux-gnu...
    Finished `dev` profile [unoptimized] target(s) in 0.36s
mbx[savings]: 3.3 TiB logical of build debris has left the building.
go stage: generating bindings...
go stage: assembling ffi module...
  go lib linux_amd64 <- x86_64-unknown-linux-gnu (480 MiB)
  go lib linux_arm64: skipped, /var/cache/github-runner-work/moq/moq/dist/go-libs/aarch64-unknown-linux-gnu/libmoq_ffi.a missing
  go lib darwin_arm64: skipped, /var/cache/github-runner-work/moq/moq/dist/go-libs/aarch64-apple-darwin/libmoq_ffi.a missing
  go lib windows_amd64: skipped, /var/cache/github-runner-work/moq/moq/dist/go-libs/x86_64-pc-windows-msvc/moq_ffi.lib missing

Staged: /var/cache/github-runner-work/moq/moq/dist/go-ffi-pkg/moq-ffi-0.0.0-dev-go
go stage: staging wrapper module...
  skipping go mod tidy (no go.sum staged)

Staged: /var/cache/github-runner-work/moq/moq/dist/go-wrapper-pkg/moq-go-0.7-wrapper
go check: checking error sentinels...
go check: go vet ./...
go check: go build ./...
go check: go test -race ./...
error: recipe `check` was terminated on line 17 by signal 15
##[endgroup]
##[error]ci: check shell failed
ci: wall and CPU seconds per module
   218     407  check py
   113      13  test py
   265     297  check rs
   297    1947  test rs
    23       3  check cargo_nix
   273     348  check c
   375     189  check cpp
    42      60  check obs_compile
    38      47  check biome
   206     548  check js
    87     126  test js
    13       7  check dead_code
     6       8  check audio_quality
    21      10  check drafts
    11      12  check markdown
    18      24  check gh
   116      98  check tooling
   177     154  check kt
    42      48  check flake
    35      59  check bench
     5       5  check carla
    90      66  check carla_bridge
     1       0  check swift
    81      30  check go (cancelled)
     1       0  check drill
     7      10  check workers
     2       2  check quest
     0       0  check python
     3       2  check shell (failed)
     1       0  check large_files
     0       0  check text
     0       0  check coverage_tables (cancelled)
   856    4536  whole run
error: recipe `ci` failed on line 120 with exit code 1
##[error]Process completed with exit code 1.
##[group]Run actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
  name: cargo-timings
  path: target/cargo-timings/cargo-timing-*.html
  if-no-files-found: ignore
  retention-days: 14
  compression-level: 6
  overwrite: false
  include-hidden-files: false
  archive: true
env:
  BASE: 9b22abb233127027ddf5c055deab282c313a4958
  CHECK_FAIL_FAST: 1
  NEXTEST_TEST_THREADS: 24
  MBX_CACHE_LINKS: 1
  MBX_REMOTE_URL: 
##[endgroup]
With the provided path, there will be 3 files uploaded
Artifact name is valid!
Root directory input is valid!
Uploading artifact: cargo-timings.zip
Beginning upload of artifact content to blob storage
Uploaded bytes 186210
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is f544929c3ff43764bb8d4fa83be47a4cc5941e282cdd74b3b1259a0bf8c60712
Finalizing artifact upload
Artifact cargo-timings successfully finalized. Artifact ID 14687901495
Artifact cargo-timings has been successfully uploaded! Final size is 186210 bytes. Artifact ID is 14687901495
Artifact download URL: https://github.com/moq-dev/moq/actions/runs/44854912132/artifacts/14687901495
Post job cleanup.
##[start-action display=Run jdx/mr-boxington-action@88acf2bb50552c7c508cbac13e5f8c576b95b1de;id=__a67eb395-fcca-4b38-9938-e47b5c75a1be.mbx]
##[end-action id=__a67eb395-fcca-4b38-9938-e47b5c75a1be.mbx;outcome=skipped;conclusion=skipped;duration_ms=0]
Post job cleanup.
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git version
git version 2.56.0
Temporarily overriding HOME='/var/cache/github-runner-work/_temp/64c00428-c0ec-4725-b8e4-d7703330ce45' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --global --add safe.directory /var/cache/github-runner-work/moq/moq
Removing SSH command configuration
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp ^includeIf\.gitdir:
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
A job completed hook has been configured by the self-hosted runner administrator
##[group]Run '/nix/store/qrn6ds64bzvwbm5nwf245ifz2c6jb9xw-ci-cache-gc.sh/bin/ci-cache-gc.sh'
shell: /nix/store/lfm00fnq66xfgbn099vqckabyl5jllz6-bash-interactive-5.3p20/bin/bash --noprofile --norc -e -o pipefail {0}
##[endgroup]
evicted 65 objects and 20 action results (264.2 MiB logical); 50.0 GiB logical remain
dropped 11 stale checkout records
dropped 4 session event streams
removed 0 learned incremental units and 3 checkout directories (3.8 KiB logical); 32 units (5.0 GiB logical) remain
evicted 0 objects and 0 action results (0 B logical); 50.0 GiB logical remain
removed 2 target directories (2.1 MiB logical, 2 abandoned and 0 live); 20.8 GiB logical remain
Cleaning up orphan processes

(written by quest land watch)

@moq-bot

moq-bot Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

codex, gpt-6.1-sol, medium effort land fixer note:

The queue log records:

ci: check shell failed in 3s
open infra/nix/node_modules/.bun-tmp-57a271e920280c3f/dist/src: no such file or directory
SC1091 (info): Not following: ../../test/lib/harness.sh was not specified as input (see shellcheck -x).
SC2153 (info): Possible misspelling: HARNESS_RUN may not be assigned. Did you mean HARNESS_RUNS?

These are lines 30385–30400. The PR changes neither sh/shell.sh, bench/browser/run.sh, nor test/lib/harness.sh. File discovery apparently stopped at a disappearing temporary Bun directory, omitting the harness that defines HARNESS_RUN. The shell check passed in the dev shell on base and on a scratch merge. The scratch merge's full nix develop --option substituters '' --no-update-lock-file --command just ci base completed with all selected checks passing except flake: ci: flake's NixOS VM tests need KVM, but /dev/kvm is missing; run them on a KVM host, as CI does. Full verification therefore requires a KVM-capable runner. No source changes were made, and the pinned PR branch remains unchanged.

(written by codex, gpt-6.1-sol, medium effort)

@moq-bot

moq-bot Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

codex, gpt-6.1-sol, medium effort land fixer: nix develop --option substituters '' --no-update-lock-file --command just ci base failed: ci: flake's NixOS VM tests need KVM, but /dev/kvm is missing; all other selected checks passed, including chec. Recommendation: Rerun the unchanged PR merged with base on a KVM-capable runner; the original shell failure indicates file discovery raced with a disappearing temporary Bun directory.

ci: check shell failed in 3s
##[group]check shell
open infra/nix/node_modules/.bun-tmp-57a271e920280c3f/dist/src: no such file or directory

In bench/browser/run.sh line 20:
source "$WORKSPACE/test/lib/harness.sh"
       ^-- SC1091 (info): Not following: ../../test/lib/harness.sh was not specified as input (see shellcheck -x).


In bench/browser/run.sh line 97:
    bun micro.ts --bench "$benchmark" --rounds 1 --out "$HARNESS_RUN/$benchmark.json" \
                                                        ^----------^ SC2153 (info): Possible misspelling: HARNESS_RUN may not be assigned. Did you mean HARNESS_RUNS?

For more information:
  https://www.shellcheck.net/wiki/SC1091 -- Not following: ../../test/lib/har...
  https://www.shellcheck.net/wiki/SC2153 -- Possible misspelling: HARNESS_RUN...

(written by codex, gpt-6.1-sol, medium effort)

@kixelated
kixelated added this pull request to the merge queue Nov 21, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant