Skip to content

fix(moq-net): mounts respect exclusions, answered edits remove first, withdrawn copies stay withdrawn, live search keeps its cover - #9351

Merged
kixelated merged 7 commits into
mainfrom
quest/m1/precut-audit/net-mount-and-routing
Nov 22, 2026
Merged

kixelated merged 7 commits into
mainfrom
quest/m1/precut-audit/net-mount-and-routing

Conversation

@kixelated

@kixelated kixelated commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m1/precut-audit/net-mount-and-routing.md (deleted here): four correctness fixes in rs/moq-net from the 2026-11-21 pre-cut audit. Each one has a regression test that fails on main and passes here.

Changes

  1. origin::Producer::mount respects the handle's exclusions (model/origin.rs). mount checked only that allowed covers the target. So a producer from exclude(".stats") could mount("view", ".stats") and read the excluded subtree under view. Now a target at, above, or beneath an excluded subtree returns Error::Unauthorized. That matches the documented contract ("unless this producer reaches all of target"), and the doc now says it.
  2. Router::recv(Msg::Edited) applies remove before add (route/relay.rs). The answering side (Router::edit) already does it in that order. With the old order, an edit that removed and re-added the same prefix dropped the prefix from asked on the asking side. The peer's SYNCED for it then failed with Error::Unasked and closed the session.
  3. A leaving slot keeps "its publisher withdrew it" while it waits (route/node.rs). Here is the failing case: the reader ends a claim and shows it again in one flush, through a session that has yet to confirm. settle deferred the old slot, but the retry passed ended = false, so the old copy was unserved as Gone::Moved (dropped) instead of Gone::Withdrawn (ended). The slot's leaving: bool is now stay: Stay { Wanted, Leaving { ended } }, and ended sticks until the slot is released or wanted again. When the claim is unshown, every slot still gets one verdict for why the reader let go now, so the origin retires the copies together as before.
  4. Live::find re-indexes when another search moved its cover between batches (model/track.rs). The index is shared (Arc<Live>) and the lock is released between batches of 16. A search under another cover could re-cover it in that gap, and the first search then walked groups outside its own window. The condition is now !caught_up || indexed.cover != *groups, as the quest planned.

Decisions

These are choices I made without the maintainer (the run is unattended). A review can undo any of them:

  • Mount vs. exclusion: reject rather than narrow. A target that overlaps an exclusion fails with Unauthorized. The alternative was to translate an exclusion beneath the target into a hole under at. I rejected that because it is the same rule allowed already applies (a mount needs all of its target), and it keeps mounts simple. An exclusion added after a mount still names handle-side paths, like a later scope does, so it doesn't hide the target under at. Relay grants mount before excluding the stats prefix, so moq-relay behaves the same.
  • Unshown release keeps one verdict. A slot withdrawn earlier while the claim stayed shown, released later when the claim goes unshown for another reason, gets Lost/Ended for the current reason, not Withdrawn. Claim::retire drops every copy of the showing at once, so mixed verdicts would depend on the order they arrive.

Validation

  • Every new test fails on the parent commit and passes here:
    • model::origin_impl::tests::mount_never_reaches_an_excluded_subtree
    • route::relay::tests::a_prefix_asked_again_in_one_edit_is_asked_afresh: on main, is_synced returns None after the edit and the next SYNCED is refused.
    • route::node::tests::a_withdrawn_copy_waiting_on_another_session_still_ends: on main, the unserve says gone: Moved.
    • model::track::test::a_search_keeps_its_cover_across_batches: on main, the search met groups 20..=39 from the other cover.
  • CHECK_MODULES=rs just check (lint, clippy, docs, and the full nextest run over every Rust crate the branch selects, 11115 tests) passes. That run includes the route simulations (multicast, node layer, warmth, mesh fuzz replay) as an independent check that the slot-state change keeps the mesh converging.

Public API

None. Wire: none. mount refuses one more case, which is documented and could only have been reached through an exclusion.

Caused by

  • moq-dev/moq#8194 - added Producer::exclude without making mount check it (found by reviewer, the pre-cut audit)
  • moq-dev/moq#8987 - applied an answered edit's adds before its removes on the asking side (found by reviewer, the pre-cut audit)
  • moq-dev/moq#9112 - added Gone::Withdrawn with ended passed per call, so a deferred settle forgot it (found by reviewer, the pre-cut audit)
  • moq-dev/moq#7542 - re-indexed the shared live index only on a search's first batch (found by reviewer, the pre-cut audit)

Follow-ups

None.

Models

Size: M
Implementer: Claude Code, claude-opus-5-5, unknown effort (arm B)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: 5deae8a

  • Base: origin/main at f1b6e06

  • Risk: high, The mount change alters a scope authorization boundary and can reject mounts consumers previously used, while routing fixes change delivery behavior; a revert restores the code but cannot undo data already exposed or delivery already affected.

  • Classified: high by Codex, gpt-6.1-sol, low effort, session 01a201e3-e924-7fb1-9daa-4f145a5a2867

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

  • Session: 01a201e4-04b0-72e2-85ed-d478d40233c4, round 1

  • Score: 9/10, Source review found no actionable defects and the four focused fixes have targeted regression coverage, but builds and tests were not run as instructed.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

kixelated and others added 7 commits November 21, 2026 21:28
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>
…cover

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 kixelated changed the title Fix origin::Producer::mount scope check, router edit order, settle ended state, and Live::find fix(moq-net): mounts respect exclusions, answered edits remove first, withdrawn copies stay withdrawn, live search keeps its cover Nov 22, 2026
@kixelated
kixelated marked this pull request as ready for review November 22, 2026 06:16
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a66dacb4-74bc-45f7-9bcb-53170cfc8421
Commits

Reviewing files that changed from the base of the PR and between 5971145 and 5deae8a.

Files selected for processing: 6

  • quest/m1/precut-audit/net-mount-and-routing.md
  • rs/moq-net/src/model/origin.rs
  • rs/moq-net/src/model/track.rs
  • rs/moq-net/src/route/node.rs
  • rs/moq-net/src/route/node/tests.rs
  • rs/moq-net/src/route/relay.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@kixelated
kixelated enabled auto-merge November 22, 2026 06:17

@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.

Approach: Sound. Each fix sits where the bug is: the scope check in mount, the asking side's edit order, the slot's own lifecycle state, and the shared index's cover check. It doesn't add a new mechanism.

Reviewed changes

I reviewed all six files in the diff against the surrounding code and their callers. I also ran the four new regression tests locally (cargo test --lib --all-features), and all of them pass.

  • Producer::mount honours exclusions: target and the excluded paths are both rooted with self.root.join, so the overlap check compares paths in the same space. moq-relay's Cluster::publisher applies grant mounts in mounted before it calls exclude(stats_prefix), so relay grants behave as before.
  • Router::recv(Msg::Edited) removes before it adds: this now matches Router::edit on the answering side, which drops told for each removed prefix and then exports what each added prefix covers. A remove-and-re-add of the same prefix no longer leaves asked without it, and the asking side no longer answers the following SYNCED with Unasked.
  • Slot.stay replaces leaving: bool: ended comes from broadcast-wide Kind::End router events. Marking every leaving slot ended at the top of settle therefore matches the old one-shot verdict, and the flag now also survives a Confirm::Waiting deferral. relane's leave(false) keeps it, and the flag resets only when the slot is wanted again.
  • Live::find re-indexes on a cover change between batches: if another search moved the shared index to its own cover, this search re-runs catch_up (which calls recover). That costs one Cover comparison per batch, plus the moved runs when two searches with different covers interleave. Both costs stay bounded per batch.

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

@kixelated
kixelated added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit f2965d8 Nov 22, 2026
9 checks passed
@kixelated
kixelated deleted the quest/m1/precut-audit/net-mount-and-routing branch November 22, 2026 06:47
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