{
  "$defs": {
    "ChainProgress": {
      "additionalProperties": false,
      "description": "Per-chain sampler progress (Expert run view).",
      "properties": {
        "chain": {
          "minimum": 0,
          "title": "Chain",
          "type": "integer"
        },
        "divergences": {
          "default": 0,
          "minimum": 0,
          "title": "Divergences",
          "type": "integer"
        },
        "draws_done": {
          "minimum": 0,
          "title": "Draws Done",
          "type": "integer"
        },
        "draws_total": {
          "minimum": 0,
          "title": "Draws Total",
          "type": "integer"
        },
        "num_steps": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Leapfrog steps of the latest draw (v0.11)",
          "title": "Num Steps"
        },
        "step_size": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Current step size (v0.11)",
          "title": "Step Size"
        },
        "tuning": {
          "default": false,
          "title": "Tuning",
          "type": "boolean"
        }
      },
      "required": [
        "chain",
        "draws_done",
        "draws_total"
      ],
      "title": "ChainProgress",
      "type": "object"
    },
    "CompareMedia": {
      "description": "One media series (key + labels) of one compared run, thinned evenly (the last is kept).",
      "examples": [
        {
          "items": [
            {
              "attempt": 1,
              "caption": "Predicted classes, epoch 3",
              "content_type": "image/png",
              "crc32c": "4waSgw==",
              "created_at": "2026-10-15T09:30:00Z",
              "expires_at": "2026-10-15T09:45:00Z",
              "height": 64,
              "id": "rm_01jaf3h1j2k3m4n5p6q7r8s9t0",
              "key": "samples",
              "kind": "image",
              "labels": {
                "split": "val"
              },
              "run_id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0",
              "sha256": "sha256:3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f",
              "size": 12034,
              "source": "runner",
              "step": 3,
              "url": "http://127.0.0.1:4443/download/storage/v1/b/mapi-local-bundles/o/t%2Fdefault%2Frun-media%2Frun_01jaf3q2x8m9v7k5h4g3f2e1d0%2F3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f.png?alt=media",
              "width": 64
            }
          ],
          "key": "samples",
          "kind": "image",
          "labels": {
            "split": "val"
          },
          "run_id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
        }
      ],
      "properties": {
        "items": {
          "items": {
            "$ref": "#/$defs/RunMedia"
          },
          "maxItems": 50,
          "title": "Items",
          "type": "array"
        },
        "key": {
          "pattern": "^[a-z][a-z0-9_]{0,63}$",
          "title": "Key",
          "type": "string"
        },
        "kind": {
          "enum": [
            "image",
            "table"
          ],
          "title": "Kind",
          "type": "string"
        },
        "labels": {
          "additionalProperties": {
            "type": "string"
          },
          "title": "Labels",
          "type": "object"
        },
        "run_id": {
          "examples": [
            "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
          ],
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]{0,127}$",
          "title": "Run Id",
          "type": "string"
        }
      },
      "required": [
        "run_id",
        "key",
        "kind"
      ],
      "title": "CompareMedia",
      "type": "object"
    },
    "CompareMetric": {
      "description": "Every series of one metric key, over the compared runs.",
      "examples": [
        {
          "key": "loss",
          "series": [
            {
              "attempt": 1,
              "count": 3,
              "labels": {
                "split": "val"
              },
              "run_id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0",
              "steps": [
                1,
                2,
                3
              ],
              "values": [
                0.9,
                0.6,
                0.45
              ]
            }
          ]
        }
      ],
      "properties": {
        "key": {
          "pattern": "^[a-z][a-z0-9_]{0,63}$",
          "title": "Key",
          "type": "string"
        },
        "series": {
          "items": {
            "$ref": "#/$defs/CompareSeries"
          },
          "maxItems": 160,
          "title": "Series",
          "type": "array"
        }
      },
      "required": [
        "key"
      ],
      "title": "CompareMetric",
      "type": "object"
    },
    "CompareParam": {
      "description": "One param key over the compared runs (run id -> text value; ``null``: not logged).",
      "examples": [
        {
          "differs": true,
          "key": "settings.adstock.l_max",
          "values": {
            "run_01jaf3q2x8m9v7k5h4g3f2e1d0": "4",
            "run_01jaf3q2x8m9v7k5h4g3f2e1d1": "8"
          }
        },
        {
          "differs": true,
          "key": "fit.draws",
          "values": {
            "run_01jaf3q2x8m9v7k5h4g3f2e1d0": "1000",
            "run_01jaf3q2x8m9v7k5h4g3f2e1d1": null
          }
        }
      ],
      "properties": {
        "differs": {
          "description": "Two runs have different values (or one has none)",
          "title": "Differs",
          "type": "boolean"
        },
        "key": {
          "title": "Key",
          "type": "string"
        },
        "values": {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": "Values",
          "type": "object"
        }
      },
      "required": [
        "key",
        "values",
        "differs"
      ],
      "title": "CompareParam",
      "type": "object"
    },
    "CompareSeries": {
      "description": "The history of one series of one compared run (``steps`` and ``values`` have equal\nlengths; downsampled to ``max_points``).",
      "examples": [
        {
          "attempt": 1,
          "count": 3,
          "labels": {
            "split": "val"
          },
          "run_id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0",
          "steps": [
            1,
            2,
            3
          ],
          "values": [
            0.9,
            0.6,
            0.45
          ]
        }
      ],
      "properties": {
        "attempt": {
          "minimum": 1,
          "title": "Attempt",
          "type": "integer"
        },
        "count": {
          "description": "Stored points (before downsampling)",
          "minimum": 0,
          "title": "Count",
          "type": "integer"
        },
        "downsampled": {
          "default": false,
          "title": "Downsampled",
          "type": "boolean"
        },
        "labels": {
          "additionalProperties": {
            "type": "string"
          },
          "title": "Labels",
          "type": "object"
        },
        "run_id": {
          "examples": [
            "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
          ],
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]{0,127}$",
          "title": "Run Id",
          "type": "string"
        },
        "steps": {
          "items": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": "Steps",
          "type": "array"
        },
        "values": {
          "items": {
            "type": "number"
          },
          "title": "Values",
          "type": "array"
        }
      },
      "required": [
        "run_id",
        "attempt",
        "count",
        "steps",
        "values"
      ],
      "title": "CompareSeries",
      "type": "object"
    },
    "CompareSummary": {
      "description": "The summary of one metric series of one compared run.",
      "examples": [
        {
          "attempt": 1,
          "count": 1,
          "first_ts": "2026-10-15T09:30:00Z",
          "key": "rmse",
          "last": 12.7,
          "last_step": null,
          "last_ts": "2026-10-15T09:30:00Z",
          "max": 12.7,
          "min": 12.7,
          "run_id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
        },
        {
          "attempt": 1,
          "count": 1400,
          "first_ts": "2026-10-15T09:30:00Z",
          "key": "step_size",
          "labels": {
            "chain": "0"
          },
          "last": 0.31,
          "last_step": 1400,
          "last_ts": "2026-10-15T09:31:00Z",
          "max": 1.2,
          "min": 0.02,
          "run_id": "run_01jaf3q2x8m9v7k5h4g3f2e1d1"
        }
      ],
      "properties": {
        "attempt": {
          "minimum": 1,
          "title": "Attempt",
          "type": "integer"
        },
        "count": {
          "description": "Stored points",
          "minimum": 0,
          "title": "Count",
          "type": "integer"
        },
        "first_ts": {
          "format": "date-time",
          "title": "First Ts",
          "type": "string"
        },
        "key": {
          "pattern": "^[a-z][a-z0-9_]{0,63}$",
          "title": "Key",
          "type": "string"
        },
        "labels": {
          "additionalProperties": {
            "type": "string"
          },
          "title": "Labels",
          "type": "object"
        },
        "last": {
          "description": "Value of the newest point (by time, then step)",
          "title": "Last",
          "type": "number"
        },
        "last_step": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Step of the newest point; null for a scalar",
          "title": "Last Step"
        },
        "last_ts": {
          "format": "date-time",
          "title": "Last Ts",
          "type": "string"
        },
        "max": {
          "title": "Max",
          "type": "number"
        },
        "min": {
          "title": "Min",
          "type": "number"
        },
        "run_id": {
          "examples": [
            "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
          ],
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]{0,127}$",
          "title": "Run Id",
          "type": "string"
        }
      },
      "required": [
        "key",
        "attempt",
        "count",
        "last",
        "min",
        "max",
        "first_ts",
        "last_ts",
        "run_id"
      ],
      "title": "CompareSummary",
      "type": "object"
    },
    "ErrorCode": {
      "description": "Stable error codes. See :data:`ERROR_INFO` for HTTP status and titles.",
      "enum": [
        "SCHEMA_INVALID",
        "SPEC_PARSE_ERROR",
        "PAYLOAD_TOO_LARGE",
        "UNSUPPORTED_API_VERSION",
        "REF_UNRESOLVED",
        "SETTINGS_INVALID",
        "BINDING_INVALID",
        "SPLIT_INVALID",
        "LEAKAGE_RISK",
        "DIM_POLICY_LOOSENED",
        "SCHEMA_DYNAMIC",
        "SIDE_TABLE_COVERAGE",
        "PLOT_UNSAFE",
        "UNSEEN_LEVELS",
        "COORD_NOT_ALLOWED",
        "HORIZON_EXCEEDS_FIT",
        "MISSING_FUTURE_COVARIATE",
        "NON_CONTIGUOUS_EXTENSION",
        "CAPABILITY_UNSUPPORTED",
        "RECURSIVE_UNSUPPORTED",
        "MODE_NOT_SUPPORTED",
        "QUOTA_EXCEEDED",
        "RATE_LIMITED",
        "UNAUTHENTICATED",
        "FORBIDDEN",
        "NOT_FOUND",
        "CONFLICT",
        "IDEMPOTENCY_CONFLICT",
        "PRECONDITION_FAILED",
        "USER_CODE_ERROR",
        "RESOURCE_EXHAUSTED",
        "INFRA_ERROR",
        "INTEGRITY_FAILURE",
        "TIMEOUT",
        "SANDBOX_VIOLATION",
        "CANCELLED",
        "INTERNAL_ERROR",
        "GUIDED_ANSWERS_INVALID",
        "BUSINESS_PRIORS_INVALID",
        "CALIBRATION_UNSUPPORTED",
        "IMPORT_UNSUPPORTED",
        "SCENARIO_OUT_OF_RANGE",
        "PROMOTION_BLOCKED",
        "OVERRIDE_REQUIRED",
        "WEBHOOK_URL_BLOCKED",
        "WEBHOOK_SIGNATURE_INVALID",
        "EMBED_NOT_ALLOWED",
        "LINK_EXPIRED",
        "EMAIL_NOT_ALLOWED",
        "TERMS_NOT_ACCEPTED",
        "EMAIL_NOT_VERIFIED",
        "IDENTITY_VERIFICATION_REQUIRED",
        "ABOUT_INCOMPLETE",
        "CHOOSER_ANSWER_INVALID",
        "WORKFLOW_INVALID",
        "EXPRESSION_INVALID",
        "EXPRESSION_ERROR",
        "NODE_UNKNOWN",
        "SCHEDULE_INVALID",
        "WORKFLOW_NOT_RUNNABLE",
        "POLICY_INVALID",
        "VALIDATION_TRANSITION_INVALID",
        "SELF_APPROVAL_FORBIDDEN",
        "NOT_VALIDATED",
        "EXPLORE_INVALID",
        "OPTIMIZE_INFEASIBLE",
        "ACTUALS_NOT_SUPPORTED",
        "ACTUALS_INVALID",
        "NOT_READY",
        "INGEST_UNSAFE_FILE"
      ],
      "title": "ErrorCode",
      "type": "string"
    },
    "FailureClass": {
      "description": "Why a run ended ``FAILED``; each maps to one stable :class:`ErrorCode`.",
      "enum": [
        "user",
        "resource_exhausted",
        "infra",
        "integrity",
        "timeout",
        "sandbox"
      ],
      "title": "FailureClass",
      "type": "string"
    },
    "Issue": {
      "additionalProperties": false,
      "description": "One problem found while validating a document, located by a JSON pointer.",
      "properties": {
        "code": {
          "$ref": "#/$defs/ErrorCode"
        },
        "context": {
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          },
          "title": "Context",
          "type": "object"
        },
        "message": {
          "description": "Trusted, platform-authored text",
          "maxLength": 2000,
          "title": "Message",
          "type": "string"
        },
        "pointer": {
          "default": "",
          "description": "RFC 6901 JSON pointer into the submitted document",
          "title": "Pointer",
          "type": "string"
        },
        "severity": {
          "$ref": "#/$defs/Severity",
          "default": "error"
        },
        "suggested_action": {
          "anyOf": [
            {
              "maxLength": 2000,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Suggested Action"
        },
        "untrusted_text": {
          "anyOf": [
            {
              "maxLength": 8000,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "User/plugin-originated text; render as text only",
          "title": "Untrusted Text"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "title": "Issue",
      "type": "object"
    },
    "JsonValue": {},
    "Problem": {
      "additionalProperties": false,
      "description": "RFC 7807 problem document with mapi extensions (``code``, ``errors``, ``untrusted_text``).",
      "properties": {
        "code": {
          "$ref": "#/$defs/ErrorCode"
        },
        "detail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Detail"
        },
        "errors": {
          "items": {
            "$ref": "#/$defs/Issue"
          },
          "title": "Errors",
          "type": "array"
        },
        "instance": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Instance"
        },
        "status": {
          "maximum": 599,
          "minimum": 100,
          "title": "Status",
          "type": "integer"
        },
        "title": {
          "title": "Title",
          "type": "string"
        },
        "trace_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Trace Id"
        },
        "type": {
          "default": "about:blank",
          "title": "Type",
          "type": "string"
        },
        "untrusted_text": {
          "anyOf": [
            {
              "maxLength": 65536,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Untrusted Text"
        }
      },
      "required": [
        "title",
        "status",
        "code"
      ],
      "title": "Problem",
      "type": "object"
    },
    "ProgressSnapshot": {
      "description": "Latest coalesced progress (one upserted row per run).",
      "examples": [
        {
          "chains": [
            {
              "chain": 0,
              "divergences": 0,
              "draws_done": 400,
              "draws_total": 1000
            },
            {
              "chain": 1,
              "divergences": 1,
              "draws_done": 380,
              "draws_total": 1000
            }
          ],
          "eta_seconds": 95,
          "fraction": 0.4,
          "message": "drawing samples",
          "phase": "sample",
          "seq": 42,
          "updated_at": "2026-10-15T09:30:00Z"
        }
      ],
      "properties": {
        "chains": {
          "items": {
            "$ref": "#/$defs/ChainProgress"
          },
          "title": "Chains",
          "type": "array"
        },
        "eta_seconds": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Eta Seconds"
        },
        "fraction": {
          "anyOf": [
            {
              "maximum": 1,
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Fraction"
        },
        "message": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Message"
        },
        "phase": {
          "$ref": "#/$defs/RunnerPhase"
        },
        "seq": {
          "minimum": 0,
          "title": "Seq",
          "type": "integer"
        },
        "updated_at": {
          "format": "date-time",
          "title": "Updated At",
          "type": "string"
        }
      },
      "required": [
        "seq",
        "phase",
        "updated_at"
      ],
      "title": "ProgressSnapshot",
      "type": "object"
    },
    "ResourceClass": {
      "description": "Executor resource class. Ordered: ``S < M < L < XL < GPU``.\n\n``GPU`` is the last (highest-rank) member on purpose: a quota whose\n``max_resource_class`` is below it refuses it, and :meth:`next_up` never offers it.",
      "enum": [
        "S",
        "M",
        "L",
        "XL",
        "GPU"
      ],
      "title": "ResourceClass",
      "type": "string"
    },
    "Run": {
      "description": "A unit of work and its lifecycle (see the state machine in ``mapi_spec.run``).",
      "examples": [
        {
          "attempt": 1,
          "cost": {
            "estimated": true
          },
          "created_at": "2026-10-15T09:30:00Z",
          "executor": "local-process",
          "id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0",
          "kind": "fit",
          "name": "weekly sales, adstock 4",
          "progress": {
            "chains": [
              {
                "chain": 0,
                "divergences": 0,
                "draws_done": 400,
                "draws_total": 1000
              },
              {
                "chain": 1,
                "divergences": 1,
                "draws_done": 380,
                "draws_total": 1000
              }
            ],
            "eta_seconds": 95,
            "fraction": 0.4,
            "message": "drawing samples",
            "phase": "sample",
            "seq": 42,
            "updated_at": "2026-10-15T09:30:00Z"
          },
          "project_id": "default",
          "queued_at": "2026-10-15T09:30:00Z",
          "resource_class": "M",
          "spec_hash": "sha256:3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f",
          "spec_id": "spc_01jaf3b1c2d3e4f5g6h7j8k9m0",
          "spec_revision": 2,
          "started_at": "2026-10-15T09:30:05Z",
          "state": "running",
          "tags": {
            "stage": "candidate",
            "team": "growth"
          },
          "tenant_id": "default",
          "timeout": "45m",
          "updated_at": "2026-10-15T09:31:00Z"
        },
        {
          "attempt": 1,
          "created_at": "2026-10-15T09:30:00Z",
          "failure_class": "resource_exhausted",
          "finished_at": "2026-10-15T09:40:00Z",
          "id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0",
          "kind": "fit",
          "problem": {
            "code": "RESOURCE_EXHAUSTED",
            "detail": "the worker was killed (exit 137); retry at class L",
            "status": 507,
            "title": "Run exhausted its resources",
            "type": "urn:mapi:error:RESOURCE_EXHAUSTED"
          },
          "project_id": "default",
          "resource_class": "M",
          "state": "failed",
          "tenant_id": "default",
          "timeout": "45m",
          "updated_at": "2026-10-15T09:40:00Z"
        }
      ],
      "properties": {
        "attempt": {
          "minimum": 1,
          "title": "Attempt",
          "type": "integer"
        },
        "columns": {
          "anyOf": [
            {
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Values of the requested `column` refs (list_runs only), keyed by RunRef.text()",
          "title": "Columns"
        },
        "cost": {
          "$ref": "#/$defs/RunCost"
        },
        "created_at": {
          "format": "date-time",
          "title": "Created At",
          "type": "string"
        },
        "dataset_id": {
          "anyOf": [
            {
              "examples": [
                "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
              ],
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]{0,127}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Dataset Id"
        },
        "executor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Executor"
        },
        "experiment_id": {
          "anyOf": [
            {
              "examples": [
                "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
              ],
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]{0,127}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Experiment of the run (v0.14)",
          "title": "Experiment Id"
        },
        "failure_class": {
          "anyOf": [
            {
              "$ref": "#/$defs/FailureClass"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "finished_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Finished At"
        },
        "id": {
          "examples": [
            "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
          ],
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]{0,127}$",
          "title": "Id",
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/RunKind"
        },
        "labels": {
          "additionalProperties": {
            "type": "string"
          },
          "title": "Labels",
          "type": "object"
        },
        "model_version_id": {
          "anyOf": [
            {
              "examples": [
                "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
              ],
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]{0,127}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Model Version Id"
        },
        "name": {
          "anyOf": [
            {
              "maxLength": 200,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Display name (v0.11)",
          "title": "Name"
        },
        "note": {
          "anyOf": [
            {
              "maxLength": 20000,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Free-text note (untrusted text, v0.11)",
          "title": "Note"
        },
        "output_model_version_id": {
          "anyOf": [
            {
              "examples": [
                "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
              ],
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]{0,127}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The model version a successful fit produced",
          "title": "Output Model Version Id"
        },
        "parent_run_id": {
          "anyOf": [
            {
              "examples": [
                "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
              ],
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]{0,127}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Parent Run Id"
        },
        "problem": {
          "anyOf": [
            {
              "$ref": "#/$defs/Problem"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "progress": {
          "anyOf": [
            {
              "$ref": "#/$defs/ProgressSnapshot"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "project_id": {
          "pattern": "^[a-z0-9](?:[a-z0-9_-]{0,62}[a-z0-9])?$",
          "title": "Project Id",
          "type": "string"
        },
        "queued_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Queued At"
        },
        "resource_class": {
          "$ref": "#/$defs/ResourceClass"
        },
        "retry_of": {
          "anyOf": [
            {
              "examples": [
                "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
              ],
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]{0,127}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Retry Of"
        },
        "spec_hash": {
          "anyOf": [
            {
              "pattern": "^sha256:[0-9a-f]{64}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Spec Hash"
        },
        "spec_id": {
          "anyOf": [
            {
              "examples": [
                "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
              ],
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]{0,127}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Spec Id"
        },
        "spec_revision": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Spec Revision"
        },
        "started_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Started At"
        },
        "state": {
          "$ref": "#/$defs/RunState"
        },
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Mutable run tags (v0.11; labels stay create-only)",
          "title": "Tags",
          "type": "object"
        },
        "tenant_id": {
          "pattern": "^[a-z0-9](?:[a-z0-9_-]{0,62}[a-z0-9])?$",
          "title": "Tenant Id",
          "type": "string"
        },
        "timeout": {
          "description": "Duration such as '45m', '1h30m' or '90s'.",
          "examples": [
            "45m",
            "1h30m"
          ],
          "pattern": "^(?=.)(\\d+h)?(\\d+m)?(\\d+s)?$",
          "title": "Timeout",
          "type": "string"
        },
        "updated_at": {
          "format": "date-time",
          "title": "Updated At",
          "type": "string"
        }
      },
      "required": [
        "id",
        "tenant_id",
        "project_id",
        "kind",
        "state",
        "attempt",
        "resource_class",
        "timeout",
        "created_at",
        "updated_at"
      ],
      "title": "Run",
      "type": "object"
    },
    "RunCost": {
      "description": "Cost of a run (all attempts). ``estimated`` is true until an ``actual`` ledger entry\nexists; ``usd`` is kept for v0.2 clients and is set only when the currency is USD.",
      "examples": [
        {
          "estimated": true,
          "gib_seconds": null,
          "usd": null,
          "vcpu_seconds": null
        },
        {
          "amount_micros": 31200,
          "attempts_billed": 1,
          "currency": "USD",
          "estimate_micros": 30000,
          "estimated": false,
          "gib_seconds": 4800,
          "price_version": "cloudrun-list-2026-10",
          "usd": 0.0312,
          "vcpu_seconds": 1200
        }
      ],
      "properties": {
        "amount_micros": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Amount Micros"
        },
        "attempts_billed": {
          "default": 0,
          "minimum": 0,
          "title": "Attempts Billed",
          "type": "integer"
        },
        "currency": {
          "anyOf": [
            {
              "pattern": "^[A-Z]{3}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Currency"
        },
        "estimate_micros": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Pre-run estimate",
          "title": "Estimate Micros"
        },
        "estimated": {
          "default": true,
          "title": "Estimated",
          "type": "boolean"
        },
        "gib_seconds": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Gib Seconds"
        },
        "price_version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Price Version"
        },
        "usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Usd"
        },
        "vcpu_seconds": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Vcpu Seconds"
        }
      },
      "title": "RunCost",
      "type": "object"
    },
    "RunKind": {
      "description": "What a run does. ``validate`` is the explicit sandboxed dry-run of a spec.\n\n``sweep``, ``backtest``, ``sbc`` and ``campaign`` are fan-out *parents* (plan \u00a76.2,\nM4): they own child runs and never execute on an executor themselves.",
      "enum": [
        "ingest",
        "describe",
        "validate",
        "fit",
        "score",
        "evaluate",
        "derive",
        "render",
        "optimize",
        "sweep",
        "backtest",
        "sbc",
        "campaign",
        "translate_priors",
        "workflow",
        "workflow_node",
        "explore",
        "governance",
        "inspect"
      ],
      "title": "RunKind",
      "type": "string"
    },
    "RunMedia": {
      "description": "An image or a table a run logged. ``caption`` is untrusted text; ``url`` is a signed GET\nof the stored copy (verify ``size`` and ``crc32c`` after the download).",
      "examples": [
        {
          "attempt": 1,
          "caption": "Predicted classes, epoch 3",
          "content_type": "image/png",
          "crc32c": "4waSgw==",
          "created_at": "2026-10-15T09:30:00Z",
          "expires_at": "2026-10-15T09:45:00Z",
          "height": 64,
          "id": "rm_01jaf3h1j2k3m4n5p6q7r8s9t0",
          "key": "samples",
          "kind": "image",
          "labels": {
            "split": "val"
          },
          "run_id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0",
          "sha256": "sha256:3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f",
          "size": 12034,
          "source": "runner",
          "step": 3,
          "url": "http://127.0.0.1:4443/download/storage/v1/b/mapi-local-bundles/o/t%2Fdefault%2Frun-media%2Frun_01jaf3q2x8m9v7k5h4g3f2e1d0%2F3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f.png?alt=media",
          "width": 64
        },
        {
          "attempt": 1,
          "content_type": "application/json",
          "crc32c": "4waSgw==",
          "created_at": "2026-10-15T09:30:00Z",
          "id": "rm_01jaf3h1j2k3m4n5p6q7r8s9t0",
          "key": "confusion_counts",
          "kind": "table",
          "run_id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0",
          "sha256": "sha256:3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f",
          "size": 412,
          "source": "api"
        }
      ],
      "properties": {
        "attempt": {
          "minimum": 1,
          "title": "Attempt",
          "type": "integer"
        },
        "caption": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Caption"
        },
        "content_type": {
          "enum": [
            "image/png",
            "image/jpeg",
            "application/json"
          ],
          "title": "Content Type",
          "type": "string"
        },
        "crc32c": {
          "description": "CRC32C as GCS reports it: base64 of the big-endian 4-byte checksum",
          "examples": [
            "4waSgw=="
          ],
          "pattern": "^[A-Za-z0-9+/]{6}==$",
          "title": "Crc32C",
          "type": "string"
        },
        "created_at": {
          "format": "date-time",
          "title": "Created At",
          "type": "string"
        },
        "expires_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Expires At"
        },
        "height": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Height"
        },
        "id": {
          "examples": [
            "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
          ],
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]{0,127}$",
          "title": "Id",
          "type": "string"
        },
        "key": {
          "pattern": "^[a-z][a-z0-9_]{0,63}$",
          "title": "Key",
          "type": "string"
        },
        "kind": {
          "enum": [
            "image",
            "table"
          ],
          "title": "Kind",
          "type": "string"
        },
        "labels": {
          "additionalProperties": {
            "type": "string"
          },
          "title": "Labels",
          "type": "object"
        },
        "run_id": {
          "examples": [
            "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
          ],
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]{0,127}$",
          "title": "Run Id",
          "type": "string"
        },
        "sha256": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "title": "Sha256",
          "type": "string"
        },
        "size": {
          "minimum": 1,
          "title": "Size",
          "type": "integer"
        },
        "source": {
          "enum": [
            "runner",
            "api"
          ],
          "title": "Source",
          "type": "string"
        },
        "step": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Step"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        },
        "width": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Width"
        }
      },
      "required": [
        "id",
        "run_id",
        "attempt",
        "key",
        "kind",
        "content_type",
        "size",
        "sha256",
        "crc32c",
        "source",
        "created_at"
      ],
      "title": "RunMedia",
      "type": "object"
    },
    "RunState": {
      "description": "Lifecycle of a run (plan \u00a78.3). Terminal states never change again, except that a\n``PARTIAL`` run can be resumed (``RESUME`` \u2192 ``QUEUED`` with a new attempt).",
      "enum": [
        "created",
        "rejected",
        "queued",
        "dispatching",
        "provisioning",
        "running",
        "stalled",
        "finalizing",
        "succeeded",
        "partial",
        "failed",
        "cancelling",
        "cancelled"
      ],
      "title": "RunState",
      "type": "string"
    },
    "RunnerPhase": {
      "description": "Coarse phase reported by the runner (drives progress text in the UI).",
      "enum": [
        "bootstrap",
        "load_inputs",
        "validate",
        "preprocess",
        "fit",
        "sample",
        "score",
        "evaluate",
        "derive",
        "plots",
        "upload",
        "done"
      ],
      "title": "RunnerPhase",
      "type": "string"
    },
    "Severity": {
      "description": "How bad an :class:`Issue` is. Only ``error`` blocks submission.",
      "enum": [
        "info",
        "warning",
        "error"
      ],
      "title": "Severity",
      "type": "string"
    }
  },
  "$id": "https://schemas.mapi.dev/v1/api-RunCompare.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "``GET /v1/run-compare``: runs side by side (summaries, histories, params, media).",
  "examples": [
    {
      "media": [
        {
          "items": [
            {
              "attempt": 1,
              "caption": "Predicted classes, epoch 3",
              "content_type": "image/png",
              "crc32c": "4waSgw==",
              "created_at": "2026-10-15T09:30:00Z",
              "expires_at": "2026-10-15T09:45:00Z",
              "height": 64,
              "id": "rm_01jaf3h1j2k3m4n5p6q7r8s9t0",
              "key": "samples",
              "kind": "image",
              "labels": {
                "split": "val"
              },
              "run_id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0",
              "sha256": "sha256:3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f",
              "size": 12034,
              "source": "runner",
              "step": 3,
              "url": "http://127.0.0.1:4443/download/storage/v1/b/mapi-local-bundles/o/t%2Fdefault%2Frun-media%2Frun_01jaf3q2x8m9v7k5h4g3f2e1d0%2F3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f.png?alt=media",
              "width": 64
            }
          ],
          "key": "samples",
          "kind": "image",
          "labels": {
            "split": "val"
          },
          "run_id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
        }
      ],
      "metrics": [
        {
          "key": "loss",
          "series": [
            {
              "attempt": 1,
              "count": 3,
              "labels": {
                "split": "val"
              },
              "run_id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0",
              "steps": [
                1,
                2,
                3
              ],
              "values": [
                0.9,
                0.6,
                0.45
              ]
            },
            {
              "attempt": 1,
              "count": 3,
              "labels": {
                "split": "val"
              },
              "run_id": "run_01jaf3q2x8m9v7k5h4g3f2e1d1",
              "steps": [
                1,
                2,
                3
              ],
              "values": [
                0.8,
                0.5,
                0.41
              ]
            }
          ]
        }
      ],
      "params": [
        {
          "differs": true,
          "key": "settings.adstock.l_max",
          "values": {
            "run_01jaf3q2x8m9v7k5h4g3f2e1d0": "4",
            "run_01jaf3q2x8m9v7k5h4g3f2e1d1": "8"
          }
        }
      ],
      "runs": [
        {
          "attempt": 1,
          "cost": {
            "estimated": true
          },
          "created_at": "2026-10-15T09:30:00Z",
          "executor": "local-process",
          "id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0",
          "kind": "fit",
          "name": "weekly sales, adstock 4",
          "progress": {
            "chains": [
              {
                "chain": 0,
                "divergences": 0,
                "draws_done": 400,
                "draws_total": 1000
              },
              {
                "chain": 1,
                "divergences": 1,
                "draws_done": 380,
                "draws_total": 1000
              }
            ],
            "eta_seconds": 95,
            "fraction": 0.4,
            "message": "drawing samples",
            "phase": "sample",
            "seq": 42,
            "updated_at": "2026-10-15T09:30:00Z"
          },
          "project_id": "default",
          "queued_at": "2026-10-15T09:30:00Z",
          "resource_class": "M",
          "spec_hash": "sha256:3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f",
          "spec_id": "spc_01jaf3b1c2d3e4f5g6h7j8k9m0",
          "spec_revision": 2,
          "started_at": "2026-10-15T09:30:05Z",
          "state": "running",
          "tags": {
            "stage": "candidate",
            "team": "growth"
          },
          "tenant_id": "default",
          "timeout": "45m",
          "updated_at": "2026-10-15T09:31:00Z"
        },
        {
          "attempt": 1,
          "cost": {
            "estimated": true
          },
          "created_at": "2026-10-15T09:30:00Z",
          "executor": "local-process",
          "id": "run_01jaf3q2x8m9v7k5h4g3f2e1d1",
          "kind": "fit",
          "name": "weekly sales, adstock 4",
          "progress": {
            "chains": [
              {
                "chain": 0,
                "divergences": 0,
                "draws_done": 400,
                "draws_total": 1000
              },
              {
                "chain": 1,
                "divergences": 1,
                "draws_done": 380,
                "draws_total": 1000
              }
            ],
            "eta_seconds": 95,
            "fraction": 0.4,
            "message": "drawing samples",
            "phase": "sample",
            "seq": 42,
            "updated_at": "2026-10-15T09:30:00Z"
          },
          "project_id": "default",
          "queued_at": "2026-10-15T09:30:00Z",
          "resource_class": "M",
          "spec_hash": "sha256:3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f",
          "spec_id": "spc_01jaf3b1c2d3e4f5g6h7j8k9m0",
          "spec_revision": 2,
          "started_at": "2026-10-15T09:30:05Z",
          "state": "succeeded",
          "tags": {
            "stage": "candidate",
            "team": "growth"
          },
          "tenant_id": "default",
          "timeout": "45m",
          "updated_at": "2026-10-15T09:31:00Z"
        }
      ],
      "summaries": [
        {
          "attempt": 1,
          "count": 1,
          "first_ts": "2026-10-15T09:30:00Z",
          "key": "rmse",
          "last": 12.7,
          "last_step": null,
          "last_ts": "2026-10-15T09:30:00Z",
          "max": 12.7,
          "min": 12.7,
          "run_id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0"
        }
      ],
      "truncated": {
        "params": false
      }
    }
  ],
  "properties": {
    "media": {
      "items": {
        "$ref": "#/$defs/CompareMedia"
      },
      "maxItems": 640,
      "title": "Media",
      "type": "array"
    },
    "metrics": {
      "items": {
        "$ref": "#/$defs/CompareMetric"
      },
      "maxItems": 12,
      "title": "Metrics",
      "type": "array"
    },
    "params": {
      "items": {
        "$ref": "#/$defs/CompareParam"
      },
      "maxItems": 2000,
      "title": "Params",
      "type": "array"
    },
    "runs": {
      "items": {
        "$ref": "#/$defs/Run"
      },
      "maxItems": 10,
      "minItems": 2,
      "title": "Runs",
      "type": "array"
    },
    "summaries": {
      "items": {
        "$ref": "#/$defs/CompareSummary"
      },
      "maxItems": 1000,
      "title": "Summaries",
      "type": "array"
    },
    "truncated": {
      "additionalProperties": {
        "type": "boolean"
      },
      "description": "True for a part that was capped",
      "propertyNames": {
        "enum": [
          "summaries",
          "series",
          "params",
          "media"
        ]
      },
      "title": "Truncated",
      "type": "object"
    }
  },
  "required": [
    "runs"
  ],
  "title": "RunCompare",
  "type": "object",
  "x-mapi-contract-version": "0.2"
}
