{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "evidence/verdict@1",
  "title": "evidence/verdict@1: what a judge decided from the evidence trail in a verify step. A gate reads verdict.<fact name> and verdict.outcome",
  "type": "object",
  "required": [
    "judge",
    "version",
    "outcome",
    "findings",
    "facts"
  ],
  "additionalProperties": false,
  "properties": {
    "judge": {
      "type": "string",
      "minLength": 1,
      "description": "The judge that returned this verdict: default, coverage, no_regression, baseline_proof or the name of a judge you declare."
    },
    "version": {
      "type": "string",
      "minLength": 1,
      "description": "The version of the judge."
    },
    "outcome": {
      "enum": [
        "pass",
        "fail",
        "error"
      ],
      "x-fact-class": "derived"
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "outcome",
          "message"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "outcome": {
            "enum": [
              "pass",
              "fail",
              "error",
              "skip"
            ]
          },
          "locator": {
            "type": "string",
            "minLength": 1
          },
          "path": {
            "type": "string",
            "minLength": 1
          },
          "message": {
            "type": "string"
          }
        }
      }
    },
    "facts": {
      "x-fact-class": "derived",
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "class",
          "value"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "class": {
            "enum": [
              "derived",
              "judged"
            ],
            "description": "derived: computed by code. judged: a rubric judge's answer under a rubric a person approved."
          },
          "value": {
            "type": [
              "boolean",
              "integer",
              "string"
            ]
          }
        }
      }
    }
  }
}
