From 841236dc8741386888bb861737f9a477830729cb Mon Sep 17 00:00:00 2001 From: mnovak Date: Sat, 14 Nov 2026 13:06:56 +0100 Subject: [PATCH 1/2] =?UTF-8?q?[docs]=20F20:=20PROTOCOL.md=20section=208,?= =?UTF-8?q?=20the=20v0=20routes=20=E2=80=94=20approved=20by=20Mark=202026-?= =?UTF-8?q?11-14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/PROTOCOL.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/PROTOCOL.md b/docs/PROTOCOL.md index c80dc5c..7231e54 100644 --- a/docs/PROTOCOL.md +++ b/docs/PROTOCOL.md @@ -61,3 +61,25 @@ The platform facts above are Claude's understanding, to be verified in `.agents/ - A delivered blob is gone; an undelivered blob is gone after the TTL (clock injected). - Parsers are fuzzed (`cargo fuzz`) for every message type. - Every check in `VERIFY.md` §1 has a CI job or a documented manual procedure. + +## 8. The wire (v0) — approved 2026-11-08, routes added 2026-11-14 +HTTP/1.1 behind TLS (the reverse proxy, F23). Ids and tokens are unpadded base64url of a fixed length +with one canonical spelling: ids are 16 bytes, and tokens and hashes are 32. JSON bodies refuse +unknown fields. A blob is at most 256 KiB, and a KeyPackage at most 16 KiB. + +| Method and path | Auth (`Authorization: Bearer`) | Effect | +|:--|:--|:--| +| `POST /v0/mailboxes` `{id, postTokenHash, fetchTokenHash}` | none | creates a mailbox. The owner sends **hashes**, so the relay never holds a token | +| `POST /v0/mailboxes/{id}/blobs` (bytes) | post token | stores the blob with its size and the hour it arrived | +| `GET /v0/mailboxes/{id}/blobs` | fetch token | the waiting blobs, oldest first, at most 100. Fetching deletes nothing | +| `DELETE /v0/mailboxes/{id}/blobs/{sha256}` | fetch token | acknowledges: deletes that mailbox's blob with this SHA-256. §5 has no blob id, and a sequential id would leak how busy the relay is | +| `PUT /v0/mailboxes/{id}/post-token` `{postTokenHash}` | fetch token | blocks: the old post token is refused from now on | +| `POST /v0/invites` `{id, secretHash, keyPackage}` | none | stores an invite. It expires after 7 days, rounded up to the hour | +| `GET /v0/invites/{id}` | invite secret | returns the KeyPackage once, then deletes the invite | +| `GET /version` | none | the protocol and relay versions | + +- A wrong token, an unknown id and a malformed id all give the same bare **404**, so nobody can probe + what exists. +- A refusal has no body. +- The relay prints no request. +- Tests: `crates/relay/tests/relay.rs`, `crates/protocol/tests/wire.rs`. From 80a27d91817ed08ab44a28173f95e03543e936d7 Mon Sep 17 00:00:00 2001 From: mnovak Date: Sat, 14 Nov 2026 13:07:16 +0100 Subject: [PATCH 2/2] [docs] F20: review of PROTOCOL.md section 8 --- .agents/reviews/feature-protocol-http.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .agents/reviews/feature-protocol-http.md diff --git a/.agents/reviews/feature-protocol-http.md b/.agents/reviews/feature-protocol-http.md new file mode 100644 index 0000000..d50e002 --- /dev/null +++ b/.agents/reviews/feature-protocol-http.md @@ -0,0 +1,14 @@ +# Review — `feature/protocol-http` (PROTOCOL.md §8, the v0 routes) + +2026-11-14. Documents only. Mark approved adding the routes on 2026-11-14. + +**F1 — the routes match the code.** The table repeats `.agents/features/relay.md` §2 as built and +tested in F20 (`crates/relay/tests/relay.rs`, 17 tests). No route, limit or status is new here. + +**F2 — privacy.** §8 adds no stored field (§5 is unchanged) and loosens no promise. Two choices are +written down as protocol commitments: +- the uniform bare 404; +- acknowledging by SHA-256 instead of an id. + +**F3 — what is not here.** No quotas yet (`relay.md` §4). A future change to §8 is a version bump, +like any change to this file.