[docs] Workflow: the agent merges every PR, protocol changes included; the self-review goes in the PR
ci / check (pull_request) Has been cancelled

Section 4's pairing change is approved (Mark, 2026-11-14). The F21 review moves from
.agents/reviews/ into PR #14.
This commit is contained in:
2026-11-14 14:58:42 +01:00
parent 6c66cabb69
commit b62317d552
3 changed files with 11 additions and 80 deletions
-74
View File
@@ -1,74 +0,0 @@
# 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.
+7 -3
View File
@@ -28,9 +28,13 @@ deploy/container/ # container image
## 3. Workflow
Same as Amicitia: analysis document in `.agents/features/` before code ((D)TDD), branch per feature,
adversarial self-review in `.agents/reviews/`, merge `--no-ff`, push and verify the remote hash. The
agent merges its own PR once local checks pass and the review is written, and reports afterwards
(Mark, 2026-11-08); a change to `docs/PROTOCOL.md` still needs Mark's approval first.
PR. **The adversarial self-review is posted in the PR** as a Gitea review: the evidence (test counts
per crate, planted bugs) in its body and a comment on each line a finding is about. The PR is the
record; `.agents/reviews/` holds the reviews from before 2026-11-14 only.
**The agent merges every PR itself**, a change to `docs/PROTOCOL.md` included, once local checks pass
and the review is posted: merge `--no-ff`, push, verify the remote hash, say in the merge commit which
PR holds the review, and report to Mark afterwards (Mark, 2026-11-14). A protocol change still says in
`docs/PROTOCOL.md` what changed, when and why.
**No AI attribution in commits, ever.** Quote test counts per crate; an exit code is not a count.
## 4. Known traps
+4 -3
View File
@@ -1,7 +1,8 @@
# Tabellarius protocol v0 — what crosses the wire, and what the relay learns
**Approved 2026-11-08 (Mark)** as v0, before any relay code. Every claim below must have a test. A change
is a protocol version bump: documented, reviewed, approved (`CLAUDE.md` §2.2).
is a protocol version bump: documented here with its date and reason, and reviewed in its PR
(`CLAUDE.md` §2.2, §3).
## 1. Threat model
| Adversary | Protected | Not protected |
@@ -42,8 +43,8 @@ invites expire after **7 days** *(decided 2026-11-08)*.
From then on each side posts to the other's mailbox. Names and post tokens travel **only inside
MLS**. To the relay, the welcome mailbox is an ordinary mailbox.
*(Changed 2026-11-14 from "the invitee replies with their own KeyPackage", pending Mark's
approval: the invitee needs no KeyPackage, because it creates the group itself.)*
*(Changed 2026-11-14, approved by Mark, from "the invitee replies with their own KeyPackage": the
invitee needs no KeyPackage, because it creates the group itself.)*
## 5. What the relay stores — the complete list
| Table | Columns |