refactor: split LoadedApp context & migrate to jotai - #1280
Draft
dorianvp wants to merge 28 commits into
Draft
Conversation
The project-local uniffi-bindgen for the Nym proxy shim moves here from zingolib's zingo-netutils workspace, pinned to the shim's uniffi 0.28. consume-android-shim now regenerates the Kotlin bindings itself from a staged .so (uniffi library mode reads the metadata statically, so a cross-compiled Android library works on the host) instead of copying a pre-generated kotlin/ tree out of the bundle; such a tree, if present, is ignored. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The UniFFI proxy shim zingo-nym-proxy-ffi moves here from zingolib's zingo-netutils workspace, where zingolib#2666 removed it. It lands at rust/nym-proxy-ffi under its original crate name, which UniFFI turns into the binding namespace the Kotlin and Swift hosts import. The shim's former path dependency on zingo-netutils becomes a git dependency on zingolib dev with the nym feature. The crate sits outside the main workspace, with its own committed lockfile, because nym-sdk's transitive graph needs crypto-common ^0.2 and cannot resolve against the workspace's pins. This supersedes the whole-workspace nym-host vendoring of PR #1251: only the shim moves, and every other crate remains in zingolib, referenced on its dev branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replayed from 5aa621e on migrate-nym-bindgen, minus the vendored rust/nym-host workspace: the shim now lives at rust/nym-proxy-ffi (the previous commit), so every nym-host path retargets there, the Kotlin bindings generate through the main workspace's zingo-uniffi-bindgen, and the iOS artifact is named ZingoNymProxyFFI.xcframework after the crate instead of the vendored directory. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The shim at rust/nym-proxy-ffi resolves in its own lockfile, so the workspace-wide jobs never touch it. This job runs fmt, check, clippy, and nextest inside the shim's workspace on every PR, joining the fail-all bucket like the other verdict jobs. Cross-compilation per ABI stays out of PR CI (issue #1275 tracks collapsing the bundle tooling; the release path builds the shipped libraries). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The replayed screens were written against the pre-token theme (colors.text, colors.background, colors.placeholder, colors.warning, and the bottom-sheet colors). Dev landed the token system after the branch diverged. This maps every stale token to its dev equivalent and moves MixnetDoctor onto the app theme hook instead of the navigation theme cast. tsc and eslint pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The root manifest carried a crates-io `zingo-netutils = "5.0.1"` dependency beside the git-sourced copy arriving through zingolib, so one build graph compiled two diverging crates under the same version. The wallet crate's two `GrpcIndexer` call sites now import through the `zingolib::netutils` facade, ADR 0024's convergence surface, and the registry dependency, its feature request, and its lockfile subtree are gone. `cargo check --workspace` passes; the only netutils in the graph is the git `dev` copy the shim also consumes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The relocated shim resolved the real rustls-platform-verifier without the JVM initialization Android requires, because zingolib's webpki patch never crosses a workspace root; every mixnet enable would have died at the first TLS handshake exactly as zingolib#2531 recorded. ADR 0004 decides the fix: this app owns platform verification. The new tls-init crate is the one hand-written JNI seam and hands the app Context to the verifier; the shim links it into libzingo_nym_proxy_ffi.so on Android; NymTlsInit invokes it before every proxy start; gradle consumes the verifier's Kotlin component from the cargo checkout so both halves share the lockfile-pinned version. Checked green on host and aarch64-linux-android. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The maintainer ratified the documentation rule for this repository on 2026-08-10: every item doc-comment is exactly one sentence, while module headers and ratified test conventions keep their shape. This change rewrites the multi-sentence doc-comments this branch introduces — in the shim, the golden-wire suite, the workbench binaries, the wallet crate's two touched blocks, and NymTlsInit's KDoc — and records the rule in .agents/claude.md. The consume-android-shim ABI note also stops naming zingolib as the bundler's home, since the bundler now lives beside it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The host lanes now run check, clippy, and nextest with --workspace so the tls-init member is proven in shape, while its Android-gated JNI body is proven by the release cross-build; the member's imports are also rustfmt-normalized. 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.
On top of #1279.
This is a huge PR that essentially splits the
LoadedAppcontext into chunks, and makes the state machine explicit throughjotai. This gives us a bunch of benefits straight away, such as:Limitations: the monolithic context still exists, with 41 setState calls on data fields (which still fan out to all 48 consumers.