Skip to content

refactor(node): W1b-0 — seams/ scaffold, relocate decoupled helper modules (#1285) - #65

Merged
MichaelTaylor3d merged 3 commits into
mainfrom
feat/w1b-seam-content
Jul 20, 2026
Merged

refactor(node): W1b-0 — seams/ scaffold, relocate decoupled helper modules (#1285)#65
MichaelTaylor3d merged 3 commits into
mainfrom
feat/w1b-seam-content

Conversation

@MichaelTaylor3d

Copy link
Copy Markdown
Contributor

What

W1b-0: first sub-PR of the W1b seam carve (#1285). Creates the seams/ module tree and
relocates the helper modules that have zero impl Node coupling (pure file moves,
no logic change) to validate the seams/ pattern before tackling the tangled god-struct
methods in later sub-PRs.

Sub-PR sequence (W1b, this is #1 of 7)

  • W1b-0 (this PR): seams/ scaffold + relocate decoupled helpers — near-zero risk.
  • W1b-1: carve seam content (content_serve.rs impl Node methods → ContentServer trait/handle).
  • W1b-2: carve seam dig_peer (peer.rs impl Node methods → PeerNetwork trait/handle).
  • W1b-3: carve seam chia_peer (chainwatch.rs + AnchoredRootResolverChainSource trait/handle).
  • W1b-4: carve seam capsule (cache_*/gap_fill/backfill methods → CapsuleStore trait/handle).
  • W1b-5: carve seam dig_rpc (RPC dispatch methods in lib.rs → RpcDispatch trait/handle).
  • W1b-6: carve seam key_mgmt (identity_seed lifecycle → KeyManager trait/handle); wallet seam
    stays a placeholder per the locked plan (embedded dig-wallet is W5, out of scope here).

Behaviour-preserving throughout — no logic/algorithm change, no seam-crate adoption, no new deps.

Closes nothing yet (tracking #1285).

MichaelTaylor3dand others added 3 commits July 20, 2026 09:59
Co-Authored-By: Claude <noreply@anthropic.com>
…dules (#1285, #1298)
Pure relocation, zero behaviour change: bandwidth.rs and verification_ledger.rs
(seam 5, content) and net.rs/pex.rs/dht.rs/address_book.rs/session.rs (seam 2,
dig_peer) move into crates/dig-node-core/src/seams/{content,dig_peer}/ — the
first two of the 7 architecturally-separated seams (#1285/#1303). These files
have zero `impl Node` coupling (confirmed by grep before the move), so this is
a mechanical file relocation + a `pub use` re-export of each module at its
original crate-root path — every existing `crate::net`/`crate::pex`/… caller
keeps working unchanged.
The seam carve of the god-struct's `impl Node` methods (content_serve.rs,
peer.rs, chainwatch.rs, download.rs — the actual seam trait/handle extraction)
lands in W1b-1 through W1b-6, sequenced on issue #1285.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@MichaelTaylor3d
MichaelTaylor3d marked this pull request as ready for review July 20, 2026 17:53

@MichaelTaylor3dMichaelTaylor3d left a comment

Copy link
Copy Markdown
ContributorAuthor

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).

Verified this is a pure, behaviour-preserving relocation of zero-coupling modules with stable re-exports:

  • All 7 moves are byte-identical. git reports similarity index 100% renames for bandwidth.rs + verification_ledger.rs → seams/content/ and net.rs + pex.rs + dht.rs + address_book.rs + session.rs → seams/dig_peer/. No function bodies, tests, or logic changed.
  • Zero impl Node coupling confirmed in all 7 relocated files (grep count 0 each) — they define standalone types/fns, correctly the first to carve cleanly.
  • Re-exports keep every original path importable. lib.rs drops the old pub mod lines and adds pub use seams::content::{bandwidth, verification_ledger}; + pub use seams::dig_peer::{address_book, dht, net, pex, session};, so crate::net/crate::pex/… (and external dig_node_core::net) resolve unchanged. No caller edits.
  • New scaffold only: seams/mod.rs + seams/content/mod.rs + seams/dig_peer/mod.rs, doc-comment modules declaring the moved submodules. No duplicate defs, no dangling refs.
  • Versions bumped + consistent: workspace 0.47.1→0.47.2 and dig-node-core 0.13.1→0.13.2 (both patch, correct for a no-behaviour-change refactor).
  • 0 unresolved review threads.

Non-gating note (resolved by me): the crate-root /// doc comments previously on pub mod session / pub mod verification_ledger were dropped from lib.rs; their content is preserved in the moved files' own //! docs and summarized in the new seam mod.rs files. No action needed.

Merge-ready.

@MichaelTaylor3d
MichaelTaylor3d merged commit 0d58c7f into mainJul 20, 2026
13 checks passed
@MichaelTaylor3d
MichaelTaylor3d deleted the feat/w1b-seam-content branch July 20, 2026 19:16
Sign up for freeto 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

@MichaelTaylor3d