Skip to content

feat(core): add a Rust session runtime over the Connection port - #176

Merged
Mearman merged 2 commits into
mainfrom
feat/rust-session-runtime
Sep 17, 2026
Merged

Mearman merged 2 commits into
mainfrom
feat/rust-session-runtime

Conversation

@Mearman

@Mearman Mearman commented Sep 17, 2026

Copy link
Copy Markdown
Member

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-established Connection that exchanges/negotiates the handshake, dispatches incoming manage-requests to handlers registered per capability verb, resolves send_manage_request calls 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.ts async-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 warnings
  • cargo fmt --check -p wire-mesh-core
  • Real end-to-end threshold-signing round trip over the new runtime (wire-mesh-threshold integration test)
  • just build && just test && just lint && just typecheck && just conformance all green

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.
@Mearman
Mearman marked this pull request as ready for review September 17, 2026 21:21
@Mearman
Mearman merged commit 94334fc into main Sep 17, 2026
7 checks passed
@Mearman
Mearman deleted the feat/rust-session-runtime branch September 17, 2026 21:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-17T21:27:41.340513Z 47eb11b Draft marked ready
ℹ️ 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.

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.

No Rust node/session runtime exists (no MeshSession equivalent)

1 participant