Commit graph

394 commits

Author SHA1 Message Date
agent
96ba463d5f
wallet: resolve the wallet-rpc binary against the executable, then PATH 2026-09-27 23:51:59 -04:00
agent
1e3eceabcb
docs: the F7 save gate and the app-owned chain source
All checks were successful
ci / test (pull_request) Successful in 6m49s
ci / sdk (pull_request) Successful in 1m25s
TUI.md: the `last` line's shape when one half of a save is refused, why an
app-owned source saves with an empty `url` while a typed endpoint with no login
is still refused, and the wording the `chain` row carries in a build without
`cuprate-daemon`.

WALLET.md: the same gate from the node's side, and the start contract — a start
that fails part way stops what it spawned and leaves the chain datadir as the
thing a retry reuses.
2026-09-27 23:16:35 -04:00
agent
6c1fc5008a
wallet_child: one contract for a start that fails part way
Settle the contract the red feature-gated test was fighting, and make the code
and both tests express it: a start that fails after the chain daemon came up is
all or nothing, the same contract
node::tests::a_missing_binary_fails_the_start_and_leaves_no_child asserts one
level up. A daemon left running behind an error has no owner (the caller gets
the error back, not the client), no handle to stop it, and holds 18081 against
the next start; what a retry reuses is the chain datadir on disk, never a
process that outlived its owner. start_with_creds already behaved that way, so
this states the contract where the stop happens rather than changing it.

in_process_source_launches_a_daemon_and_stop_shuts_it_down was red because its
fake monero-wallet-rpc never binds the port its own readiness gate probes:
start() returns that error, the test discarded it with `let _ =`, and it then
asserted the daemon had survived a failed start. It now holds the published
port the way the module's other start tests do
(test_support::PublishedPortHold) and expects the start to succeed, with every
assertion it had kept. The failure path gets its own test instead, which pins
the tear-down: neither child running, the daemon's port closed, the chain
datadir kept.
2026-09-27 23:16:30 -04:00
agent
c776ea3e0c
tui: the chain row says when this build has no in-process daemon
cuprate::available() was never consulted in the TUI, so the 'chain' row
offered 'in-process node · cuprate in this app' in a build whose only possible
answer is cuprate::NO_FEATURE_MSG. The row now carries that wording where the
choice is made, the same way prune_display()/network_display() carry theirs.
The choice stays in the picker: builds with the feature exist, and a stored
in-process source must still be readable.
2026-09-27 23:16:10 -04:00
agent
c877375ea5
tui: an app-owned chain source saves without an external wallet RPC
A save on F7 ran the wallet-config write first and returned early on its
error, so an empty 'url' row failed the whole save: 'wallet RPC endpoint
required'. That refusal belongs to Wallet::from_config and it is about an
externally run monero-wallet-rpc; an app-owned chain source (local monerod,
in-process Cuprate) spawns its own child with generated creds and a port it
picked, and Node::start_wallet_child_with replaces the stored client after
the spawn, so the url/login rows describe no endpoint the app dials.

- an empty endpoint on an app-owned source no longer vetoes the chain-source
  write; the validator itself is untouched, and a *typed* endpoint with no
  login is still refused
- both halves of a save are attempted and reported on one line shape, so a
  wallet-config refusal cannot silently drop a chain source the user picked
2026-09-27 23:15:53 -04:00
02f8e4d914 Merge pull request 'tui: F7 becomes the node-setup screen, and F6 goes back to being the wallet' (#169) from onionwire/f7-node-setup into main
All checks were successful
ci / test (push) Successful in 7m8s
ci / sdk (push) Successful in 1m19s
android-ci / android (push) Successful in 13m45s
v0.3.0
Reviewed-on: #169
2026-09-28 00:43:14 +00:00
06367b2949 Merge pull request 'ci: skip superseded runs, move fuzz to nightly, trim the android PR trigger' (#168) from ci/trim-redundant-runs into main
Some checks failed
ci / test (push) Failing after 47s
ci / sdk (push) Successful in 10s
android-ci / android (push) Successful in 13m36s
Reviewed-on: #168
2026-09-28 00:42:46 +00:00
agent
5cdfbacf10
tui: F7 becomes the node-setup screen, and F6 goes back to being the wallet
All checks were successful
ci / test (pull_request) Successful in 7m20s
ci / sdk (pull_request) Successful in 1m45s
android-ci / android (pull_request) Successful in 13m36s
ci / fuzz (pull_request) Successful in 5m29s
The chain source was reachable from three places and configured from none of
them properly: `F6`'s inline `1`/`2`/`3` picker wrote only the in-process
choice, the `F9` menu showed the state and named keys that edited it, and
`Node::set_local_monerod` / `set_remote_daemon` / `set_receive_only` — the only
way to point the app at a Monero node — had **no TUI caller at all** (Kotlin
only). `wallet::NOT_CONFIGURED_MSG` told users to "open F7" and there was no F7.

F7 (`WalletSetupConfig`) is now the one screen that sets up the node:

- The `datadir` row is new and editable. `Node::set_local_monerod_at` takes the
  path; `set_local_monerod` delegates with the derived default, so an existing
  install keeps the store it already has. An empty datadir is refused rather
  than silently replaced — a store that moved unasked looks like a vanished
  chain and resyncs somewhere the user did not choose.
- The `network` row is new: it carries the Cuprate mainnet/testnet choice that
  `F6`'s `1`/`2`/`3` used to own, so deleting those keys loses nothing. Mainnet
  reads `unvalidated` before it is picked.
- A `NODE` section shows the live `Node::wallet_child_status` line (state, chain
  source, `sync h/t`, last error) and the last save/test answer. It is the
  node's answer, never the draft above it, and `Ctrl-R` re-reads it.
- `Ctrl-S` saves and starts the child (the daemon, and `monerod` for a local
  source); `Ctrl-X` stops it. Both go through the same `Node::start_wallet_child`
  / `stop_wallet_child` the app's own lifecycle uses, so a start that lands on a
  wallet with no stored passphrase still reaches the unlock prompt.

F6 loses the chain picker and the `s`/`x`/`p` child keys — it is the wallet
again (receive, balance, transfers, create/import) — and its footer points at
`F7 node`. The `F9` menu's `child`/`sync` rows now name `F7 ctrl-s/x` and
`F7 ctrl-r` instead of keys that no longer exist on F6. `set_cuprate_chain` and
the `p` probe handler are deleted rather than left dead.

The node's own keys are named in the body, on the section they act on: at 80
columns the footer has room for one group and the status line already spends
half the width, which is the same reason the login row names `Ctrl-U`.

Tests: six new cases in `src/tui.rs`'s `wallet_setup_config_tests` drive the real
key path and the real node — the typed datadir reaching `ChainSource::Local`, an
empty one being refused with nothing written, the live row on open, `Ctrl-S`
saving then reporting the node's own refusal, the in-process network pick
reaching the store, and F6 no longer owning keys it does not handle.
`tests/tui_spec.rs`'s menu-key check now asserts the F7 keys; the F6 keys it
asserted before no longer work.
2026-09-27 20:06:51 -04:00
agent
a37712f3af
tui: F7 wallet setup — RPC endpoint and chain source on screen
`wallet::NOT_CONFIGURED_MSG` has always said "open F7 to set it up" and there
was no F7. This is that screen.

- `FunctionKey::Setup` on `F7`, live on Main, the settings menu and peer
  payments, same invariant `F9` follows.
- `Screen::WalletSetupConfig` carries `WalletSetupConfigState`: a snapshot of
  plain data taken when the screen opens, never a handle onto `Node`.
- Rows: the wallet RPC endpoint and its login (never rendered back — the row
  says `hidden · set`, `Debug` redacts it), the view-only toggle, and a chain
  picker over all four `ChainSource` cases with their own fields.
- `Node::set_remote_daemon` / `set_local_monerod` / `set_receive_only`, so the
  TUI can reach what only the Android API could, plus `F6`'s in-process source.
- An untouched chain row is not written, so an F7 save cannot silently undo the
  in-process choice; picking a remote daemon says who is trusted in the same
  frame, one line, lowercase.
- `Ctrl-T` tests the endpoint and shows the sanitized `PingResult::line()`.
  Saving never dials. A rejected form writes nothing — the node validates.
- Docs that claimed there is no F7 (`docs/TUI.md`, `docs/WALLET.md`) now
  describe the screen; the settings menu's `endpoint` row names the key.

(cherry picked from commit a48d40bc4e)
2026-09-27 19:23:51 -04:00
agent
404ceea0f8
ci: skip superseded runs, move fuzz to nightly, trim the android PR trigger
All checks were successful
ci / test (pull_request) Successful in 6m33s
ci / sdk (pull_request) Successful in 1m27s
android-ci / android (pull_request) Successful in 12m47s
Three sources of wasted Pi time, measured over a two-week window
(353 workflow runs, 694 job runs): ~78% of CI wall-clock was spent on
work that did not need to happen.

1. Nothing was ever cancelled. Every `concurrency:` block in the repo
   had `cancel-in-progress: false`, and 279 of 353 runs sat in the
   queue behind a newer commit on the same branch. The comment
   justifying it ("shared the container name `onionwire-ci`") was
   stale — the name has been per-run-id for a while — but the real
   constraint is the shared cargo target volume, which two concurrent
   writers corrupt (`Permission denied (os error 13)` on
   /target/debug/deps). So the flag stays false and superseded runs
   instead stand down at a new gate: compare GITHUB_SHA against the
   remote branch tip and skip. Seconds, not minutes, and it cannot
   release the concurrency group into a volume race. Added to
   ci.yml (test, sdk) and android-ci.yml (android).

   Verified against the run history: Forgejo's pull_request GITHUB_SHA
   is the branch head, never a synthetic merge commit (245/245 recorded
   PR runs match a refs/pull/*/head tip), so the gate cannot skip a
   live run. It fails open — an unresolvable ref runs the job. 232 of
   477 historical PR runs would have been skipped.

2. `fuzz` ran on almost every push. A job cannot narrow a
   workflow-level path filter, so `fuzz/**` sat in ci.yml's list
   beside `src/**` and `crates/**`: 80 of 84 recorded runs touched
   nothing in fuzz/, each paying a nightly toolchain install and
   `cargo install cargo-fuzz` for 15 seconds of actual fuzzing. Moved
   to its own workflow, schedule-only (03:30 UTC, off the arti-watch
   slot) plus workflow_dispatch. The build/run single-container fix
   and the PATH export from #106/#107 come along unchanged.

3. android-ci built a full APK for commits that touched no android/
   file — 95 of 143 runs, at ~11 minutes each. The PR trigger now
   covers android/**, crates/onionwire-sdk/**, Cargo.toml, Cargo.lock
   and the build script. The push-to-main trigger keeps src/** and
   crates/**, so every merge still runs the in-APK checks that earn
   their keep (the target_max_memory marker gate, the .so listing, the
   sha256 round-trip) — a Rust-only PR now finds out at merge instead
   of before it, and nothing reaches a release untested.

Also drops `fetch-depth: 0` from android-ci: nothing in the build
reads git history (PUBLISH_TAG comes from the environment).

ci.yml's `push: [main]` trigger is unchanged. It re-tests trees a PR
already tested identically (73 job runs in the window), but branch
protection is empty, so it is not a merge gate — it is the "CI green
on main" signal docs/RELEASING.md's readiness gate reads, and a merge
commit has a different sha so statuses do not carry over. The
staleness gate already removes most of its cost.

docs/RELEASING.md describes all of the above; its android-ci path
list and its fuzz-job account were both wrong after this change.
2026-09-27 15:34:58 -04:00
9f3745cd1d Merge pull request 'tui: the F6 wallet screen draws its body in the slot that has the height' (#167) from onionwire/t_716400d7-onionwire-tui-the-f6-wallet-screen-clips into main
Some checks failed
android-ci / android (push) Has been cancelled
ci / test (push) Failing after 29s
ci / sdk (push) Successful in 1m15s
ci / fuzz (push) Successful in 5m15s
v0.2.0
Reviewed-on: #167
2026-09-27 18:45:13 +00:00
d93e9c3276 Merge branch 'main' into onionwire/t_716400d7-onionwire-tui-the-f6-wallet-screen-clips
Some checks failed
android-ci / android (pull_request) Has been cancelled
ci / test (pull_request) Failing after 42s
ci / sdk (pull_request) Successful in 1m45s
ci / fuzz (pull_request) Successful in 5m10s
2026-09-27 18:45:04 +00:00
dca69bad6f Merge pull request 'tests/tui_spec: remove the NO_COLOR env race behind the flaky suite' (#164) from onionwire/t_75caf868-onionwire-tui-tests-no_color-env-race-ma into main
Some checks failed
ci / test (push) Failing after 26s
ci / sdk (push) Successful in 1m16s
ci / fuzz (push) Successful in 4m54s
android-ci / android (push) Successful in 10m25s
Reviewed-on: #164
2026-09-27 18:08:48 +00:00
0149e105b0 Merge branch 'main' into onionwire/t_75caf868-onionwire-tui-tests-no_color-env-race-ma
Some checks failed
ci / test (pull_request) Failing after 29s
ci / sdk (pull_request) Successful in 1m11s
ci / fuzz (pull_request) Successful in 5m10s
android-ci / android (pull_request) Successful in 12m5s
2026-09-27 18:08:39 +00:00
agent
3bec3bffbf
tui: the F6 wallet screen draws its body in the slot that has the height
All checks were successful
android-ci / android (pull_request) Successful in 10m37s
ci / test (pull_request) Successful in 6m46s
ci / sdk (pull_request) Successful in 1m17s
ci / fuzz (pull_request) Successful in 5m1s
2026-09-26 23:35:31 -04:00
b78e0fcb55 Merge pull request 'tui: a fresh install must not open on the Monero spend-authority warning' (#162) from onionwire/t_6aa61cf8-onionwire-tui-a-fresh-install-must-not-o into main
Some checks failed
android-ci / android (push) Successful in 10m51s
ci / test (push) Failing after 36s
ci / sdk (push) Successful in 1m9s
ci / fuzz (push) Successful in 4m49s
Reviewed-on: #162
2026-09-27 03:34:52 +00:00
fa58930678 Merge branch 'main' into onionwire/t_6aa61cf8-onionwire-tui-a-fresh-install-must-not-o
Some checks failed
android-ci / android (pull_request) Successful in 11m8s
ci / test (pull_request) Failing after 39s
ci / sdk (pull_request) Successful in 1m34s
ci / fuzz (pull_request) Successful in 5m0s
2026-09-27 03:34:38 +00:00
73130b443f Merge pull request 'tui: F6 opens the wallet screen instead of exiting when no wallet is configured' (#161) from onionwire/t_da08817e-onionwire-tui-f6-exits-the-app-when-no-w into main
All checks were successful
android-ci / android (push) Successful in 10m31s
ci / test (push) Successful in 6m17s
ci / sdk (push) Successful in 1m9s
ci / fuzz (push) Successful in 4m54s
Reviewed-on: #161
2026-09-27 02:58:22 +00:00
4ff5af3fab Merge branch 'main' into onionwire/t_da08817e-onionwire-tui-f6-exits-the-app-when-no-w
Some checks failed
android-ci / android (pull_request) Has been cancelled
ci / test (pull_request) Successful in 6m6s
ci / sdk (pull_request) Successful in 1m21s
ci / fuzz (pull_request) Successful in 5m3s
2026-09-27 02:58:10 +00:00
863adc22dd Merge pull request 'docs: TUI wallet surfaces — presentation and flow review (report only)' (#160) from onionwire/t_e4eb38a8-onionwire-tui-presentation-flow-review-o into main
Reviewed-on: #160
2026-09-27 02:51:19 +00:00
agent
a9cb0d5758 tests/tui_spec: remove the NO_COLOR env race behind the flaky suite
Some checks failed
android-ci / android (pull_request) Has been cancelled
ci / test (pull_request) Successful in 6m23s
ci / sdk (pull_request) Successful in 1m17s
ci / fuzz (pull_request) Successful in 5m6s
`alert_line_prefixes_when_no_color` flipped the process-global `NO_COLOR`
without the `ASCII_ENV` mutex the other env-touching tests in this binary
hold, so a concurrent `remove_var("NO_COLOR")` could win and make
`alert_line()` resolve to Rgb/Ansi16 — the `! ` assertion then failed on an
otherwise green run (measured 1/12 runs at cc1201d).

Inject the colour mode instead of reading the environment in the test:

* `tui::alert_line_for_mode(mode, msg, width)` — `alert_line()` is now a
  one-line delegate passing `color_mode()`, so production behaviour is
  unchanged and the no-colour path is asserted without touching the env.
* The test now pins all three shapes of that path: `None` prefixes `! `,
  Rgb leaves the message verbatim, and an already-prefixed alert is not
  double-prefixed.

Also fix the second, same-class race the 20x repeat surfaced:
`wallets_settings_menu_frame_shows_the_shipped_footer` compares a rendered
frame against `status_footer_phased` computed moments earlier, and both read
`ascii_chrome()`/`color_mode()` live — a concurrent `ONIONWIRE_ASCII=1` made
the two sides disagree (✓/… vs ok/...). It now takes the same `ASCII_ENV`
lock and forces the unicode mode.

Evidence (TMPDIR=/home/lancelot/.hermes/tmp/onionwire-tui):
* cargo test --locked -> exit 0, 35 suites, 472 passed, 0 failed, 4 ignored
* cargo clippy --locked --all-targets -- -D warnings -> exit 0
* cargo test --locked --test tui_spec x60 -> 60 ok, 0 failures
* teeth: with the `! ` prefix removed from the None path, the test fails
  ("expected '! ' prefix in None mode: \"peer down\"") — reverted.
* ONIONWIRE_ASCII=1 cargo test --locked --test tui_spec -> 37 passed (no
  unlocked test's outcome depends on the ambient value)
* rustfmt --edition 2024 --check on both files: only the inherited hunks
  (src/tui.rs 16 == HEAD 16; tests/tui_spec.rs 3 vs HEAD 4, one inherited
  hunk reformatted away by this edit)
2026-09-26 22:46:43 -04:00
agent
cc1201d876
tui: a fresh install opens on the main view, not the spend-authority warning
All checks were successful
android-ci / android (pull_request) Successful in 10m37s
ci / test (pull_request) Successful in 6m20s
ci / sdk (pull_request) Successful in 1m20s
ci / fuzz (pull_request) Successful in 5m13s
2026-09-26 22:29:59 -04:00
rust-dev
5fcd4ed643
tui: F6 opens the wallet screen instead of exiting when no wallet is configured
All checks were successful
ci / test (pull_request) Successful in 6m44s
ci / sdk (pull_request) Successful in 1m33s
android-ci / android (pull_request) Successful in 12m2s
ci / fuzz (pull_request) Successful in 18m34s
App::open_wallet propagated the node's "no receive address" error with `?`,
so on an install with no wallet RPC configured and no profile xmr the Err
travelled out of App::run and out of boot(), and the process exited 1. The
same call already degrades to an empty address on F9.

Degrade it here too, and leave a status note that names the way forward:
this screen's own `c`/`i` create/import keys plus ONIONWIRE_WALLET_RPC.
A configured-but-failing endpoint gets the existing NOT_CONNECTED_MSG
instead of the unconfigured copy. balance and transfers are unchanged.

Tests: F6 on a bare install opens Screen::Wallet with an empty receive_addr,
a status note, and no error text in the frame drawn through App::draw; the
frame after Esc back to Main really renders the note. The control case (a
profile xmr address) still fills receive_addr and sets no note. The existing
offset-notice test asserted the propagation itself and now asserts the screen
it reaches instead.
2026-09-26 22:15:51 -04:00
tui-design
041179eb89
docs: presentation and flow review of the TUI wallet surfaces
Report-only audit of the wallet screens at a1f5c878: rendered frames at
80x24/120x40/200x60 for the first-run frame, the F6 wallet screen, the
F6 -> w wallet list, the create-spend-wallet gate and the F9 menu, plus a
findings table located by function and line.

No source file changed.
2026-09-26 22:07:15 -04:00
a1f5c878d3 Merge pull request 'wallet: optional seed-offset passphrase on import' (#156) from onionwire/t_dc9b74a6-onionwire-wallet-optional-seed-offset-pa into main
All checks were successful
ci / test (push) Successful in 6m21s
ci / sdk (push) Successful in 1m29s
android-ci / android (push) Successful in 12m27s
ci / fuzz (push) Successful in 5m6s
Reviewed-on: #156
2026-09-25 22:22:57 +00:00
agent
f6a7daf892
wallet: optional seed-offset passphrase on import
All checks were successful
ci / test (pull_request) Successful in 6m21s
ci / sdk (pull_request) Successful in 1m28s
android-ci / android (pull_request) Successful in 12m54s
ci / fuzz (pull_request) Successful in 18m31s
Monero's `restore_deterministic_wallet` takes a `seed_offset`: a second
spend secret mixed into the 25 words at restore time, so the same words
with a different offset open a different wallet. It is not the wallet-file
passphrase and must never be sealed, stored, logged or put on an argv.

- `Wallet::restore_wallet` gains `seed_offset: Option<&str>`: None, empty
  or whitespace-only leaves the field out of the JSON entirely; otherwise
  the ends are trimmed and it is sent beside the seed.
- `Node::wallet_restore` passes it through and still seals only the file
  passphrase.
- SDK: `import_wallet` keeps its signature (None) and
  `import_wallet_with_offset` is added (Kotlin `importWalletWithOffset`).
- TUI: a new `ImportOffset` step between the seed and the file passphrase
  (blank Enter skips, a real one is confirmed, a mismatch never dials), and
  `ImportOffsetSeen` after a successful import that used one -- Esc cannot
  leave it, only SEEN, and the offset is not drawn anywhere.
- Docs: WALLET.md, THREAT_MODEL.md, TUI.md, one README sentence.
2026-09-25 00:42:44 -04:00
6d815b0fe8 Merge pull request 'wallet: wait for listeners before treating connect refusal as an error' (#155) from onionwire/t_c8fe0549-onionwire-wallet-start-waits-for-the-dae into main
All checks were successful
android-ci / android (push) Successful in 11m35s
ci / test (push) Successful in 5m48s
ci / sdk (push) Successful in 1m14s
ci / fuzz (push) Successful in 5m1s
Reviewed-on: #155
2026-09-24 00:44:44 +00:00
agent
2f3d5d69c3
docs: start waits for the daemon and wallet RPC listeners
Some checks failed
android-ci / android (pull_request) Has been cancelled
ci / test (pull_request) Successful in 8m43s
ci / sdk (pull_request) Successful in 1m16s
ci / fuzz (pull_request) Successful in 5m21s
2026-09-23 20:37:13 -04:00
agent
4136f36dd4
wallet: a connect refusal while coming up is not a status error 2026-09-23 20:37:13 -04:00
agent
081bdfac3e
wallet: wait for monero-wallet-rpc to accept before publishing the child 2026-09-23 20:37:13 -04:00
agent
f5e310fdf4
wallet: wait for the daemon RPC before spawning monero-wallet-rpc 2026-09-23 20:37:13 -04:00
rust-dev
052879fa39
wallet: share the loopback accept wait the SOCKS path already uses 2026-09-23 20:37:13 -04:00
9322d885f8 Merge pull request 'android: do not paint a connect refusal while the wallet is connecting' (#154) from onionwire/t_1b021834-onionwire-android-do-not-paint-a-wallet into main
All checks were successful
android-ci / android (push) Successful in 11m26s
Reviewed-on: #154
2026-09-24 00:08:52 +00:00
agent
971d8b3894
android: reload wallet reads when the child starts answering
All checks were successful
android-ci / android (pull_request) Successful in 12m46s
2026-09-23 19:50:18 -04:00
agent
9eb054b10f
android: do not paint a connect refusal while the wallet is connecting 2026-09-23 19:48:52 -04:00
25e4c67181 Merge pull request 'wallet: land the file-name picker fix and the wallet manager on main (from t_67879b98)' (#153) from onionwire/t_67879b98-wallet-actually-open-the-wallet-file-and into main
Some checks failed
android-ci / android (push) Has been cancelled
ci / test (push) Successful in 6m38s
ci / sdk (push) Successful in 1m18s
ci / fuzz (push) Has been cancelled
v0.1.0
Reviewed-on: #153
2026-09-23 02:33:38 +00:00
685ce89b29 Merge pull request 'wallet: the file-name picker must consult the disk, not only the catalogue' (#151) from onionwire/t_81deabb5-wallet-the-file-name-picker-must-consult into onionwire/t_67879b98-wallet-actually-open-the-wallet-file-and
Some checks failed
android-ci / android (pull_request) Has been cancelled
ci / sdk (pull_request) Has been cancelled
ci / fuzz (pull_request) Has been cancelled
ci / test (pull_request) Has been cancelled
Reviewed-on: #151
2026-09-23 00:46:47 +00:00
c1fda00080 Merge branch 'onionwire/t_67879b98-wallet-actually-open-the-wallet-file-and' into onionwire/t_81deabb5-wallet-the-file-name-picker-must-consult
All checks were successful
ci / test (pull_request) Successful in 6m39s
ci / sdk (pull_request) Successful in 1m49s
ci / fuzz (pull_request) Successful in 7m1s
android-ci / android (pull_request) Successful in 19m1s
2026-09-23 00:46:34 +00:00
3ddd370b3d Merge pull request 'android: ask for the wallet passphrase, and stop printing RPC errors' (#150) from onionwire/t_9ef8561c-wallet-manager-ask-for-the-passphrase-an into onionwire/t_67879b98-wallet-actually-open-the-wallet-file-and
Reviewed-on: #150
2026-09-23 00:41:47 +00:00
01d3294282 Merge pull request 'wallet: actually open the wallet file, and remember its passphrase' (#149) from onionwire/t_67879b98-wallet-actually-open-the-wallet-file-and into main
All checks were successful
ci / test (push) Successful in 6m2s
ci / sdk (push) Successful in 1m33s
android-ci / android (push) Successful in 13m13s
ci / fuzz (push) Successful in 4m57s
Reviewed-on: #149
2026-09-23 00:26:38 +00:00
agent
6edcd65e96
tests: take the restart's port from the child that dials it
All checks were successful
ci / test (pull_request) Successful in 6m3s
ci / sdk (pull_request) Successful in 1m14s
ci / fuzz (pull_request) Successful in 4m53s
android-ci / android (pull_request) Successful in 12m15s
`a_restart_opens_the_stored_wallet_file` failed on the Pi runner twice in a
row — CI run 905 job 1373 and run 901 job 1365 — and passed 3/3 on a 16-core
host:

  open the wallet with a passphrase: "wallet file onionwire-1 is not open —
  the wallet RPC never answered (wallet connect: Connection refused (os error
  111))"

The whole `WALLET_OPEN_WAIT` was burned on refusals, so the mock was bound on
a port the restarted child never dialled. Production is not the suspect:
`WalletChild::start_children` builds the child's argv and the `WalletClient`
URL from the same `pick_port` value, and `start_wallet_child_with` installs
that client in `self.wallet` before `open_child_wallet` dials it, so the client
can never carry the previous child's port.

The harness is the suspect. It learned the restarted child's port from the
*shared* argv log — a file every child writes — and cleared that file first.
A clear is not a synchronisation: on a loaded runner the killed child's write
lands after it, so the poller read the port of a child that was already dead
and bound the mock there. Reproduced deterministically with a stand-in whose
exec is late; with the old read the new test fails with the CI message, byte
for byte.

Each fake child now writes `<log>.<pid>` as well, and the shared copy lands
first, so a pid-named file implies the shared one is complete. A test that
spans two children reads the pid-named file: only that child can write it, so
the port belongs to the child that dials it. `WalletChild::wallet_rpc_pid`
(test-only) supplies the pid.

`open_wallet_blocking` already retries while the RPC is unreachable and gives
up after a bounded wait with a typed `OpenFailure::NotAnswering`, so it cannot
refuse forever against a merely slow child: no production change.

new test: node::tests::a_restart_is_not_given_the_stopped_childs_port
2026-09-22 15:37:55 -04:00
agent
8d80a4fd55
tests: write the fake child's argv log with one mv, not append-per-line
Some checks failed
android-ci / android (pull_request) Successful in 12m25s
ci / test (pull_request) Failing after 4m11s
ci / sdk (pull_request) Successful in 1m20s
ci / fuzz (pull_request) Successful in 5m28s
The wallet-child tests learn a spawned stand-in's port by polling its argv
log, and `fake_bin`/`fake_child_bin` truncated the log and then appended
one line per argument -- so a poller could read a prefix. A truncated port
is a *valid* u16 ("427" out of "42765"), so `wait_for_child_rpc_port`
happily returned a port nothing was listening on and the restart's
`open_wallet` died with `Connection refused` after its 10s budget; the
same prefix read is what `loopback_and_clearnet_remotes_carry_no_proxy...`
printed with its `--daemon-address` value missing.

Both tests failed on the first CI run of this branch (ci / test) and are
green in isolation, which is the signature of this race rather than of a
code defect. The argv now lands in the log with a single `mv`, so a reader
sees either no log or the complete one.

Measured with a tight read loop (argv-race-probe.sh): the append version
was caught mid-write 1/300 reads, the mv version 0/300.
2026-09-22 14:33:32 -04:00
agent
b4f8bb809c
android: filter the wallet child's last_error where the SDK record becomes the model
All checks were successful
android-ci / android (pull_request) Successful in 12m53s
The status line renders WalletChildInput.lastError through walletChildLine,
and the same field feeds walletChildStatusDescription for the screen reader.
The filter added in 3f84021 sat on the sticky error card only, so in exactly
the state this card targets — a live child with no wallet file open answering
-13 No wallet file — the raw daemon sentence still reached the line and the
screen-reader sentence.

Move it to the producer: WalletChildStatus.toInput() now runs lastError
through walletFailureText, the one seam where the SDK record becomes the
Kotlin model. Idempotent on its own replacement texts, so the error card's
second pass is stable.

New JVM tests build the SDK record and assert on the rendered line (and its
description), not on walletFailureText in isolation: with the filter removed
they fail on the raw 'No wallet file'.
2026-09-22 14:11:34 -04:00
rust-dev
59175f6931
wallet: the file-name picker consults the disk, not only the catalogue
Some checks failed
ci / test (pull_request) Failing after 4m25s
ci / sdk (pull_request) Successful in 1m29s
ci / fuzz (pull_request) Successful in 4m57s
android-ci / android (pull_request) Successful in 12m6s
next_wallet_filename returned <default>-<n> for the first n the SQLCipher
catalogue did not hold, and never looked at the wallet directory. monero
writes two files per wallet (<name> and <name>.keys) and refuses a create
that would collide with either, so a file whose catalogue row is gone -
Store::delete_wallet keeps the file, and a create whose record_wallet
failed leaves one - meant every attempt proposed the same taken name and
the daemon answered -21 Cannot create wallet. Already exists. for ever.

Add wallet_name_taken (src/wallet_child.rs): it lists the wallet dir and
answers whether <name> or <name>.keys is already there. next_wallet_filename
now needs the candidate free in both places, and Node::wallet_dir() is the
single source of $ONIONWIRE_HOME/wallet, used by the child spawn too.

Fail closed: an unreadable (or missing) wallet dir is an error, not a
guess. Reads only - nothing here deletes a file the catalogue does not
hold, which may be the only copy of a funded wallet.
2026-09-22 13:41:35 -04:00
apk-dev
3f84021abb
android: ask for the wallet passphrase, and stop printing RPC errors
All checks were successful
android-ci / android (pull_request) Successful in 12m38s
The wallet manager could not open a wallet it holds no passphrase for: the
child came up pointed at the file with no wallet open, `needs_passphrase`
was true, and every read answered the daemon's `-13 No wallet file`. The
screen rendered that string.

Phone side of t_67879b98:

* WalletManagerScreen asks for the passphrase when the child reports
  `needs_passphrase` and no wallet is open, and submits it through the
  parent's `Wire::open_wallet_with_passphrase` on the file the child is
  already pointed at. Masked field, no copy action (same rule as the seed
  card), wiped on success and on dispose, FLAG_SECURE while the screen is
  up.
* `walletFailureText` filters every user-visible wallet failure: the
  daemon's `No wallet file`, a bare `-13`, and any JSON envelope become a
  plain sentence that says whether a wallet is open and what to do next.
  Applied at every site that renders a wallet error, in both wallet
  screens and the wallet-child error flow in the ViewModel.
* The wallet screen says "no wallet is open in the child" and where to fix
  it, instead of leaving it to surface later as the daemon's own words.

Tests: WalletManagerTest covers the new decisions (prompt shown / not
shown, submit gate and its reasons, the failure-text filter, the open
hint) on the JVM. 203 unit tests green.
2026-09-22 13:30:08 -04:00
agent
ed29131a67
wallet: actually open the wallet file, and remember its passphrase
All checks were successful
ci / test (pull_request) Successful in 6m14s
ci / sdk (pull_request) Successful in 1m44s
android-ci / android (pull_request) Successful in 12m56s
ci / fuzz (pull_request) Successful in 5m1s
`monero-wallet-rpc` starts with no wallet open and keeps one only for the
life of its process, so a restart, a Lock/unlock or a wallet re-point left
a live child answering `-13 No wallet file` to every read while the file
sat on disk. The app now opens the configured catalogue file itself
(`Wallet::open_wallet`, over RPC — never `--wallet-file`/`--password` on
argv, which `ps` exposes) after the child is up, and keeps the passphrase
that does it, sealed with the store data key beside the RPC creds under
its own AAD.

- core: `Wallet::open_wallet`, `WalletConfig::wallet_passphrase`
  (+ `with_wallet_passphrase`, redacted Debug, kept out of the endpoint
  config), `Error::is_unreachable` for the one retryable class (the port
  binds a moment after spawn; a timeout is not a start in progress).
- store: `wallet_config.sealed_passphrase` column (additive, AAD
  `onionwire-store-v1:wallet-passphrase`), read-modify-written so the
  endpoint/login survive; `wallet_save_config` keeps the stored one.
- node: `start_wallet_child` opens the file, `open_wallet_with_passphrase`
  opens a file with a passphrase the user just typed and seals it only
  once a live daemon accepted it, `wallet_status` grows `wallet_open` and
  `needs_passphrase`. A child the RPC refuses is stopped rather than left
  inert; an install with no stored passphrase still starts, and says so.
- tui: one-shot prompt (`WalletSetup::UnlockPass`) on a wallet that needs
  it, reachable from the saved-wallet picker and from `s`.
- sdk: `openWalletWithPassphrase`, the two status fields, README flow.
- docs: WALLET/THREAT_MODEL/README — the passphrase is kept, and the
  consequence (the store passphrase is sufficient to spend) is stated
  rather than implied.

Tests: 4 new node tests drive a real child lifecycle against a loopback
wallet RPC (open on restart, no open without a passphrase, refused
passphrase, sealed-on-success), a `tests/wallet.rs` test asserts the bytes
sent (`open_wallet` + filename + password), and `tests/store.rs` covers
the sealed column and the plaintext->encrypted upgrade with it set.
Mutation-checked: stubbing the two open paths fails all four.
2026-09-22 12:52:08 -04:00
c5725856ad Merge pull request 'android: profile screen — nickname + Monero receiving address' (#148) from onionwire/t_54329f2b-android-profile-screen-nickname-monero-r into main
All checks were successful
android-ci / android (push) Successful in 11m34s
Reviewed-on: #148
2026-09-22 12:28:49 +00:00
dc8c3933cd Merge branch 'main' into onionwire/t_54329f2b-android-profile-screen-nickname-monero-r
All checks were successful
android-ci / android (pull_request) Successful in 12m30s
2026-09-22 12:09:33 +00:00
460a5afb12 Merge pull request 'android: saved-wallets screen (list, select, back up the open wallet)' (#147) from onionwire/t_cf7e07f9-android-saved-wallets-screen-list-select into main
All checks were successful
android-ci / android (push) Successful in 11m55s
Reviewed-on: #147
2026-09-22 12:09:18 +00:00
agent
775f2e88be
android: profile screen — nickname + Monero receiving address
All checks were successful
android-ci / android (pull_request) Successful in 12m27s
The phone's half of the TUI's `/profile`. A `Profile` action on the roster's
app bar opens `ui/ProfileScreen.kt`: nickname, bio, and the Monero address
friends pay to, all three loaded from the store and written back through the
core's own validation.

- The address is checked with `uniffi.onionwire_sdk.checkAddress` *before* the
  write, so a typo is refused with the typed text still in the field instead of
  surfacing as a store error afterwards. An empty address is allowed and is
  labelled with its consequence: with no profile address and no running wallet
  child the core has nothing to hand a payer.
- The bio is carried, not owned: a save that did not touch the field writes
  back the value read from the store immediately before the write, so a bio set
  in the TUI cannot be blanked from the phone.
- On save the profile is pushed to **every** friend in the roster, one-shot and
  fail-closed per friend like the TUI's `save_profile`. A push failure is not a
  save failure: the status line always starts with `profile saved` and names the
  count, with each failure listed by petname (else shortened fingerprint).

Every decision the screen makes is a pure function in the new file, covered by
`ProfileDraftTest` (21 cases) on the JVM: the save-button rule (dead until the
read lands, dead while the form is unchanged), the address branch, the bio rule,
label selection and the status-line aggregation.

Verified on AVD ow35 (x86_64 slice, emulator-5560): the roster app bar carries
`Profile`; nickname/bio/address survive `am force-stop` + relaunch; an invalid
address is refused before the write; a save with an empty roster reports
`profile saved`; with one (self-)peer in the roster a save reports
`profile saved · sent to 1 friend`, and with the emulator's network cut the same
save reports `profile saved · sent to 0 of 1 friend · failed: <label>: <tor err>`.
2026-09-22 02:12:32 -04:00