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.
This commit is contained in:
Sirius DevOps 2026-09-12 13:35:10 -04:00 • committed by agent
commit d6d157765a
No known key found for this signature in database
9 changed files with 1042 additions and 53 deletions

View file

@ -35,6 +35,16 @@ impl Error {
pub fn is_fingerprint_mismatch(&self) -> bool {
self.mismatch
}
/// String for the UI: a pinned-identity mismatch gets the documented banner,
/// everything else is the underlying snow/framing message.
pub fn into_message(self) -> String {
if self.mismatch {
crate::tui::fingerprint_mismatch_banner().to_string()
} else {
self.msg
}
}
}
impl std::fmt::Display for Error {