◈︎

Overview

AIOSchema conformance is verified through two independent test suites:

  1. Unit test vectors (TV-01 through TV-25): validate individual operations
  2. Cross-verification vectors (CV-01 through CV-18): validate deterministic output across all six implementations

An implementation is conformant when it passes all 25 unit test vectors and all 18 cross-verification vectors for its target compliance level.

Compliance Levels

Level Requirements Key Dependency
Level 1, Core Core Block fields + core_fingerprint computation, canonical JSON, timestamp validation None
Level 2, Signed Level 1 + Ed25519 signature, creator_id validation Ed25519 key pair
Level 3, Anchored Level 2 + anchor reference parsing, anchor verification Anchor service

Level 1 is valid today, in ten years, and in fifty years: with no server, no key, no infrastructure dependency. The hash is the proof.

Note: core_fingerprint is a derived value computed from the five Core Block fields. It is not itself a Core Block field: it is the integrity seal over them.

Bootstrap Rule

core_fingerprint is computed over exactly these five fields:

CORE_HASH_FIELDS = [
  "asset_id",
  "schema_version",
  "creation_timestamp",
  "hash_original",
  "creator_id"
]

core_fingerprint is deliberately excluded from this set. An implementation that includes core_fingerprint in its own computation will produce incorrect results and fail conformance. All six reference implementations verify this rule explicitly.

Test Vectors

TV-01 through TV-12 cover the v0.4 baseline. TV-13 through TV-18 cover v0.5 additions. TV-19 through TV-24 cover v0.5.6 additions (public_key, ai_declaration, extension size limit). All 24 vectors are required for full v0.5.6 conformance.

TV-01 to TV-12 (v0.4 baseline)

ID Description
TV-01 Valid generate + verify round-trip (hard match)
TV-02 Tampered hash_original must fail
TV-03 Tampered core_fingerprint must fail
TV-04 Soft match within pHash threshold
TV-05 Soft match outside threshold must fail
TV-06 Signature present and valid
TV-07 Signature with wrong public key must fail
TV-08 Unsigned manifest (null signature) passes
TV-09 Missing required fields must fail
TV-10 Invalid timestamp format rejected
TV-11 Non-UTC timestamp (+HH:MM offset) rejected
TV-12 Unknown schema_version rejected

TV-13 to TV-18 (v0.5 additions)

ID Description
TV-13 Multi-hash manifest (SHA-256 + SHA-384)
TV-14 manifest_signature present and valid
TV-15 manifest_signature fails when extensions tampered
TV-16 SHA-384 single-hash manifest
TV-17 Anchor verified via AnchorResolver
TV-18 anchor_reference present, verify_anchor=false: warning not failure

TV-19 to TV-25 (v0.5.6 additions)

ID Description
TV-19 public_key fingerprint match with valid signature
TV-20 public_key fingerprint mismatch: must fail
TV-21 Valid ai_declaration with constraint satisfied
TV-22 ai_declaration constraint violation (standard_editing=true + disclosure_required=true): must fail
TV-23 4KB extension limit at boundary (4096 bytes): passes
TV-24 4KB extension limit exceeded (4097+ bytes): must fail
TV-25 compliance_eu_art50 present + human_reviewed=true: MUST emit warning

Cross-Verification Vectors

The conformance/cross_verify_vectors.json file contains 18 deterministic vectors. All six conformant implementations produce byte-identical results for every vector.

ID Description Expected output
CV-01 SHA-256 of "The quick brown fox..." sha256-d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592
CV-02 SHA-384 of "The quick brown fox..." sha384-ca737f1014a48f4c0b6dd43cb177b0afd9e5169367544c494011e3317dbf9a509cb1e5dc1e85a941bbee3d7f2afbc9b1
CV-03 SHA-256 of empty bytes sha256-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
CV-04 SHA-256 of bytes 0x00 to 0xFF See cross_verify_vectors.json
CV-05 Canonical JSON of known object Compact, sorted keys, no whitespace
CV-06 core_fingerprint of known core fields See cross_verify_vectors.json
CV-07 Deterministic manifest verification (fixed inputs) success: true, match_type: "hard"
CV-08 Tampered hash_original: fail success: false
CV-09 Tampered core_fingerprint: fail success: false
CV-10 hash_schema_block alias accepted success: true
CV-11 Multi-hash array verification success: true
CV-12 Unsupported schema_version: fail success: false
CV-13 Missing required field (creator_id): fail success: false
CV-14 Invalid timestamp format: fail success: false
CV-15 public_key fingerprint match with valid signature success: true, signature_verified: true, manifest_signature_verified: true
CV-16 public_key fingerprint mismatch: must fail success: false, message contains "fingerprint"
CV-17 Valid ai_declaration with constraint satisfied success: true, match_type: "hard"
CV-18 ai_declaration constraint violation success: false, message contains "standard_editing"

Test Suite Summary

Implementation Unit Tests CV Vectors Status
Python 3.9+ 110 / 117 (7 anchor skip) 18 / 18 All passing
TypeScript 76 18 / 18 + 12 XC All passing
Node.js 18+ 86 18 / 18 All passing
Go 1.21+ 26 18 / 18 All passing
Rust 2021 15 18 / 18 All passing
.NET 8+ 68 + 14 CV 18 / 18 All passing

Conformance Registry

Implementation Level 1 Level 2 Level 3 Notes
Python 3.9+ Pass Pass Pass TV-01 to TV-24, CV-01 to CV-18
TypeScript Pass Pass Pass TV-01 to TV-24, CV-01 to CV-18
Node.js 18+ Pass Pass Pass TV-01 to TV-24, CV-01 to CV-18
Go 1.21+ Pass Pass Pass TV-01 to TV-24, CV-01 to CV-18
Rust 2021 Pass Pass Pass TV-01 to TV-24, CV-01 to CV-18
.NET 8+ Pass Pass Pass TV-01 to TV-24, CV-01 to CV-18

Reference implementations are available at github.com/aioschema/aioschema.


View reference implementations →