Compare commits

...

3 Commits

Author SHA1 Message Date
mnovak 80a27d9181 [docs] F20: review of PROTOCOL.md section 8
ci / check (pull_request) Has been cancelled
2026-11-14 13:07:16 +01:00
mnovak 841236dc87 [docs] F20: PROTOCOL.md section 8, the v0 routes — approved by Mark 2026-11-14 2026-11-14 13:06:56 +01:00
mnovak 710e1f87fb [relay] F20: merge feature/relay — wire types and the relay, on loopback first
ci / check (push) Has been cancelled
2026-11-11 21:12:00 +01:00
2 changed files with 36 additions and 0 deletions
+14
View File
@@ -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.
+22
View File
@@ -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`.