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>
34 lines
1.3 KiB
JSON
34 lines
1.3 KiB
JSON
{
|
|
"$schema": "../../schema/test-vector.schema.json",
|
|
"name": "Framing - Empty Payload Rejection",
|
|
"spec_ref": "src/01-wire-format.md",
|
|
"protocol_version": 0,
|
|
"description": "Verifies that packets with zero-length payload are rejected. The reference implementation (Packet::readFrom) checks 'if (i >= len) return false' after reading header+transport+path_len+path, requiring at least 1 byte of payload.",
|
|
"vectors": [
|
|
{
|
|
"id": "ep-001",
|
|
"description": "FLOOD packet with no payload bytes (just header + path_len)",
|
|
"type": "invalid",
|
|
"binary": "0D 00",
|
|
"expected_error": "empty_payload",
|
|
"notes": "2 bytes total: header 0x0D + path_len 0x00. No payload bytes remain. readFrom returns false because i(2) >= len(2)."
|
|
},
|
|
{
|
|
"id": "ep-002",
|
|
"description": "TRANSPORT_FLOOD with no payload (header + transport + path_len only)",
|
|
"type": "invalid",
|
|
"binary": "0C 0000 0000 00",
|
|
"expected_error": "empty_payload",
|
|
"notes": "6 bytes: header(1) + transport(4) + path_len(1). i=6, len=6, so i>=len = true."
|
|
},
|
|
{
|
|
"id": "ep-003",
|
|
"description": "FLOOD packet with path but no payload",
|
|
"type": "invalid",
|
|
"binary": "0D 02 AABB",
|
|
"expected_error": "empty_payload",
|
|
"notes": "4 bytes: header(1) + path_len(1) + path(2). i=4, len=4."
|
|
}
|
|
]
|
|
}
|