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>
This commit is contained in:
swaitsandClaude Opus 4.7 committed 2026-05-12 09:36:28 -06:00
1 parent 75fb228909
commit d785e35919
79 files changed
+173 -56

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../../../schema/test-vector.schema.json",
"name": "Framing - Decode Only",
"spec_ref": "spec/01-wire-format.md",
"spec_ref": "src/01-wire-format.md",
"protocol_version": 0,
"description": "Tests one-way decode cases where the binary is valid to decode but may not be the canonical encoding a conformant encoder would produce.",
"vectors": [
@@ -1,7 +1,7 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Framing - Empty Payload Rejection",
"spec_ref": "spec/01-wire-format.md",
"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": [
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Framing - Maximum Size Packets",
"spec_ref": "spec/01-wire-format.md",
"spec_ref": "src/01-wire-format.md",
"protocol_version": 0,
"description": "Tests packets at or near the maximum wire size of 255 bytes (MAX_TRANS_UNIT). Verifies size calculation: total = 1 (header) + transport(0|4) + 1 (path_len) + path_bytes + payload_len.",
"vectors": [
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Framing - Minimal Valid Packets",
"spec_ref": "spec/01-wire-format.md",
"spec_ref": "src/01-wire-format.md",
"protocol_version": 0,
"description": "Tests the smallest valid packets for each route type. A valid packet must have at least header(1) + path_len(1) + payload(1+) bytes, plus 4 bytes for transport codes if applicable.",
"vectors": [
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Header - Combined Field Encoding",
"spec_ref": "spec/02-header.md",
"spec_ref": "src/02-header.md",
"protocol_version": 0,
"description": "Combinatorial tests of header byte encoding, exercising various combinations of version, payload type, and route type to verify correct bit packing.",
"vectors": [
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Header - Payload Types",
"spec_ref": "spec/02-header.md",
"spec_ref": "src/02-header.md",
"protocol_version": 0,
"description": "Tests encoding of all defined payload types in the header byte. Uses FLOOD routing and minimal payloads to isolate header encoding.",
"vectors": [
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Header - Route Types",
"spec_ref": "spec/02-header.md",
"spec_ref": "src/02-header.md",
"protocol_version": 0,
"description": "Tests encoding and decoding of all 4 route types in the header byte, using ACK (payload_type=3) as a simple payload.",
"vectors": [
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Header - Protocol Versions",
"spec_ref": "spec/02-header.md",
"spec_ref": "src/02-header.md",
"protocol_version": 0,
"description": "Tests encoding of all 4 protocol version values in header bits 6-7. Uses ACK (type=3) with FLOOD routing as a simple baseline.",
"vectors": [
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Invalid - Bad Path Length Encoding",
"spec_ref": "spec/03-path.md",
"spec_ref": "src/03-path.md",
"protocol_version": 0,
"description": "Tests invalid path_len values including the reserved hash_size=4 and path overflow conditions.",
"vectors": [
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Invalid - Too Short Packets",
"spec_ref": "spec/01-wire-format.md",
"spec_ref": "src/01-wire-format.md",
"protocol_version": 0,
"description": "Tests packets that are shorter than the minimum required size for their route type.",
"vectors": [
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Invalid - Truncated Packets",
"spec_ref": "spec/01-wire-format.md",
"spec_ref": "src/01-wire-format.md",
"protocol_version": 0,
"description": "Tests packets that are truncated at various points, verifying that decoders reject them gracefully.",
"vectors": [
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Path - Boundary Conditions",
"spec_ref": "spec/03-path.md",
"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": [
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Path - Hash Counts",
"spec_ref": "spec/03-path.md",
"spec_ref": "src/03-path.md",
"protocol_version": 0,
"description": "Tests various hash count values including zero, small, and maximum values for each hash size.",
"vectors": [
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Path - Hash Sizes",
"spec_ref": "spec/03-path.md",
"spec_ref": "src/03-path.md",
"protocol_version": 0,
"description": "Tests all valid hash sizes (1, 2, 3 bytes) in the path length encoding. These vectors are critical for catching implementations that treat path_len as a raw byte count.",
"vectors": [
@@ -1,7 +1,7 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Transport Codes - Basic",
"spec_ref": "spec/01-wire-format.md",
"spec_ref": "src/01-wire-format.md",
"protocol_version": 0,
"description": "Tests transport code encoding with various values and route types that include/exclude transport codes.",
"vectors": [