Skip to content

refactor(id-worlds): split world/mod.rs into world::journal (#10430) - #10451

Merged
dezren39 merged 1 commit into
mainfrom
queue/17354-10430-world-mod-split
Nov 15, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/17354-10430-world-mod-split

Conversation

@dezren39

@dezren39 dezren39 commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Summary

Splits pkgs/id/crates/id-worlds/src/world/mod.rs (#10430) by extracting the
world journal records into a new world::journal submodule.

world/mod.rs was 2,559 production lines (over the 2,500 limit) and
production-line-guard was red on main for it. It has no grandfather entry,
so the split is the fix.

What moved

New file pkgs/id/crates/id-worlds/src/world/journal.rs holds the durable
journal-format surface:

  • JournalEntry (all variants), JournalAdminHistory
  • CoordinatorJournalEntry
  • JournalSignedMove (+ from_record / to_record)
  • TrustBasis, TrustDecision
  • every JOURNAL_VERSION* constant, MAX_JOURNAL_VERSION,
    journal_version_required_by (the journal upgrade/refusal contract, Define rollback compatibility for world profile journal entries #227)
  • the WorldJournal trait
  • JournalSnapshot, JournalSnapshotSource

CapabilityDenied / is_capability_denied deliberately stayed in mod.rs:
they are capability-authorization types, not journal records.

No behavior change / public paths unchanged

  • mod.rs declares mod journal; and re-exports every moved item, so
    crate::world::JournalEntry, crate::world::WorldJournal,
    crate::world::JOURNAL_VERSION, … are all unchanged. JournalAdminHistory
    keeps its pub(crate) reachability through its re-export.
  • The moved text is a byte-for-byte move (verified by diffing the extracted
    region against origin/main). The only edits are mechanical:
    pub(crate) struct JournalAdminHistory became pub inside the private
    journal module to keep the private_interfaces warning from appearing
    across the module boundary (its effective visibility is unchanged — the
    module is private and the re-export is pub(crate)), one anyhow::Result
    to Result / dropped a redundant local use anyhow::Context as _, and the
    intra-doc link WorldCore::restore → crate::world::WorldCore::restore
    now that it crosses the module boundary.
  • No serialization, ordering, matching or error text changed.

Guard evidence

Before (branch point origin/main @ 73ae4d58dc):

$ bash .github/scripts/check-production-line-limit.sh
::error::OVER LIMIT pkgs/id/crates/id-worlds/src/world/mod.rs: 2559 production lines (limit 2500)

After, counting this worktree's two files with the same script (LIMIT lowered
to 0 in a scratch copy so it prints every count):

::error::OVER LIMIT pkgs/id/crates/id-worlds/src/world/journal.rs: 988 production lines (limit 0)
::error::OVER LIMIT pkgs/id/crates/id-worlds/src/world/mod.rs: 1599 production lines (limit 0)

mod.rs: 2,559 -> 1,599 production lines. With the real limit restored and
only these two files in scope the guard is green:

$ bash .github/scripts/check-production-line-limit.sh <scratch-root>
production-line-guard: checked 2 production .rs files, limit 2500
production-line-guard: OK

Full-tree run on this worktree no longer lists world/mod.rs; the two
remaining OVER LIMIT lines in the full run (atlas-search/server.rs 2509,
fleet-search/server.rs 2501) are pre-existing on main at this branch point
and are not touched here.

Tests

cargo test -p id-worlds (full crate suite), run through
~/tools/fleet-build-lock:

     Running unittests src/lib.rs (target/debug/deps/id_worlds-da3e8fee6dba446a)
test result: ok. 674 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 39.58s
   Doc-tests id_worlds
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

No test or fixture was modified.

Closes #10430


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

…ords (#10430)

world/mod.rs was 2559 production lines, over the 2500 production-line
limit (F11.10 guard #1411, split family #8588-#8594; this file had no
grandfather entry). Extract the durable journal surface into
world::journal: JournalEntry and its admin-history window, the
coordinator journal entries, JournalSignedMove, the trust-gate records,
every JOURNAL_VERSION* constant with journal_version_required_by, the
WorldJournal trait, and JournalSnapshot/JournalSnapshotSource.

mod.rs re-exports every moved item, so all crate::world::* public paths
are unchanged (JournalAdminHistory stays pub(crate)). The moved text is a
byte-for-byte move; the only edits are mechanical: JournalAdminHistory is
pub inside the private journal module (effective visibility unchanged, and
a pub(crate) item referenced by a public enum field across the new module
boundary would trigger private_interfaces), one anyhow::Result -> Result
with the now-redundant local Context import dropped, and the
WorldCore::restore intra-doc link repointed to its full path.

No behavior change. world/mod.rs: 2559 -> 1599 production lines;
world/journal.rs: 988. production-line-guard green for both files.
cargo test -p id-worlds: 674 passed, 0 failed.
@dezren39
dezren39 requested a review from a team as a code owner November 15, 2026 08:58
@chatgpt-codex-connector

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-15T08:58:24.340953Z
We couldn’t complete this review. Comment @codex review to try again.
06e0e26 PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Nov 15, 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 11 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: 6e79caa4-28fb-4bfd-a60e-ef323b7ba72b
Commits

Reviewing files that changed from the base of the PR and between 9ce1dbf and 06e0e26.

Files selected for processing: 2

  • pkgs/id/crates/id-worlds/src/world/journal.rs
  • pkgs/id/crates/id-worlds/src/world/mod.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

@dezren39

Copy link
Copy Markdown
Member Author

Codex findings disposition (queue worker lane code-c, task 17354):

The Codex code review for this PR failed to run — the summary comment states the review could not be completed and the follow-up comment states Codex usage limits for code reviews have been reached. There are no substantive Codex findings on this PR: verified fresh — zero inline PR review comments and zero submitted reviews on PR #10451.

Disposition: nothing to fix or rebut; the failure is a reviewer-availability limit, not a code finding. Merge proceeds on the verified evidence in the PR body plus a fresh local re-run: production-line guard shows world/mod.rs at 1,599 production lines (under the 2,500 limit) and cargo test -p id-worlds passes 674/674.

@dezren39
dezren39 merged commit 83f4d90 into main Nov 15, 2026
1 check passed
@dezren39
dezren39 deleted the queue/17354-10430-world-mod-split branch November 15, 2026 09:41
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.

id: split pkgs/id/crates/id-worlds/src/world/mod.rs (2,559 production lines) — over the 2500 production line limit

1 participant