feat(versioning): snapshot corpus per spec version
mdBook / build (push) Canceled after 0s
mdBook / deploy (push) Canceled after 0s

A frozen spec is only meaningful if it's paired with the corpus
that was current at release time — otherwise a v0.1.0 reader
follows "see corpus/payloads/ack/" and lands on a file whose
test vectors may have changed since v0.1.0 was cut.

Three changes:

1. `cut-version` now copies BOTH src/ AND corpus/ into the
   snapshot directory. A release is the pair, not just the text.

2. The corpus URL rewriting in cut-version now retargets
   /tree/main/corpus -> /tree/main/versions/<v>/corpus (and the
   blob variant). This lets the link resolve on GitHub from main
   alone — no git tag required, since the frozen copy is a real
   path under main. Downgrades the "tag is REQUIRED" message from
   last commit back to "optionally tag the commit".

3. The frozen corpus's spec_ref fields get rewritten too: from
   `src/04-payload-ack.md` to `versions/<v>/04-payload-ack.md`,
   so a reader following a test vector lands on the spec text the
   vector was paired with at release time.

versions/v0.1.0/ regenerated from scratch via `just cut-version v0.1.0`
to pick up the corpus snapshot + the new sed patterns. The release
is now self-consistent: v0.1.0 spec links go to v0.1.0 corpus, which
links back to v0.1.0 spec.

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 10:38:02 -06:00
1 parent f83d4088e3
commit 9232c16f7c
71 files changed
+5924 -28

No files matched your search

@@ -0,0 +1,127 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "Trace Payload - Basic",
"spec_ref": "versions/v0.1.0/10-payload-trace.md",
"protocol_version": 0,
"description": "Tests the basic 9-byte TRACE payload structure: tag(4) + auth_code(4) + flags(1).",
"vectors": [
{
"id": "trc-001",
"description": "Basic trace with tag=1, auth_code=2, flags=0",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "trace",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"tag": 1,
"auth_code": 2,
"flags": 0
}
},
"binary": "25 00 01000000 02000000 00",
"notes": "tag=1 LE=01000000, auth_code=2 LE=02000000, flags=0."
},
{
"id": "trc-002",
"description": "Trace with large tag and auth_code values",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "trace",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"tag": 4294967295,
"auth_code": 305419896,
"flags": 0
}
},
"binary": "25 00 FFFFFFFF 78563412 00",
"notes": "tag=0xFFFFFFFF, auth_code=0x12345678 LE=78563412."
},
{
"id": "trc-003",
"description": "Trace with flags indicating 1-byte path hash size (flags & 0x03 = 0)",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "trace",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"tag": 100,
"auth_code": 200,
"flags": 0
}
},
"binary": "25 00 64000000 C8000000 00",
"notes": "flags=0: path_hash_size = 1 << (0 & 3) = 1 byte."
},
{
"id": "trc-004",
"description": "Trace with flags indicating 2-byte path hash size (flags & 0x03 = 1)",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "trace",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"tag": 100,
"auth_code": 200,
"flags": 1
}
},
"binary": "25 00 64000000 C8000000 01",
"notes": "flags=1: path_hash_size = 1 << (1 & 3) = 2 bytes."
},
{
"id": "trc-005",
"description": "Trace sent via direct routing with path hashes appended to payload",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "trace",
"route_type": "direct"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"data": "01000000 02000000 00 AABBCC"
}
},
"binary": "26 00 01000000 02000000 00 AABBCC",
"notes": "Header 0x26 = TRACE(9)+DIRECT(2). path_len=0 (path field used for SNR). Payload: 9-byte header + 3 path hash bytes. Using raw payload since the appended hashes are semantically part of the trace."
}
]
}