feat(versioning): snapshot corpus per spec version
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:
71 files changed
+5924
-28
No files matched your search
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"$schema": "../../schema/test-vector.schema.json",
|
||||
"name": "Control Payload - Basic",
|
||||
"spec_ref": "versions/v0.1.0/12-payload-control.md",
|
||||
"protocol_version": 0,
|
||||
"description": "Tests control payload encoding. Control packets carry raw bytes where the first byte's bit 7 indicates zero-hop-only restriction.",
|
||||
"vectors": [
|
||||
{
|
||||
"id": "ctl-001",
|
||||
"description": "Control packet with multi-hop allowed (bit 7 clear)",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "control",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "01 AABBCCDD"
|
||||
}
|
||||
},
|
||||
"binary": "2D 00 01 AABBCCDD",
|
||||
"notes": "control_byte=0x01: bit 7 clear, multi-hop allowed."
|
||||
},
|
||||
{
|
||||
"id": "ctl-002",
|
||||
"description": "Control packet with zero-hop only (bit 7 set)",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "control",
|
||||
"route_type": "direct"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "80 AABBCCDD"
|
||||
}
|
||||
},
|
||||
"binary": "2E 00 80 AABBCCDD",
|
||||
"notes": "control_byte=0x80: bit 7 set, zero-hop only. Direct route with path_count=0 = zero-hop."
|
||||
},
|
||||
{
|
||||
"id": "ctl-003",
|
||||
"description": "Minimal control packet (1 byte)",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "control",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "00"
|
||||
}
|
||||
},
|
||||
"binary": "2D 00 00"
|
||||
},
|
||||
{
|
||||
"id": "ctl-004",
|
||||
"description": "Control packet with zero-hop restriction and data via direct routing",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "control",
|
||||
"route_type": "direct"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "FF 0102030405"
|
||||
}
|
||||
},
|
||||
"binary": "2E 00 FF 0102030405",
|
||||
"notes": "control_byte=0xFF: bit 7 set (zero-hop), all other bits set."
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user