{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.rtemis.org/provenance/v1/schema.json",
  "title": "rtemis Provenance",
  "description": "What produced a run record: package and language versions, platform, timing, how the run ended, and a fingerprint of each dataset used. Referenced by every `<family>/v1/record.json`.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string",
      "const": "https://schema.rtemis.org/provenance/v1/schema.json",
      "description": "JSON Schema URI for this config instance."
    },
    "rtemis_version": {
      "type": "string",
      "description": "rtemis version that produced this record.",
      "x-rtemis": {
        "type": "string"
      }
    },
    "r_version": {
      "type": "string",
      "description": "R version, as reported by `R.version.string`.",
      "x-rtemis": {
        "type": "string"
      }
    },
    "platform": {
      "type": "string",
      "description": "Platform the run executed on.",
      "x-rtemis": {
        "type": "string"
      }
    },
    "started": {
      "type": "string",
      "description": "When the run started, ISO 8601.",
      "x-rtemis": {
        "type": "string"
      }
    },
    "finished": {
      "type": "string",
      "description": "When the run finished, ISO 8601.",
      "x-rtemis": {
        "type": "string"
      }
    },
    "elapsed_seconds": {
      "type": "number",
      "minimum": 0,
      "description": "Wall-clock duration of the run, in seconds.",
      "x-rtemis": {
        "type": "number"
      }
    },
    "outcome": {
      "type": "string",
      "enum": ["completed", "failed", "canceled"],
      "description": "How the run ended: completed, failed, or canceled.",
      "x-rtemis": {
        "type": "string"
      }
    },
    "data_training": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "https://schema.rtemis.org/datafingerprint/v1/schema.json"
        }
      ]
    },
    "data_validation": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "https://schema.rtemis.org/datafingerprint/v1/schema.json"
        }
      ]
    },
    "data_test": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "https://schema.rtemis.org/datafingerprint/v1/schema.json"
        }
      ]
    }
  }
}
