Repository navigation
pkgs/id crate split step 3c: envelope + envelope_net + envelope_outbox + artifact to id-sync (#4406) - #8747
Merged
Conversation
…x + artifact to id-sync (#4406)
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. |
|
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 32 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. |
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 3c of the pkgs/id crate split (#4406) — the final step-3 PR: the friend-envelope and artifact transfer family moves into
id-sync, completing the crate. With this, step 3's scope (log_sync + the wire layer + artifact) has landed: 3a (#8703, frames/abuse vocabulary to id-core), 3b (#8730, id-sync created with log_sync/protocol/fileops/dht/meta_client wire half), and this PR.What moved into
id-syncenvelope(new module) —Envelope,EnvelopeKind,SignedBodyand the signing/verification impl, extracted from the facade'sdirectory.rs. The directory's acceptance policy (TTL, skew, pending-request cap) andReceivedstay with the directory; the facade re-exports the types atid::directory::{Envelope, EnvelopeKind}.envelope_net— the/id-envelope/1+ artifact push transport (deliver,send,answer_frames,EnvelopeProtocol).envelope_outbox— the durable outbox (Outbox,flush,check_target).artifact—ArtifactLog,SignedArtifact, the push/pull protocols and page transfer.hex(private module) — the wire layer's copies ofhex_encode/hex_to_array/normalize_key(the directory keeps its own).Historical paths preserved throughout (
id::envelope_net,id::envelope_outbox,id::artifact,id::directory::Envelope, …); no caller changed.Seam 9, as designed: the availability trait
id_sync::host::SessionHostis the small trait the design called for — only what the transfer code actually calls:receive_envelope(Envelope) -> Result<Availability<Option<EnvelopeReceived>>>receive_artifact(SignedArtifact) -> Result<Availability<Option<Stored>>>read_artifacts(account, after) -> Result<Availability<Vec<SignedArtifact>>>Availability::Busyis the hub-lease failure, mapped to exactly the wire answers the inline code produced (Reply::Retry("the server is busy; try again")/ the pull page's bail). Errors keepid_core::Refusalin their chain, so the refused-vs-retry mapping is byte-for-byte the old behaviour.EnvelopeProtocol,ArtifactPushProtocolandArtifactPullProtocolare generic overH: SessionHost; the facade implements the trait forWorldHubin a newsession_host.rs(lease +DirectoryAction, outcome fields mapped 1:1), andcommands/serve.rsconstructs the protocols with the hub exactly as before.The direct-
Directoryuses inverted behindid_sync::artifact::ArtifactSink(receive_artifact,artifact_head_seq):apply_page,pullandpull_withinare generic over it, and the facade implements it forDirectorywith two forwarders.Notes
Envelope::signedandEnvelope::body/SignedBodyare pub (the directory composes and re-signs envelopes); artifact'ssigned_bytes,Kind::encode,is_friend_request_id,check_home_declared,SignedArtifact::parsed_for_replayare pub (directory receipt/replay calls them);SignedArtifact::sign_uncheckedfollows the established#[cfg(any(test, feature = "test-utils"))] pubpattern, enabled for the facade through a dev-dependency;ArtifactPullProtocol's tuning fields (hub,frame_deadline,close_wait) are pub so the facade's deadline test can still build one by literal.ArtifactSinkin id-sync; the chat-frame transport test adds its blob withiroh_blobsdirectly instead of the CLI'sadd_raw); tests that need a realDirectory, world hub ortest_forgeriesstayed in the facade thin files. Per-module test counts are conserved exactly (artifact 40, envelope_net 7, envelope_outbox 21, directory 70, before and after).Verification
cargo test --no-fail-fast): 3,693 passed / 1 failed / 33 ignored; sole failureframes::tests::byte_refusal_…(pkgs/id: frames byte_refusal test fails deterministically on main (RequestTooLarge vs BudgetExhausted) #8620, pre-existing). This branch: 3,709 passed / 1 failed / 33 ignored — the same sole failure; the +16 are tests added by unrelated main commits in the meantime (name-level diff checked; every moved-module test present and passing).sha256sum pkgs/id/src/sandbox.rsunchanged (db88ec8d52e961702353c97a407b77badadef1bd7e0a610a6075267e175d80b5);print_fuel_baselinebyte-identical (72 lines).nix build ./pkgs/id#id-lib, no overrides): same outcome as steps 3a/3b — the check phase passes the lib suites and fails only atcli_tests::world_new_scaffold_compiles_with_pinned_rocintests/cli_integration.rs("Roc cache writes are failing / AccessDenied" inside the Nix sandbox), the latent sandbox-environment failure unmasked in 3a; the test passes outside the sandbox and its inputs are untouched by this PR.CARGO_TARGET_DIRs were used for the local runs, as in 3a/3b.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.