Skip to content

pkgs/id crate split step 5b: extract id-worlds core — world, sessions, sandbox, directory cluster (#4408) - #8768

Merged
dezren39 merged 1 commit into
mainfrom
crate-split-step5b-id-worlds-core
Nov 11, 2026
Merged

dezren39 merged 1 commit into
mainfrom
crate-split-step5b-id-worlds-core

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Step 5b of the pkgs/id crate split (#4408; step 5a = #8762): move the world runtime core into id-worlds. Stacked on step 5a and rebased onto current main.

What moved (implementation exists only in pkgs/id/crates/id-worlds; the facade re-exports every historical id:: path):

  • The runtime: world/ (mod, core, actor, replica, replication + receiver, handle, clock, hotness, metrics, signed, upgrade, util, tests), world_session/, world_store, world_net, world_hub, world_compile, world_native, world_fixture, world_records, shell_contract (+ its tests), and sandbox — the wasmtime dependency now lives inside id-worlds (id-worlds/sandbox); the facade sandbox feature forwards to it and the facade's own wasmtime dependency is gone.
  • session_host — the SessionHost/ArtifactSink impls for the hub and directory. The orphan rule puts them here: the trait is id-sync's and the types are now this crate's (they sat in the facade only while the hub and directory did).
  • The directory cluster (directory, directory_auth, directory_view, directory_mail, ~9,600 lines). This is the seam-10 resolution for this step, and it is the consumer-side move (the seam-6 pattern from 5a): WorldCore holds the Directory (world/core.rs:208), the world actor executes directory_view::run against it, world_session's service API names Caller/DirectoryAction/DirectoryOutcome, and world_store persists the directory beside the journal. A trait inversion here would have meant re-typing WorldCore's public directory()/directory_mut() accessors (used by server_config and web) — a public-API redesign, which the step's stop rule reserves. Moving the cluster changes no API and no behaviour: the facade re-exports id::directory* unchanged. Seam 10's remaining half is unchanged by this: step 6's id-directory extraction must still invert or re-home WorldCore's hold on the directory, exactly as it would have had to from the facade — recorded on pkgs/id crate split — step 5: extract id-worlds #4408 and for pkgs/id crate split — step 6: extract id-directory, then id-web #4409. directory_log does not move (nothing in the world family names it; it is step 6's).
  • test_forgeries (94-line signature-fixture leaf) → id-core, gated #[cfg(any(test, feature = "test-utils"))] like id-core's other test seams: the directory tests that move need it, and the facade's remaining users take it from there too — one canonical home, no duplication.

Also: six items the facade's remaining modules use across the new boundary were widened pub(crate) → pub (Directory::apply, directory::hex_to_array, WorldHandle::replication_feed, WorldProtocol::abuse_handle, world::EmptyWorldProgram, world_session::MAX_ADMIN_TOKEN_BYTES — the last via a single-name re-export, not a group widening); tempfile is a real dependency of world_compile and is declared as one; asset include_* paths and CARGO_MANIFEST_DIR example paths in moved files gained the two directory levels the files descended (the intra-tree world/tests.rs → world_session/mod.rs source include is unchanged, as the tree layout is mirrored); id-worlds dev-deps declare the id-sync/test-utils seam its directory tests use, so the crate's tests compile standalone.

Left for step 5c: world_dev, world_doctor, world_ssh, world_replication_net (nothing in this PR's moved set names them; they name this set, so they follow).

Verification (laptop, fresh CARGO_TARGET_DIRs; counting run = full workspace cargo test --no-fail-fast with tests/probe_attestation_sign.rs set aside, as in 5a, plus the feature-gated dht_testnet):

  • Baseline on unmodified main (850f2fce31): 73 suites, 3,719 passed / 1 failed / 33 ignored; the 1 failure is the known frames::tests::byte_refusal_… (pkgs/id: frames byte_refusal test fails deterministically on main (RequestTooLarge vs BudgetExhausted) #8620).
  • After 5a: 75 suites, 3,719 / 1 / 33. After 5b: 75 suites, 3,719 passed / 1 failed (same test) / 33 ignored — exact redistribution: facade lib 1,918 → 1,166 passed / ignored 3 → 1; id-worlds lib 47 → 796 passed / 2 ignored; id-core lib 364 → 367 passed (the test_forgeries tests' new home); every other suite identical.
  • Fuel canary (the numbers are the invariant): (1) print_fuel_baseline output byte-identical before/after — 72 lines, sha256 59cfad49c7553c8309a8b40b23405321399bb76bb741acaeb90f78570f45c32c; (2) the FUEL_BUDGETS table literal extracted from the moved crates/id-worlds/src/sandbox.rs diffed against unmodified main's — byte-identical (the file's own sha256 changed to 4c3b8edb… from the include-path edits, which the step brief names as expected, not a canary failure); (3) the checked-in fuel tests pass (in the id-worlds suite, 796 passed / 0 failed).
  • Feature shapes: --no-default-features --features world (the id-lib derivation's shape) fails identically on main and this branch (2 errors, src/boards.rs:1998,2000). --no-default-features is a named delta: main fails it with 28 errors (the facade's ungated world_compile/world_hub referenced cfg-gated siblings); this branch passes it — the moved modules' cfg blocks are crate-local now. No shipped derivation uses that shape (id-lib = no-default + sandbox,world; id-web adds web,ssh), and the default build is unchanged.
  • Completeness grep: no world/session/sandbox/directory implementation remains in facade src/ (only re-export shims; src/world/, src/world_session/, src/shell_contract/ are gone).
  • Nix: nix build ./pkgs/id#id-lib — result posted as a PR comment (expected parity: build phase passes, check phase fails only on the pre-existing probe compile error).
  • Bench canary: not run, consistent with steps 1–4 (the applied protocol is tests + fuel + nix parity).

🤖 Agent note — crate-split step 5b, issue #4408.


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

@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 20:00
@coderabbitai

coderabbitai Bot commented Nov 11, 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 20 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: d4bcf78e-2289-4bcd-9352-1e28540659d0
Commits

Reviewing files that changed from the base of the PR and between eeee505 and 2469548.

Files ignored due to path filters: 1

  • pkgs/id/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 42

  • pkgs/id/Cargo.toml
  • pkgs/id/crates/id-core/Cargo.toml
  • pkgs/id/crates/id-core/src/lib.rs
  • pkgs/id/crates/id-core/src/test_forgeries.rs
  • pkgs/id/crates/id-worlds/Cargo.toml
  • pkgs/id/crates/id-worlds/src/directory.rs
  • pkgs/id/crates/id-worlds/src/directory_auth.rs
  • pkgs/id/crates/id-worlds/src/directory_mail.rs
  • pkgs/id/crates/id-worlds/src/directory_view.rs
  • pkgs/id/crates/id-worlds/src/lib.rs
  • pkgs/id/crates/id-worlds/src/sandbox.rs
  • pkgs/id/crates/id-worlds/src/session_host.rs
  • pkgs/id/crates/id-worlds/src/shell_contract.rs
  • pkgs/id/crates/id-worlds/src/shell_contract/tests.rs
  • pkgs/id/crates/id-worlds/src/world/actor.rs
  • pkgs/id/crates/id-worlds/src/world/clock.rs
  • pkgs/id/crates/id-worlds/src/world/core.rs
  • pkgs/id/crates/id-worlds/src/world/core/checkpoint_parts.rs
  • pkgs/id/crates/id-worlds/src/world/handle.rs
  • pkgs/id/crates/id-worlds/src/world/hotness.rs
  • pkgs/id/crates/id-worlds/src/world/metrics.rs
  • pkgs/id/crates/id-worlds/src/world/mod.rs
  • pkgs/id/crates/id-worlds/src/world/replica.rs
  • pkgs/id/crates/id-worlds/src/world/replication.rs
  • pkgs/id/crates/id-worlds/src/world/replication_receiver.rs
  • pkgs/id/crates/id-worlds/src/world/signed.rs
  • pkgs/id/crates/id-worlds/src/world/tests.rs
  • pkgs/id/crates/id-worlds/src/world/upgrade.rs
  • pkgs/id/crates/id-worlds/src/world/util.rs
  • pkgs/id/crates/id-worlds/src/world_compile.rs
  • pkgs/id/crates/id-worlds/src/world_fixture.rs
  • pkgs/id/crates/id-worlds/src/world_hub.rs
  • pkgs/id/crates/id-worlds/src/world_native.rs
  • pkgs/id/crates/id-worlds/src/world_net.rs
  • pkgs/id/crates/id-worlds/src/world_records.rs
  • pkgs/id/crates/id-worlds/src/world_session/contract_tests.rs
  • pkgs/id/crates/id-worlds/src/world_session/mod.rs
  • pkgs/id/crates/id-worlds/src/world_session/service.rs
  • pkgs/id/crates/id-worlds/src/world_session/tests.rs
  • pkgs/id/crates/id-worlds/src/world_session/types.rs
  • pkgs/id/crates/id-worlds/src/world_store.rs
  • pkgs/id/src/lib.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 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T20:03:04.320257Z 2469548 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.

@dezren39

Copy link
Copy Markdown
Member Author

Nix: nix build ./pkgs/id#id-lib on this branch — build phase passed; check phase failed only on the pre-existing tests/probe_attestation_sign.rs E0061 ×2 (lines 47, 72; from f998d27, present on unmodified main) — parity with main, as with step 5a (#8762). Full test/fuel/feature verification is in the PR body: 75 suites, 3,719 passed / 1 known frames failure / 33 ignored, exact redistribution; fuel canary byte-identical on all three checks. Merging with a merge commit per the step protocol.

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