tui: mark friends invite-stale after an F8 prekey rotation
All checks were successful
ci / test (pull_request) Successful in 21m19s
ci / sdk (pull_request) Successful in 2m7s

F8 replaces the Noise static prekey and the ML-KEM key together and clears
every stored ratchet, but nothing recorded the cut: a friend on the roster
still held an invite with the old prekey, the next inbound frame could not be
decrypted, our own outbound re-bootstrapped an epoch they did not have, and the
send looked delivered. The only fix -- ask them to paste the new invite -- was
never said.

- `rotate_prekey` snapshots the roster into `$ONIONWIRE_HOME/invite-stale`
  (derived local state; no store schema change, no wire field, no new crate).
  `Node::invite_stale(pk)` / `invite_stale_friends()` answer the question, and
  an install that never rotated has no file and nothing marked.
- `Node::send` and `Node::send_once` fail closed with `invite stale` for a
  pre-rotation friend instead of silently re-bootstrapping past the cut.
- The roster gains its own `invite stale` word and colour token (violet; `stale`
  keeps meaning "the last dial did not answer"), and the alert row above the
  panes carries `invite stale -- F2 to share your new invite, they F3-paste it`,
  recomputed every draw so F3-pasting an invite for that friend clears it.
- `add_friend_payload` removes the pubkey from the set, which is the test the
  card asks for; docs/TUI.md documents the marker.

This makes the existing hard cut legible. It does not add in-band revocation or
a soft rotation; the threat model's hard-cut wording stays as it is.
This commit is contained in:
rust-dev 2026-10-22 23:38:30 -04:00
commit 9b53632859
No known key found for this signature in database
4 changed files with 436 additions and 20 deletions

View file

@ -108,7 +108,13 @@ the composer types the letter.
`loc `; offline friends must F3-paste the new invite.
- **F8.** Type `ROTATE`. Prekey is the Noise static **and** the ratchet bootstrap
seed. Every friend must F3-paste the new invite. Status:
`prekey rotated · friends must F3-paste your new invite`.
`prekey rotated · friends must F3-paste your new invite`. The cut is recorded
locally (`$ONIONWIRE_HOME/invite-stale`), so every friend who was on the roster
shows `invite stale` on their row, in violet, and the alert row above the panes
reads `invite stale — F2 to share your new invite, they F3-paste it`. Sends to
that friend fail closed with `invite stale` instead of looking delivered. The
marker is not the dial marker: `stale` keeps meaning "the last dial did not
answer". F3-pasting an invite for that friend clears it.
## Wallet (`F6`)