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,122 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "ACK Payload - Basic",
"spec_ref": "versions/v0.1.0/04-payload-ack.md",
"protocol_version": 0,
"description": "Basic ACK payload encoding/decoding tests with various CRC values.",
"vectors": [
{
"id": "ack-001",
"description": "ACK with CRC 0xDEADBEEF",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "ack",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"ack_crc": "DEADBEEF"
}
},
"binary": "0D 00 EFBEADDE",
"notes": "CRC 0xDEADBEEF stored as little-endian: EF BE AD DE."
},
{
"id": "ack-002",
"description": "ACK with CRC 0x00000001",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "ack",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"ack_crc": "00000001"
}
},
"binary": "0D 00 01000000"
},
{
"id": "ack-003",
"description": "ACK with CRC 0x12345678",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "ack",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"ack_crc": "12345678"
}
},
"binary": "0D 00 78563412"
},
{
"id": "ack-004",
"description": "ACK via direct routing with path",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "ack",
"route_type": "direct"
},
"path": {
"hash_size": 1,
"hash_count": 2,
"hashes": [
"AA",
"BB"
]
},
"payload": {
"ack_crc": "CAFEBABE"
}
},
"binary": "0E 02 AABB BEBAFECA",
"notes": "Direct routed ACK. CRC 0xCAFEBABE as LE = BEBAFECA."
},
{
"id": "ack-005",
"description": "ACK with 2-byte hash path",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "ack",
"route_type": "direct"
},
"path": {
"hash_size": 2,
"hash_count": 1,
"hashes": [
"AABB"
]
},
"payload": {
"ack_crc": "00000000"
}
},
"binary": "0E 41 AABB 00000000",
"notes": "path_len=0x41: hash_size=2, count=1."
}
]
}
@@ -0,0 +1,115 @@
{
"$schema": "../../schema/test-vector.schema.json",
"name": "ACK Payload - Boundary Values",
"spec_ref": "versions/v0.1.0/04-payload-ack.md",
"protocol_version": 0,
"description": "ACK CRC boundary value tests including all-zeros, all-ones, and single-bit patterns.",
"vectors": [
{
"id": "ack-bnd-001",
"description": "ACK CRC all zeros",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "ack",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"ack_crc": "00000000"
}
},
"binary": "0D 00 00000000"
},
{
"id": "ack-bnd-002",
"description": "ACK CRC all ones",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "ack",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"ack_crc": "FFFFFFFF"
}
},
"binary": "0D 00 FFFFFFFF"
},
{
"id": "ack-bnd-003",
"description": "ACK CRC 0x80000000 (high bit set)",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "ack",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"ack_crc": "80000000"
}
},
"binary": "0D 00 00000080"
},
{
"id": "ack-bnd-004",
"description": "ACK CRC 0x00000080 (byte boundary)",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "ack",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"ack_crc": "00000080"
}
},
"binary": "0D 00 80000000"
},
{
"id": "ack-bnd-005",
"description": "ACK CRC 0x01000000",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "ack",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"ack_crc": "01000000"
}
},
"binary": "0D 00 00000001",
"notes": "Tests that 0x01000000 LE = 00 00 00 01, not confused with 0x00000001."
}
]
}