core: extract Wiremap from Engine#63
Merged
Merged
Conversation
Every wire-key <-> local-path translation lived as 12 private Engine methods woven through three Engine fields (adapters, excludes, resolver), and with them the freeze verdicts that keep a skipped key from reading as a mesh-wide deletion: excluded keys (#14), the dropped-agent guard, and the failed-mapping tombstone withhold (#49). None of it was directly testable - the only coverage ran through two-node integration tests. wiremap.rs now owns the adapters, the per-agent excludes, and the path-map Resolver behind one interface: key_of/dest_of/localize/ canonical_plaintext for translation, excluded/frozen/tombstone_withheld for the freeze verdicts, plus identify/session_files/roots pass-throughs so Engine never touches adapters directly. key_of records mapping failures itself (KeyFailure carries the log-once announce flag), so the whole #49 invariant sits in one module. The freeze invariants gain direct unit tests (no iroh, no network): key/dest round-trip, per-agent exclude scoping, dropped-agent freeze, failure-freezes-tombstones with log-once, merge-policy lookup, and root-containment. Engine sheds ~200 lines; behavior is unchanged and the two-node suite passes as before.
fosskar
enabled auto-merge
July 21, 2026 15:37
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.
Second refactor from the architecture review, stacked on #62 (base retargets to main once that merges).
Every wire-key ↔ local-path translation lived as 12 private Engine methods woven through three Engine fields (
adapters,excludes,resolver) — and with them the freeze verdicts that keep a skipped key from reading as a mesh-wide deletion: excluded keys (#14), the dropped-agent guard, and the failed-mapping tombstone withhold (#49). None of it was directly testable; the only coverage ran through two-node integration tests.wiremap.rsowns the adapters, the per-agent excludes, and the path-mapResolverbehind one interface:key_of/local_dest_of/localize/canonical_plaintextfor translation,excluded/frozen/tombstone_withheldfor freeze verdicts, plusidentify/session_files/rootspass-throughs — Engine never touches adapters directly.key_ofrecords mapping failures itself and returns an explicitKeyLookupoutcome. A skipped lookup carries theanyhow::Erroronly for its first log announcement;begin_passscopes the Failure and collision semantics #49 tombstone freeze to one tick.key_partshelper, preventing translation drift and repeated adapter scans.cleanup/searchre-point towiremap::session_files; AGENTS.md gains theWiremapterm.No version bump: pure refactor and test isolation, no user-visible behavior change.
Verified:
cargo clippy --workspace --all-targets -- -D warningscargo test --workspace -- --test-threads=1— 230 passedssync-nettests passed 10/10 repeated iterationsnix fmt