{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://medgauge.org/schemas/0.1.0/level-override.schema.json",
  "title": "level-override",
  "description": "A signed level assignment that a program cannot derive (L5): the model and harness, the capability, the evidence, the signer and an expiry date.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^lo-[a-z0-9.-]+$"
    },
    "model": {
      "type": "string",
      "minLength": 1
    },
    "harness": {
      "type": "string",
      "minLength": 1
    },
    "harness_version": {
      "type": "string",
      "minLength": 1
    },
    "capability": {
      "type": "string",
      "pattern": "^E\\.\\d+$"
    },
    "benchmark_version": {
      "type": "string",
      "minLength": 1
    },
    "level": {
      "const": "L5"
    },
    "evidence": {
      "type": "array",
      "minItems": 2,
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "scenario_before_after",
              "external_anchor"
            ]
          },
          "url_or_path": {
            "type": "string",
            "minLength": 1
          },
          "date": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "kind",
          "url_or_path",
          "date"
        ]
      }
    },
    "signed_by": {
      "type": "string",
      "minLength": 1
    },
    "signed_on": {
      "type": "string",
      "format": "date"
    },
    "expires_on": {
      "type": "string",
      "format": "date"
    }
  },
  "required": [
    "id",
    "model",
    "harness",
    "harness_version",
    "capability",
    "benchmark_version",
    "level",
    "evidence",
    "signed_by",
    "signed_on"
  ]
}