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,38 @@
|
||||
{
|
||||
"$schema": "../../schema/test-vector.schema.json",
|
||||
"name": "Group Data Payload",
|
||||
"spec_ref": "versions/v0.1.0/08-payload-group.md",
|
||||
"protocol_version": 0,
|
||||
"description": "Tests group datagram payload. Same wire format as GRP_TXT but payload type = 0x06.",
|
||||
"vectors": [
|
||||
{
|
||||
"id": "grp-data-001",
|
||||
"description": "Group datagram with known channel secret",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "grp_data",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"channel_hash": "72",
|
||||
"cipher_mac": "D184",
|
||||
"ciphertext": "948C819389BA4ED7B1194A0FF8E62073"
|
||||
}
|
||||
},
|
||||
"binary": "19 00 72 D184 948C819389BA4ED7B1194A0FF8E62073",
|
||||
"crypto_context": {
|
||||
"shared_secret": "202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F",
|
||||
"encryption_key": "202122232425262728292A2B2C2D2E2F",
|
||||
"plaintext": "47726F75704D736721"
|
||||
},
|
||||
"notes": "Header 0x19 = GRP_DATA(6)+FLOOD(1). Same ciphertext as GRP_TXT since same key and plaintext."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"$schema": "../../schema/test-vector.schema.json",
|
||||
"name": "Group Text Payload",
|
||||
"spec_ref": "versions/v0.1.0/08-payload-group.md",
|
||||
"protocol_version": 0,
|
||||
"description": "Tests group text message payload: channel_hash(1) + cipher_mac(2) + ciphertext.",
|
||||
"vectors": [
|
||||
{
|
||||
"id": "grp-txt-001",
|
||||
"description": "Group text message with known channel secret",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "grp_txt",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"channel_hash": "72",
|
||||
"cipher_mac": "D184",
|
||||
"ciphertext": "948C819389BA4ED7B1194A0FF8E62073"
|
||||
}
|
||||
},
|
||||
"binary": "15 00 72 D184 948C819389BA4ED7B1194A0FF8E62073",
|
||||
"crypto_context": {
|
||||
"shared_secret": "202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F",
|
||||
"encryption_key": "202122232425262728292A2B2C2D2E2F",
|
||||
"plaintext": "47726F75704D736721"
|
||||
},
|
||||
"notes": "Channel hash = SHA256(channel_secret)[0] = 0x72. Plaintext 'GroupMsg!' (9 bytes). AES key = first 16 bytes of channel secret."
|
||||
},
|
||||
{
|
||||
"id": "grp-txt-002",
|
||||
"description": "Group text with tampered MAC must fail",
|
||||
"type": "invalid",
|
||||
"binary": "15 00 72 0000 948C819389BA4ED7B1194A0FF8E62073",
|
||||
"expected_error": "mac_invalid",
|
||||
"notes": "Same ciphertext as grp-txt-001 but MAC zeroed. Verification must fail."
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user