{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paloframework.org/schemas/palo-evidence-bundle.schema.json",
  "title": "PALO Evidence Bundle",
  "type": "object",
  "required": ["format", "schemaVersion", "bundleId", "generatedAt", "artifacts", "sourceRegistry", "freshness"],
  "properties": {
    "format": { "const": "palo-evidence-bundle" },
    "schemaVersion": { "const": "1.0.0" },
    "bundleId": { "type": "string", "pattern": "^bundle-[a-z0-9][a-z0-9-]{5,63}$" },
    "caseId": { "type": "string", "pattern": "^case-[a-z0-9][a-z0-9-]{5,63}$" },
    "generatedAt": { "type": "string", "format": "date-time" },
    "assessment": { "type": "object" },
    "route": { "type": "array", "items": { "type": "object" } },
    "evidenceReadiness": { "type": "object", "additionalProperties": { "type": "boolean" } },
    "artifacts": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["artifactId", "title", "kind", "status"],
        "properties": {
          "artifactId": { "type": "string", "minLength": 1 },
          "title": { "type": "string", "minLength": 1 },
          "kind": { "type": "string", "minLength": 1 },
          "status": { "enum": ["open", "draft", "ready", "verified", "superseded"] },
          "content": {}
        },
        "additionalProperties": true
      }
    },
    "sourceRegistry": { "type": "array", "items": { "$ref": "palo-case-file.schema.json#/$defs/source" } },
    "freshness": {
      "type": "object",
      "required": ["evaluatedAt", "status"],
      "properties": {
        "evaluatedAt": { "type": "string", "format": "date-time" },
        "status": { "enum": ["current", "review-due", "stale", "unknown"] }
      },
      "additionalProperties": true
    },
    "disclaimer": { "type": "string" }
  },
  "additionalProperties": true
}
