{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://crapwatch.invalid/schemas/provenance.schema.json",
  "title": "Crapwatch provenance locator",
  "type": "object",
  "required": ["evidence_class", "artifact", "sha256", "extraction_status"],
  "properties": {
    "evidence_class": {"enum": ["source_fact", "parser_output", "derived_statistic", "hypothesis", "policy_recommendation"]},
    "artifact": {"type": "string", "minLength": 1},
    "source_url": {"type": ["string", "null"], "format": "uri"},
    "sha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
    "page": {"type": ["integer", "null"], "minimum": 1},
    "section_or_table": {"type": ["string", "null"]},
    "field_or_parameter": {"type": ["string", "null"]},
    "raw": {"type": ["string", "number", "boolean", "null"]},
    "extraction_status": {"enum": ["OK", "OK_ANNOTATED", "SOURCE_BLANK", "SOURCE_SINGLE_DASH", "SOURCE_DOUBLE_DASH", "SOURCE_EM_DASH", "SOURCE_NA", "NOT_APPLICABLE", "NOT_REQUIRED", "NOT_MONITORED", "ABSENT_FROM_SOURCE", "ABSENT_FROM_TABLE", "UNIT_NOT_STATED", "EXPLICIT_IN_SOURCE", "VISUALLY_VERIFIED_IN_SOURCE", "UNPARSED", "UNKNOWN", "MANUAL_VERIFICATION"]},
    "derivation": {"type": ["string", "null"]},
    "verified_at": {"type": ["string", "null"], "format": "date-time"}
  },
  "additionalProperties": false
}
