{
  "spec": "LRFS v1.0",
  "spec_url": "https://llmind.org/spec/",
  "namespace": "https://llmind.org/ns/1.0/",
  "generated_on": "2026-04-24",
  "generated_by": "scripts/generate-spec-vectors.ts",
  "vectors_total": 15,
  "vectors": [
    {
      "category": "canonicalization",
      "id": "001-single-text-layer",
      "description": "Single layer containing the ASCII string \"hello world\". The canonical input is layer-name + 0x00 + value + 0x00.",
      "spec_section": "LRFS v1.0 §3.3",
      "file": "/spec/test-vectors/canonicalization/001-single-text-layer.json"
    },
    {
      "category": "canonicalization",
      "id": "002-multiple-layers-alphabetical",
      "description": "Three layers serialized in alphabetical order by layer name. Verifies that writers sort consistently regardless of insertion order.",
      "spec_section": "LRFS v1.0 §3.3",
      "file": "/spec/test-vectors/canonicalization/002-multiple-layers-alphabetical.json"
    },
    {
      "category": "canonicalization",
      "id": "003-json-structure-layer",
      "description": "Layer containing JSON-as-string. The JSON itself must be serialized with sorted keys and no whitespace before canonicalization (LRFS v1.0 §3.3 rule 1).",
      "spec_section": "LRFS v1.0 §3.3",
      "file": "/spec/test-vectors/canonicalization/003-json-structure-layer.json"
    },
    {
      "category": "canonicalization",
      "id": "004-utf8-multibyte",
      "description": "Layers containing multibyte UTF-8 content (French accents, Japanese). Verifies that canonicalization is byte-based (not code-point-based) and handles all Unicode consistently.",
      "spec_section": "LRFS v1.0 §3.3",
      "file": "/spec/test-vectors/canonicalization/004-utf8-multibyte.json"
    },
    {
      "category": "canonicalization",
      "id": "005-signature-layer-excluded",
      "description": "The llmind:signature layer MUST be excluded from the canonical input when computing a signature (LRFS v1.0 §3.3 rule 2). This vector verifies writers correctly drop it during canonicalization.",
      "spec_section": "LRFS v1.0 §3.3",
      "file": "/spec/test-vectors/canonicalization/005-signature-layer-excluded.json"
    },
    {
      "category": "hmac-sha256",
      "id": "001-basic",
      "description": "HMAC-SHA256 signature over the canonical input of a single-layer payload. Fixed ASCII key; reproducible output.",
      "spec_section": "LRFS v1.0 §4.1",
      "file": "/spec/test-vectors/hmac-sha256/001-basic.json"
    },
    {
      "category": "hmac-sha256",
      "id": "002-multi-layer",
      "description": "HMAC-SHA256 signature over a three-layer payload after canonicalization. Verifies that the signature is stable across writer implementations as long as canonicalization is correct.",
      "spec_section": "LRFS v1.0 §4.1",
      "file": "/spec/test-vectors/hmac-sha256/002-multi-layer.json"
    },
    {
      "category": "ed25519",
      "id": "001-basic",
      "description": "ed25519 signature over the canonical input of a single-layer payload. Uses RFC 8032 test vector #1 secret key for reproducibility; any Ed25519 implementation should produce the same signature.",
      "spec_section": "LRFS v1.0 §4.2",
      "file": "/spec/test-vectors/ed25519/001-basic.json"
    },
    {
      "category": "file-checksum",
      "id": "001-pdf-prefix",
      "description": "SHA-256 of a minimal PDF file prefix (10 bytes). Demonstrates how the file-checksum layer is computed over the file bytes excluding the XMP packet.",
      "spec_section": "LRFS v1.0 §4.3",
      "file": "/spec/test-vectors/file-checksum/001-pdf-prefix.json"
    },
    {
      "category": "file-checksum",
      "id": "002-nist-abc",
      "description": "SHA-256 of the 3-byte ASCII string \"abc\". Standard NIST FIPS 180-4 test vector; any conformant SHA-256 implementation produces the expected hex digest.",
      "spec_section": "LRFS v1.0 §4.3",
      "file": "/spec/test-vectors/file-checksum/002-nist-abc.json"
    },
    {
      "category": "failure-modes",
      "id": "001-tampered-signature",
      "description": "Signature bytes do not match the canonical input under the declared key and algorithm. Any conformant verifier MUST reject this payload.",
      "spec_section": "LRFS v1.0 §4.1",
      "file": "/spec/test-vectors/failure-modes/001-tampered-signature.json"
    },
    {
      "category": "failure-modes",
      "id": "002-malformed-xmp",
      "description": "XMP packet is syntactically invalid XML — truncated before the closing RDF element. Conformant readers MUST surface a structured parse error, not crash or silently return partial data.",
      "spec_section": "LRFS v1.0 §3.1",
      "file": "/spec/test-vectors/failure-modes/002-malformed-xmp.json"
    },
    {
      "category": "failure-modes",
      "id": "003-signature-algorithm-mismatch",
      "description": "Declared signing algorithm is incompatible with the provided signature byte length. Conformant readers MUST reject before attempting verification.",
      "spec_section": "LRFS v1.0 §4",
      "file": "/spec/test-vectors/failure-modes/003-signature-algorithm-mismatch.json"
    },
    {
      "category": "failure-modes",
      "id": "004-empty-payload",
      "description": "XMP packet is well-formed and contains the LRFS namespace, but declares zero layers and no signature. This is distinct from a file with no LRFS metadata at all. Conformant readers MUST treat this as a file with no semantic layer (not a parse error, not a verification failure) and return an empty layer set without crashing.",
      "spec_section": "LRFS v1.0 §3.2",
      "file": "/spec/test-vectors/failure-modes/004-empty-payload.json"
    },
    {
      "category": "failure-modes",
      "id": "005-unknown-namespace-version",
      "description": "XMP uses a future-version namespace (v2.0) unknown to a v1.0 reader. Per LRFS v1.0 §7 version compatibility, v1.0 readers MUST ignore unknown major-version namespaces — not crash, not misinterpret the layers as v1.0, not return an error.",
      "spec_section": "LRFS v1.0 §7",
      "file": "/spec/test-vectors/failure-modes/005-unknown-namespace-version.json"
    }
  ],
  "categories": {
    "canonicalization": 5,
    "hmac-sha256": 2,
    "ed25519": 1,
    "file-checksum": 2,
    "failure-modes": 5
  }
}
