{
  "$defs": {
    "ComparisonRow": {
      "additionalProperties": false,
      "description": "One summary, compared: candidate minus baseline, with its interval.",
      "properties": {
        "baseline": {
          "$ref": "#/$defs/Measure"
        },
        "candidate": {
          "$ref": "#/$defs/Measure"
        },
        "difference": {
          "title": "Difference",
          "type": "number"
        },
        "high": {
          "title": "High",
          "type": "number"
        },
        "low": {
          "title": "Low",
          "type": "number"
        },
        "note": {
          "default": "",
          "title": "Note",
          "type": "string"
        },
        "summary": {
          "title": "Summary",
          "type": "string"
        },
        "unit": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Unit"
        },
        "verdict": {
          "enum": [
            "higher",
            "lower",
            "no_detectable_difference",
            "equal",
            "not_estimable"
          ],
          "title": "Verdict",
          "type": "string"
        }
      },
      "required": [
        "summary",
        "baseline",
        "candidate",
        "difference",
        "low",
        "high",
        "verdict"
      ],
      "title": "ComparisonRow",
      "type": "object"
    },
    "Contrast": {
      "additionalProperties": false,
      "properties": {
        "candidate": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "title": "Candidate",
          "type": "string"
        },
        "candidate_scenario": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "title": "Candidate Scenario",
          "type": "string"
        },
        "rows": {
          "items": {
            "$ref": "#/$defs/ComparisonRow"
          },
          "title": "Rows",
          "type": "array"
        }
      },
      "required": [
        "candidate",
        "candidate_scenario",
        "rows"
      ],
      "title": "Contrast",
      "type": "object"
    },
    "Measure": {
      "additionalProperties": false,
      "properties": {
        "high": {
          "title": "High",
          "type": "number"
        },
        "low": {
          "title": "Low",
          "type": "number"
        },
        "mean": {
          "title": "Mean",
          "type": "number"
        },
        "n": {
          "title": "N",
          "type": "integer"
        }
      },
      "required": [
        "n",
        "mean",
        "low",
        "high"
      ],
      "title": "Measure",
      "type": "object"
    }
  },
  "$id": "mokili.comparison/1",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Runs compared to a baseline run, with the method and its assumptions stated.",
  "properties": {
    "assumptions": {
      "items": {
        "type": "string"
      },
      "title": "Assumptions",
      "type": "array"
    },
    "baseline": {
      "pattern": "^sha256:[0-9a-f]{64}$",
      "title": "Baseline",
      "type": "string"
    },
    "baseline_scenario": {
      "pattern": "^sha256:[0-9a-f]{64}$",
      "title": "Baseline Scenario",
      "type": "string"
    },
    "confidence": {
      "title": "Confidence",
      "type": "number"
    },
    "contrasts": {
      "items": {
        "$ref": "#/$defs/Contrast"
      },
      "title": "Contrasts",
      "type": "array"
    },
    "method": {
      "title": "Method",
      "type": "string"
    },
    "name": {
      "default": "",
      "title": "Name",
      "type": "string"
    },
    "schema": {
      "const": "mokili.comparison/1",
      "title": "Schema",
      "type": "string"
    }
  },
  "required": [
    "schema",
    "baseline",
    "baseline_scenario",
    "contrasts",
    "method",
    "confidence",
    "assumptions"
  ],
  "title": "Comparison",
  "type": "object"
}
