{
  "$defs": {
    "ArtifactLink": {
      "description": "A short-lived, generation-pinned signed GET URL for one artifact (HTTP Range works).",
      "examples": [
        {
          "content_type": "application/zip",
          "crc32c": "4waSgw==",
          "expires_at": "2026-10-15T09:45:00Z",
          "generation": 7,
          "name": "bundle.zarr.zip",
          "size": 2097152,
          "url": "http://127.0.0.1:4443/download/storage/v1/b/mapi-local-bundles/o/t%2Fdefault%2Fmodels%2Fmdl_01%2F1%2Fbundle.zarr.zip?generation=7&X-Goog-Signature=\u2026"
        }
      ],
      "properties": {
        "content_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content Type"
        },
        "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"
        },
        "expires_at": {
          "format": "date-time",
          "title": "Expires At",
          "type": "string"
        },
        "generation": {
          "minimum": 1,
          "title": "Generation",
          "type": "integer"
        },
        "method": {
          "const": "GET",
          "default": "GET",
          "title": "Method",
          "type": "string"
        },
        "name": {
          "maxLength": 1024,
          "title": "Name",
          "type": "string"
        },
        "size": {
          "minimum": 0,
          "title": "Size",
          "type": "integer"
        },
        "url": {
          "title": "Url",
          "type": "string"
        }
      },
      "required": [
        "name",
        "url",
        "expires_at",
        "size",
        "crc32c",
        "generation"
      ],
      "title": "ArtifactLink",
      "type": "object"
    },
    "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"
    },
    "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"
    },
    "ForecastConditioning": {
      "description": "What a forecast was conditioned on: the fitted history, the supplied actuals and where\nthe forecast periods came from. ``parameters`` is always ``fitted``: conditioning never\nre-estimates the model. ``message`` says the same in plain language.",
      "examples": [
        {
          "actuals_through": "1961-03-01",
          "conditioned": true,
          "dim": "t",
          "fit_end": "1960-12-01",
          "horizon_source": "horizon",
          "message": "Forecast updated with 3 actuals (1961-01-01 to 1961-03-01) after the fitted history, which ends 1960-12-01; the model's parameters were not re-estimated. 8 periods forecast from 1961-04-01 to 1961-11-01.",
          "n_actuals": 3,
          "n_series": 1,
          "parameters": "fitted",
          "periods": 8,
          "revised": 0,
          "series": [
            {
              "actuals_through": "1961-03-01",
              "first_actual": "1961-01-01",
              "forecast_from": "1961-04-01",
              "forecast_to": "1961-11-01",
              "missing": 0,
              "n_actuals": 3,
              "n_forecast": 8,
              "origin": "1961-03-01",
              "revised": 0,
              "series": {}
            }
          ],
          "series_conditioned": 1,
          "truncated": false
        },
        {
          "conditioned": false,
          "dim": "t",
          "fit_end": "1960-12-01",
          "horizon_source": "horizon",
          "message": "Forecast from the end of the fitted history (1960-12-01); no actuals were supplied. 8 periods forecast from 1961-01-01 to 1961-08-01.",
          "n_actuals": 0,
          "periods": 8,
          "series": [
            {
              "forecast_from": "1961-01-01",
              "forecast_to": "1961-08-01",
              "n_actuals": 0,
              "n_forecast": 8,
              "origin": "1960-12-01"
            }
          ]
        }
      ],
      "properties": {
        "actuals_through": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The latest actual over every series",
          "title": "Actuals Through"
        },
        "conditioned": {
          "description": "Whether any supplied actual was used",
          "title": "Conditioned",
          "type": "boolean"
        },
        "dim": {
          "pattern": "^[A-Za-z_][A-Za-z0-9_.\\-]{0,127}$",
          "title": "Dim",
          "type": "string"
        },
        "fit_end": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            }
          ],
          "description": "The last period of the fitted history",
          "title": "Fit End"
        },
        "horizon_source": {
          "enum": [
            "rows",
            "horizon"
          ],
          "title": "Horizon Source",
          "type": "string"
        },
        "message": {
          "maxLength": 2000,
          "title": "Message",
          "type": "string"
        },
        "n_actuals": {
          "description": "Actuals used, over every series",
          "minimum": 0,
          "title": "N Actuals",
          "type": "integer"
        },
        "n_series": {
          "default": 1,
          "minimum": 0,
          "title": "N Series",
          "type": "integer"
        },
        "parameters": {
          "const": "fitted",
          "default": "fitted",
          "title": "Parameters",
          "type": "string"
        },
        "periods": {
          "description": "Forecast periods (the most over series)",
          "minimum": 0,
          "title": "Periods",
          "type": "integer"
        },
        "revised": {
          "default": 0,
          "minimum": 0,
          "title": "Revised",
          "type": "integer"
        },
        "series": {
          "items": {
            "$ref": "#/$defs/SeriesConditioning"
          },
          "maxItems": 1000,
          "title": "Series",
          "type": "array"
        },
        "series_conditioned": {
          "default": 0,
          "description": "Series with at least one actual",
          "minimum": 0,
          "title": "Series Conditioned",
          "type": "integer"
        },
        "truncated": {
          "default": false,
          "description": "More series than MAX_CONDITIONING_SERIES",
          "title": "Truncated",
          "type": "boolean"
        }
      },
      "required": [
        "dim",
        "fit_end",
        "conditioned",
        "n_actuals",
        "horizon_source",
        "periods",
        "message"
      ],
      "title": "ForecastConditioning",
      "type": "object"
    },
    "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"
    },
    "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"
    },
    "ScoreSummary": {
      "description": "The requested summary of a score run as plain tables (``summary.json``), inlined in\n:class:`ScoreCallResult` so spreadsheets, BI tools and curl callers get numbers without\nzarr or Arrow. ``truncated``: more than :data:`SCORE_SUMMARY_MAX_CELLS` cells (use the\n``score.zarr.zip`` output for everything). ``conditioning`` (forecasts): what the\nforecast was conditioned on - the end of the fitted history and the actuals the request\nsupplied (:mod:`mapi_spec.actuals`); ``actuals`` holds those values next to the\npredictions they compare with.",
      "examples": [
        {
          "tables": [
            {
              "columns": [
                "geo",
                "time",
                "mean",
                "hdi_90_lower",
                "hdi_90_upper"
              ],
              "rows": [
                [
                  "de",
                  "2026-01-05",
                  1520.4,
                  1402.1,
                  1633.9
                ]
              ],
              "variable": "revenue"
            }
          ],
          "truncated": false
        },
        {
          "conditioning": {
            "actuals_through": "1961-03-01",
            "conditioned": true,
            "dim": "t",
            "fit_end": "1960-12-01",
            "horizon_source": "horizon",
            "message": "Forecast updated with 3 actuals (1961-01-01 to 1961-03-01) after the fitted history, which ends 1960-12-01; the model's parameters were not re-estimated. 8 periods forecast from 1961-04-01 to 1961-11-01.",
            "n_actuals": 3,
            "n_series": 1,
            "parameters": "fitted",
            "periods": 8,
            "revised": 0,
            "series": [
              {
                "actuals_through": "1961-03-01",
                "first_actual": "1961-01-01",
                "forecast_from": "1961-04-01",
                "forecast_to": "1961-11-01",
                "missing": 0,
                "n_actuals": 3,
                "n_forecast": 8,
                "origin": "1961-03-01",
                "revised": 0,
                "series": {}
              }
            ],
            "series_conditioned": 1,
            "truncated": false
          },
          "tables": [
            {
              "columns": [
                "t",
                "median",
                "q5",
                "q95"
              ],
              "rows": [
                [
                  "1961-01-01",
                  447.2,
                  424.9,
                  469.5
                ],
                [
                  "1961-04-01",
                  461.8,
                  431.0,
                  492.6
                ]
              ],
              "variable": "y_hat"
            }
          ],
          "truncated": false
        }
      ],
      "properties": {
        "actuals": {
          "description": "Forecasts with actuals: the actuals the request supplied, as tables named after the prediction variable they compare with (its coordinate columns, then `actual`), in the output's names and original units. Predictions on those periods are one-step-ahead: what the model expected before seeing each actual",
          "items": {
            "$ref": "#/$defs/ScoreSummaryTable"
          },
          "maxItems": 16,
          "title": "Actuals",
          "type": "array"
        },
        "conditioning": {
          "anyOf": [
            {
              "$ref": "#/$defs/ForecastConditioning"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "tables": {
          "items": {
            "$ref": "#/$defs/ScoreSummaryTable"
          },
          "maxItems": 1000,
          "title": "Tables",
          "type": "array"
        },
        "truncated": {
          "default": false,
          "title": "Truncated",
          "type": "boolean"
        }
      },
      "title": "ScoreSummary",
      "type": "object"
    },
    "ScoreSummaryTable": {
      "description": "One output variable's summary as a table: the coordinate columns (one per dim), then\none column per statistic (``mean``, ``hdi_90_lower``, ...). Dates are ISO text.\n``period``: the variable is a circular output (``OutputDecl.circular``), summarised on the\ncircle (see the field). ``dims`` and ``time_dim`` say which columns are coordinates and\nwhich one is time; a server that predates them leaves both out. ``plots``: the recipe ids\nof the run's rendered plots (``plots.json``) that draw this variable, so a client can show\nthem next to the table.",
      "examples": [
        {
          "columns": [
            "geo",
            "time",
            "mean",
            "hdi_90_lower",
            "hdi_90_upper"
          ],
          "dims": [
            "geo",
            "time"
          ],
          "rows": [
            [
              "de",
              "2026-01-05",
              1520.4,
              1402.1,
              1633.9
            ]
          ],
          "time_dim": "time",
          "variable": "revenue"
        }
      ],
      "properties": {
        "columns": {
          "items": {
            "type": "string"
          },
          "maxItems": 256,
          "title": "Columns",
          "type": "array"
        },
        "dims": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "maxItems": 64,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The coordinate columns (the leading columns); the rest are statistics",
          "title": "Dims"
        },
        "period": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Set for a circular output (an angle that wraps at one turn, in the output's units): the statistics are on the circle. `mean` is the circular mean, the intervals are centred on it, and every value is in [0, period). An interval with lower > upper crosses the seam (from 350 to 10 degrees)",
          "title": "Period"
        },
        "plots": {
          "anyOf": [
            {
              "items": {
                "pattern": "^[A-Za-z0-9_.\\-]{1,128}$",
                "type": "string"
              },
              "maxItems": 16,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Recipe ids of the run's plots that draw this output (sci.area_map, core.roc_pr, ...)",
          "title": "Plots"
        },
        "rows": {
          "items": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "title": "Rows",
          "type": "array"
        },
        "time_dim": {
          "anyOf": [
            {
              "maxLength": 256,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The dim that is time, when there is one",
          "title": "Time Dim"
        },
        "variable": {
          "maxLength": 256,
          "title": "Variable",
          "type": "string"
        }
      },
      "required": [
        "variable",
        "columns",
        "rows"
      ],
      "title": "ScoreSummaryTable",
      "type": "object"
    },
    "SeriesConditioning": {
      "description": "What one series' forecast was conditioned on.\n\n``series`` holds the series' labels on the target's other dims (empty for a single\nseries). ``origin`` is the last period the forecast starts from: the last actual, or the\nend of the fitted history when the series has none.",
      "examples": [
        {
          "actuals_through": "1961-03-01",
          "first_actual": "1961-01-01",
          "forecast_from": "1961-04-01",
          "forecast_to": "1961-11-01",
          "missing": 0,
          "n_actuals": 3,
          "n_forecast": 8,
          "origin": "1961-03-01",
          "revised": 0,
          "series": {}
        }
      ],
      "properties": {
        "actuals_through": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The last supplied actual",
          "title": "Actuals Through"
        },
        "first_actual": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "First Actual"
        },
        "forecast_from": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Forecast From"
        },
        "forecast_to": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Forecast To"
        },
        "missing": {
          "default": 0,
          "description": "Empty periods between the fitted history and the last actual, filtered as missing observations (only models that accept missing targets)",
          "minimum": 0,
          "title": "Missing",
          "type": "integer"
        },
        "n_actuals": {
          "description": "Periods with a supplied actual",
          "minimum": 0,
          "title": "N Actuals",
          "type": "integer"
        },
        "n_forecast": {
          "default": 0,
          "minimum": 0,
          "title": "N Forecast",
          "type": "integer"
        },
        "origin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            }
          ],
          "title": "Origin"
        },
        "revised": {
          "default": 0,
          "description": "Actuals inside the fitted range: they replaced the fitted values",
          "minimum": 0,
          "title": "Revised",
          "type": "integer"
        },
        "series": {
          "patternProperties": {
            "^[A-Za-z_][A-Za-z0-9_.\\-]{0,127}$": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ]
            }
          },
          "title": "Series",
          "type": "object"
        }
      },
      "required": [
        "n_actuals",
        "origin"
      ],
      "title": "SeriesConditioning",
      "type": "object"
    },
    "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-ScoreCallResult.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "``done`` with output links (200), or the still-running run (202). ``summary`` is the\nrequested summary (mean and HDI by default) inline, once the run succeeded.",
  "examples": [
    {
      "done": true,
      "outputs": [
        {
          "content_type": "application/zip",
          "crc32c": "4waSgw==",
          "expires_at": "2026-10-15T09:45:00Z",
          "generation": 7,
          "name": "bundle.zarr.zip",
          "size": 2097152,
          "url": "http://127.0.0.1:4443/download/storage/v1/b/mapi-local-bundles/o/t%2Fdefault%2Fmodels%2Fmdl_01%2F1%2Fbundle.zarr.zip?generation=7&X-Goog-Signature=\u2026"
        }
      ],
      "run": {
        "attempt": 1,
        "cost": {
          "estimated": true
        },
        "created_at": "2026-10-15T09:30:00Z",
        "executor": "local-process",
        "id": "run_01jaf3q2x8m9v7k5h4g3f2e1d0",
        "kind": "score",
        "name": "weekly sales, adstock 4",
        "progress": null,
        "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"
      }
    }
  ],
  "properties": {
    "done": {
      "title": "Done",
      "type": "boolean"
    },
    "outputs": {
      "items": {
        "$ref": "#/$defs/ArtifactLink"
      },
      "title": "Outputs",
      "type": "array"
    },
    "run": {
      "$ref": "#/$defs/Run"
    },
    "summary": {
      "anyOf": [
        {
          "$ref": "#/$defs/ScoreSummary"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "required": [
    "done",
    "run"
  ],
  "title": "ScoreCallResult",
  "type": "object",
  "x-mapi-contract-version": "0.2"
}
