Commit graph

120 commits

Author SHA1 Message Date
Hermes apk-dev
4bc0d6684d
fix(android): surface the outbox send state instead of denying it
The SDK has returned `SendState` and a per-row `ChatMessage.delivery` since
the local outbox landed, but the app still said "there is no outbox in v1"
and threw the state away.

- `WireViewModel.send()` returns `SendState`; `ChatScreen` no longer discards
  it. A `QUEUED` send raises a "local-only until the retry worker gets a
  circuit through" hint instead of pretending success.
- Outgoing rows render the TUI's delivery markers from `ChatMessage.delivery`
  (`✓` / `◷ queued` / `» sending` / `✗ failed: <reason>`), plus the TUI's
  `{n} queued` footer while the outbox still owns rows. Incoming rows stay
  unmarked; an unreadable state renders no marker rather than a tick.
- The empty-chat copy describes the outbox (8 attempts, backoff capped at
  30 min, local-only until it lands) instead of denying it exists.
- New pure `Delivery.kt` so the vocabulary is unit-testable without a device.

Verified: `./gradlew :app:assembleDebug :app:testDebugUnitTest` → BUILD
SUCCESSFUL, 15 tests / 0 failures (10 new), APK contains the new copy and no
longer the "There is no outbox" string. Stacked on the SDK fix (PR #51).
2026-09-12 17:13:45 -04:00
Hermes rust-dev
0de5f7b220
fix(sdk): surface Sent/Queued on send(), and build the SDK in CI
All checks were successful
ci / test (pull_request) Successful in 3m2s
ci / sdk (pull_request) Successful in 55s
`Node::send()` became `Result<OutboxStatus, String>` in the local-outbox work,
which broke `crates/onionwire-sdk` (E0308 at src/lib.rs:195) — and nothing
noticed, because the SDK is a separate cargo workspace that root CI never
compiles and android-release.yml only builds on a v*.*.* tag.

- `Wire::send()` now returns `WResult<SendState>` (`Sent` | `Queued`) instead
  of swallowing the outcome as `()`. A queued send is local-only until the
  retry worker gets a circuit through, so the Kotlin boundary must be able to
  tell it apart from a delivered one.
- `ChatMessage` gains `delivery: Option<String>` ("sent" | "queued" |
  "sending" | "failed: <reason>"), populated from the message's outbox row;
  `None` for incoming messages. An outgoing row with no outbox row was accepted
  on the first attempt, so it reads "sent".
- New `sdk` job in `.forgejo/workflows/ci.yml`: `cargo test --locked` +
  `cargo clippy --locked --all-targets -- -D warnings` in `crates/onionwire-sdk`
  in the same rust:1.91-bookworm container, with its own target volume (the SDK
  resolves the root crate with rustls, so sharing the root job's target dir
  would thrash feature-unified artifacts).
- Drift found while un-rotting it: the SDK `Cargo.lock` was stale (missing
  `sha2`, added to the root crate by the zeroize work), so `--locked` failed;
  and the SDK README still said "no outbox, no spool in v1" and "identity keys
  in sqlite are plaintext", both untrue since the outbox and SQLCipher landed.

Tests: crates/onionwire-sdk 4 passed (2 new unit tests over the status
mapping), clippy clean; root `cargo test --locked` clean. The CI job body was
smoke-run locally in the same container image before being committed.
2026-09-12 17:12:33 -04:00
rust-dev
afff5f8dff
feat(tui): join outbox rows to chat rows by message id
All checks were successful
ci / test (pull_request) Successful in 3m27s
`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 14:34:43 -04:00
t
ebd3a306e8
feat(tui): per-message outbox delivery state + N queued footer
All checks were successful
ci / test (pull_request) Successful in 3m20s
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:22:38 -04:00
t
7c6de696a1
Merge remote-tracking branch 'origin/feat/local-outbox' into feat/tui-outbox-state
All checks were successful
ci / test (pull_request) Successful in 3m16s
2026-09-12 14:11:28 -04:00
4338e8aeb6 Merge pull request 'ci(android): publish APK/AAR from the Pi runner' (#38) from wt/t_0bbaca1b into main
Reviewed-on: #38
2026-09-12 18:06:58 +00:00
Sirius DevOps
068b655c19
feat(outbox): local retry queue for chat sends
All checks were successful
ci / test (pull_request) Successful in 3m22s
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 13:55:07 -04:00
Sirius DevOps
601eb35c4b
ci(android): publish APK/AAR from the Pi runner
Build stays on docker-amd64. Attach artifacts on the Pi so POST /releases
does not 422 from amd64 dind. Join v0.1.0 when that release is missing
the APK instead of minting patch+1.
2026-09-12 13:55:07 -04:00
e6e2a158a8 Merge pull request 'feat(tui): ASCII chrome, invite wrap, remaining copy' (#27) from wt/t_b02176dc into main
All checks were successful
ci / test (push) Successful in 3m16s
release / version (push) Successful in 3s
release / x86_64 (push) Successful in 1m53s
release / aarch64 (push) Successful in 2m24s
release / publish (push) Successful in 11s
Reviewed-on: #27
2026-09-12 17:47:52 +00:00
2b2ad573c0 Merge pull request 'fix(ci): Android APK build in debian:bookworm sibling container' (#30) from wt/t_87d7245b into main
Reviewed-on: #30
2026-09-12 13:43:38 +00:00
f01cb7b937 Merge branch 'main' into wt/t_87d7245b 2026-09-12 13:43:24 +00:00
81ae8556b9 Merge pull request 'ci(release): publish from the Pi; surface API 422s' (#37) from wt/t_2c84cd13 into main
Reviewed-on: #37
2026-09-12 13:23:16 +00:00
Sirius DevOps
30b0294c2b
ci(release): delete dangling tags from the publish job
The sibling cleanup job ran after a successful v0.1.0 publish (run 135)
because act leaves needs.publish.result unset, so != success is true.
It Early-terminated before deleting, but that is not a guard. Fold
fail-closed delete into publish as if: failure() and drop the extra job.
2026-09-12 03:01:14 -04:00
Sirius DevOps
9b7e72b257
ci(release): publish from the Pi; surface API 422s
Run 116 built both arches then POST /releases returned 422 six times
(--retry-all-errors) with no body, while sitting on docker-amd64 behind
android. Move publish to the Pi runner (same path as tag create) and
print the Forgejo error instead of retrying 4xx. README now matches the
core-only path filter and onionwire-ci-pi concurrency.
2026-09-12 02:51:07 -04:00
Sirius DevOps
63abd8eaf2
fix(ci): do not fail the Android verify pipe on SIGPIPE from head
All checks were successful
ci / test (pull_request) Successful in 2m44s
BUILD SUCCESSFUL produced a 33MB arm64 APK; pipefail + aapt|head then
exited 141 and dropped the artifacts before docker cp.
2026-09-12 02:23:34 -04:00
Sirius DevOps
c90c59146d
fix(ci): new android-release concurrency group so dry_run can queue
All checks were successful
ci / test (pull_request) Successful in 2m46s
2026-09-12 02:06:37 -04:00
Sirius DevOps
53ba1e857f
fix(android): point UniFFI --library at CARGO_TARGET_DIR
All checks were successful
ci / test (pull_request) Successful in 2m51s
CI sets CARGO_TARGET_DIR=/cargo-target. Bindgen still looked at
crates/onionwire-sdk/target/release/libonionwire_sdk.so and died ENOENT
after a green host compile.
2026-09-12 02:05:05 -04:00
fecec6c29a Merge pull request 'ci: skip cargo suite when the change cannot affect Rust' (#32) from wt/t_bc2f5c51 into main
Some checks are pending
ci / test (push) Waiting to run
Reviewed-on: #32
2026-09-12 05:44:13 +00:00
Sirius DevOps
1218869629
ci: skip cargo suite when the change cannot affect Rust
Some checks failed
ci / test (pull_request) Has been cancelled
Path allowlist on push-to-main and pull_request: src/, crates/, tests/,
Cargo.toml, Cargo.lock, and this workflow. workflow_dispatch still always
runs. No branch protections, so a skipped run is not a merge trap.
2026-09-12 01:42:01 -04:00
1e8d4057bb Merge pull request 'ci(release): apt retries, always-run publish, Pi concurrency' (#31) from wt/t_2c84cd13 into main
Some checks failed
ci / test (push) Failing after 2m42s
Reviewed-on: #31
2026-09-12 05:39:08 +00:00
Sirius DevOps
1e6a4c12b2
fix(ci): join latest tag when its release lacks the APK
All checks were successful
ci / test (pull_request) Successful in 2m45s
Core owns tag creation. If vN exists and the release is missing the
Android APK, attach there instead of minting N+1. Never delete tags.
Path filter is sources/Gradle only — README edits do not publish.
2026-09-12 01:37:40 -04:00
Sirius DevOps
ae9cd5728e
ci(release): do not mint a release for workflow-only edits
All checks were successful
ci / test (pull_request) Successful in 4m46s
Drop release.yml and build-release-local.sh from on.push.paths so a CI
tweak cannot cut a user-facing tag. Validate those files with dry_run
dispatch instead. release-body.md stays because it is the published body.
2026-09-12 01:35:13 -04:00
Sirius DevOps
eaea3d49f7
ci(release): apt retries on IPv4; never skip the publish job
All checks were successful
ci / test (pull_request) Successful in 3m39s
Concurrent dind rust containers looped on apt InRelease; abort and retry
with ForceIPv4. Publish always runs after version so cleanup is not
blocked by Forgejo act "'runs-on' key not defined" on a skipped job.
Do not bake a custom rust image on this card.
2026-09-12 01:30:16 -04:00
Sirius DevOps
87ab0d2869
fix(ci): use debian:bookworm for the Android sibling container
All checks were successful
ci / test (pull_request) Successful in 3m0s
eclipse-temurin:17-jdk-bookworm is not a published tag (manifest unknown).
debian:bookworm is current and has openjdk-17.
2026-09-12 01:16:28 -04:00
Sirius DevOps
c087b223e9
fix(ci): build Android APK in a bookworm sibling container
All checks were successful
ci / test (pull_request) Successful in 4m57s
node:20-bullseye (the amd64 job image) is EOL; apt-get there fails on
expired/404 security indexes. Run JDK 17 + SDK/NDK + cargo-ndk inside
eclipse-temurin:17-jdk-bookworm via docker create + stdin tar, matching
the Rust CI pattern. Fetch a static docker CLI if the job image lacks
one. On publish failure after creating a tag, delete that tag so the
next run retries the same version (first release stays v0.1.0).
2026-09-12 01:14:43 -04:00
3e72f40e0e Merge pull request 'fix(ci): Android APK build in bookworm sibling container' (#29) from wt/t_87d7245b into main
All checks were successful
ci / test (push) Successful in 3m40s
Reviewed-on: #29
2026-09-12 05:13:46 +00:00
3e28fa311c Merge pull request 'ci(release): install static docker CLI on amd64 jobs' (#28) from wt/t_2c84cd13 into main
Some checks failed
release / x86_64 (push) Failing after 19m52s
ci / test (push) Waiting to run
release / version (push) Successful in 3s
release / aarch64 (push) Successful in 3m30s
release / publish (push) Has been cancelled
release / cleanup (push) Has been cancelled
Reviewed-on: #28
2026-09-12 05:10:07 +00:00
Sirius DevOps
898b943485
ci(release): share ci.yml concurrency; make cleanup actually delete
Some checks failed
ci / test (pull_request) Failing after 2m51s
Use onionwire-ci-pi so cargo release builds cannot race tests on the
Pi's shared /target volume. Strip PAT newlines in cleanup and treat
publish skipped/failed as the signal to delete the tag this run created,
so the next run retries the same version instead of advancing.
2026-09-12 01:09:46 -04:00
Sirius DevOps
951439d7e2
ci(release): install static docker CLI on amd64 jobs
All checks were successful
ci / test (pull_request) Successful in 3m48s
The docker-amd64 runner's node:20-bullseye job image has no docker
binary (Pi jobs get one via the host socket mount). Fetch the upstream
static CLI so the rust:1.91-bookworm sibling build can run.
2026-09-12 01:03:22 -04:00
4a248f5b73 Merge pull request 'feat(android): auto-publish signed APK and AAR from CI' (#26) from wt/t_87d7245b into main
All checks were successful
ci / test (push) Successful in 3m8s
Reviewed-on: #26
2026-09-12 04:59:41 +00:00
Sirius DevOps
c8693d2006
fix(ci): android-release HTTPS apt mirrors and dry_run input
All checks were successful
ci / test (pull_request) Successful in 7m9s
dind timed out on http://deb.debian.org:80. Flip sources to HTTPS.
Do not let workflow_call's boolean false clobber dispatch dry_run.
2026-09-12 01:00:42 -04:00
Sirius DevOps
1c4aaefb01
feat(android): auto-publish signed APK and AAR from CI
Some checks failed
ci / test (pull_request) Failing after 3m13s
Push to main that touches android/** builds a release APK + SDK AAR on
docker-amd64, verifies size/ABI/signature, and create-or-joins the Forgejo
release. Version is latest v*.*.* patch+1, or v0.1.0 when there are no tags.
Release signing uses repo secrets (ANDROID_KEYSTORE_*), not the debug key.
2026-09-12 00:54:17 -04:00
Sirius DevOps
35b8caa716
feat(tui): ASCII chrome, invite wrap, alert truncate, remaining copy
Some checks failed
ci / test (pull_request) Failing after 4m39s
ONIONWIRE_ASCII (and NO_COLOR) switches truncation to ... and ASCII
borders. Share/paste wrap at : so a mouse-copy cannot lose a mid-hex
line. Alerts truncate to the frame; empty threads and paste errors keep
the next-step hint. Skip the optional 40-row wordmark.
2026-09-12 00:54:16 -04:00
2b704ba464 Merge pull request 'ci(release): auto-tag and publish aarch64+x86_64 on main' (#25) from wt/t_2c84cd13 into main
Some checks failed
ci / test (push) Has been cancelled
release / version (push) Successful in 5s
release / x86_64 (push) Failing after 6s
release / aarch64 (push) Successful in 2m30s
release / publish (push) Failing after 0s
release / cleanup (push) Successful in 15s
Reviewed-on: #25
2026-09-12 04:54:09 +00:00
Sirius DevOps
58e10a0bc0
ci(release): honor dry_run input and send JSON Content-Type
Some checks failed
ci / test (pull_request) Failing after 4m1s
Forgejo dispatch passes string inputs; boolean dry_run stayed false and
tried to mint v0.1.0. Strip PAT newlines so Authorization does not eat
the next header (422 Empty Content-Type).
2026-09-12 00:55:18 -04:00
Sirius DevOps
111b95c3ae
ci(release): auto-tag and publish aarch64+x86_64 on main
Some checks failed
ci / test (pull_request) Failing after 2m16s
Drop the tag-push trigger so API-created tags cannot start a second run.
Core paths on main (or workflow_dispatch) mint the next v*.*.* tag
(v0.1.0 when none exist), build both arches in CI, and publish one
release. dry_run builds without tagging. Fail closed on empty assets.
2026-09-12 00:52:46 -04:00
33beeded92 Merge pull request 'feat(tui): fail-closed footer, 1-line header, help overlay' (#24) from wt/t_0d3b0f80 into main
All checks were successful
ci / test (push) Successful in 2m48s
Reviewed-on: #24
2026-09-12 04:25:07 +00:00
Sirius DevOps
7d3e1bd627
test(tui): keep send-failed visible in crowded status_footer
All checks were successful
ci / test (pull_request) Successful in 3m5s
PR #23 locked the old drop. Flip status_footer_drops_send_failed_when_crowded
to assert the note stays at 80/120/200 with TOR, me:, and ? help.
2026-09-12 00:22:04 -04:00
Sirius DevOps
494a0e4099
Merge remote-tracking branch 'origin/main' into wt/t_0d3b0f80 2026-09-12 00:20:26 -04:00
53f9914be5 Merge pull request 'docs(tui): visual audit, before frames, and design spec' (#23) from wt/t_3c2d56df into main
All checks were successful
ci / test (push) Successful in 3m39s
Reviewed-on: #23
2026-09-12 04:15:38 +00:00
Sirius DevOps
0749d2300a
feat(tui): keep fail-closed footer, flatten main chrome
All checks were successful
ci / test (pull_request) Successful in 4m48s
status_footer never drops send failed / status_note; TOR, me:, and ? help
still fit at 80 and 120. Main at 24 rows uses a one-line header, a 22-cell
roster, chat as the primary pane, and an unboxed composer with a message
placeholder. Help at height < 28 is full-screen so Esc closes this overlay
is visible. Palette maps RGB to 16-color and NO_COLOR (glyphs/weight only).

Do not include docs/TUI.md or tests/tui_frames.rs (PR #23).
2026-09-12 00:15:19 -04:00
175f5dd943 Merge pull request 'fix(file): pace chunks to fit rendezvous rate limit' (#22) from wt/t_fc02d8b6 into main
All checks were successful
ci / test (push) Successful in 2m54s
Reviewed-on: #22
2026-09-12 04:11:10 +00:00
dcb98132e2 Merge branch 'main' into wt/t_fc02d8b6
All checks were successful
ci / test (pull_request) Successful in 3m2s
2026-09-12 04:11:00 +00:00
4457c7330c Merge pull request 'sanitize peer chat/control/bidi before store and TUI render' (#21) from wt/t_6ddd495e into main
All checks were successful
ci / test (push) Successful in 3m42s
Reviewed-on: #21
2026-09-12 03:59:46 +00:00
0a888eced5 Merge branch 'main' into wt/t_6ddd495e
Some checks failed
ci / test (pull_request) Failing after 2m29s
2026-09-12 03:58:53 +00:00
f9395ee070 Merge pull request 'fix(protocol): domain-separate loc/prf/inv/rcp signatures' (#20) from wt/t_ce5649ac into main
All checks were successful
ci / test (push) Successful in 2m27s
Reviewed-on: #20
2026-09-12 03:53:43 +00:00
Sirius DevOps
4205ed149d
docs(tui): visual audit, before frames, and design spec
All checks were successful
ci / test (pull_request) Successful in 2m45s
Dump current chrome through TestBackend at 80x24 / 120x40 / 200x60.
No src changes. Spec in docs/TUI.md for the implementation card.
2026-09-11 23:52:05 -04:00
Sirius DevOps
4bbc2de9ab
[verified] fix(file): pace chunks to fit rendezvous rate limit
All checks were successful
ci / test (pull_request) Successful in 2m42s
Sender-side only. First chunk attempt is immediate; later attempts
(retries and later chunks) wait 3s. Three attempts per chunk, then
fail closed. Token bucket 30/60s burst 10 is unchanged.

A 1 MiB file is 17 one-shot sessions; pacing floor is 16*3s = 48s
plus handshake time. Latency trade, not a security fix.
2026-09-11 23:49:29 -04:00
Sirius DevOps
818cf5922f
ci: retrigger Pi runner after shared target lock
All checks were successful
ci / test (pull_request) Successful in 2m43s
Previous PR run waited on the cargo build-dir lock then compiled
tests against a stale rlib missing sanitize.
2026-09-11 23:46:54 -04:00
Sirius DevOps
e3738c51f7
[verified] sanitize peer chat/control/bidi before store and TUI render
Some checks failed
ci / test (pull_request) Failing after 2m2s
Strip C0 (except tab/newline), DEL, C1, and bidi/format marks at ingest
and render; keep ZWJ; lossy UTF-8 stays U+FFFD. Reject the same set in
fil names. Docs match the policy.
2026-09-11 23:42:48 -04:00