{
  "$defs": {
    "EnvironmentEvidence": {
      "additionalProperties": false,
      "properties": {
        "python_implementation": {
          "anyOf": [
            {
              "$ref": "#/$defs/EnvironmentValue"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "python_version": {
          "anyOf": [
            {
              "$ref": "#/$defs/EnvironmentValue"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "platform": {
          "anyOf": [
            {
              "$ref": "#/$defs/EnvironmentValue"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "architecture": {
          "anyOf": [
            {
              "$ref": "#/$defs/EnvironmentValue"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "packages": {
          "default": [],
          "items": {
            "$ref": "#/$defs/PackageEvidence"
          },
          "maxItems": 4096,
          "title": "Packages",
          "type": "array"
        },
        "artifacts": {
          "default": [],
          "items": {
            "$ref": "#/$defs/InputArtifact"
          },
          "maxItems": 64,
          "title": "Artifacts",
          "type": "array"
        }
      },
      "title": "EnvironmentEvidence",
      "type": "object"
    },
    "EnvironmentValue": {
      "additionalProperties": false,
      "properties": {
        "value": {
          "anyOf": [
            {
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Value"
        },
        "origin": {
          "$ref": "#/$defs/EvidenceOrigin"
        }
      },
      "required": [
        "value",
        "origin"
      ],
      "title": "EnvironmentValue",
      "type": "object"
    },
    "EvidenceOrigin": {
      "enum": [
        "declared",
        "static",
        "runtime",
        "unknown"
      ],
      "title": "EvidenceOrigin",
      "type": "string"
    },
    "FrozenJSON": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "maximum": 9223372036854775807,
          "minimum": -9223372036854775808,
          "type": "integer"
        },
        {
          "type": "number"
        },
        {
          "maxLength": 8192,
          "type": "string"
        },
        {
          "items": {
            "$ref": "#/$defs/FrozenJSON"
          },
          "maxItems": 1024,
          "type": "array"
        },
        {
          "additionalProperties": {
            "$ref": "#/$defs/FrozenJSON"
          },
          "maxProperties": 1024,
          "propertyNames": {
            "maxLength": 256
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "InputArtifact": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "maxLength": 128,
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "reference": {
          "anyOf": [
            {
              "maxLength": 1024,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Reference"
        },
        "digest": {
          "anyOf": [
            {
              "pattern": "^[0-9a-f]{64}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Digest"
        },
        "size": {
          "anyOf": [
            {
              "maximum": 9223372036854775807,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Size"
        },
        "origin": {
          "$ref": "#/$defs/EvidenceOrigin"
        },
        "content_origin": {
          "anyOf": [
            {
              "$ref": "#/$defs/EvidenceOrigin"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "format_hint": {
          "anyOf": [
            {
              "enum": [
                "csv",
                "parquet",
                "numpy",
                "joblib"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Format Hint"
        },
        "uri": {
          "anyOf": [
            {
              "maxLength": 1024,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Uri"
        }
      },
      "required": [
        "name",
        "origin"
      ],
      "title": "InputArtifact",
      "type": "object"
    },
    "Metric": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "maxLength": 128,
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "value": {
          "$ref": "#/$defs/FrozenJSON"
        },
        "unit": {
          "anyOf": [
            {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Unit"
        },
        "origin": {
          "const": "runtime",
          "title": "Origin",
          "type": "string"
        }
      },
      "required": [
        "name",
        "value",
        "origin"
      ],
      "title": "Metric",
      "type": "object"
    },
    "OutputArtifact": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "maxLength": 128,
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "reference": {
          "anyOf": [
            {
              "maxLength": 1024,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Reference"
        },
        "digest": {
          "pattern": "^[0-9a-f]{64}$",
          "title": "Digest",
          "type": "string"
        },
        "size": {
          "anyOf": [
            {
              "maximum": 9223372036854775807,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Size"
        },
        "media_type": {
          "anyOf": [
            {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Media Type"
        },
        "origin": {
          "const": "runtime",
          "title": "Origin",
          "type": "string"
        }
      },
      "required": [
        "name",
        "digest",
        "origin"
      ],
      "title": "OutputArtifact",
      "type": "object"
    },
    "PackageEvidence": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "maxLength": 128,
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Version"
        },
        "origin": {
          "$ref": "#/$defs/EvidenceOrigin"
        }
      },
      "required": [
        "name",
        "version",
        "origin"
      ],
      "title": "PackageEvidence",
      "type": "object"
    },
    "Parameter": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "maxLength": 128,
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "value": {
          "$ref": "#/$defs/FrozenJSON"
        },
        "origin": {
          "$ref": "#/$defs/EvidenceOrigin"
        }
      },
      "required": [
        "name",
        "value",
        "origin"
      ],
      "title": "Parameter",
      "type": "object"
    },
    "RandomnessControl": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "maxLength": 128,
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "value": {
          "$ref": "#/$defs/FrozenJSON"
        },
        "origin": {
          "$ref": "#/$defs/EvidenceOrigin"
        },
        "provider": {
          "maxLength": 128,
          "minLength": 1,
          "title": "Provider",
          "type": "string"
        }
      },
      "required": [
        "name",
        "value",
        "origin",
        "provider"
      ],
      "title": "RandomnessControl",
      "type": "object"
    },
    "RunDiagnostic": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9_.-]*$",
          "title": "Code",
          "type": "string"
        },
        "origin": {
          "const": "runtime",
          "title": "Origin",
          "type": "string"
        }
      },
      "required": [
        "code",
        "origin"
      ],
      "title": "RunDiagnostic",
      "type": "object"
    },
    "RunTiming": {
      "additionalProperties": false,
      "properties": {
        "started_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Started At"
        },
        "ended_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ended At"
        },
        "duration_seconds": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Duration Seconds"
        },
        "origin": {
          "const": "runtime",
          "title": "Origin",
          "type": "string"
        }
      },
      "required": [
        "origin"
      ],
      "title": "RunTiming",
      "type": "object"
    },
    "SourceIdentity": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "enum": [
            "python",
            "notebook"
          ],
          "title": "Kind",
          "type": "string"
        },
        "reference": {
          "maxLength": 1024,
          "minLength": 1,
          "title": "Reference",
          "type": "string"
        },
        "digest": {
          "pattern": "^[0-9a-f]{64}$",
          "title": "Digest",
          "type": "string"
        },
        "executable_digest": {
          "anyOf": [
            {
              "pattern": "^[0-9a-f]{64}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Executable Digest"
        },
        "module": {
          "anyOf": [
            {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Module"
        },
        "capability_id": {
          "anyOf": [
            {
              "maxLength": 512,
              "minLength": 1,
              "pattern": "^[^\\s/\\\\]+$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Capability Id"
        }
      },
      "required": [
        "kind",
        "reference",
        "digest"
      ],
      "title": "SourceIdentity",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "schema_version": {
      "const": "apizr.experiment-run/v1",
      "default": "apizr.experiment-run/v1",
      "title": "Schema Version",
      "type": "string"
    },
    "plan_digest": {
      "pattern": "^[0-9a-f]{64}$",
      "title": "Plan Digest",
      "type": "string"
    },
    "subject": {
      "$ref": "#/$defs/SourceIdentity"
    },
    "status": {
      "enum": [
        "success",
        "failed",
        "cancelled"
      ],
      "title": "Status",
      "type": "string"
    },
    "observed_inputs": {
      "default": [],
      "items": {
        "$ref": "#/$defs/InputArtifact"
      },
      "maxItems": 256,
      "title": "Observed Inputs",
      "type": "array"
    },
    "effective_parameters": {
      "default": [],
      "items": {
        "$ref": "#/$defs/Parameter"
      },
      "maxItems": 256,
      "title": "Effective Parameters",
      "type": "array"
    },
    "randomness": {
      "default": [],
      "items": {
        "$ref": "#/$defs/RandomnessControl"
      },
      "maxItems": 128,
      "title": "Randomness",
      "type": "array"
    },
    "environment": {
      "anyOf": [
        {
          "$ref": "#/$defs/EnvironmentEvidence"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "metrics": {
      "default": [],
      "items": {
        "$ref": "#/$defs/Metric"
      },
      "maxItems": 256,
      "title": "Metrics",
      "type": "array"
    },
    "outputs": {
      "default": [],
      "items": {
        "$ref": "#/$defs/OutputArtifact"
      },
      "maxItems": 256,
      "title": "Outputs",
      "type": "array"
    },
    "timing": {
      "anyOf": [
        {
          "$ref": "#/$defs/RunTiming"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "diagnostics": {
      "default": [],
      "items": {
        "$ref": "#/$defs/RunDiagnostic"
      },
      "maxItems": 32,
      "title": "Diagnostics",
      "type": "array"
    }
  },
  "required": [
    "plan_digest",
    "subject",
    "status"
  ],
  "title": "ExperimentRun",
  "type": "object"
}
