feat(cli)!: nym compiles by default; network on is the in-session consent act - #2592
Open
zancas wants to merge 6 commits into
Open
feat(cli)!: nym compiles by default; network on is the in-session consent act#2592zancas wants to merge 6 commits into
zancas wants to merge 6 commits into
Conversation
…sent act Four rulings land together (ADR 0026). First, nym is a default feature of zingo-cli: every ordinary build carries the mixnet transport, and enabling it never demands a rebuild. The opt-out stays explicit: --no-default-features on cargo, --clearnet on run-cli, which now passes the former to build clearnet. zingolib's own default remains nym-off, so library consumers inherit nothing. Second, the REPL command renames from nym to network: there is exactly one mixnet, so the transport's name is implicit, and the command's true subject is the session's network posture. The internal types follow the rename. Third, network on is itself a Connectivity Consent act, amending ADR 0025's act list. An offline session that runs it switches to ONLINE MODE for this session only, resolving its indexer over the same curated ranking --online uses at launch and only then bootstrapping the mixnet; the help and the command's output warn about the switch in capitals. The REPL's change_server pin reads the live session, so the granted consent unlocks it. network probe grants nothing and refuses offline. The zingolib netutils funnel deliberately gains GetClientError so the connect failure stays typed. Fourth, a build without the capability has no Online Mode at all: the network command does not exist there, the online launch acts refuse loudly, a stored standing consent is reported as inert, and --forget-online still retires it. Verified: clippy -D warnings and rustfmt clean on both feature shapes and the workbench crate; 174/174 default-shape and 156/156 opt-out lib tests; a live REPL run of the offline flow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The container's libtonode phase failed 33 of 40 tests with MixnetNotReady(Unattached) once nym became a zingo-cli default feature (ADR 0026): the phases share one --workspace build scope, so feature unification compiled zingolib/nym into the zingolib the chain tests link, and the five-state wallet refused every unconsented scenario send. The scenarios' clearnet consent already existed, but it keyed on zingolib_testutils' OWN nym feature, which nobody enables in that build — the consent compiled to a no-op at exactly the moment the refusal compiled in. The one attribution failure was the same desync at one remove: the send refused before a transaction was built, so no Failed record could hold one. The cfg moves to the only place it cannot desync. zingolib gains the unconditional, testutils-gated LightClient::consent_to_clearnet_for_tests, whose body follows zingolib's own feature: with the mixnet compiled in it records the deliberate SwitchedOff act, without it there is nothing to record. The testutils twin-cfg pair collapses into a delegation, and the consent moves into ClientBuilder::build_client — the one construction funnel every faucet and recipient flows through — closing the coverage gaps the three explicit call sites left. The mobileclient scenarios' explicit calls stay, pinned for zingo-mobile; a second consent is idempotent. Verified: cargo check --workspace --all-targets (the container's unified feature scope), clippy -D warnings on zingolib and testutils, and rustfmt, all clean. The chain tests themselves are container-only; issue #2591 scopes the follow-on framework work. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…nted funnel The ADR 0026 default flip compiles zingolib/nym into the container workspace build, so a test client left in the Unattached ground state refuses its first send with MixnetNotReady: absence is never consent (ADR 0011). Commit 082d44a recorded the consent at the zingolib_testutils ClientBuilder funnel, but two construction paths never pass through it. The in-crate chain_generics harness builds clients directly in ConductChain::create_client and load_client, and the watch-only test constructs its client by hand. Those paths produced the three remaining container reds: two chain_generics sends unwrapped the refusal, and test_scanning_in_watch_only_mode asserted NoSpendingKey but met the send preflight's earlier MixnetNotReady(Unattached) refusal, which fires before calculation. A testutils-gated LightClient::new_clearnet_consented now records the consent at construction, and every harness funnel delegates to it: ClientBuilder::build_client, ConductChain::create_client and load_client, and the watch-only client. The scenarios module's local consent_to_clearnet helper and its redundant per-site calls collapse into the constructor. A raw LightClient::new in a test now marks a deliberately unconsented client, the ground state the refusal-contract pins assert. Verified with cargo fmt, clippy -D warnings on both feature configurations, and the zingolib unit suites: 415 passing with nym,nym-diary and 336 passing with default features. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
zancas
marked this pull request as ready for review
July 29, 2026 21:59
The ADR 0026 default-feature flip lets cargo feature unification enable zingolib/nym in the default workspace `cargo doc` build, which documents the nym module for the first time in CI. Three latent intra-doc links in supervisor.rs (present since b5ba704, identical on dev) point at the pub(crate) methods MixnetProxy::stop and MixnetProxy::attach from public documentation, and rustdoc private_intra_doc_links under -D warnings fails the cargo-checkmate doc job on PR #2592. The methods stay crate-private by design, so the references become plain code spans. Verified with RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps. 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.
This branch makes
nyma default feature of zingo-cli and renames the REPL command fromnymtonetwork. Turning the network on is now an in-session Connectivity Consent act:network onswitches an offline session to ONLINE MODE, the help text and command output warn in capitals, the probe still refuses while offline, and thechange_serverrefusal pin reads live state. Builds that opt out of the feature are offline-only — they carry nonetworkcommand, their online launch acts refuse, and stored consent is inert. ADR 0026 records the default flip, the consent act, and the rename.A second commit fixes the testutils clearnet-consent funnel to key on zingolib's own
nymfeature rather than the testutils crate's: feature unification can enablezingolib/nymfrom any workspace member, and a local cfg would compile the consent out exactly when the refusal is compiled in.Verified on both feature shapes:
cargo clippy -D warningsandrustfmtclean, 174/174 default and 156/156 opt-out lib tests, and a live REPL demonstration of the consent act.🤖 Generated with Claude Code