Repository navigation
pkgs/id crate split step 4: extract id-groups (#4407) - #8754
Merged
Merged
Conversation
…_gate, encryption) (#4407) Step 4 of the pkgs/id crate split (#3447 umbrella, design doc/2026-11-01T16-53-00Z_design_id_crate_split): the policy/enforcement remainder of the group layer moves into the new id-groups workspace crate, over id-events' group projection (step 2b ruling on #4405: the group model, fold, policy and friendship live in id-events and do not move again; membership and access already live in id-core; pull_policy in id-events). Moved (implementation exists only in id-groups now): - groups remainder: actions.rs, log.rs (GroupLog), warnings.rs. id_groups::groups re-exports the id_events::groups model at the same paths, so the moved files' super::/crate::groups references resolve unchanged. The dead pub(crate) wire re-export in log.rs (no consumer at HEAD) is dropped. - encryption/ whole module (scheme, history, notice, ordering, roster, welcome, tests). Seam 5 turned out already cut by step 3a: MAX_FRAME_BYTES lives in id_core::frames (world_session only re-exports it), so welcome.rs and tests.rs name id_core::frames::MAX_FRAME_BYTES — same constant, same value (1024 * 1024), no behaviour change. scheme.rs/tests.rs name id_core::rejection::Reason; history.rs names id_store::policy::History, its defining home since step 2a. - blob_gate gate logic: BlobPolicy, Request, decide, decide_with_blocks, blob_events/blob_events_with_blocks and the WorldAccess re-export. Split, mirroring step 2a's store_traits pattern: FoldedWorlds (the WorldAccess implementation over groups::worlds::Worlds) stays in the facade with worlds.rs — worlds is step 5, above id-groups — together with its four folded tests, so step 5 moves FoldedWorlds and worlds.rs together. The gate's table/proptest tests move; the blocked-member test uses a small local BlockList stub (the facade's pull_policy::testing stub folds through worlds and cannot live below it). Facade: id::groups::* (shim keeps worlds.rs local plus re-exports from id_groups and id_events), id::encryption and id::blob_gate paths all keep compiling unchanged. The facade's now-unused p2panda-encryption dependency moves to id-groups with the same features. id-groups deps per the design map: id-core, id-store, id-events. Verification (laptop, fresh CARGO_TARGET_DIRs; the cargo-target broker is broken fleet-wide): - Baseline on unmodified main (0535417) first: full cargo test --no-fail-fast stops at a pre-existing compile failure in tests/probe_attestation_sign.rs (E0061 x2, sign_claim gained a &GenesisAgreement parameter in f998d27 today without updating the salvaged probe). Counting run (all targets except that probe and the feature-gated dht_testnet): 3,670 passed, 1 failed (frames::tests::byte_refusal_..., the known #8620 failure, frames now in id-core), 8 ignored, 62 suites; doc tests 19 passed. - After: identical counts — 3,670 passed, 1 failed (same test), 8 ignored; suites 63 (facade lib 2,090 -> 1,975 passed, new id-groups suite 115 passed, ignored 4 -> 3 + 1: exact redistribution, no test lost). Doc tests 19 passed, 0 failed. Full unfiltered run fails with the identical probe error only. - Fuel canary: sha256 src/sandbox.rs db88ec8d...80b5, unchanged; print_fuel_baseline output byte-identical (72 lines, sha256 59cfad49...32c both runs). - Feature-shape parity: --no-default-features and --no-default-features --features world checks fail on main and here with identical error location sets (facade world modules name gated siblings; unsupported shapes before this step too), minus the one diagnostic on the removed dead log.rs re-export. - Nix: nix build ./pkgs/id#id-lib — build phase passes; check phase fails on the same pre-existing probe_attestation_sign compile error as main (parity; the known cli_tests Roc-sandbox failure behind it is unreachable until that probe is fixed upstream).
|
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 26 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. |
Codex Review Summary: ✅ CompletedThis 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. |
This was referenced Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 4 of the pkgs/id crate split (#3447 umbrella; design
doc/2026-11-01T16-53-00Z_design_id_crate_split). One PR, branchcrate-split-step4-id-groups, worktree on the laptop.What moved (implementation exists only in
id-groupsnow)New workspace crate
pkgs/id/crates/id-groups(deps per the design map: id-core, id-store, id-events), containing the policy/enforcement remainder over id-events' group projection — the step-2b ruling on #4405 stands: the group model/fold/policy/friendship live inid-eventsand do not move again; membership/access already live in id-core;pull_policyin id-events.actions.rs,log.rs(GroupLog),warnings.rs.id_groups::groupsre-exports theid_events::groupsmodel at the same paths, so the moved files'super::/crate::groupsreferences resolve unchanged. The deadpub(crate) use id_events::groups::wire;re-export inlog.rs(no consumer at HEAD) is dropped.groups/worlds.rsdoes not move (seam 6 → id-worlds, step 5): the facadesrc/groups/now holds only the shimmod.rs+worlds.rs, and the shim re-exportsactions/log/warningsfrom id-groups — step 5's extraction ofworlds.rsis a straight lift from there.BlobPolicy,Request,decide,decide_with_blocks,blob_events/blob_events_with_blocks, and theWorldAccessre-export (trait itself stays in id-events, step 2b).Facade paths
id::groups::*,id::encryption,id::blob_gatekeep compiling unchanged. The facade's now-unusedp2panda-encryptiondependency moves to id-groups with identical features.Seam 5 resolution (encryption → world_session)
Already cut by step 3a:
MAX_FRAME_BYTESis defined inid_core::frames(pub const MAX_FRAME_BYTES: usize = 1024 * 1024); the facade'sworld_sessiononly re-exports it. The actual leak in the moved code wasencryption/welcome.rs(and one test line) naming it throughcrate::world_session; both now nameid_core::frames::MAX_FRAME_BYTES— same constant, same value, no relocation needed and no behaviour change. Also:scheme.rs/tests nameid_core::rejection::Reason;history.rsnamesid_store::policy::History(its defining home since step 2a).blob_gate treatment (split, mirroring step 2a's store_traits pattern)
FoldedWorlds— theWorldAccessimpl overgroups::worlds::Worlds— genuinely needs the world-fold type, which is step 5 (above id-groups). So the gate moved and the world-folding adapter stayed in the facadesrc/blob_gate.rs(189 lines: re-exports +FoldedWorlds+ its four folded tests), positioned to move together withworlds.rsin step 5. The gate's table/proptest tests moved with it; the blocked-member test uses a small localBlockListstub in id-groups (the facade'spull_policy::testingstub folds through worlds and cannot live below it).Verification (laptop; fresh
CARGO_TARGET_DIRs — the cargo-target-broker is broken fleet-wide, noted in step 3)Baseline taken on unmodified main
05354175d2before any edit:cargo test --no-fail-faststops at a pre-existing compile failure unrelated to this step:tests/probe_attestation_sign.rsE0061 ×2 —sign_claimgained a&GenesisAgreementparameter in f998d27 (landed today) without updating the salvaged probe. Counting run (every target except that probe and the feature-gateddht_testnet): 3,670 passed, 1 failed, 8 ignored, 62 suites; the one failure is the knownframes::tests::byte_refusal_does_not_spend_a_frame_token_or_increment_counters(pkgs/id: frames byte_refusal test fails deterministically on main (RequestTooLarge vs BudgetExhausted) #8620; frames now lives in id-core). Doc tests: 19 passed.After this change:
id-groupssuite 115 passed / 1 ignored; every other suite byte-identical counts. Doc tests 19 passed / 0 failed. Full unfiltered run fails with the identical probe error only.sha256sum src/sandbox.rs=db88ec8d52e961702353c97a407b77badadef1bd7e0a610a6075267e175d80b5before and after;print_fuel_baselineoutput byte-identical (72 lines, sha25659cfad49c7553c8309a8b40b23405321399bb76bb741acaeb90f78570f45c32cboth runs).cargo check -p id --no-default-featuresand--no-default-features --features worldfail on main and on this branch with identical error-location sets (the facade's world modules name gated siblings; these shapes were unsupported before this step), minus one diagnostic on the removed deadlog.rsre-export line.nix build ./pkgs/id#id-lib(no NIX_CONFIG override) — build phase passes; check phase fails on the same pre-existingprobe_attestation_signcompile error as main (parity; the knowncli_tests::world_new_scaffold_compiles_with_pinned_rocRoc-sandbox failure sits behind that compile error and is unreachable until the probe is fixed upstream).src/groups/holds only the shim +worlds.rs;src/encryption.rsis a 14-line re-export;src/blob_gate.rsholds only re-exports + theFoldedWorldsadapter + its tests. All implementations exist only undercrates/id-groups/.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.