Skip to content

refactor(node): W1b-5 — seam dig_rpc, RpcDispatch trait/handle carve (#1285)#70

Merged
MichaelTaylor3d merged 2 commits into
mainfrom
feat/w1b5-seam-dig-rpc
Jul 20, 2026
Merged

refactor(node): W1b-5 — seam dig_rpc, RpcDispatch trait/handle carve (#1285)#70
MichaelTaylor3d merged 2 commits into
mainfrom
feat/w1b5-seam-dig-rpc

Conversation

@MichaelTaylor3d

Copy link
Copy Markdown
Contributor

What

W1b-5 (6th of the 7 W1b sub-PRs, #1285): carve the RPC dispatch `impl Node` methods into
an `RpcDispatch` trait + handle under `seams/dig_rpc/`. STRUCTURAL carve only — the
`dig-rpc-protocol` crate ADOPTION is W3, not this pass; the existing hand-rolled dispatch
logic is relocated byte-identical behind the trait.

Depends on W1b-4 (merged, origin/main @ 8319345).

Closes nothing yet (tracking #1285).

MichaelTaylor3d and others added 2 commits July 20, 2026 15:21
Co-Authored-By: Claude <noreply@anthropic.com>
…(#1285, #1298)

Carves the core JSON-RPC dispatch (the 665-line handle_rpc match over
dig-rpc-protocol's Method enum) into the RpcDispatch trait (seam 4's public
surface), implemented by Node with the EXISTING dispatch body relocated
byte-identical into seams/dig_rpc/dispatch.rs. STRUCTURAL carve only — the
dig-rpc-protocol crate ADOPTION (replacing the hand-rolled match) is W3,
out of scope here.

The crate-root handle_rpc/handle_rpc_json free functions — the STABLE entry
point every external caller uses (dig-node-service's server.rs/control.rs/
rpc.rs/meta.rs, dig-runtime's FFI bridge, peer.rs's peer-RPC server, the
openrpc_drift_guard conformance suite) — now thinly delegate to
RpcDispatch::dispatch. Their signatures are UNCHANGED, so this is the
lowest-blast-radius carve of the sequence: NO external caller needed any
change at all.

async_trait-boxed (matching the other seam traits) so it stays dyn-compatible
for the future Arc<dyn RpcDispatch> handle (W1c).

Depends on W1b-4 (merged, #1285).

Co-Authored-By: Claude <noreply@anthropic.com>
@MichaelTaylor3d
MichaelTaylor3d marked this pull request as ready for review July 20, 2026 22:47

@MichaelTaylor3d MichaelTaylor3d left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PASS — single correctness gate (fresh context), W1b-5 seam dig_rpc RpcDispatch carve.

Verified (read-only, no rebuild):

  • Behaviour-preserving / byte-identical body. The 664-line dispatch body in seams/dig_rpc/dispatch.rs (RpcDispatch::dispatch) is whitespace-insensitive IDENTICAL to the pre-carve handle_rpc body (base lib.rs:2064-2727). diff -w = clean; the only real change is the added let node = self; alias (dispatch.rs:41). The exact-diff noise is pure indentation shift (free-fn -> impl-method scope, the #1302 whitespace). No match arm added/removed/reordered/altered.
  • Signature-preserving delegation. handle_rpc now delegates RpcDispatch::dispatch(node, req).await with an UNCHANGED signature (lib.rs:2072-2074); handle_rpc_json unchanged. The PR touches exactly 7 files — dig-node-service, dig-runtime FFI, peer.rs and openrpc_drift_guard are NOT in the change set (zero external caller edits, as claimed).
  • Objective invariant GREEN. crates/dig-node-service/tests/openrpc_drift_guard.rs ran under Test + coverage = pass — the JSON-RPC surface did not drift. Clippy/Rustfmt/CodeQL/version-increment/commitlint all green.
  • Version bumps agree: core 0.13.6->0.13.7, binary 0.47.6->0.47.7.
  • 0 unresolved review threads.
  • No dig-constants concern (structural carve, no new/shared constants). Cross-seam reaches via use crate::* are expected until W1c, not a violation.

Note: platform packaging builds (.deb/.msi/.pkg) still pending at review time — not correctness gates; merge when green.

@MichaelTaylor3d
MichaelTaylor3d merged commit 4624d5d into main Jul 20, 2026
12 checks passed
@MichaelTaylor3d
MichaelTaylor3d deleted the feat/w1b5-seam-dig-rpc branch July 20, 2026 22:53
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.

1 participant