F20: wire types and the relay, on loopback first #12

Closed
mnovak wants to merge 0 commits from feature/relay into main
Owner

F20 (#4, #5): the wire types and the relay, on loopback first. Analysis: .agents/features/relay.md. Review: .agents/reviews/feature-relay.md.

Protocol crate:

  • Mailbox and invite ids, tokens and hashes, each with exactly one wire spelling (unpadded base64url).
  • Strict JSON bodies (deny_unknown_fields).
  • Limits: a blob is at most 256 KiB and a KeyPackage at most 16 KiB.
  • A token never prints.

Relay (axum + SQLite):

  • Create a mailbox; post with the post token; fetch with the fetch token.
  • Acknowledge a blob by its SHA-256, which deletes it.
  • Rotate the post token (block).
  • Invites are claimed once and expire after 7 days. Blobs are purged after 30 days.
  • A wrong token, an unknown id and a malformed id all give the same bare 404.
  • No request is logged. It listens on 127.0.0.1:8470 unless told otherwise.

Evidence:

  • protocol 14 tests, relay 17: 31 passed, 0 failed. Clippy and fmt clean; the dependency-direction check and hook tests pass.
  • The database schema is checked against PROTOCOL.md section 5, column by column.
  • A byte search of the database file after real TCP requests finds no token, invite secret, client address or user agent.
  • Deleted and purged blobs leave no bytes in the file, and no -wal file exists.
  • 12 out of 12 planted bugs are caught.

Open:

  • The HTTP routes still need to go into PROTOCOL.md (needs Mark's approval).
  • There are no quotas yet; they come before any public relay.
  • cargo fuzz waits for a Linux runner.
  • The message canary is proved in F21.
F20 (#4, #5): the wire types and the relay, on loopback first. Analysis: `.agents/features/relay.md`. Review: `.agents/reviews/feature-relay.md`. **Protocol crate:** - Mailbox and invite ids, tokens and hashes, each with exactly one wire spelling (unpadded base64url). - Strict JSON bodies (`deny_unknown_fields`). - Limits: a blob is at most 256 KiB and a KeyPackage at most 16 KiB. - A token never prints. **Relay** (axum + SQLite): - Create a mailbox; post with the post token; fetch with the fetch token. - Acknowledge a blob by its SHA-256, which deletes it. - Rotate the post token (block). - Invites are claimed once and expire after 7 days. Blobs are purged after 30 days. - A wrong token, an unknown id and a malformed id all give the same bare 404. - No request is logged. It listens on 127.0.0.1:8470 unless told otherwise. **Evidence:** - protocol 14 tests, relay 17: 31 passed, 0 failed. Clippy and fmt clean; the dependency-direction check and hook tests pass. - The database schema is checked against PROTOCOL.md section 5, column by column. - A byte search of the database file after real TCP requests finds no token, invite secret, client address or user agent. - Deleted and purged blobs leave no bytes in the file, and no -wal file exists. - 12 out of 12 planted bugs are caught. **Open:** - The HTTP routes still need to go into PROTOCOL.md (needs Mark's approval). - There are no quotas yet; they come before any public relay. - `cargo fuzz` waits for a Linux runner. - The message canary is proved in F21.
mnovak added 4 commits 2026-11-11 21:11:50 +01:00
Author
Owner

Merged into main with --no-ff as 710e1f87fb (remote hash verified). 31 tests pass on main after the merge.

Merged into `main` with `--no-ff` as 710e1f87fba0c56d05e049cac87f138d3496a88e (remote hash verified). 31 tests pass on main after the merge.
mnovak closed this pull request 2026-11-11 21:12:23 +01:00
Some checks are pending
ci / check (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.