Files
swaitsandClaude Opus 4.7 d785e35919 feat(mdbook): publish spec via mdBook on GitHub Pages
Set up the protocol spec as an mdBook and add a GitHub Actions
workflow that builds it on every push/PR and deploys to GitHub
Pages on main. The repo is now both a machine-readable corpus and
a browsable, searchable site.

Structure changes (one-time, mechanical):

- Rename the spec source directory from `spec/` to `src/` to match
  mdBook's default convention. All 21 chapter files move; their
  internal relative cross-links are unchanged.
- Add `src/SUMMARY.md` as the mdBook table of contents, grouping
  chapters under Wire Format, Payloads, Cryptography & Identity,
  and Routing & Higher-Layer Protocols.
- Add `book.toml` at repo root: title, author, search enabled,
  fold enabled, edit-on-GitHub links, navy theme.
- Add `.github/workflows/mdbook.yml`: build on push + PR, deploy
  on push to main only (configure-pages + upload-pages-artifact +
  deploy-pages from actions/).
- Add `/book/` to .gitignore.

Reference updates so the old path is fully retired:

- Every `spec_ref` in `corpus/**/*.json` rewritten from `spec/` to
  `src/` (54 files).
- Schema description text and example path in
  `corpus/schema/test-vector.schema.json`.
- `README.md`: prominent link to the published site near the top;
  "What's Here" updated for the new layout.
- `CONTRIBUTING.md`: spec-editing instructions point at `src/`
  and note the SUMMARY.md requirement.
- `CLAUDE.md`: directory-layout notes updated.

CHANGELOG.md historical entries intentionally keep their `spec/`
paths since those record what the paths were at the time of those
commits.

After this lands, the user needs to enable GitHub Pages in repo
settings with source = "GitHub Actions" (one-time, manual). The
workflow will then publish to https://swaits.github.io/meshcore-spec/
on every push to main.

Verified locally: `mdbook build` produces a clean book/ tree with
all 21 chapters rendered and the SUMMARY-driven sidebar populated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 09:36:28 -06:00

86 lines
3.2 KiB
JSON

{
"$schema": "../../schema/test-vector.schema.json",
"name": "Anonymous Request Payload",
"spec_ref": "src/07-payload-anon-req.md",
"protocol_version": 0,
"description": "Tests anonymous request payload: dest_hash(1) + sender_pub_key(32) + cipher_mac(2) + ciphertext.",
"vectors": [
{
"id": "anon-001",
"description": "Anonymous request with known keys",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "anon_req",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"dest_hash": "AB",
"sender_pub_key": "404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F",
"cipher_mac": "F4B4",
"ciphertext": "908A4FC137435774D0BB603F55A06069"
}
},
"binary": "1D 00 AB 404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F F4B4 908A4FC137435774D0BB603F55A06069",
"crypto_context": {
"shared_secret": "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F",
"encryption_key": "000102030405060708090A0B0C0D0E0F",
"plaintext": "416E6F6E526571"
},
"notes": "Header 0x1D = ANON_REQ(7)+FLOOD(1). Payload: dest_hash(1) + pub_key(32) + mac(2) + ct(16) = 51 bytes. Plaintext 'AnonReq' (7 bytes)."
},
{
"id": "anon-002",
"description": "Anonymous request with tampered MAC",
"type": "invalid",
"binary": "1D 00 AB 404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F 0000 908A4FC137435774D0BB603F55A06069",
"expected_error": "mac_invalid",
"notes": "MAC zeroed. Verification must fail."
},
{
"id": "anon-003",
"description": "Anonymous request via DIRECT routing with 2-hop path",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "anon_req",
"route_type": "direct"
},
"path": {
"hash_size": 1,
"hash_count": 2,
"hashes": ["AA", "BB"]
},
"payload": {
"dest_hash": "CC",
"sender_pub_key": "404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F",
"cipher_mac": "F4B4",
"ciphertext": "908A4FC137435774D0BB603F55A06069"
}
},
"binary": "1E 02 AABB CC 404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F F4B4 908A4FC137435774D0BB603F55A06069",
"crypto_context": {
"shared_secret": "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F",
"encryption_key": "000102030405060708090A0B0C0D0E0F",
"plaintext": "416E6F6E526571"
},
"notes": "Header 0x1E = ANON_REQ(7)+DIRECT(2). Direct-routed anonymous request with 2 path hashes."
},
{
"id": "anon-004",
"description": "Anonymous request truncated before ciphertext",
"type": "invalid",
"binary": "1D 00 AB 404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F F4B4",
"expected_error": "too_short",
"notes": "Payload is only 35 bytes (dest_hash + pub_key + mac). Missing ciphertext. Minimum is 51 bytes."
}
]
}