{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://pkic.org/cbom/schema/policy-result.schema.json",
  "title": "CBOM policy result",
  "$comment": "A judgement computed from CBOMs under a versioned policy at a stated date. It points to every CBOM it read by SHA-256 digest; a CBOM never points to a result.",
  "type": "object",
  "required": [
    "resultFormat",
    "resultFormatVersion",
    "policy",
    "evaluationDate",
    "documents",
    "findings",
    "notAsserted"
  ],
  "properties": {
    "resultFormat": {
      "const": "pkic.cbom.policy-result"
    },
    "resultFormatVersion": {
      "type": "string"
    },
    "policy": {
      "type": "object",
      "required": [
        "policyId",
        "version",
        "digest"
      ]
    },
    "evaluationDate": {
      "type": "string",
      "format": "date"
    },
    "documents": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "file",
          "digest"
        ],
        "properties": {
          "digest": {
            "type": "object",
            "required": [
              "alg",
              "value"
            ]
          }
        }
      }
    },
    "summary": {
      "type": "object"
    },
    "findings": {
      "type": "array"
    },
    "notAsserted": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1
    }
  }
}
