feat(netutils): report the bootstrap race as typed events - #2742
Open
zancas wants to merge 5 commits into
Open
Conversation
The mobile diagnostics surface (zmobs ADR 0007) needs to name which Exit Node each bootstrap step concerns, and the prose lines from start_over cannot carry that identity. This change makes the race narrative typed at its source and keeps the prose rendering for the spawnable binary unchanged. A public BootstrapEvent enum carries five lifecycle variants: DiscoveryStarted, DiscoveryFinished with the candidate count, PullLaunched and PullFailed with the full Exit Node address (the failure text stays prose, as it already is inside RaceEvent), and Connected with the winner. NymProxy::start_observed and NymProxy::start_over_observed report them; start and start_over are now thin renderings over the same path, so the two narrations cannot drift. Internally drive_acq_race reports an AcqStep per launch, failure, and counter change, and connect_across_exit_nodes resolves arm indices to Exit Node addresses, falling back to the index form short_exit_node_name uses when a panicked pull loses its index. The planner's hedging mechanics stay private, and the existing RaceProgress narration is byte-identical. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The enum was public only inside the private nym_proxy module, so the standalone-workspace doc build rejected the intra-doc links and no consumer could name the variants that start_observed reports. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
zancas
marked this pull request as ready for review
August 25, 2026 04:05
NymProxy::reconnect_observed reports each step of a reconnect race through the same typed BootstrapEvent channel the bootstrap uses, and reconnect becomes a thin silent rendering over it, so the diagnostics surface no longer goes blind at the moment after a proxy death. The discovery narration is one shared discover_observed path used by both entries, and a falsifier pins that a failed directory query still reports its departure. The redraw moves into redraw_clutch, with a falsifier pinning that a reconnect never rebinds a spent exit. BootstrapEvent::PullFailed now carries the pull's whole typed zingo_net_diag::NetOpFailure rather than a line rendered for a human, so a diagnostics surface renders structure instead of parsing prose. AcqStep becomes generic over the failure so the driver hands it through untouched. The spawnable binary's prose output is byte-identical. cargo clippy --features nym --all-targets is clean and all 71 library tests pass. Co-Authored-By: Claude Fable 5 <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.
The mobile diagnostics surface needs to name the Exit Node each bootstrap step concerns. The prose lines from
start_overcannot carry that identity. This change makes the race narrative typed at its source. It serves zmobs ADR 0007, which defines how a debug build observes the three mixnet legs.A public
BootstrapEventenum carries five lifecycle variants.DiscoveryStartedmarks the directory query.DiscoveryFinishedcarries the candidate count.PullLaunchedandPullFailedcarry the full Exit Node address. The failure text stays prose, as it already is insideRaceEvent.Connectednames the winner.NymProxy::start_observedandNymProxy::start_over_observedreport these events.startandstart_overare now thin renderings over the same path, so the two narrations cannot drift. The spawnable binary's prose output is byte-identical.Internally,
drive_acq_racereports oneAcqStepper launch, per failure, and per counter change.connect_across_exit_nodesresolves arm indices to Exit Node addresses. When a panicked pull loses its index, the lookup falls back to the index formshort_exit_node_nameuses. The planner's hedging mechanics stay private.A new falsifier pins the driver contract: every launch and every failure is reported with its arm index and text. The adapted narration test keeps its original assertion.
cargo clippy --features nym --all-targetsis clean and all 69 library tests pass.🤖 Generated with Claude Code