test(bus): deterministic dial-back source probes to decide #61 sufficiency - #69
Merged
Conversation
…iency
WHAT: Three real-iroh unit probes in bus.rs that answer, deterministically, what
the #[ignore]d mDNS integration tests cannot: what does incoming.remote_addr()
report for a same-host dial, and does the reply_dial_candidates set actually
reconnect to it?
- probe_loopback_v4/v6_source_is_dialable_and_reconnects: bind two real
endpoints, dial asker->responder over loopback, observe the source exactly as
accept_conn does (logged as evidence), then dial the asker BACK over the
candidate set and assert it reconnects.
- probe_scopeless_link_local_source_reconnects_via_loopback_fallback: the
decisive #61 case — feed the exact fe80::/scope-0 (undialable) shape at the
asker's real port; assert the candidate set drops it yet still reconnects via
the loopback fallback over real iroh.
WHY: #63 landed the candidate-set fix (reply_dial_candidates) but the empirical
"is it sufficient?" question was only answerable on a real-LAN runner. These make
the SAME-HOST answer deterministic and CI-gating: #63 delivers the reply even in
the worst-case scopeless-link-local source shape. Cross-host scoped-link-local
(does iroh preserve the recvmsg scope_id?) remains the real-LAN tier, covered by
the existing #[ignore]d reply_reaches_quiet_asker_via_dial_back.
Observed on this host: loopback-v4 -> 127.0.0.1:<port>, loopback-v6 -> [::1]:<port>
(both dialable); all three probes green in ~0.06s.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What this PR does
bus.rsunittests) that answer the empirical
#61question the#[ignore]d mDNS testscan't: what does
incoming.remote_addr()report for a same-host dial, and doesreply_dial_candidatesactually reconnect to it? Each binds two realtransport endpoints, has the responder observe the source exactly as
accept_conndoes, and dials the asker back over the candidate set.probe_loopback_v4/v6_source_is_dialable_and_reconnects— dial over loopback,observe + log the source, assert it's dialable and the dial-back reconnects.
probe_scopeless_link_local_source_reconnects_via_loopback_fallback— thedecisive
#61case: the exactfe80::/scope-0 (undialable) shape at theasker's real port; assert the candidate set drops it yet still reconnects via
the loopback fallback over real iroh.
Test plan
cargo test -p agent-mesh-bus --lib probe_→ 3/3 green, ~0.06s, deterministic.127.0.0.1:<port>, loopback-v6 →[::1]:<port>(both dialable).just check+just cov-cigreen via the pre-push hook (57-test bus lib incl.the probes; coverage floor held — these only add coverage).
Out of scope
recvmsgscope id so ascoped
fe80::source is directly dialable?) — genuinely a two-host / real-NICscenario, left to the existing
#[ignore]dreply_reaches_quiet_asker_via_dial_backreal-LAN tier.
#63's fix is untouched; this only adds decisionevidence.
The decision this informs
For the same-host case (CI + the common quiet-peer scenario),
#63'scandidate-set fix is sufficient: the reply is delivered even when iroh
surfaces the undialable scopeless-link-local source — proven deterministically,
end to end. The one remaining open question is cross-host scoped link-local,
which fundamentally needs the real-LAN tier.
🤖 Generated with Claude Code