{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:agla:candidate:preparation-provenance:0.1.0",
  "type": "object",
  "additionalProperties": false,
  "required": ["record_id", "original_prompt", "interpretations", "sources", "transformations", "assumptions", "conflicts", "tests", "revisit", "authority_effect"],
  "properties": {
    "record_id": {"type": "string", "minLength": 1},
    "original_prompt": {"$ref": "#/$defs/snapshot"},
    "interpretations": {"type": "array", "items": {"$ref": "#/$defs/snapshot"}},
    "sources": {"type": "array", "items": {"$ref": "#/$defs/source"}},
    "transformations": {"type": "array", "items": {"$ref": "#/$defs/transformation"}},
    "assumptions": {"type": "array", "items": {"type": "string"}},
    "conflicts": {"type": "array", "items": {"type": "string"}},
    "tests": {"type": "array", "items": {"$ref": "#/$defs/snapshot"}},
    "revisit": {"$ref": "#/$defs/snapshot"},
    "authority_effect": {"const": "NONE"}
  },
  "$defs": {
    "snapshot": {"type": "object", "required": ["id", "content_hash", "status"], "properties": {"id": {"type": "string"}, "content_hash": {"type": "string"}, "status": {"type": "string"}}},
    "source": {"type": "object", "required": ["id", "content_hash", "authority", "permitted_use"], "properties": {"id": {"type": "string"}, "content_hash": {"type": "string"}, "authority": {"type": "string"}, "permitted_use": {"type": "string"}}},
    "transformation": {"type": "object", "required": ["id", "input_refs", "output_ref", "rule", "declared_loss"], "properties": {"id": {"type": "string"}, "input_refs": {"type": "array"}, "output_ref": {"type": "string"}, "rule": {"type": "string"}, "declared_loss": {"type": "string"}}}
  }
}

