Repository navigation
fix(net): a mount closes under its session's scope - #8983
Conversation
Quest-Claim: 5e2913f4950c2132
A scoped session's mount filed its key with no scope, so the session closing through it doubted the Node ID the scoped peer declared. The router now reads each closing key's scope from the session it answers, as it stands at close. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Head: d65ca7cbcdedeb4347ccc6ce58fccd31e09f9baa
No blocker found. Snapshotting the listener's current scope before removing any keys makes close order irrelevant and respects a permit relink after the mount opened. Scoped closes still withdraw the individual routes without casting node-wide doubt; unscoped closes retain that signal. Dropping a mount by itself still goes through retire, so it does not report a closed session. The new test covers the original false doubt. Static review only; I did not rerun the reported tests.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed how a lite-07 session's close decides whether to doubt its declared Node ID when mounts of that session are open.
- Scope read from the session, not the key —
Router::disconnectlooks up each closing key's scope throughlistenbefore removing any key. A mount filed withscope: Nonenow follows its scoped session and casts no doubt. - Ordering holds —
Stream::dropfor a main key passes the main key and every mount toclose(keys, true)in one call. Because the scope is read up front, it doesn't matter whether the main key or a mount is removed first. Arelinkthat changes scope after the mount opened is also picked up at close. - Test —
a_session_closing_with_its_mounts_doubts_only_if_unscopedsweeps scoped/unscoped against mounted/unmounted, with the scope set after the mount opened, and checks the doubt count.
claude-opus-5-5 | 𝕏
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|

Finishes quest/m2/cluster-routes/mount-scope.md (deleted here).
Summary
Stream::mountfiles a mount's key withscope: None, since a mount hears nothing. When a scoped lite-07 session closed with a mount open,Router::disconnecttook the mount's key for an unscoped session's and doubted the Node ID the scoped peer declared. A scoped peer names itself as it likes, so it must not be trusted to speak for that node.Router::disconnectnow reads each closing key's scope from the session it answers (listen), before any key goes, instead of from the key's own link. That covers both cases from the quest's Plan: the mount needs no copy of the scope, and a permit that changes the session's scope after a mount opened (relink) still applies at close. A copy on the mount's link would have gone stale on such a relink.Decisions
relink, and the mount's link is never relinked.Validation
a_session_closing_with_its_mounts_doubts_only_if_unscoped(rs/moq-net/src/route/node/tests.rs) sweeps scoped and unscoped sessions, with and without a mount, setting the scope after the mount opened. Before the fix it failed onscoped true, mounted true(1 doubt, expected 0); after, it passes, and an unscoped session still doubts its declared ID.cargo test -p moq-net: 1607 passed.just check: passed.Scopedset narrows interest), and the rule a scoped close follows is unchanged, so it was not re-run.Public API / Wire
None.
Caused by
scope: None, so a scoped session's close through it doubted the declared Node ID (found by reviewer).Follow-ups
None.
Models
Size: S
Implementer: Claude, claude-opus-5-5, unknown effort (arm A)
(Written by Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: d65ca7c
Base: origin/main at c7da5e2
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1e6ce-9dd0-7de0-b0f5-303957aed78f, round 1Score: 9/10,
The fix preserves scoped isolation and unscoped disconnect behavior, with no actionable defects found through source review; builds and tests were intentionally not run.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none