{
  "$defs": {
    "AdapterIdentity": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "version": {
          "title": "Version",
          "type": "string"
        }
      },
      "required": [
        "name",
        "version"
      ],
      "title": "AdapterIdentity",
      "type": "object"
    },
    "Notice": {
      "additionalProperties": false,
      "properties": {
        "message": {
          "title": "Message",
          "type": "string"
        },
        "reason": {
          "title": "Reason",
          "type": "string"
        }
      },
      "required": [
        "reason",
        "message"
      ],
      "title": "Notice",
      "type": "object"
    },
    "TranscriptRef": {
      "additionalProperties": false,
      "description": "The exchanges with an engine, as a file: one line per message, each\nhashed with the one before. `head` is the last hash.",
      "properties": {
        "digest": {
          "description": "The transcript file, stored by digest",
          "pattern": "^sha256:[0-9a-f]{64}$",
          "title": "Digest",
          "type": "string"
        },
        "head": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "title": "Head",
          "type": "string"
        },
        "messages": {
          "minimum": 0,
          "title": "Messages",
          "type": "integer"
        }
      },
      "required": [
        "digest",
        "head",
        "messages"
      ],
      "title": "TranscriptRef",
      "type": "object"
    }
  },
  "$id": "mokili.run/1",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "How a result came to exist, or why it does not.",
  "properties": {
    "adapter": {
      "$ref": "#/$defs/AdapterIdentity"
    },
    "environment": {
      "additionalProperties": {
        "type": "string"
      },
      "title": "Environment",
      "type": "object"
    },
    "failure": {
      "anyOf": [
        {
          "$ref": "#/$defs/Notice"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "finished_at": {
      "title": "Finished At",
      "type": "string"
    },
    "log": {
      "default": [],
      "description": "The last lines the engine wrote",
      "items": {
        "type": "string"
      },
      "title": "Log",
      "type": "array"
    },
    "model": {
      "pattern": "^sha256:[0-9a-f]{64}$",
      "title": "Model",
      "type": "string"
    },
    "reproducibility": {
      "enum": [
        "deterministic",
        "seeded",
        "unseeded",
        "external"
      ],
      "title": "Reproducibility",
      "type": "string"
    },
    "result": {
      "anyOf": [
        {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Result"
    },
    "scenario": {
      "pattern": "^sha256:[0-9a-f]{64}$",
      "title": "Scenario",
      "type": "string"
    },
    "schema": {
      "const": "mokili.run/1",
      "title": "Schema",
      "type": "string"
    },
    "started_at": {
      "title": "Started At",
      "type": "string"
    },
    "status": {
      "enum": [
        "succeeded",
        "failed",
        "timed_out"
      ],
      "title": "Status",
      "type": "string"
    },
    "transcripts": {
      "additionalProperties": {
        "$ref": "#/$defs/TranscriptRef"
      },
      "default": {},
      "description": "Engines speaking mokili-step/2: their exchanges",
      "title": "Transcripts",
      "type": "object"
    },
    "warnings": {
      "default": [],
      "items": {
        "$ref": "#/$defs/Notice"
      },
      "title": "Warnings",
      "type": "array"
    }
  },
  "required": [
    "schema",
    "model",
    "scenario",
    "adapter",
    "environment",
    "started_at",
    "finished_at",
    "status",
    "reproducibility"
  ],
  "title": "RunRecord",
  "type": "object"
}
