{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.agoragentic.com/ecf-core/evidence-units.v1.json",
  "title": "ECF Core Evidence Units",
  "type": "object",
  "required": ["schema_version", "generated_by", "created_at", "source_count", "unit_count", "units"],
  "additionalProperties": true,
  "properties": {
    "schema_version": { "const": "ecf-core.evidence-units.v1" },
    "generated_by": { "const": "ecf-core" },
    "artifact_role": { "const": "ecf_compile_stage_evidence_units" },
    "created_at": { "type": "string" },
    "source_count": { "type": "integer", "minimum": 0 },
    "unit_count": { "type": "integer", "minimum": 0 },
    "compatibility_aliases": { "type": "array", "items": { "type": "string" } },
    "units": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["unit_id", "source_id", "source_path", "claim", "supported_answer", "citations", "policy", "hash", "created_at"],
        "additionalProperties": true,
        "properties": {
          "unit_id": { "type": "string" },
          "source_id": { "type": "string" },
          "source_path": { "type": "string" },
          "source_type": { "type": "string" },
          "source_hash": { "type": "string" },
          "claim": { "type": "string" },
          "supported_answer": { "type": "string" },
          "summary": { "type": "string" },
          "citations": { "type": "array", "items": { "type": "string" } },
          "citation_labels": { "type": "array", "items": { "type": "string" } },
          "tags": { "type": "array", "items": { "type": "string" } },
          "entities": { "type": "array", "items": { "type": "string" } },
          "policy": {
            "type": "object",
            "required": ["allowed_for_agent", "public_safe", "requires_review", "live_deploy_allowed"],
            "additionalProperties": true,
            "properties": {
              "allowed_for_agent": { "type": "boolean" },
              "public_safe": { "type": "boolean" },
              "requires_review": { "type": "boolean" },
              "requires_public_exposure_review": { "type": "boolean" },
              "live_deploy_allowed": { "const": false }
            }
          },
          "provenance": { "type": "object", "additionalProperties": true },
          "hash": { "type": "string" },
          "created_at": { "type": "string" }
        }
      }
    }
  }
}
