[docs] F21: review — 41 tests, 10 on the Android emulator, 6/6 planted bugs caught
ci / check (pull_request) Has been cancelled

This commit is contained in:
2026-11-14 13:23:25 +01:00
parent 580b8d50e3
commit 6c66cabb69
+74
View File
@@ -0,0 +1,74 @@
# Review — `feature/client` (F21: the client, MLS 1:1, mailboxes, invites)
Adversarial self-review, 2026-11-14. Base: `main` at b502e57. Analysis: `.agents/features/client.md`.
## Evidence
| What | Result |
|:--|:--|
| `cargo test --workspace --locked` (Windows) | client **10** (1 unit + 8 pairing + 1 real relay), protocol 14, relay 17 — **41 passed, 0 failed** |
| The same client tests **on the Android emulator** | `amicitia_test`, Android 15, x86_64: test binaries built with the NDK r27b and run over `adb` — **10 passed, 0 failed**, including the real relay running on the device |
| `cargo build -p tabellarius-client` for `aarch64-` and `armv7-` Android | passes |
| Clippy (`-D warnings`), fmt, `check-deps.sh`, hook tests | clean / ok / 7 passed |
| Licences of the client's tree | MIT, Apache-2.0 or BSD, except **`hpke-rs` 0.7, MPL-2.0** (F2). No C code |
| Planted bugs (`mutate_client.py`) | **6/6 caught**, after three tests were fixed (F1) |
| Welcome-mailbox derivation | pinned to a vector computed **independently** (Python `hmac`, RFC 5869 written out) |
| Planted bug | Caught by |
|:--|:--|
| The display name put in the MLS credential (so in the KeyPackage on the relay) | the real-relay test: byte search while the invite waits |
| The text also posted in the clear | *the relay holds no name and no word* |
| The payload put in MLS's **unencrypted** additional data | the same |
| A junk blob shown as a message | *junk in a mailbox is dropped and never shown* |
| Blobs never acknowledged | the junk test and *two people pair…*: both count what waits on the relay |
| A second `hello` accepted, redirecting messages to another mailbox | unit test *a second hello changes nothing* |
## Findings
**F1 — test honesty: three tests were too weak, found by planted bugs, fixed.**
- **The junk test** posted into a *third* client's welcome mailbox, so the client under test never
saw the junk. It now posts junk before and after the real Welcome, into the right mailbox.
- **"Second poll is empty"** passed without acknowledgements too: MLS rejects a re-fetched message
as a replay, so nothing is shown either way. The tests now count the blobs left on the relay.
- **The second `hello`** had no test at all. There is one now.
**F2 — licence, for Amicitia.** OpenMLS's HPKE (`hpke-rs`, `-crypto`, `-rust-crypto`) is MPL-2.0,
file-level copyleft. Shipping it unmodified inside the closed Amicitia app is allowed, but the app
must say where the source is. That belongs in Amicitia's licence notices, with F22.
**F3 — protocol: §4 changes, and merging waits for Mark's approval** (`CLAUDE.md` §3).
- §4 said the invitee *replies with their own KeyPackage*, and did not say where the reply goes.
- Here the invitee creates the group itself, so it needs no KeyPackage of its own.
- The first reply goes to a welcome mailbox whose id and post token are derived from the link's
secret.
- No new field for the relay; §5 and §8 are unchanged.
- The new §4 text is on this branch.
**F4 — privacy: what the relay sees in a pairing.**
- **The KeyPackage**, until it is claimed: the inviter's MLS public keys and a credential with **16
random bytes, not a name**. The first planted bug is the guard for this.
- **The Welcome**: encrypted to the KeyPackage.
- **The hellos and texts**: MLS private messages. Their additional data is empty, which the third
planted bug guards.
- The relay cannot tell that the welcome mailbox and the two personal mailboxes belong together,
except by timing (§1, stated).
**F5 — whoever opens the link first becomes the contact.** The inviter sees the joiner's name. A
leaked link is answered by safety footprints (F26), and by sharing links privately or by QR in
person.
**F6 — state lives in memory.** Restarting the client loses its groups. Keeping MLS state in
Amicitia's encrypted `mls` table is F22. Until then nothing is used for real.
**F7 — MLS test vectors.** RFC 9420's test vectors run in OpenMLS's own CI, not here. This
repository tests two of its clients talking, and OpenMLS validates every message it processes.
Stated as is.
**F8 — scope.**
- Not here: block (F24), the HTTP transport for apps (F22), and several devices per person.
- The welcome mailbox stays on the relay, empty, after use: the protocol cannot delete a mailbox yet.
## Not verified
- A real phone (only the emulator, x86_64).
- iOS.
- Long conversations: epochs, many messages, key rotation.
- Two invites in flight at once on one client. The code keeps every welcome mailbox, so it should
work, but no test covers it.