{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://opentine.com/schemas/tine-assurance-1.schema.json",
  "title": "Assurance",
  "description": "Claimed and verified assurance tier of a run (_assurance.assess): T0 self-reported .. T3 witnessed and timestamped. `verified` never exceeds what was checked.",
  "type": "object",
  "required": [
    "claimed",
    "verified"
  ],
  "properties": {
    "claimed": {
      "enum": [
        "T0",
        "T1",
        "T2",
        "T3"
      ]
    },
    "verified": {
      "enum": [
        "T0",
        "T1",
        "T2",
        "T3"
      ]
    },
    "witness": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "reasons": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "factors": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "factor",
          "ok",
          "reason",
          "detail"
        ],
        "properties": {
          "factor": {
            "enum": [
              "oms-model-signature"
            ]
          },
          "ok": {
            "type": "boolean"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "detail": {
            "type": "string"
          },
          "bundle": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "root_digest": {
            "type": "string"
          },
          "files": {
            "type": "integer",
            "minimum": 0
          },
          "key": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "files_checked": {
            "type": "boolean"
          }
        }
      }
    }
  }
}
