Skip to content

id: phase-4 mount validation — canonical paths, reserved-route and remount conflict refusal (#5537) - #11284

Merged
dezren39 merged 1 commit into
mainfrom
queue/19857-5537-phase4-mounts
Nov 17, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/19857-5537-phase4-mounts

Conversation

@dezren39

@dezren39 dezren39 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Phase 4 of design #2146 for #5537: path mounts in id serve — the validation/conflict layer that was missing.

Verified landscape first: segment-boundary dispatch already exists (publication_mount_layer in id-web routes resolves via PublicationMounts::lookup(), longest whole-segment prefix, and serves the mounted world from a program-only router scoped under the prefix). What was missing: canonicalization/validation, and mount() silently replaced any existing mount.

Changes:

  • id-web: canonicalize_mount_path() — rejects relative paths, empty/./.. segments, trailing slash except root, whitespace/control/?/#/\ characters.
  • id-web: RESERVED_EXPLORER_ROUTES + shadow check (either-direction segment-boundary relation) — mounting over a reserved Explorer route is refused at mount time. The acknowledged override remains the id(serve): dynamic publish/unpublish — bind and unbind programs and pages to ports, interfaces, and paths at runtime #2147 publication operation only, not implemented here (per packet scope).
  • id-web: PublicationMounts::mount() now returns Result<()> — refuses a path already mounted to a different world (table unchanged on error); same-world re-mount stays idempotent; nested mounts stay legal (longest-prefix lookup).
  • id-cli: ServeMountSink propagates the result (the publication manager already reverts its persisted entry on sink error).

Tests (laptop, fleet-build-lock, patch verified at base c91a8ba — see note): cargo test -p id-web 704 passed / 0 failed; cargo test -p id-cli 686+7+7 passed / 0 failed. New tests cover the canonical accept/reject matrices, the reserved-route matrix, different-world remount refusal, and sibling-mount segment isolation (/prog2 does not resolve under mount /prog).

Known residuals (pre-existing, not this PR): WebSocket upgrades under a mount do not complete (documented in publication_mount_layer); current main carries an unrelated id-worlds E0004 breakage from #1831 S2 (commit b6409f5) that post-dates the verified base — the three touched files are byte-identical between the two bases.

Queue task 19857.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…and remount conflict refusal (#5537)

Work preserved from the prior claim's sub-session (task 19857, lanes code-a/any-n): PublicationMounts::mount is now fallible and validates at mount time — canonicalize_mount_path, RESERVED_EXPLORER_ROUTES shadow refusal (either-direction segment-boundary relation), different-world remount refusal with same-world idempotence. ServeMountSink propagates the error so the publication manager reverts its persisted entry. Tests: canonical accept/reject matrix, reserved-route matrix with near-misses, remount conflict, sibling-mount segment isolation, router-level refusal with the Explorer still answering, sink propagation.
@dezren39
dezren39 requested a review from a team as a code owner November 17, 2026 12:29
@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

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 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review 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: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f561b042-c487-44b5-8032-a91a0519531f
Commits

Reviewing files that changed from the base of the PR and between 4b9cd2b and 6003e5b.

Files selected for processing: 3

  • pkgs/id/crates/id-cli/src/commands/serve_publications.rs
  • pkgs/id/crates/id-web/src/lib.rs
  • pkgs/id/crates/id-web/src/routes.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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T12:32:02.445462Z
We couldn’t complete this review. Comment @codex review to try again.
6003e5b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

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