feat(core): add a Rust session runtime over the Connection port - #176
Merged
Merged
Conversation
Adds Session, the Rust node/session runtime wire-mesh#173 identified as missing: wraps an already-established Connection, exchanges and negotiates the handshake, dispatches incoming manage-requests to handlers registered per capability verb via a new HandlerRegistry, resolves send_manage_request calls against their correlated manage-response (with an optional timeout resolving a protocol-level timeout outcome rather than hanging forever), sends data frames directly, and emits connection lifecycle events over an unbounded channel. Uses tokio tasks and channels rather than TypeScript's async-iterable mesh-session.ts shape, per the issue's own design decision: a session runtime is a concurrency-model-specific construct, unlike the byte-level codec or synchronous verification-logic parity every other Rust/TypeScript pairing in this codebase has. Gated behind the existing "net" feature, alongside tcp_transport.rs, since it needs a real tokio task-spawning runtime that wasm32-unknown-unknown consumers (wire-mesh-threshold-wasm) cannot support.
… session runtime Adds an integration test that drives wire-mesh#171's NetworkThresholdCoordinator and handle_threshold_* participant handlers over two real TCP connections wrapped as wire-mesh-core's new Session, rather than the fake in-memory sender/participant test doubles src/network.rs's own unit test uses: a coordinator dials each participant, each participant registers a ManageRequestHandler for the threshold verb, and a full commit/sign round trip produces a signature that verifies against the DKG group's public key. Adds wire-mesh-core as a dev-dependency with default (net-on) features specifically for this test binary, alongside the existing net-off [dependencies] entry the wasm32-unknown-unknown build still relies on -- Cargo unifies dev-dependency features only for this crate's own test builds, never for a consumer (wire-mesh-threshold-wasm) that depends on this crate as an ordinary dependency and never builds its tests.
Codex Review SummaryThis 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 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.
Summary
Adds a Rust node/session runtime (
wire_mesh_core::domain::session::Session), the piece wire-mesh#173 identified as missing: a live dispatch loop over an already-establishedConnectionthat exchanges/negotiates the handshake, dispatches incoming manage-requests to handlers registered per capability verb, resolvessend_manage_requestcalls against their correlated response (with an optional timeout), sends data frames directly, and emits connection lifecycle events.Built on tokio tasks and channels rather than a port of the TypeScript side's
mesh-session.tsasync-iterable shape, matching the design decision already recorded on the issue: a session/dispatch runtime is a concurrency-model-specific construct, not something that needs API-shape parity across languages the way the byte-level codecs and synchronous verification logic do.Still to come on this branch: wiring wire-mesh#171's
NetworkThresholdCoordinator/handle_threshold_*onto this runtime for a real end-to-end threshold-signing test over actual TCP connections.Closes #173
Test plan
cargo test -p wire-mesh-core(134 tests, including 6 new session-runtime tests over real TCP loopback connections)cargo clippy -p wire-mesh-core --all-targets -- -D warningscargo fmt --check -p wire-mesh-corejust build && just test && just lint && just typecheck && just conformanceall green