Commit graph

380 commits

Author SHA1 Message Date
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
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
apk-dev
812c259f46
android: saved-wallets screen (list, select, back up the open wallet)
All checks were successful
android-ci / android (pull_request) Successful in 10m37s
The app could hold several wallets and show none of them. Add the screen
that lists the store's catalogue, marks the one the wallet child has open,
switches to another on a tap, and — for the open one only — shows its
recovery phrase and private keys.

Everything secret here belongs to the file the child currently has open:
`query_key` is answered by that file and no other, so the seed card and the
keys card hang off `active_wallet_filename()`, not off a row. On a row that
is not the open one both actions are dead and say why ("open this wallet to
view its backup") instead of opening it under the user — switching wallets
is a deliberate tap, because `open_wallet` stops and restarts a running
child.

The phrase keeps the existing treatment: the wallet screen's own
`SeedBackupCard`, widened from `private` to `internal` rather than copied,
so the gate constants are still the one `SeedBackupGate`. The keys card
shows the view key always and the spend key when there is one; a view-only
wallet says "view-only wallet — no spend key" in words, because `null` is
the wallet's own answer and not a failure. Neither value is logged,
persisted, tagged, or held in saved state, and both are dropped on dispose.

The catalogue is re-read on entry and on Refresh, never cached from app
start, so a wallet created on the wallet screen after this one was first
opened shows up without restarting the app. An empty catalogue ("No saved
wallets yet") and a read failure ("could not read the wallet catalogue" +
the core's text) are rendered as the two different states they are.

The gate is pure Kotlin in the new file and `WalletManagerTest` covers it on
the JVM (17 cases): the row label's name/blank/whitespace fallback, which
child states count as readable, and whether the secret actions are offered
for a row.
2026-09-22 01:23:47 -04:00
573bf4bf8d Merge pull request 'android: collapse the roster identity block into a dropdown' (#146) from onionwire/t_d62da406-android-roster-collapse-the-identity-blo into main
All checks were successful
android-ci / android (push) Successful in 10m20s
Reviewed-on: #146
2026-09-22 04:31:22 +00:00
181c13647a Merge branch 'main' into onionwire/t_d62da406-android-roster-collapse-the-identity-blo
All checks were successful
android-ci / android (pull_request) Successful in 12m1s
2026-09-22 04:31:06 +00:00
0e866c096a Merge pull request 'sdk: expose the wallet catalogue, the open wallet's keys, and the self profile over UniFFI' (#145) from onionwire/t_c9e48c46-onionwire-sdk-expose-the-wallet-catalogu into main
Some checks failed
android-ci / android (push) Has been cancelled
ci / test (push) Successful in 8m8s
ci / sdk (push) Successful in 1m7s
ci / fuzz (push) Successful in 4m53s
Reviewed-on: #145
2026-09-22 04:30:20 +00:00
agent
b6447f76d6
android: collapse the roster identity block into a dropdown
All checks were successful
android-ci / android (pull_request) Successful in 12m26s
The identity card's full fingerprint wraps to several lines on a phone and
pushes the friend list off the first screen. Collapse it: one line by
default (label + `shortId(fingerprint)` + chevron), the full fingerprint and
the full onion behind a tap, in the order they already had.

The `sdk …` line and `keepAliveNote` stay outside the disclosure — the
keep-alive denial is the only place that note appears, so hanging it off a
collapsed block would hide it.

`shortId` is a pure top-level function (`head … tail`, unchanged when the
value is no longer than the abbreviation, empty stays empty) so the collapsed
line is a slice of the value shown expanded, not a parallel encoding. The
expand state is `rememberSaveable`: a rotation keeps what the user chose, and
nothing about it belongs in the store.

RosterIdTest covers the abbreviation on the JVM (7 cases: the 64-hex
fingerprint, the head/tail boundary, custom head/tail, shorter-than-input,
empty, single-char ellipsis).
2026-09-22 00:28:39 -04:00
sirius
5f19a56be3
sdk: expose the wallet catalogue, the open wallet's keys, and the self profile
Some checks failed
ci / test (pull_request) Successful in 5m59s
ci / sdk (pull_request) Successful in 1m35s
android-ci / android (pull_request) Successful in 12m42s
ci / fuzz (pull_request) Has been cancelled
The Android wallet/profile screens had nothing to call: the core could list
wallets, switch the child onto one, read its keys and read/write the self
profile, but none of it crossed UniFFI.

Core:
- Wallet::keys() -> WalletKeys { view_key, spend_key: Option<String> }: two
  query_key calls against the file the RPC has open. A view-only wallet's -29
  is spend_key: None, not an error. WalletKeys' Debug redacts both halves.
- Node::wallet_keys() mirrors wallet_create/wallet_seed; refuses locally when
  no wallet is configured.
- Node::active_wallet_filename() -> Option<String>: the file the child is
  pointed at, None until wallet-child settings exist, so a client can mark the
  open row.

SDK (UniFFI):
- records WalletRow / WalletKeys / SelfProfile, and Wire::{wallets,
  open_wallet, active_wallet_filename, wallet_keys, self_profile,
  set_self_profile, push_self_profile}.
- The rule the clients must express is in the docs: the seed and the private
  keys come from the OPEN wallet, so there is deliberately no accessor that
  reads another saved wallet's secrets without opening it.

docs/WALLET.md (catalogue + 'secrets belong to the open wallet'),
docs/THREAT_MODEL.md (the new on-demand-display exposure surface) and the SDK
README are updated in the same commit.
2026-09-22 00:25:33 -04:00
agent
a9117b8991
Merge PR #144: tui -- read the wallet list from the store and load the chosen wallet
All checks were successful
ci / test (push) Successful in 5m47s
ci / sdk (push) Successful in 1m24s
android-ci / android (push) Successful in 10m42s
ci / fuzz (push) Successful in 4m52s
# Conflicts:
#	docs/TUI.md
#	src/tui.rs
2026-09-21 12:12:12 -04:00
agent
511c9e921d
Merge PR #143: node -- remember a created wallet in the store catalogue 2026-09-21 12:11:19 -04:00
agent
8986724848
tui: read the wallet list from the store and load the chosen wallet
All checks were successful
ci / test (pull_request) Successful in 6m14s
android-ci / android (pull_request) Successful in 12m16s
ci / sdk (pull_request) Successful in 1m30s
ci / fuzz (pull_request) Successful in 4m50s
The selection screen shipped as presentation only: `F6 w` opened its
unavailable state, the rows were never read, and Enter on a wallet said
switching was not wired up. The catalogue, the create path and the screen
all existed; nothing joined them.

- `App::open_wallet_select` builds its rows from `Node::list_wallets` at
  the moment the screen opens (never cached from startup), and a failed
  read is the screen's own error state rather than "no saved wallets".
- `App::choose_wallet` resolves `WalletChoice::Open(index)` against the
  catalogue as it is now — the index is a position, and two saved wallets
  may share an identity key — then loads it. `+ create new wallet` still
  starts the existing create flow.
- `Node::open_wallet(filename)` is the load: it refuses a file the
  catalogue does not hold, re-points the sealed wallet-child record with a
  read-modify-write (the generated RPC creds survive), and restarts a
  running child onto the new file. An idle child takes the change on its
  next start.
- `App::new` starts on the selection screen when the catalogue is
  non-empty and on the create flow when it is empty, so a restart lands on
  the wallets it remembers and a first run has no dead empty list.
- The stored identity/locator stay catalogue columns: a locator rotates
  (F4) and identity is the roster key the node already holds, so the live
  header keeps reading them from the node.
- `SELECT_UNAVAILABLE` is gone with the state it described; docs/TUI.md
  now describes the wired behaviour.

Tests (both new): `Node::open_wallet` over an offline node — the chosen
file, the creds kept across the read-modify-write, the choice surviving a
reopen, and a non-catalogue file refused; and the app path in src/tui.rs
over a real store-backed node — start screen both ways, catalogue mapping,
row index over a shared identity, the create row, and a wallet recorded
after startup appearing the next time the list opens.
2026-09-21 11:43:07 -04:00
agent
d96de1d7f0
tui: wallet selection screen (F6 -> w) with create as the last row
Screen::WalletSelect: a table of saved wallets — name, identity prefix,
locator prefix, creation day — the selected row's full identity and locator
under it, and a `+ create new wallet` row as the last item. j/k or arrows
move, Enter takes the choice, Esc back. Empty, failed and in-flight reads
each get their own copy; a wallet with a NULL label, no published locator or
no usable timestamp reads `(unlabelled)` / `-` / `unknown` rather than blank.

Presentation only. Rows are plain display data (WalletRow) built by the
caller; the render path never reads the store, and the selection is by row
index because two records may share an identity key. Loading a chosen record
into the session is the wallet-store integration step, so the F6 `w` entry
opens the screen on its unavailable state until that accessor lands, and the
create row works today either way.

Evidence: tests/tui_select.rs (16 tests) drives the real draw path through
TestBackend at 80x24, 120x40 and 200x60, pins the dumped frame's footer to
status_footer_phased(..., wallet_select_footer_hint()), asserts exactly one
focus marker, a cell-width line budget from 20 to 200 columns, the window
disclosure with the create row always visible, hostile labels (ESC/BEL/C1/
bidi/newline/tab) and the crate-local UTC date formatter.

(cherry picked from commit 99a4ab640e)
2026-09-21 11:15:44 -04:00
dd7c749373 Merge pull request 'node: remember a created wallet in the store catalogue' (#143) from wt/t_511023b6 into wt/t_64c9ba3c
Reviewed-on: #143
2026-09-21 15:10:36 +00:00
5f1500191e Merge pull request 'tui: wallet selection screen (F6 -> w) with create as the last row' (#142) from wt/t_14ac0a3f into main
Some checks failed
android-ci / android (push) Has been cancelled
ci / test (push) Successful in 7m32s
ci / sdk (push) Successful in 1m14s
ci / fuzz (push) Successful in 4m58s
Reviewed-on: #142
2026-09-21 15:10:17 +00:00
49756d2a2d Merge branch 'main' into wt/t_14ac0a3f
Some checks failed
ci / test (pull_request) Successful in 5m56s
android-ci / android (pull_request) Has been cancelled
ci / sdk (pull_request) Successful in 1m30s
ci / fuzz (pull_request) Has been cancelled
2026-09-21 15:10:10 +00:00
948d9b4b0c Merge pull request 'store: a wallet catalogue in the encrypted db (wallets table + CRUD)' (#141) from wt/t_64c9ba3c into main
All checks were successful
ci / test (push) Successful in 6m0s
ci / sdk (push) Successful in 1m35s
android-ci / android (push) Successful in 11m56s
ci / fuzz (push) Successful in 4m51s
Reviewed-on: #141
2026-09-21 15:09:45 +00:00