| README.md | file | 3.2 KiB |
This directory defines the conformance test suite and interoperability contract for attestation serialization and note verification.
Any independent implementation of attest must serialize every input.json in this directory to
the exact byte sequence of the corresponding statement.txt, and must successfully verify every
statement.note. If implementations disagree by even a single byte, cryptographic signatures
produced by one tool will fail verification in another.
The canonical written format and signed note envelope specification are detailed in design/verification.md.
Each directory under vectors/ represents a single conformance test case:
input.json: A statement represented as arbitrary JSON (with unnormalized key ordering,
whitespace, or escape sequences).statement.txt: The exact, canonical byte sequence produced by the written form. Signatures cover
these bytes and nothing else.statement.note: The canonical statement text followed by a blank line and signed note lines.
Test verification keys are defined in known_keys.The vectors validate crucial serialization rules:
predicate.required none when no
checks were required for a path.10 follows index 9.refused/) #The refused/ directory contains malformed inputs that every compliant implementation must reject:
.json files containing unrenderable data (e.g., raw numbers, empty objects, newlines within
values)..txt files containing invalid statement texts (e.g., misordered sections, duplicate keys,
non-sequential array indices).The conformance test suite executes automatically as part of repository checks:
nix flake check
To run individual checks manually:
# Verify byte-for-byte canonical rendering:
nix run .#attest -- render attest/conformance/vectors/01-statement-minimal/input.json \
| cmp - attest/conformance/vectors/01-statement-minimal/statement.txt
# Verify cryptographic note signatures:
nix run .#attest -- verify \
--note attest/conformance/vectors/04-two-signers/statement.note \
--known-keys attest/conformance/known_keys
Recorded vector bytes must only change if the underlying canonical specification in
design/verification.md changes. Modifying the written format breaks backward compatibility with
all previously signed attestations.
To add new test cases, create a new subfolder under vectors/ containing the test files. The test
runner will discover and run them automatically.