{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.lowpricedito.com/.well-known/provenance/schema.json",
  "title": "Clickerwayne Provenance Manifest",
  "description": "Schema for the Clickerwayne Provenance Engine manifest format (application/vnd.clickerwayne.provenance+json). All manifests generated by Clickerwayne-Provenance-Engine/1.4+ conform to this schema.",
  "type": "object",
  "required": ["header", "claim", "signature"],
  "properties": {
    "header": {
      "type": "object",
      "required": ["manifest_version", "alg", "cert", "sig_info"],
      "properties": {
        "manifest_version": {
          "type": "string",
          "description": "Version of the manifest format. Currently '1.0'."
        },
        "alg": {
          "type": "string",
          "enum": ["es256"],
          "description": "Signing algorithm. Always 'es256' (ECDSA P-256 with SHA-256)."
        },
        "cert": {
          "type": "string",
          "description": "Base64-encoded public key or X.509 certificate. Decode instructions in cert_info."
        },
        "cert_info": {
          "type": "object",
          "required": ["type", "fingerprint", "encoding"],
          "properties": {
            "type": {
              "type": "string",
              "enum": ["public-key-pem", "x509", "unknown"],
              "description": "Format of the cert field after base64 decoding."
            },
            "fingerprint": {
              "type": "string",
              "description": "SHA-256 fingerprint of the decoded certificate."
            },
            "encoding": {
              "type": "string",
              "enum": ["base64"],
              "description": "Encoding applied to the cert field."
            },
            "decode_instructions": {
              "type": "string"
            }
          }
        },
        "sig_info": {
          "type": "object",
          "required": ["alg", "hash_algo", "curve", "canonicalization", "signs_what"],
          "properties": {
            "alg": {"type": "string", "enum": ["ES256"]},
            "sig_format": {"type": "string", "enum": ["raw-der-base64"]},
            "hash_algo": {"type": "string", "enum": ["sha256"]},
            "curve": {"type": "string", "enum": ["P-256"]},
            "canonicalization": {"type": "string", "enum": ["recursive-ksort-json"]},
            "signs_what": {"type": "string"},
            "description": {"type": "string"}
          }
        },
        "revocation": {
          "type": "object",
          "required": ["mechanism", "uri"],
          "properties": {
            "mechanism": {"type": "string"},
            "uri": {"type": "string", "format": "uri"},
            "description": {"type": "string"}
          }
        },
        "timestamp_authority": {
          "type": "object",
          "required": ["mechanism", "uri"],
          "properties": {
            "mechanism": {"type": "string"},
            "uri": {"type": "string", "format": "uri"},
            "description": {"type": "string"}
          }
        }
      }
    },
    "claim": {
      "type": "object",
      "required": ["claim_generator", "format", "instance_id", "assertions"],
      "properties": {
        "claim_generator": {
          "type": "string",
          "description": "Identifier of the software that generated this manifest."
        },
        "format": {
          "type": "string",
          "const": "application/vnd.clickerwayne.provenance+json"
        },
        "instance_id": {
          "type": "string",
          "description": "Unique identifier for this manifest instance. Format: xmpid:<hex>. Also used for revocation checks.",
          "pattern": "^xmpid:[a-f0-9]+$"
        },
        "assertions": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": ["label", "data"],
            "properties": {
              "label": {
                "type": "string",
                "description": "Reverse-domain assertion type identifier.",
                "pattern": "^org\\.clickerwayne\\.[a-z.-]+$"
              },
              "data": {
                "type": "object",
                "required": ["page_id", "page_type", "page_name", "url", "source", "method", "timestamp", "hash", "claim_type", "description"],
                "properties": {
                  "page_id": {"type": "integer"},
                  "page_type": {"type": "string", "enum": ["root", "article", "product", "brand", "category", "games"]},
                  "page_name": {"type": "string"},
                  "url_slug": {"type": "string"},
                  "meta_title": {"type": "string"},
                  "url": {"type": "string", "format": "uri"},
                  "source": {"type": "string", "const": "Clickerwayne Holdings OPC"},
                  "method": {"type": "string", "const": "DB-Driven-Hybrid-Retail-Engine"},
                  "timestamp": {"type": "string", "format": "date-time"},
                  "hash": {"type": "string", "pattern": "^sha256-[a-f0-9]{64}$"},
                  "claim_type": {"type": "string"},
                  "description": {"type": "string"},
                  "price_valid_until": {"type": "string", "format": "date-time"}
                }
              }
            }
          }
        }
      }
    },
    "signature": {
      "type": "string",
      "description": "Base64-encoded DER ECDSA signature over the canonicalized claim object."
    }
  }
}