Repository navigation
id(serve): persisted publications registry, boot restore + shadow warnings (#2147 slice 1) - #5114
Conversation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e52989c1b9
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pub const KNOWN_EXPLORER_ROUTES: &[&str] = &[ | ||
| "/", "/api", "/blob", "/edit", "/explore", "/files", "/hash", "/invite", "/peers", "/settings", | ||
| "/view", "/world", "/ws", | ||
| ]; |
There was a problem hiding this comment.
Include the assets route in shadow detection
For a persisted, unacknowledged mount at /assets or any descendant, startup emits no shadow warning because this list omits /assets. The Explorer router registers /assets/{*path} in pkgs/id/src/web/routes.rs:370, and its templates reference JavaScript and CSS under that prefix. The same omission lets publish accept these collisions without acknowledgement. Include the assets prefix so both publication validation and boot warnings cover this existing Explorer route.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in bcd90bf — KNOWN_EXPLORER_ROUTES now includes /assets (the Explorer router registers /assets/{*path} at pkgs/id/src/web/routes.rs:370, verified). Shadow-detection assertions for /assets and /assets/app.js added to shadow_detection_is_segment_boundaried; the publications test suite passes 9/9 on the laptop (cargo test --lib publications::).
| if !path.exists() { | ||
| return Ok(Self::default()); |
There was a problem hiding this comment.
Distinguish missing registries from metadata failures
If ID_PUBLICATIONS_FILE points into an existing directory that the serve process cannot search, Path::exists() returns false on the permission error, causing startup to silently treat the persisted registry as empty. This bypasses the intended fail-loud behavior when publications cannot be read. Read the file directly and return an empty registry only for ErrorKind::NotFound, propagating other errors with the file context, as GroupLog::open already does in pkgs/id/src/groups/log.rs.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in bcd90bf — Registry::load now reads the file directly and treats only ErrorKind::NotFound as an empty registry; every other read error propagates with the file context, following the GroupLog::open pattern. Regression test load_fails_loud_on_unreadable_path_not_just_missing (loading a directory must error, not silently restore an empty registry) added and passing (suite 9/9).
… registry Codex review findings on PR #5114 (issue #2147 slice 1): - KNOWN_EXPLORER_ROUTES omitted /assets, though the Explorer router registers /assets/{*path} (web/routes.rs) — unacknowledged mounts at /assets or below passed publish validation and drew no boot warning. Route added, with shadow-detection assertions. - Registry::load probed Path::exists() first, collapsing permission and metadata failures into an empty registry (silent restore of nothing). It now reads directly and treats only NotFound as empty, propagating other errors with the file context — the GroupLog::open pattern. Regression test: load of a directory errors. Tests: cargo test --lib publications:: — 9 passed, 0 failed.
|
Warning Review limit reachedYou'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 41 minutes. View limit details
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. CodeRabbit Verify
|
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Slice 1 of #2147 (dynamic program publications): the persisted publications registry — the part of the design with no sockets in it, landed first so later slices build on a tested data model.
pkgs/id/src/publications.rs:Publication/Placement(dedicated listener vs path mount on the Explorer listener) /Registry, with the id(serve): design — how does a program appear as a website? (program-only ports, mixed ports, path mounts) #2146 world-name target model./, no empty/./..segments); shadowing is a segment-boundary prefix relation in either direction (/worldsshadows nothing).publishrefuses an unacknowledged mount that shadows an Explorer route, naming the route; withacknowledge_shadowset it succeeds and returns the loud warning text. One program per placement — a second publish must unpublish first.ID_PUBLICATIONS_FILEoverride, elsepublications.jsonin the store dir), written atomically (temp + rename). Missing file = empty registry; malformed file = error naming the file.id serve: the persisted set is loaded at startup, each restored publication is named in the startup log (inspectable), and boot shadow warnings are re-issued for unacknowledged shadow mounts, per id(serve): dynamic publish/unpublish — bind and unbind programs and pages to ports, interfaces, and paths at runtime #2147. A malformed registry fails startup loudly instead of silently restoring nothing.Not in this slice (remaining for #2147, in order)
Evidence
d6bf024a4(current main). Dependencies verified fresh this shift: issue id(serve): a bindings model — multiple listeners by flag and config #2145 CLOSED, issue id(serve): design — how does a program appear as a website? (program-only ports, mixed ports, path mounts) #2146 CLOSED, design PR design(id): #2146 program websites #3836 MERGED 2026-11-02 — the earlier block reason on task 5193 is dead.Refs #2147 (slice 1 of the implementation; the issue stays open for slices 2–3).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.