Commit graph

321 commits

Author SHA1 Message Date
agent
1aecbbee72
change app icon 2026-09-13 21:15:16 -04:00
11510d3993 Merge pull request 'feat(android): wallet screen + SDK payment surface' (#65) from feat/android-wallet into main
All checks were successful
ci / test (push) Successful in 3m55s
ci / sdk (push) Successful in 57s
Reviewed-on: #65
2026-09-13 19:48:00 +00:00
agent
9c4067d09e
fix(tui): clippy question_mark / unwrap_or_default in open_wallet
All checks were successful
ci / test (pull_request) Successful in 4m8s
ci / sdk (pull_request) Successful in 1m2s
CI clippy -D warnings failed on the match arms in src/tui.rs:1603.
2026-09-13 15:34:39 -04:00
agent
7cf98bb9fe
feat(android): wallet screen and SDK payment surface
Some checks failed
ci / test (pull_request) Failing after 4m1s
ci / sdk (pull_request) Successful in 1m27s
Expose wallet balance/address/transfers plus one-shot invoice and tip on
the UniFFI SDK. Wire a Compose wallet route (QR, composers) without dropping
wipe-chat. Ignore machine-local android/.cargo NDK paths.
2026-09-13 15:27:57 -04:00
agent
dc52df2366
ci(release): authenticate Forgejo API with HTTP Basic
Bearer is rejected on this instance (403/1010). Use sirius + token, matching
the dispatch path that actually works.
2026-09-13 15:27:57 -04:00
agent
10d81964a5
feat: tip frame (sign/verify/encode/decode), wallet balance + receive address, F6 wallet screen with QR, dispatch Kind::Tip
Some checks failed
ci / test (push) Failing after 9m39s
ci / sdk (push) Failing after 20s
2026-09-12 23:13:22 -04:00
7b147d8ebe Merge pull request 'docs(readme): document local outbox, delivery UI, wallet no-spend, Android stack' (#64) from docs/readme-new-features into main
Reviewed-on: #64
2026-09-13 01:06:08 +00:00
agent
e979203c20
docs(readme): document local outbox, delivery UI, wallet no-spend, Android stack
README still claimed "peer down → send fails / no outbox" after the local
chat outbox, TUI/Android delivery markers, SDK SendState/outbox rows,
view-only wallet switch, zeroize, Keystore-wrapped passphrase, and
foreground keep-alive all landed on main. Align the operator-facing
summary with PROTOCOL.md / THREAT_MODEL.md / TUI.md / WALLET.md:

- intro + first-run: local outbox for chat, fail-closed for fil/rcp
- replace Fail closed section with Local outbox (chat) and fail closed
- Monero: prefer view-only + ONIONWIRE_WALLET_NO_SPEND
- seized laptop: zeroize + pending outbox rows in the same store
- Android: SendState/outbox rows, delivery UI, FGS keep-alive, Keystore;
  android-release is dispatch-only
- Not in v1: ban is server-side outbox only
2026-09-12 21:04:50 -04:00
a8aa3098c7 Merge pull request 'fix(sdk): send() returns SendState (Sent|Queued), and build the SDK in CI' (#51) from wt/t_9a29fd3c into main
All checks were successful
ci / test (push) Successful in 3m57s
ci / sdk (push) Successful in 57s
Reviewed-on: #51
2026-09-12 23:58:29 +00:00
448cb73170 Merge pull request 'feat(android): surface outbox delivery state in chat (queued/sending/delivered/failed)' (#56) from feat/android-outbox-state into wt/t_9a29fd3c
All checks were successful
ci / test (pull_request) Successful in 3m52s
ci / sdk (pull_request) Successful in 59s
Reviewed-on: #56
2026-09-12 23:58:15 +00:00
a948627896 Merge pull request 'feat(sdk): expose outbox rows (attempts + next attempt time) behind a queued chat message' (#58) from feat/sdk-outbox-rows into feat/android-outbox-state
All checks were successful
ci / test (pull_request) Successful in 3m55s
ci / sdk (pull_request) Successful in 54s
Reviewed-on: #58
2026-09-12 23:58:01 +00:00
t
fc2b2197c7
feat(android): chat row renders queued (try 3/8, retry 45s) from the SDK's outbox rows
All checks were successful
ci / test (pull_request) Successful in 3m55s
ci / sdk (pull_request) Successful in 1m2s
Consumes the SDK surface from PR #58 (`Wire.outbox(pubkeyHex)` →
`OutboxRow { messageId, status, attempts, nextAttemptAt, lastError }` and
`outboxMaxAttempts()`): a queued chat row now says *why* it is still queued
instead of a flat `queued`.

* `OutboxDetail.kt` — `retryInText` mirrors `src/tui.rs::retry_in_text`
  (`<= 0` → `retry now`; `< 60` → `retry {n}s`; else `retry {ceil-minutes}m`),
  and `outboxDetails` joins the SDK's rows onto the chat rows. The denominator
  is the core's `outboxMaxAttempts()`/`Rust` budget, fetched once — never 8.
* A terminal `"failed"` row keeps the marker's own `failed: <reason>` and gets
  **no** countdown: `nextAttemptAt` on a failed row is the last time it was
  scheduled for, so a countdown there would promise an attempt that never comes.
  `"sending"` stays bare, matching the TUI.
* `ChatScreen` polls the outbox rows on the same 2s cadence as the bodies and
  renders the countdown against an injectable `nowSeconds` (the store holds an
  absolute instant, the app computes the age).
* The join is positional — `ChatMessage` carries no `messages.id` — and
  fail-closed: mismatched row counts, an unknown status, or a status that
  contradicts the one the SDK resolved for that message drops every detail and
  leaves the flat markers. `ChatMessage.id` would remove the positional part;
  filed as follow-up.
* `OutboxDetailTest` (17 tests) asserts the three `retry_in_text` buckets, the
  `queued (try 3/8, retry 45s)` wording, that a failed row shows no countdown,
  that the denominator comes from the caller, and the three fail-closed cases.
  32 unit tests, 0 failures.

Android base: PR #56 (`feat/android-outbox-state`, t_f46a9863) — the Android
half of the #52/#56 duplicate pair, which is not merged here. SDK base: PR #58
on PR #51.
2026-09-12 19:16:45 -04:00
rust-dev
7b68cb4a9f
feat(sdk): ChatMessage.id — join a chat row to its outbox row
`OutboxRow::message_id` documents itself as *the* join key (the
`messages.id` a `ChatMessage` belongs to), but the record carried no id,
so the Android client could only pair the two lists positionally.

Add `ChatMessage.id: i64` as the first field, copied straight from the
`messages.id` the store already selects. Additive over UniFFI: Kotlin
consumers only gain a constructor field and the bindings regenerate.

The id mapping moves into a `chat_message` helper so the join property is
testable without a Node: the new test builds a real store, queues an
outbox row for a message, and asserts the id on the message equals the
`message_id` the outbox row reports for that same row.

# Conflicts:
#	crates/onionwire-sdk/src/lib.rs
2026-09-12 19:16:45 -04:00
rust-dev (hermes)
56bd8845e7
feat(sdk): expose the outbox rows behind a queued chat message
The TUI can say why a queued row is still queued ('queued (try n/8,
retry 45s)') because it reads OutboxEntry::attempts and next_attempt_at
directly. The SDK exposed neither: ChatMessage.delivery is a flat
'queued'/'sending'/'failed: <reason>' string and Wire had no outbox
accessor, so an Android chat row could only invent a countdown.

Adds OutboxRow { message_id, status, attempts, next_attempt_at,
last_error } and Wire::outbox(pubkey_hex) over Node::outbox_pending, plus
outbox_max_attempts() so the client renders 'try n/8' against the core's
own budget instead of a hardcoded 8. Additive: Wire::send() and
ChatMessage.delivery are untouched.

# Conflicts:
#	crates/onionwire-sdk/src/lib.rs
2026-09-12 19:16:45 -04:00
apk-dev
c4b824a83d
feat(android): surface outbox delivery state in chat
Renders the core's own Queued/Sending/Sent/Failed per outgoing row instead of
implying a message either sent or did not: a clock for queued, a progress
spinner for sending, a double-check for delivered and an error marker with the
short reason for a terminal failure, plus a chat-level `N queued` footer that
keeps a fail-closed `send failed: <reason>` statement on screen.

States are read verbatim from ChatMessage.delivery (Node::outbox_status_of_message
over UniFFI) — no parallel enum, nothing guessed from a timeout. A missing or
unrecognised status renders as queued, never delivered.

WireViewModel.send() now returns the SDK SendState instead of dropping it, so the
composer can say a send is queued rather than pretend it landed, and the empty-chat
copy no longer claims 'there is no outbox in v1'.

Accessibility: every marker carries an explicit contentDescription sentence and a
test tag; the glyph is never what a screen reader announces.
2026-09-12 19:16:44 -04:00
agent
f2dcd79d5c
fix(sdk): surface Sent/Queued on send(), and build the SDK in CI
All checks were successful
ci / test (pull_request) Successful in 3m56s
ci / sdk (pull_request) Successful in 53s
Node::send() became Result<OutboxStatus, String> in the local-outbox work,
which broke crates/onionwire-sdk — and nothing noticed, because the SDK is a
separate cargo workspace that root CI never compiles.

- Wire::send() returns WResult<SendState> (Sent | Queued)
- ChatMessage.delivery for outgoing rows
- New sdk job in ci.yml (own target volume; rustls workspace)
- Refresh SDK Cargo.lock + README (SQLCipher / outbox facts)

Rebased onto main after #50/#54: no src/node.rs changes (WAL checkpoint lives
in Store now). README at-rest claims kept from #55.
2026-09-12 19:16:42 -04:00
997b554bf1 Merge pull request 'ci(release): android-release cannot be woken by a CI-created tag — make it dispatch-only' (#63) from wt/t_95e0d607 into main
Reviewed-on: #63
2026-09-12 23:11:24 +00:00
7f8a1959df Merge branch 'main' into wt/t_95e0d607 2026-09-12 23:10:13 +00:00
2cf055c1e8
ci(release): android-release is dispatch-only; a CI-created tag cannot wake it
Neither decoupled trigger fires on Forgejo 10.0.3: a tag created by the CI
(API or git push) is an Actions-user push and is not dispatched back into
Actions, and reusable workflows need Forgejo >= 12. The release procedure is
therefore two dispatches: release.yml, then android-release with that tag.
2026-09-12 18:55:58 -04:00
7435ce42f5
ci(release): create the release tag with git push so the Android job fires
POST /tags sends no push event on this Forgejo (the v0.2.0 tag it created
produced no android-release run), so the tag is now created locally and
pushed, which does fire android-release.yml's `push: tags` trigger.
2026-09-12 18:49:14 -04:00
0c12abfa32 Merge pull request 'ci(release): manual, batched releases — no release on every merge' (#62) from wt/t_95e0d607 into main
Reviewed-on: #62
2026-09-12 22:29:20 +00:00
70ae597abc Merge branch 'main' into wt/t_95e0d607 2026-09-12 22:29:07 +00:00
46cff770ab Merge pull request 'feat(tui): join outbox rows to chat rows by message id (drop the body match)' (#50) from feat/tui-msgid-join into main
All checks were successful
release / x86_64 (push) Successful in 1m56s
release / aarch64 (push) Successful in 2m26s
release / publish (push) Successful in 12s
ci / test (push) Successful in 3m57s
release / version (push) Successful in 2s
Reviewed-on: #50
2026-09-12 22:11:26 +00:00
18ccab5464 Merge branch 'main' into feat/tui-msgid-join
All checks were successful
ci / test (pull_request) Successful in 4m10s
2026-09-12 22:10:54 +00:00
175cb58aba Merge pull request 'fix(store): checkpoint the WAL on the store's own keyed connection' (#54) from feat/store-checkpoint-wal into main
Some checks are pending
ci / test (push) Waiting to run
release / version (push) Waiting to run
release / aarch64 (push) Blocked by required conditions
release / x86_64 (push) Blocked by required conditions
release / publish (push) Blocked by required conditions
Reviewed-on: #54
2026-09-12 22:10:10 +00:00
111e90ce0a Merge branch 'main' into feat/store-checkpoint-wal
All checks were successful
ci / test (pull_request) Successful in 4m18s
2026-09-12 22:09:58 +00:00
c55dfd2492 Merge pull request 'feat(android): foreground service keeps the onion reachable through Doze' (#60) from feat/android-foreground-keepalive into main
Reviewed-on: #60
2026-09-12 22:08:46 +00:00
5032243934 Merge branch 'main' into feat/android-foreground-keepalive 2026-09-12 22:08:35 +00:00
6c9fd00b8a
ci(release): manual, batched releases — no release on merge
All checks were successful
ci / test (pull_request) Successful in 3m49s
Drop `push: branches: [main]` from both release workflows. release.yml now
runs only via workflow_dispatch, with bump (default minor), version, tag and
dry_run inputs; contradictory input is rejected instead of guessed at.

android-release.yml keeps the Android assets on the same tag by subscribing to
`push: tags: v*.*.*`: creating a tag over the API sends the same push
notification a git push does, so the core's tag wakes it. No workflow_call —
this Forgejo is 10.0.3, where reusable workflows are not supported.

docs/RELEASING.md is the policy and procedure.
2026-09-12 17:57:15 -04:00
dc4ed84a19 Merge pull request 'docs: README at-rest claims match the SQLCipher store (stale since #43)' (#55) from wt/t_f2fc5190 into main
Reviewed-on: #55
2026-09-12 21:21:06 +00:00
t
d256d3bb8e
docs: describe the SQLCipher store, not the pre-#43 design
The v0.2 banner and the "Seized laptop" section still claimed only chat
bodies were encrypted, that `self.identity_sk` and the roster were
plaintext, and that "sqlcipher is out of v1". That has been false since
#43.

- README banner: whole store is encrypted at rest with SQLCipher, with the
  row-bound AEAD layer kept on top.
- "Seized laptop": whole-file SQLCipher (Argon2id key over the 16-byte
  `store_salt`, raw `PRAGMA key`), identity/friends/locators inside the
  encrypted file, fail-closed unlock and `store_salt`-missing refusal, and
  the in-place v0.2.1 upgrade. Kept the honest caveats: no defense against
  a live compromise or a known passphrase, `/wipe` is not a forensic erase
  (SSD wear-levelling), and THREAT_MODEL.md stays the reference.
- "Not in v1": drop `sqlcipher` (shipped in #43).
- docs/SECURITY_AUDIT.md "Still true" bullet repeated the same plaintext
  claim; restated it as the residual risk that actually remains.

No code change. Evidence: cargo test --test store (21 passed, incl.
whole_store_file_is_encrypted_at_rest) and cargo test --lib -- store::
(6 passed, incl. the plaintext->SQLCipher upgrade and the wrong-passphrase
no-op).

Card: t_f2fc5190
2026-09-12 17:20:56 -04:00
rust-dev
2cbe7d41e5
feat(tui): join outbox rows to chat rows by message id
All checks were successful
ci / test (pull_request) Successful in 4m12s
`chat_with_delivery` matched pending outbox rows to chat rows by body
because `store::Message` carried no id, so an older send that was still
queued showed a delivered mark whenever a newer send of the same text had
already crossed the circuit.

`store::Message` now carries its `messages.id`, and the TUI joins
`OutboxEntry::message_id` == `Message::id`. The body match and its
newest-first fallback are gone.

`list_messages()` keeps its signature; callers that do not need the id
are untouched.
2026-09-12 17:12:30 -04:00
02b531625f Merge pull request 'feat(sdk): explicit Tor lifecycle — Wire.shutdown / flush / torState + observable state' (#49) from feat/tor-lifecycle into main
All checks were successful
ci / test (push) Successful in 4m17s
release / version (push) Successful in 2s
release / x86_64 (push) Successful in 1m55s
release / aarch64 (push) Successful in 2m25s
release / publish (push) Successful in 11s
Reviewed-on: #49
2026-09-12 20:58:31 +00:00
apk-dev
e923e06891
feat(android): keep the onion published through Doze with a foreground service
WireViewModel owned the single Wire node and called shutdown() from
onCleared(), so a backgrounded node died with the UI. Node lifetime is now
arbitrated by a pure policy (NodeLifetime) with two anchors — UI and
keep-alive — and one process-wide owner (NodeHost) that is the only caller
of flush()/shutdown() in the app.

KeepAliveService holds the process in the foreground behind an ongoing
notification from the "keep-alive" channel, started on unlock and stopped
by Lock or the notification action, so peers can still reach the device
while the screen is off.

- foregroundServiceType="specialUse": dataSync is documented as a finite
  transfer (upload/download/backup) and this is an always-on node
- POST_NOTIFICATIONS requested when the node becomes reachable; denial
  keeps the service running with no visible notice instead of failing
- re-unlock with a node the service kept alive adopts it rather than
  reopening the store the live node still holds
- 9 device-free unit tests for the start/stop/re-unlock state machine
2026-09-12 16:34:40 -04:00
cecad2b364 Merge pull request 'feat(tui): per-message outbox delivery state (queued/sending/sent/failed) + N queued footer' (#48) from feat/tui-outbox-state into main
All checks were successful
release / x86_64 (push) Successful in 1m52s
release / aarch64 (push) Successful in 2m25s
release / publish (push) Successful in 12s
ci / test (push) Successful in 6m1s
release / version (push) Successful in 2s
Reviewed-on: #48
2026-09-12 20:32:39 +00:00
a50df7ee43 Merge pull request 'feat(core): zeroize the profile/loc signing copy and the TUI passphrase buffer' (#47) from feat/zeroize-tui-profile into main
Some checks failed
release / version (push) Waiting to run
release / aarch64 (push) Blocked by required conditions
release / x86_64 (push) Blocked by required conditions
release / publish (push) Blocked by required conditions
ci / test (push) Has been cancelled
Reviewed-on: #47
2026-09-12 20:31:46 +00:00
beb523bdde Merge pull request 'wallet: no-spend (view-only) mode + RPC view-only detection + docs/WALLET.md' (#41) from feat/wallet-no-spend-view-only into main
All checks were successful
ci / test (push) Successful in 4m2s
release / version (push) Successful in 3s
release / x86_64 (push) Successful in 1m51s
release / aarch64 (push) Successful in 2m28s
release / publish (push) Successful in 10s
Reviewed-on: #41
2026-09-12 20:08:08 +00:00
t
2c3d9fd176
fix(store): checkpoint the WAL on the store's own keyed connection
All checks were successful
ci / test (pull_request) Successful in 4m23s
The WAL checkpoint that `Node::shutdown`/`flush` promise ran through a
short-lived second connection that no longer works: since the SQLCipher
store every db is encrypted and its key lives inside `Store`, so an
unkeyed second connection reads the file as noise and the checkpoint
degenerated to "store is SQLCipher-encrypted — skipped (file is not a
database)".

`Store::checkpoint_wal()` now runs `PRAGMA wal_checkpoint(TRUNCATE)` on
the connection `Store` owns, and `wipe_messages` reuses it instead of its
inline copy. The node-side helper and its doc caveat are gone; the
offline test moves with the code into `store.rs` and runs against a real
encrypted store (it failed on the old implementation with exactly the
SQLITE_NOTADB skip above). The live shutdown test now checks the WAL is
0 bytes after `flush` on a bootstrapped node.

Public signatures of `Node::shutdown`/`flush` are unchanged.
2026-09-12 15:56:33 -04:00
t
e3be8ffdd0
feat(core): zeroize the profile/loc signing copy and the TUI passphrase buffer
All checks were successful
ci / test (pull_request) Successful in 4m14s
The Ed25519 identity secret was still copied into a bare [u8; 32] on the
stack in two signers (profile::sign, loc::sign), and the TUI kept the
typed backup/restore passphrase in a plain String for the life of the
screen. Both now go through Zeroizing:

- profile::signing_key_bytes() builds the 32-byte copy into a
  Zeroizing<[u8; 32]> (same pattern as pay::sign_bytes / qr::encode,
  but with copy_from_slice so no Copy temporary is left behind);
  loc::sign shares the helper instead of making its own copy.
- Screen::Passphrase now owns a PassphraseEntry whose buffers are
  Zeroizing<String>. Every exit path (Enter, mismatch, Esc) calls
  close(), which wipes both buffers eagerly; a drop — including Ctrl-Q
  and a panic — is the backstop.

Evidence: tests/zeroize.rs gains a drop probe (ManuallyDrop +
drop_in_place + read_volatile) on the Zeroizing signing buffer and a
length-rejection test; src/tui.rs gains unit tests asserting the buffer
types and that close() leaves every byte of the passphrase's heap
capacity zeroed.
2026-09-12 15:41:54 -04:00
Sirius DevOps
323100b162
wallet: no-spend mode + view-only detection over RPC
All checks were successful
ci / test (pull_request) Successful in 4m11s
/tip needs monero-wallet-rpc `transfer`, which a view-only wallet cannot do.
With ONIONWIRE_WALLET_NO_SPEND=1 (`1`/`true`/`yes`/`on`) `Wallet::transfer`
refuses locally, before any RPC dial, and /pay + receipt verification are
unchanged.

When a transfer does fail, ask the documented signal before surfacing the raw
wallet error: `query_key` key_type=spend_key answers
WALLET_RPC_ERROR_CODE_WATCH_ONLY (-29) on a view-only wallet
(wallet_rpc_server.cpp on_query_key). Both paths return one sentence —
"wallet is in view-only/no-spend mode — /tip is disabled; /pay and receipt
verification still work". Fail closed: if the probe cannot answer, the wallet's
own error stands; no fabricated detection.

New docs/WALLET.md: --generate-from-view-key / generate_from_keys watch-only
setup, --rpc-login Digest, why loopback still needs auth, the local
spend-authority warning, and the detection trade-off (a spend-capable wallet
answers the probe with its spend key, which is discarded). Linked from
docs/THREAT_MODEL.md.
2026-09-12 15:41:33 -04:00
agent
48c06df2cf
docs(sdk): Wire::shutdown doc said the second call returns Ok; it returns Stopped
All checks were successful
ci / test (pull_request) Successful in 4m22s
The handle-level call takes the node out on the first shutdown, so a second
call reports the typed `WireError::Stopped` (covered by
`calls_after_shutdown_are_typed_errors_not_panics`). Only the node-level
`Node::shutdown()` is Ok-idempotent. The rustdoc claimed otherwise.
2026-09-12 15:26:17 -04:00
apk-dev
c068e292a0
feat(android): stop the node when the UI goes away
`WireViewModel.lock()` set `wire = null` and `onCleared()` did not exist at all,
so neither the user pressing Lock nor the Activity finishing stopped anything:
Arti kept its client and the hosted onion service, the outbox worker kept
dialing, and the sqlite connection stayed open behind the JNI handle.

Both paths now go through `stopNode(Wire)`:

1. `flush()` — one last bounded drain, so a queued message gets its chance
   before the process may lose its socket.
2. `shutdown()` — drain again with a shorter budget, stop the onion service,
   abort the retry worker, checkpoint the WAL, and take the node handle out of
   the `Wire` (which is what releases the last Arc to the Tor client and the
   store).

Both run on a process-scoped `TEARDOWN` scope (`SupervisorJob` + `Dispatchers.IO`)
because `onCleared()` runs *after* `viewModelScope` is already cancelled. Errors
are deliberately swallowed there: the UI is gone, and the SDK reports a second
teardown as the typed `WireException.Stopped` rather than a panic.

`unlock()` joins any in-flight teardown before opening again. The old node holds
the sqlite file and Arti's state lock until its teardown returns, and racing it
makes the next `openWire` fail.

A process killed outright (Doze, background-process killer, force-stop) still
never runs any of this — that is what the sqlite outbox and the new `flush()`
are for. The foreground-service card (`t_5bf32cd3`) moves this ownership from
the ViewModel to the service.
2026-09-12 15:10:29 -04:00
apk-dev
38fde75d40
feat(core,sdk): explicit Tor lifecycle — stop, flush, observable state
A node had no way to stop. `Wire` was a bare handle over a `Node`: dropping the
Kotlin reference left Arti's client, the hosted v3 onion service, the outbox
retry worker and the sqlite connection alive, and there was no way to ask where
the onion service was. On Android the process is killed without warning by Doze
and the background-process killer, so "drop everything when the process dies" is
not a lifecycle.

Core (`src/node.rs`, `src/hs.rs`):

* `Node::shutdown()` — bounded outbox drain (10s), stop the onion service (the
  rendezvous task is aborted and the RunningOnionService dropped), abort the
  retry worker, checkpoint the sqlite WAL. Idempotent at this level: the flag is
  swapped first, so a racing second call is a no-op.
* `Node::flush() -> FlushOutcome { attempted, delivered, remaining }` — one
  delivery attempt for every queued outbox row, ignoring backoff, then a WAL
  checkpoint. Bounded by 30s because a dead peer's onion holds a dial for ~20s
  and the caller is a UI thread. A timeout leaves rows in `sending`;
  `Outbox::reset_stale` requeues them on the next unlock, same as a process that
  died mid-attempt.
* `Node::tor_state() -> TorState` (`Bootstrapping` / `Published` /
  `DegradedReachable` / `Stopped`) and `hs::tor_state_of(state, stopped,
  reachable)`, which mirrors `hs_is_ready` exactly instead of re-deriving
  readiness.
* Every network entry point (`send`, `send_once`, `connect_onion`, `rotate`,
  `flush`) fails with a typed error after the node stops, rather than dialing a
  dead client.
* `checkpoint_wal` reaches the database through a short-lived second connection:
  `Store` owns the write connection and does not lend it out, and a checkpoint is
  a property of the database, not of one connection. Best effort — WAL replay on
  open recovers anything committed.

The `WorkerHandle` moved into a `Mutex<Option<...>>` so the teardown can *abort*
the retry worker instead of only dropping it when the whole `Node` dies.

SDK (`crates/onionwire-sdk/src/lib.rs`):

* `Wire.shutdown()`, `Wire.flush(): FlushOutcome`, `Wire.torState(): TorState`.
  `Wire` now holds `Mutex<Option<Arc<Node>>>`, so teardown drops the last
  reference to the Tor client and the store instead of keeping them alive behind
  a JNI handle.
* `WireError::Stopped` — a second flat variant, so "you must unlock again" is a
  typed `WireException.Stopped` in Kotlin, not a string match on `Failed`.
* No `unwrap()` on a poisoned mutex anywhere: a poisoned handle reports
  `Stopped`, which is the correct recovery (unlock again).
* Fixes the crate not compiling on this base at all: `Node::send` has returned
  `Result<OutboxStatus, String>` since the outbox landed, and the SDK still
  mapped it to `Result<(), String>` (E0308). CI's path allowlist excludes
  `crates/**` from the Rust job, which is why it stayed green.

The live Tor test found a real bug in the first version of `tor_state`: Arti's
combined status is still `Bootstrapping` after a *successful* probe of our own
onion (that mismatch is what the 360s publish wait exists for), and a freshly
launched service reports `Shutdown` before its publish reactor starts — so a
node that was live and reachable reported `Bootstrapping`, and briefly
`Stopped`, right after unlock. `Node` now tracks an `onion_reachable` flag set
when the publish bar is crossed and cleared when `rotate` hard-cuts the service,
and `Shutdown`/`Broken` on a live node read `Bootstrapping` (transient) rather
than terminal.
2026-09-12 15:10:29 -04:00
c39259b919 Merge pull request 'feat(core): zeroize in-memory secret material (Noise/Ed25519/X25519/store key)' (#46) from feat/zeroize-secrets into main
All checks were successful
ci / test (push) Successful in 3m54s
release / version (push) Successful in 2s
release / x86_64 (push) Successful in 1m53s
release / aarch64 (push) Successful in 2m27s
release / publish (push) Successful in 11s
Reviewed-on: #46
2026-09-12 19:06:58 +00:00
8eb0820df0 Merge branch 'main' into feat/zeroize-secrets
All checks were successful
ci / test (pull_request) Successful in 6m33s
2026-09-12 19:06:50 +00:00
2a53bc2b89 Merge pull request 'feat(outbox): local chat retry queue — queue sends and retry with backoff' (#45) from feat/local-outbox into main
Some checks failed
release / version (push) Waiting to run
release / aarch64 (push) Blocked by required conditions
release / publish (push) Blocked by required conditions
release / x86_64 (push) Blocked by required conditions
ci / test (push) Has been cancelled
Reviewed-on: #45
2026-09-12 19:06:14 +00:00
t
b79f1fd6f3
feat(tui): per-message outbox delivery state + N queued footer
All checks were successful
ci / test (pull_request) Successful in 4m9s
Chat rows now carry the state the local outbox actually holds: `✓` delivered,
`◷ queued (try n/8, retry 45s)` while the retry worker still has it, `» sending`
mid-attempt and `✗ failed: <short reason>` once attempts are exhausted. The
footer replaces the flat `sent` / `send failed` copy with the live count
(`2 queued`), and keeps a fail-closed `send failed: …` statement as long as any
row is terminally failed.

States come from the outbox API (`Node::outbox_pending` → `Queued` / `Sending` /
`Failed`; a delivered row is deleted, so absence is `Sent`). No parallel state
model, no new wire prefix. Every new glyph has an ASCII fallback (`ok` plus the
state word) exercised by a test.

- `chat_with_delivery()` / `delivery_tag()` / `retry_in_text()` /
  `short_send_reason()` / `OutboxSummary::note()` are pure and unit-tested.
- `draw_chat()` is now the real chat-pane renderer (extracted from
  `App::draw_main`) so width/wrap is testable without a `Node`.
- docs/TUI.md: delivery markers, copy, and the 80x24 floor / 120x40 target.

Verified: cargo test 26/26 suites ok (tui_spec 20/20, incl. a real Store +
Outbox::send -> pending() -> render path); clippy --all-targets -D warnings clean.
2026-09-12 14:44:35 -04:00
Sirius DevOps
d6d157765a
feat(outbox): local retry queue for chat sends
All checks were successful
ci / test (pull_request) Successful in 4m8s
Queue a chat send locally when the peer's v3 onion is unreachable and retry
it with exponential backoff (30s doubling, capped at 30 min, 8 attempts then
terminal Failed). Still peer-to-peer: no server, no store-and-forward relay,
no new frame prefix — every attempt is a fresh Noise IK handshake.

- src/outbox.rs: Outbox + Deliverer + ArtiDeliverer, pure backoff_secs(),
  is_permanent_send_error(), background worker (15s scan).
- store: `outbox` table (no body column — the body is read from the joined
  messages row, under that row's existing AEAD + AAD), append_message_id(),
  queue/due/pending/mark_* helpers, reset_sending_outbox(), wipe.
- Node::send() returns Result<OutboxStatus, String> (Sent/Queued) instead of
  Err on transport failure; protocol errors still fail immediately and are
  never queued.
- Retry triggers: timer, unlock/foreground (spawn_flush_all), and "that peer
  was just seen" (handshake or connect_onion -> spawn_flush_friend).
- File transfer and payment/rcp frames stay fail-closed.
- docs/PROTOCOL.md + docs/THREAT_MODEL.md: replace the no-queue statements;
  add the seizure/cadence delta to the threat model.

src/tui.rs gets one forced arm change (Ok(()) -> Ok(_)); UI surfacing is
child card t_d9a5b065.
2026-09-12 14:39:14 -04:00
acb6c7dd65 Merge pull request 'feat(android): wrap the store passphrase in the Android Keystore' (#44) from feat/android-keystore-store-passphrase into main
Reviewed-on: #44
2026-09-12 18:29:19 +00:00
bf9900f9dc Merge branch 'main' into feat/android-keystore-store-passphrase 2026-09-12 18:29:10 +00:00