{
  "$comment": "SPDX-License-Identifier: MIT",
  "$id": "https://spec.vaultfire.local/v3-open/1.0.0/conformance-report.v1.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "candidate": {
      "additionalProperties": false,
      "properties": {
        "artifactManifestSha256": {
          "pattern": "^[0-9a-f]{64}$",
          "type": "string"
        },
        "authority": {
          "const": "external-conformance-envelope-v1"
        },
        "canonicalMappingSha256": {
          "pattern": "^[0-9a-f]{64}$",
          "type": "string"
        },
        "deploymentEvidenceDigest": {
          "pattern": "^0x[0-9a-f]{64}$",
          "type": "string"
        },
        "interfaceSnapshotSha256": {
          "pattern": "^[0-9a-f]{64}$",
          "type": "string"
        },
        "licenseSha256": {
          "pattern": "^[0-9a-f]{64}$",
          "type": "string"
        },
        "repositoryCommit": {
          "pattern": "^[0-9a-f]{40}$",
          "type": "string"
        },
        "repositoryTree": {
          "pattern": "^[0-9a-f]{40}$",
          "type": "string"
        }
      },
      "required": [
        "authority",
        "repositoryCommit",
        "repositoryTree",
        "canonicalMappingSha256",
        "interfaceSnapshotSha256",
        "artifactManifestSha256",
        "licenseSha256",
        "deploymentEvidenceDigest"
      ],
      "type": "object"
    },
    "checks": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "evidenceDigest": {
            "pattern": "^0x[0-9a-f]{64}$",
            "type": "string"
          },
          "id": {
            "pattern": "^[A-Z][A-Z0-9_]{2,63}$",
            "type": "string"
          },
          "status": {
            "enum": [
              "pass",
              "fail",
              "not-run"
            ]
          }
        },
        "required": [
          "id",
          "status",
          "evidenceDigest"
        ],
        "type": "object"
      },
      "maxItems": 128,
      "minItems": 1,
      "type": "array",
      "uniqueItems": true
    },
    "generatedAt": {
      "format": "date-time",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$",
      "type": "string"
    },
    "harnessVersion": {
      "const": "1.0.0"
    },
    "implementation": {
      "additionalProperties": false,
      "properties": {
        "digest": {
          "pattern": "^0x[0-9a-f]{64}$",
          "type": "string"
        },
        "name": {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        },
        "version": {
          "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z.-]+)?$",
          "type": "string"
        }
      },
      "required": [
        "name",
        "version",
        "digest"
      ],
      "type": "object"
    },
    "protocolVersion": {
      "const": "3.0.0"
    },
    "schema": {
      "const": "vaultfire.v3.open.conformance-report.v1"
    },
    "schemaVersion": {
      "const": "1.0.0"
    },
    "summary": {
      "additionalProperties": false,
      "properties": {
        "conformant": {
          "type": "boolean"
        },
        "failed": {
          "minimum": 0,
          "type": "integer"
        },
        "notRun": {
          "minimum": 0,
          "type": "integer"
        },
        "passed": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "passed",
        "failed",
        "notRun",
        "conformant"
      ],
      "type": "object"
    },
    "truth": {
      "additionalProperties": false,
      "properties": {
        "audited": {
          "type": "boolean"
        },
        "authorized": {
          "type": "boolean"
        },
        "deployed": {
          "type": "boolean"
        },
        "endorsed": {
          "type": "boolean"
        },
        "specificationCompliant": {
          "type": "boolean"
        }
      },
      "required": [
        "specificationCompliant",
        "audited",
        "deployed",
        "authorized",
        "endorsed"
      ],
      "type": "object"
    }
  },
  "required": [
    "schema",
    "schemaVersion",
    "protocolVersion",
    "implementation",
    "harnessVersion",
    "generatedAt",
    "checks",
    "summary",
    "truth",
    "candidate"
  ],
  "type": "object"
}
