{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://feedoracle.io/.well-known/epm.schema.json",
  "title": "FeedOracle Evidence Pack Manifest v1.0",
  "type": "object",
  "required": [
    "epm_version",
    "manifest_id",
    "type",
    "issued_at",
    "issuer",
    "subject"
  ],
  "description": "Universal evidence pack schema. Data infrastructure only - not compliance certification.",
  "properties": {
    "epm_version": {
      "const": "1.0"
    },
    "manifest_id": {
      "type": "string",
      "pattern": "^EPM-[A-Z0-9]+-[0-9T]+$"
    },
    "type": {
      "enum": [
        "rlusd.integrity",
        "carbon.supplychain",
        "rwa.health",
        "generic"
      ]
    },
    "issued_at": {
      "type": "string",
      "format": "date-time"
    },
    "manifest_hash": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "issuer": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "lei": {
          "type": "string",
          "pattern": "^[A-Z0-9]{20}$"
        }
      }
    },
    "subject": {
      "type": "object",
      "required": [
        "id",
        "type"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      }
    },
    "jurisdiction": {
      "type": "string",
      "enum": [
        "EU",
        "UK",
        "US",
        "GLOBAL",
        "DE",
        "FR",
        "CH"
      ],
      "description": "Legal jurisdiction scope"
    },
    "handling": {
      "type": "object",
      "properties": {
        "class": {
          "enum": [
            "PUBLIC",
            "INTERNAL",
            "CONFIDENTIAL"
          ]
        },
        "retention_days": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "attestors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "role": {
            "enum": [
              "issuer",
              "attestor",
              "supplier",
              "system",
              "auditor"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "signature_ref": {
            "type": "string"
          }
        }
      }
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "uri": {
            "type": "string",
            "format": "uri"
          },
          "retrieved_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "anchors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "chain": {
            "type": "string"
          },
          "txid": {
            "type": "string"
          },
          "block": {
            "type": "integer"
          }
        }
      }
    },
    "validity": {
      "type": "object",
      "properties": {
        "not_before": {
          "type": "string"
        },
        "not_after": {
          "type": "string"
        }
      }
    },
    "disclaimer_ref": {
      "type": "string",
      "format": "uri"
    },
    "extensions": {
      "type": "object"
    }
  }
}