Repository navigation
feat(net): exclude a subtree from an origin consumer - #6932
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: e8703e4
No actionable bugs found. Exclusions survive scoping, are checked in handle-side coordinates before mount resolution/shared-front reuse, and reach discovery through translated cursor holes. Keeping covering routes visible while refusing excluded requests matches the documented contract.
Direction: a small, additive subtree API reusing existing authorization and discovery machinery is simpler than mirroring an origin or extending positive Patterns with set difference. The unchanged allowed() semantics are explicitly documented.
Useful additional regression coverage: exclude before further scoping, repeated exclusions, and request/follow/routing refusal through a mount (the new mounted test covers discovery).
Verification: static inspection of the changed code, surrounding scope/mount/cursor/request paths, and added tests; tests and builds were not run.
|
No actionable comments were generated in the recent review.
|
|
Landing e8703e4. The maintainer accepted the new (Written by Claude Opus 5.5) |
Summary
origin::Consumer::exclude(prefix)returns a view that never reaches the subtree atprefix:announced()leaves out the routes at or beneath it, andrequest_broadcast,routed_broadcastandfollowrefuse paths there withUnauthorized. A route announced above the prefix is still reported; only the paths beneath it are refused.Consumer: a relay that publishes its own
local().with_hidden(true).scope(..)view to another relay, minus a platform-owned subtree. Today the only way to subtract paths is to mirror the view into a private origin and answer its requests with the session-onlyRequest::accept, which #6496 rightly made crate-private. Withexclude, that view is a plain composedConsumerpublished to the session, so serving by reference, route identity and egress attribution come from the normal session path.Approach
OriginScopegainsexcluded: absolute subtrees, named as the handle sees them.permitsrefuses paths beneath one, which covers every request gate (request,routing,follow).holesthat mounts already use. The consumer's own cursor gets the excluded prefixes; a mount cursor gets those beneath its mount point translated onto the target, and is dropped when one covers the mount point.Patterns:Patternsis a reduced positive union with no set difference, and the subtree case is what holes already express.Public API
origin::Consumer::exclude(prefix) -> Result<Consumer, Error>.allowed()is unchanged and does not reflect exclusions.Origin.Consumerhas nolocal, mount or consumer-level hidden view either, and no consumer needs it.Tests
exclude_hides_and_refuses_the_subtree(discovery, all three request paths, a covering route, segment boundaries) andexclude_reaches_into_a_mount(an exclusion inside a mount, over a mount point, and under a mount-rooted handle).(Written by Claude Opus 5.5)
🤖 Generated with Claude Code