Skip to content

pkgs/id crate split — step 5: extract id-worlds #4408

Closed

Description

@dezren39

Crate split step 5 of 7 — from the merged design

Design: doc/2026-11-01T16-53-00Z_design_id_crate_split/2026-11-01T16-53-00Z_design_id_crate_split.md (merged as PR #3824, 2026-11-01). Tracking issue: #3447. Program: #3195 (build-time review; Drew's priority order — shipped-binary runtime performance first, build time second).

Scope (design, verbatim intent)

Design step 5: id-worlds. The big one, done when the verify loop is fast and every crate below is stable. shell_contract lands here; directory's world references (seam 10) are resolved as the boundary is drawn.

Current state

Not started. Supersedes blocked queue task 5855 ('extract id-world', pre-design phase plan, blocked packet_defect 2026-11-01): that packet's narrower world-cluster cut is an earlier draft of this step.

Dependency — do not start early

Step 4 (id-groups) merged. If this step's queue task is claimed before the dependency lands, park it with that reason.

Fuel canary (non-negotiable, every step): the FUEL_BUDGETS tables in pkgs/id/src/sandbox.rs must be byte-identical after this step; the fuel-tables diff is committed in the step PR. Any drift means behaviour changed and the step stops. Full verification protocol: design note §"Verification protocol".

Verification protocol (design, every step): one PR; main green throughout; the shipped binary is built by the same Nix derivations at every point (all three entry points: the sub-flake's id-web and id-lib, and default.nix); test count matches or exceeds the step-0 baseline with any delta named; cold check-build timing recorded on #3447 and #3195 with the laptop load noted. Heavy builds run under ~/tools/fleet-build-lock on the laptop (max 2 concurrent, CARGO_BUILD_JOBS = half the cores) — there is no load gate (Drew, 2026-11-02).

Activity

  1. added
    kind/performancePerformance problem or optimization
    priority/highImportant and time-sensitive
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 2, 2026
  2. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: parked
    task: 6302
    worker: repo-worker-code (lane A)
    note: Dependency gate checked fresh: Step 4 (#4407, extract id-groups) is still OPEN and has not landed — pkgs/id/crates/ on current main contains only id-core (Step 1), so Steps 2-4 are all still ahead of this one. This packet directs: if claimed before the dependency lands, park with that reason; do not start early. Parked 30m. The #3447 sequence is currently queued out of order (Steps 5/6/7 were claimed first this shift and are parked behind their gates: tasks 6302, 6295, 6303) — the chain unblocks from the earliest unlanded step. Resume: #4407 closed / step-4 PR merged -> start Step 5 (extract id-worlds) with the FUEL_BUDGETS canary; builds under ~/tools/fleet-build-lock per the packet build policy.

  3. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 2, 2026
  4. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  5. 325 remaining items

  6. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  7. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor

    🤖 Agent note · parked

  8. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor

    agent-note:v1 agent=repo-worker-code state=parked task=6302 lane=code-f at=2026-11-08T05:13:00Z

    🤖 Agent note · parked (dependency gate) — MID-SHIFT FALLBACK

  9. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    Picked up by repo-worker-code-f — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-f posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  10. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    Progress from repo-worker-code-f: parked (dependency gate): step 5 waits on step 4 issue #4407 landing (id-groups on main); steps 2 #4405 / 3 #4406 also open; resume when #4407 merges — fallback park, claim left to go stale per runbook 0a park rule

  11. added 3 commits that reference this issue on Nov 11, 2026
  12. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    Step 5 landed — closing.

    PRs (each merged with a merge commit before the next started):

    What is in id-worlds (deps per the design map: id-core, id-caps, id-store, id-events, id-groups, id-sync): the whole world family from the step brief — world/ (mod, core, actor, replica, replication + receiver, handle, clock, hotness, metrics, signed, upgrade, util, tests), world_session/, world_ssh, sandbox, world_net, world_store, world_compile, world_fixture, world_hub, world_native, world_cache, world_dev, world_doctor, world_line, world_records, world_replication_net, world_terminal, shell_contract — ≈34k lines of family code plus the directory cluster and session_host. The facade re-exports every historical id:: path; feature mapping is preserved (world pulls id-worlds; sandbox = wasmtime inside id-worlds via id-worlds/sandbox; ssh = russh inside via id-worlds/ssh; the Nix buildFeatures lists did not change shape).

    Seam resolutions:

    • Seam 6 (rider a): src/groups/worlds.rs moved into id-worlds as id_worlds::groups::worlds (5a) — the consumer side, over a groups module re-exporting the id-events model, mirroring id_groups::groups. The facade groups shim re-exports it.
    • FoldedWorlds (rider b — decided: id-worlds): step 4's parked facade adapter landed in id_worlds::blob_gate (5a) with its 4 folded tests. It folds groups::worlds::Worlds (now in id-worlds), so id-groups — which is below id-worlds — cannot hold it; the facade blob_gate.rs is now a pure re-export shim over id_groups + id_worlds. No facade adapter remains for blob_gate.
    • Seam 10 (directory↔worlds) — the step's one big call: the world family's only upward references on current main were the directory cluster (scan: no local, server_config, cli/commands/repl or web references anywhere in the family). The coupling is structural, not incidental: WorldCore holds the Directory (world/core.rs:208), the actor executes directory_view::run, the session service API names Caller/DirectoryAction/DirectoryOutcome, world_store persists the directory beside the journal, and world_session/types.rs holds Arc<dyn MailSink>. The sanctioned alternatives did not fit: a trait inversion would re-type WorldCore's public directory()/directory_mut() accessors (used by facade server_config and web) — a public-API redesign, which the step's stop rule reserves — and leaving "one file" in the facade would have meant leaving the runtime core itself. So the cluster (directory, directory_auth, directory_view, directory_mail, ~9,600 lines) moved into id-worlds as the consumer side (the seam-6 pattern), in 5b. No API or behaviour changed; the facade re-exports id::directory* unchanged. What remains for step 6 (pkgs/id crate split — step 6: extract id-directory, then id-web #4409), unchanged in kind: id-directory must still invert or re-home WorldCore's hold on the directory to leave id-worlds — the same work it faced from the facade. directory_log did not move (nothing in the family names it; it is step 6's), and directory's own former upward refs (world::{WorldScopes, hex_encode}) are intra-crate now and become step 6's to cut downward then. No new directory→world couplings were added.
    • session_host: moved into id-worlds (5b) — necessarily: it implements id_sync::host::SessionHost for WorldHub and id_sync::artifact::ArtifactSink for Directory, and once those types live in id-worlds the orphan rule forbids the impls remaining in the facade. This removes the step-3 facade adapter rather than leaving one.
    • test_forgeries (94-line signature-fixture leaf): moved to id-core under #[cfg(any(test, feature = "test-utils"))] — one canonical home for the directory tests that moved and the facade tests that stayed; no duplication.
    • Small widenings where the facade's remaining code uses moved items across the boundary (pub(crate) → pub): world_terminal::{probe_local_tty, ProbeOutcome}, Directory::apply, directory::hex_to_array, WorldHandle::replication_feed, WorldProtocol::abuse_handle, world::EmptyWorldProgram, world_session::MAX_ADMIN_TOKEN_BYTES. Asset include_* / CARGO_MANIFEST_DIR paths in moved files gained the two directory levels descended. The facade keeps russh as a dev-only dependency (its cli_integration tests are an SSH client) and lost wasmtime/russh/vt100 from its library graph.

    Verification (laptop, fresh CARGO_TARGET_DIRs throughout — the cargo-target-broker is broken fleet-wide; counting runs = full workspace cargo test --no-fail-fast with tests/probe_attestation_sign.rs set aside exactly as step 4 enumerated around the pre-existing f998d27 breakage, 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).
    • 5a: 75 suites, 3,719 / 1 / 33 (facade 1,965→1,918; id-worlds 47). 5b: 75 suites, 3,719 / 1 / 33 (facade →1,166; id-worlds →796; id-core 364→367 with test_forgeries). 5c: 75 suites, 3,735 / 1 / 33 — every delta vs 5b is main-side test growth in the window (id-core +9 from fix(id): fuzz numeric invariants compare through f64 — integers above 2^53 lose precision and violated invariants can pass (PR #8635 review finding) #8752, id-events +2, store_traits +1, world_dev +4 on main) plus the move redistribution (facade −43, id-worlds +47); the failure is the same single frames test in every run.
    • Fuel canary, all three checks, every PR: (1) print_fuel_baseline output byte-identical — 72 lines, sha256 59cfad49c7553c8309a8b40b23405321399bb76bb741acaeb90f78570f45c32c before and after each PR; (2) the FUEL_BUDGETS table literal extracted from sandbox.rs wherever it lives, diffed against unmodified main's — byte-identical each PR (the file's own sha256 changed in 5b to 4c3b8edb… from include-path edits, expected and not a canary failure); (3) the checked-in fuel tests pass (in the facade suite for 5a, the id-worlds suite for 5b/5c).
    • Nix: nix build ./pkgs/id#id-lib on each PR branch — build phase passed; check phase failed only on the pre-existing probe_attestation_sign E0061 ×2 that unmodified main has — parity each time, stated on each PR.
    • Feature shapes: the id-lib shape (--no-default-features --features world) fails identically on main and every branch (2 errors, src/boards.rs:1998,2000). Named delta from 5b on: plain --no-default-features, which main fails with 28 errors (the facade's ungated world_compile/world_hub referenced cfg-gated siblings), now passes — the moved modules' cfg blocks are crate-local; 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 per PR; after 5c: ls pkgs/id/src | grep world is empty, src/world/, src/world_session/, src/shell_contract/, src/groups/worlds.rs are gone, and no world/sandbox/directory implementation remains in facade src/ — only re-export shims.
    • Bench canary: not run, consistent with steps 1–4 (the applied protocol is tests + fuel + nix parity).

    No behaviour changes, no fuel number moved, no test deleted or weakened in any of the three PRs.

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

  13. added
    epic/id-programReprioritization program epic (2026-11-12)
    epic/id-crate-splitEpic: id-crate-split - all issues of this effort carry it
    design/id-crate-splitDesign: id-crate-split - all issues of this effort carry it
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)design/id-crate-splitDesign: id-crate-split - all issues of this effort carry iteffort/lLarge: multi-day or open-ended; expect staged check-insepic/id-crate-splitEpic: id-crate-split - all issues of this effort carry itepic/id-programReprioritization program epic (2026-11-12)expediteImportant - do this very soon, before anything not expeditedkind/performancePerformance problem or optimizationpriority/highImportant and time-sensitivequeue/claimedQueue worker lifecycle statequeue/parkedQueue task is parked (waiting on CI, time, or an event)source/creatorFiled by the new-issue-creator jobstatus/parkedDeliberately paused with a recorded resume conditiontask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions