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>
157 lines
3.9 KiB
JSON
157 lines
3.9 KiB
JSON
{
|
|
"$schema": "../../schema/test-vector.schema.json",
|
|
"name": "Path - Boundary Conditions",
|
|
"spec_ref": "src/03-path.md",
|
|
"protocol_version": 0,
|
|
"description": "Tests boundary conditions for path encoding including maximum valid values and values just below overflow thresholds.",
|
|
"vectors": [
|
|
{
|
|
"id": "pb-001",
|
|
"description": "hash_size=2, count=31 (62 bytes, 2 below max)",
|
|
"type": "encode_decode",
|
|
"structured": {
|
|
"header": {
|
|
"version": 0,
|
|
"payload_type": "ack",
|
|
"route_type": "flood"
|
|
},
|
|
"path": {
|
|
"hash_size": 2,
|
|
"hash_count": 31,
|
|
"hashes": [
|
|
"0001",
|
|
"0203",
|
|
"0405",
|
|
"0607",
|
|
"0809",
|
|
"0A0B",
|
|
"0C0D",
|
|
"0E0F",
|
|
"1011",
|
|
"1213",
|
|
"1415",
|
|
"1617",
|
|
"1819",
|
|
"1A1B",
|
|
"1C1D",
|
|
"1E1F",
|
|
"2021",
|
|
"2223",
|
|
"2425",
|
|
"2627",
|
|
"2829",
|
|
"2A2B",
|
|
"2C2D",
|
|
"2E2F",
|
|
"3031",
|
|
"3233",
|
|
"3435",
|
|
"3637",
|
|
"3839",
|
|
"3A3B",
|
|
"3C3D"
|
|
]
|
|
},
|
|
"payload": {
|
|
"ack_crc": "00000001"
|
|
}
|
|
},
|
|
"binary": "0D 5F 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D 01000000",
|
|
"notes": "path_len=0x5F: hash_size=2, count=31. Path: 62 bytes. Just below max."
|
|
},
|
|
{
|
|
"id": "pb-002",
|
|
"description": "hash_size=3, count=20 (60 bytes, 3 below max for this hash_size)",
|
|
"type": "encode_decode",
|
|
"structured": {
|
|
"header": {
|
|
"version": 0,
|
|
"payload_type": "ack",
|
|
"route_type": "flood"
|
|
},
|
|
"path": {
|
|
"hash_size": 3,
|
|
"hash_count": 20,
|
|
"hashes": [
|
|
"000102",
|
|
"030405",
|
|
"060708",
|
|
"090A0B",
|
|
"0C0D0E",
|
|
"0F1011",
|
|
"121314",
|
|
"151617",
|
|
"18191A",
|
|
"1B1C1D",
|
|
"1E1F20",
|
|
"212223",
|
|
"242526",
|
|
"272829",
|
|
"2A2B2C",
|
|
"2D2E2F",
|
|
"303132",
|
|
"333435",
|
|
"363738",
|
|
"393A3B"
|
|
]
|
|
},
|
|
"payload": {
|
|
"ack_crc": "00000001"
|
|
}
|
|
},
|
|
"binary": "0D 94 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F30313233343536373839 3A3B 01000000",
|
|
"notes": "path_len=0x94: hash_size=3, count=20. Path: 60 bytes."
|
|
},
|
|
{
|
|
"id": "pb-003",
|
|
"description": "Single-byte path: hash_size=1, count=1",
|
|
"type": "encode_decode",
|
|
"structured": {
|
|
"header": {
|
|
"version": 0,
|
|
"payload_type": "ack",
|
|
"route_type": "flood"
|
|
},
|
|
"path": {
|
|
"hash_size": 1,
|
|
"hash_count": 1,
|
|
"hashes": [
|
|
"00"
|
|
]
|
|
},
|
|
"payload": {
|
|
"ack_crc": "00000001"
|
|
}
|
|
},
|
|
"binary": "0D 01 00 01000000",
|
|
"notes": "Minimal non-empty path. Hash value 0x00 is valid."
|
|
},
|
|
{
|
|
"id": "pb-004",
|
|
"description": "Path with all-FF hashes",
|
|
"type": "encode_decode",
|
|
"structured": {
|
|
"header": {
|
|
"version": 0,
|
|
"payload_type": "ack",
|
|
"route_type": "flood"
|
|
},
|
|
"path": {
|
|
"hash_size": 1,
|
|
"hash_count": 3,
|
|
"hashes": [
|
|
"FF",
|
|
"FF",
|
|
"FF"
|
|
]
|
|
},
|
|
"payload": {
|
|
"ack_crc": "00000001"
|
|
}
|
|
},
|
|
"binary": "0D 03 FFFFFF 01000000",
|
|
"notes": "All hashes are 0xFF. Valid encoding."
|
|
}
|
|
]
|
|
}
|