Skip to content

feat(netutils): report the bootstrap race as typed events - #2742

Open
zancas wants to merge 5 commits into
devfrom
nym_bootstrap_events
Open

feat(netutils): report the bootstrap race as typed events#2742
zancas wants to merge 5 commits into
devfrom
nym_bootstrap_events

Conversation

@zancas

@zancas zancas commented Aug 24, 2026

Copy link
Copy Markdown
Member

The mobile diagnostics surface needs to name the Exit Node each bootstrap step concerns. The prose lines from start_over cannot 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 BootstrapEvent enum carries five lifecycle variants. DiscoveryStarted marks the directory query. DiscoveryFinished carries the candidate count. PullLaunched and PullFailed carry the full Exit Node address. The failure text stays prose, as it already is inside RaceEvent. Connected names the winner.

NymProxy::start_observed and NymProxy::start_over_observed report these events. start and start_over are 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_race reports one AcqStep per launch, per failure, and per counter change. connect_across_exit_nodes resolves arm indices to Exit Node addresses. When a panicked pull loses its index, the lookup falls back to the index form short_exit_node_name uses. 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-targets is clean and all 69 library tests pass.

🤖 Generated with Claude Code

zancas and others added 3 commits August 24, 2026 13:29
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
zancas marked this pull request as ready for review August 25, 2026 04:05
zancas and others added 2 commits August 26, 2026 09:46
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>
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