{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://capitalguard.io/contracts/v0.1.0/evidence-bundle.schema.json",
  "title": "CapitalGuard Evidence Bundle 0.1.0",
  "type": "object",
  "additionalProperties": false,
  "required": ["bundleDigestAlgorithm", "bundleDigestSha256", "claimBoundary", "material", "schemaVersion"],
  "properties": {
    "bundleDigestAlgorithm": { "const": "sha256" },
    "bundleDigestSha256": { "$ref": "#/$defs/digest" },
    "claimBoundary": { "type": "string", "minLength": 40, "maxLength": 500 },
    "material": {
      "type": "object",
      "additionalProperties": false,
      "required": ["abom", "accessGraph", "binding", "generatedAt", "securityEvents"],
      "properties": {
        "abom": { "$ref": "abom.schema.json" },
        "accessGraph": { "$ref": "../../standard/v1.0.0/guardprint.schema.json" },
        "binding": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "abomSemanticDigestSha256",
            "accessGraphGuardprintSha256",
            "finalEventHashSha256",
            "securityEventBatchDigestSha256"
          ],
          "properties": {
            "abomSemanticDigestSha256": { "$ref": "#/$defs/digest" },
            "accessGraphGuardprintSha256": { "$ref": "#/$defs/digest" },
            "finalEventHashSha256": { "$ref": "#/$defs/digest" },
            "securityEventBatchDigestSha256": { "$ref": "#/$defs/digest" }
          }
        },
        "generatedAt": { "type": "string", "format": "date-time" },
        "securityEvents": { "$ref": "security-event-batch.schema.json" }
      }
    },
    "schemaVersion": { "const": "cg-evidence-bundle-0.1.0" }
  },
  "$defs": {
    "digest": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
  }
}
