{
  "type": "object",
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1000
    },
    "description": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1000
    },
    "units": {
      "const": "mm"
    },
    "models": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
          },
          "metadata": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-][A-Za-z0-9._-]*(?:/[A-Za-z0-9_-][A-Za-z0-9._-]*)*$"
          }
        },
        "required": [
          "id",
          "metadata"
        ],
        "additionalProperties": false
      }
    },
    "stages": {
      "type": "array",
      "minItems": 1,
      "maxItems": 8,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "model": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
          },
          "replay": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
          },
          "status": {
            "enum": [
              "observed",
              "failed",
              "unverified"
            ]
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "status"
        ],
        "additionalProperties": false,
        "oneOf": [
          {
            "required": [
              "model"
            ],
            "not": {
              "required": [
                "replay"
              ]
            }
          },
          {
            "required": [
              "replay"
            ],
            "not": {
              "required": [
                "model"
              ]
            }
          }
        ]
      }
    },
    "revisions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "parents": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "uniqueItems": true
          },
          "decision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          }
        },
        "required": [
          "id",
          "parents",
          "decision"
        ],
        "additionalProperties": false
      },
      "maxItems": 200
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
          },
          "kind": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "path": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-][A-Za-z0-9._-]*(?:/[A-Za-z0-9_-][A-Za-z0-9._-]*)*$"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "scope": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "status": {
            "enum": [
              "observed",
              "failed",
              "unverified"
            ]
          },
          "revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "id",
          "kind",
          "path",
          "sha256",
          "scope",
          "status"
        ],
        "additionalProperties": false
      },
      "maxItems": 200
    },
    "claims": {
      "type": "object",
      "properties": {
        "physicalValidation": {
          "const": false
        },
        "hardwareRelease": {
          "const": false
        }
      },
      "required": [
        "physicalValidation",
        "hardwareRelease"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "id",
    "name",
    "description",
    "units",
    "models",
    "stages",
    "revisions",
    "evidence",
    "claims"
  ],
  "additionalProperties": false,
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Vehicle Lab portable project v1"
}
