{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hushspec.dev/schemas/hushspec-hash-vector.v0.schema.json",
  "$comment": "Frozen 0.x lineage. This file is retained for documents that declare a 0.x hushspec version and is not edited after HushSpec 1.0.0; the current schema is the .v1. file with the same name (spec/versioning.md).",
  "title": "HushSpec Canonical Form Test Vector v0",
  "description": "A test vector for spec/hushspec-canonical.md. Each vector pairs a resolved HushSpec document with the exact canonical JSON serialization and content hash a conformant implementation MUST produce for it. Vectors live under fixtures/core/hash/ and are generated by scripts/canonical_json.py.",
  "type": "object",
  "required": [
    "hushspec_hash_vector",
    "description",
    "policy",
    "canonical",
    "content_hash"
  ],
  "additionalProperties": false,
  "properties": {
    "hushspec_hash_vector": {
      "type": "string",
      "const": "0.1.0",
      "description": "Vector format version."
    },
    "description": {
      "type": "string",
      "minLength": 1,
      "description": "What this vector exercises, citing the spec section."
    },
    "source": {
      "type": "object",
      "description": "Informational: the unresolved document the `policy` below was produced from (for vectors that exercise a resolved extends chain). Never canonicalized directly."
    },
    "policy": {
      "type": "object",
      "required": [
        "hushspec"
      ],
      "description": "The resolved HushSpec document to canonicalize. MUST NOT contain `extends` or `merge_strategy`."
    },
    "canonical": {
      "type": "string",
      "minLength": 2,
      "description": "The exact RFC 8785 canonical JSON text (UTF-8) of the canonical projection of `policy`."
    },
    "content_hash": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$",
      "description": "SHA-256 of the UTF-8 bytes of `canonical`, in the `sha256:<lowercase hex>` wire form."
    }
  }
}
