{
  "$defs": {
    "AppliesTo": {
      "additionalProperties": false,
      "description": "Scope beside the estimand: compared by ``G-EST-02`` like the seven fields.",
      "properties": {
        "client_id": {
          "title": "Client Id",
          "type": "string"
        },
        "geo_ids": {
          "items": {
            "type": "string"
          },
          "title": "Geo Ids",
          "type": "array"
        },
        "kpi": {
          "title": "Kpi",
          "type": "string"
        },
        "media_ids": {
          "items": {
            "type": "string"
          },
          "title": "Media Ids",
          "type": "array"
        },
        "period": {
          "$ref": "#/$defs/Period"
        },
        "time_id": {
          "description": "Spec \u00a74 time registry entry ID.",
          "title": "Time Id",
          "type": "string"
        }
      },
      "title": "AppliesTo",
      "type": "object"
    },
    "ChannelResult": {
      "additionalProperties": false,
      "properties": {
        "contribution": {
          "anyOf": [
            {
              "$ref": "#/$defs/ShownNumber"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "marginal_roi": {
          "anyOf": [
            {
              "$ref": "#/$defs/ShownNumber"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "media_id": {
          "title": "Media Id",
          "type": "string"
        },
        "outside_grid": {
          "default": false,
          "title": "Outside Grid",
          "type": "boolean"
        },
        "spend": {
          "title": "Spend",
          "type": "number"
        }
      },
      "required": [
        "media_id",
        "spend"
      ],
      "title": "ChannelResult",
      "type": "object"
    },
    "Estimand": {
      "additionalProperties": false,
      "description": "The seven fields plus ``applies_to`` and the registered optional members. ``None`` (written\n``\"undeclared\"``) means undeclared.",
      "properties": {
        "applies_to": {
          "$ref": "#/$defs/AppliesTo"
        },
        "baseline": {
          "anyOf": [
            {
              "enum": [
                "zero_spend",
                "current_plan",
                "reduced_spend",
                "control_counterfactual"
              ],
              "type": "string"
            },
            {
              "const": "undeclared",
              "type": "string"
            }
          ],
          "title": "Baseline"
        },
        "baseline_x": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "const": "undeclared",
              "type": "string"
            }
          ],
          "description": "x of reduced_spend(x): spend at x times the current plan. Required with baseline reduced_spend; ignored otherwise (spec \u00a75).",
          "title": "Baseline X"
        },
        "field_status": {
          "additionalProperties": {
            "enum": [
              "declared",
              "undeclared",
              "assumed"
            ],
            "type": "string"
          },
          "title": "Field Status",
          "type": "object"
        },
        "horizon": {
          "anyOf": [
            {
              "$ref": "#/$defs/Horizon"
            },
            {
              "const": "undeclared",
              "type": "string"
            }
          ]
        },
        "interval": {
          "anyOf": [
            {
              "$ref": "#/$defs/IntervalSpec"
            },
            {
              "const": "undeclared",
              "type": "string"
            }
          ]
        },
        "intervention": {
          "anyOf": [
            {
              "$ref": "#/$defs/Intervention"
            },
            {
              "const": "undeclared",
              "type": "string"
            }
          ]
        },
        "metric_family": {
          "description": "sales_return, brand_awareness, ...",
          "title": "Metric Family",
          "type": "string"
        },
        "point_rule": {
          "anyOf": [
            {
              "enum": [
                "posterior_mean",
                "posterior_median",
                "map",
                "estimator_point"
              ],
              "type": "string"
            },
            {
              "$ref": "#/$defs/PointRuleSpec"
            },
            {
              "const": "undeclared",
              "type": "string"
            }
          ],
          "title": "Point Rule"
        },
        "registry_id": {
          "description": "Registered estimand id, e.g. E-BM-AVG-ROI.",
          "title": "Registry Id",
          "type": "string"
        },
        "schema_version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "const": "undeclared",
              "type": "string"
            }
          ],
          "description": "Estimand registry version, e.g. est-registry/1.2.0. No default.",
          "title": "Schema Version"
        },
        "unit": {
          "anyOf": [
            {
              "$ref": "#/$defs/Unit"
            },
            {
              "const": "undeclared",
              "type": "string"
            }
          ]
        }
      },
      "title": "Estimand",
      "type": "object"
    },
    "FallbackEntry": {
      "additionalProperties": false,
      "description": "\u00a719 fallback note. ``effect`` says how the interval changed, in plain words.",
      "properties": {
        "acknowledged_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Acknowledged At"
        },
        "acknowledged_by": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Acknowledged By"
        },
        "assumed": {
          "title": "Assumed",
          "type": "string"
        },
        "code": {
          "pattern": "^[A-Z][A-Z0-9_]*$",
          "title": "Code",
          "type": "string"
        },
        "effect": {
          "title": "Effect",
          "type": "string"
        },
        "envelope_kind": {
          "anyOf": [
            {
              "enum": [
                "bound",
                "range"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "G-DEP-01 (spec \u00a77): `bound` for sums, means, CVaR and monotone functions of sums; `range` for quantile-type, non-monotone outputs and EVOI. A range is never a bound.",
          "title": "Envelope Kind"
        },
        "field": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Field"
        },
        "gate": {
          "title": "Gate",
          "type": "string"
        },
        "interval_after": {
          "anyOf": [
            {
              "$ref": "#/$defs/Interval"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "interval_before": {
          "anyOf": [
            {
              "$ref": "#/$defs/Interval"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "code",
        "gate",
        "assumed",
        "effect"
      ],
      "title": "FallbackEntry",
      "type": "object"
    },
    "Horizon": {
      "additionalProperties": false,
      "description": "Time over which the effect is counted. ``{type: window, anchor: fit}`` is the model's fit window:\na template written before any fit (an adapter's metadata) leaves ``weeks`` absent, and every\nquantity a fit produces states ``weeks`` (spec \u00a75, \"Fit-window horizon\"). ``weeks`` is never null.",
      "properties": {
        "anchor": {
          "const": "fit",
          "description": "Spec \u00a75: `fit` means the window is the model's fit window. Absent means the window counts from the start of the intervention.",
          "title": "Anchor",
          "type": "string"
        },
        "threshold": {
          "description": "Decay threshold for total_to_decay.",
          "title": "Threshold",
          "type": "number"
        },
        "type": {
          "enum": [
            "immediate",
            "window",
            "total_to_decay",
            "total"
          ],
          "title": "Type",
          "type": "string"
        },
        "weeks": {
          "description": "Weeks counted. Absent only on a fit-window template.",
          "minimum": 0,
          "title": "Weeks",
          "type": "integer"
        }
      },
      "required": [
        "type"
      ],
      "title": "Horizon",
      "type": "object"
    },
    "Interval": {
      "additionalProperties": false,
      "properties": {
        "hi": {
          "title": "Hi",
          "type": "number"
        },
        "level": {
          "default": 0.9,
          "exclusiveMaximum": 1,
          "exclusiveMinimum": 0,
          "title": "Level",
          "type": "number"
        },
        "lo": {
          "title": "Lo",
          "type": "number"
        },
        "method": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Method"
        },
        "segments": {
          "anyOf": [
            {
              "items": {
                "maxItems": 2,
                "minItems": 2,
                "prefixItems": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "number"
                  }
                ],
                "type": "array"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Spec \u00a75: an `hdi` region that is not one interval, as ordered, non-overlapping [lo, hi] segments inside [lo, hi] (note MULTIMODAL_HDI).",
          "title": "Segments"
        }
      },
      "required": [
        "lo",
        "hi"
      ],
      "title": "Interval",
      "type": "object"
    },
    "IntervalSpec": {
      "additionalProperties": false,
      "properties": {
        "level": {
          "exclusiveMaximum": 1,
          "exclusiveMinimum": 0,
          "title": "Level",
          "type": "number"
        },
        "method": {
          "enum": [
            "hdi",
            "eti",
            "confidence",
            "bootstrap_pct",
            "placebo",
            "envelope",
            "imputed"
          ],
          "title": "Method",
          "type": "string"
        }
      },
      "required": [
        "method",
        "level"
      ],
      "title": "IntervalSpec",
      "type": "object"
    },
    "Intervention": {
      "additionalProperties": false,
      "properties": {
        "arms": {
          "items": {
            "type": "string"
          },
          "title": "Arms",
          "type": "array"
        },
        "population": {
          "anyOf": [
            {
              "enum": [
                "itt",
                "exposed",
                "geo_set"
              ],
              "type": "string"
            },
            {
              "const": "undeclared",
              "type": "string"
            }
          ],
          "title": "Population"
        },
        "size": {
          "description": "e.g. -0.30 for a 30% cut, 0.10 for +10%.",
          "title": "Size",
          "type": "number"
        },
        "size_kind": {
          "anyOf": [
            {
              "enum": [
                "absolute",
                "relative"
              ],
              "type": "string"
            },
            {
              "const": "undeclared",
              "type": "string"
            }
          ],
          "description": "How to read size: relative (a fraction of current spend) or absolute (spend in unit.currency). Required when size is present; no default (spec \u00a75).",
          "title": "Size Kind"
        },
        "type": {
          "enum": [
            "remove_all",
            "scale",
            "add",
            "marginal"
          ],
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "Intervention",
      "type": "object"
    },
    "Note": {
      "additionalProperties": false,
      "description": "Informational or warning note (e.g. ``ENGINE_STUB``, ``NOT_IMPLEMENTED_IN_POC``).",
      "properties": {
        "code": {
          "pattern": "^[A-Z][A-Z0-9_]*$",
          "title": "Code",
          "type": "string"
        },
        "gate": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Gate"
        },
        "message": {
          "title": "Message",
          "type": "string"
        },
        "severity": {
          "default": "info",
          "enum": [
            "info",
            "warn"
          ],
          "title": "Severity",
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "title": "Note",
      "type": "object"
    },
    "Period": {
      "additionalProperties": false,
      "description": "Calendar dates, half-open ``[start, end)`` (spec \u00a74).",
      "properties": {
        "end": {
          "format": "date",
          "title": "End",
          "type": "string"
        },
        "start": {
          "format": "date",
          "title": "Start",
          "type": "string"
        }
      },
      "title": "Period",
      "type": "object"
    },
    "PlanLine": {
      "additionalProperties": false,
      "properties": {
        "cost_basis": {
          "default": "net",
          "enum": [
            "net",
            "gross"
          ],
          "title": "Cost Basis",
          "type": "string"
        },
        "media_id": {
          "title": "Media Id",
          "type": "string"
        },
        "period": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Period"
        },
        "region_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Region Id"
        },
        "spend": {
          "minimum": 0,
          "title": "Spend",
          "type": "number"
        }
      },
      "required": [
        "media_id",
        "spend"
      ],
      "title": "PlanLine",
      "type": "object"
    },
    "PointRuleSpec": {
      "additionalProperties": false,
      "description": "``{rule, scale}`` form of ``point_rule`` (spec \u00a75): ``scale`` is ``identity`` or ``log``.",
      "properties": {
        "rule": {
          "enum": [
            "posterior_mean",
            "posterior_median",
            "map",
            "estimator_point"
          ],
          "title": "Rule",
          "type": "string"
        },
        "scale": {
          "enum": [
            "identity",
            "log"
          ],
          "title": "Scale",
          "type": "string"
        }
      },
      "required": [
        "rule",
        "scale"
      ],
      "title": "PointRuleSpec",
      "type": "object"
    },
    "ScenarioResult": {
      "additionalProperties": false,
      "properties": {
        "dependence_used": {
          "anyOf": [
            {
              "enum": [
                "joint_draws",
                "joint_gaussian",
                "declared_assumption",
                "per_channel",
                "none"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Dependence Used"
        },
        "kpi": {
          "$ref": "#/$defs/ShownNumber"
        },
        "ladder_step": {
          "default": "full_model",
          "enum": [
            "full_model",
            "curve_params",
            "spend_table",
            "summary",
            "benchmarks",
            "not_available"
          ],
          "title": "Ladder Step",
          "type": "string"
        },
        "per_channel": {
          "items": {
            "$ref": "#/$defs/ChannelResult"
          },
          "title": "Per Channel",
          "type": "array"
        }
      },
      "required": [
        "kpi"
      ],
      "title": "ScenarioResult",
      "type": "object"
    },
    "ShownNumber": {
      "additionalProperties": false,
      "description": "The display contract: a value can only be shown with its interval, estimand and trust labels.",
      "properties": {
        "artifact_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "G-REP-01: the artifact this number resolves to.",
          "title": "Artifact Id"
        },
        "audit_level": {
          "default": 2,
          "enum": [
            1,
            2,
            3,
            4
          ],
          "title": "Audit Level",
          "type": "integer"
        },
        "confidence": {
          "anyOf": [
            {
              "enum": [
                "high",
                "medium",
                "low"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "From trust level and interval width (rule in ump_spec.rules.plain; proposed).",
          "title": "Confidence"
        },
        "estimand": {
          "$ref": "#/$defs/Estimand"
        },
        "fallbacks": {
          "items": {
            "$ref": "#/$defs/FallbackEntry"
          },
          "title": "Fallbacks",
          "type": "array"
        },
        "headline": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Plain short label, e.g. 'Return per $1 on Linear TV'.",
          "title": "Headline"
        },
        "interval": {
          "$ref": "#/$defs/Interval"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Short caption, e.g. 'Paid Social iROAS'.",
          "title": "Label"
        },
        "notes": {
          "items": {
            "$ref": "#/$defs/Note"
          },
          "title": "Notes",
          "type": "array"
        },
        "plain_words": {
          "description": "Estimand in plain words, including any assumed field.",
          "title": "Plain Words",
          "type": "string"
        },
        "range_words": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The interval in words, e.g. 'likely between $0.60 and $1.87'.",
          "title": "Range Words"
        },
        "trust_level": {
          "default": 2,
          "maximum": 4,
          "minimum": 1,
          "title": "Trust Level",
          "type": "integer"
        },
        "unit_label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Unit Label"
        },
        "value": {
          "title": "Value",
          "type": "number"
        },
        "why_best_guess": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "One plain sentence when the number rests on fallbacks.",
          "title": "Why Best Guess"
        },
        "width_label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "narrow|moderate|wide (proposed cut points).",
          "title": "Width Label"
        }
      },
      "required": [
        "value",
        "interval",
        "estimand",
        "plain_words"
      ],
      "title": "ShownNumber",
      "type": "object"
    },
    "Unit": {
      "additionalProperties": false,
      "description": "``per`` is ``spend``, ``impression`` or ``absolute``. ``currency`` (ISO 4217) is required with\n``per: spend`` and allowed with ``per: absolute`` (a money KPI); there its absence means the KPI is\nnot money. Build a spend unit with ``spend_unit(currency)``.",
      "properties": {
        "cost_basis": {
          "anyOf": [
            {
              "enum": [
                "net",
                "gross"
              ],
              "type": "string"
            },
            {
              "const": "undeclared",
              "type": "string"
            }
          ],
          "title": "Cost Basis"
        },
        "currency": {
          "anyOf": [
            {
              "pattern": "^[A-Z]{3}$",
              "type": "string"
            },
            {
              "const": "undeclared",
              "type": "string"
            }
          ],
          "description": "ISO 4217 alpha-3; required with per: spend.",
          "title": "Currency"
        },
        "kpi": {
          "title": "Kpi",
          "type": "string"
        },
        "per": {
          "anyOf": [
            {
              "enum": [
                "spend",
                "impression",
                "absolute"
              ],
              "type": "string"
            },
            {
              "const": "undeclared",
              "type": "string"
            }
          ],
          "description": "Denominator: spend, impression or absolute (spec \u00a75).",
          "title": "Per"
        }
      },
      "required": [
        "kpi"
      ],
      "title": "Unit",
      "type": "object"
    }
  },
  "$id": "https://schemas.ump.dev/v1/scenario.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "allocation": {
      "anyOf": [
        {
          "items": {},
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Allocation lines copied from the optimisation result. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Allocation"
    },
    "approved_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): approver principal.",
      "title": "Governance ApprovedBy"
    },
    "assumptions": {
      "additionalProperties": true,
      "title": "Assumptions",
      "type": "object"
    },
    "audit_level": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Spec \u00a713 audit level of the run that made it. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Audit Level"
    },
    "author": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Author"
    },
    "baseline_kpi": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Baseline KPI as a ShownNumber. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Baseline Kpi"
    },
    "baseline_plan": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Baseline spend per channel. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Baseline Plan"
    },
    "client_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Client Id"
    },
    "content_hash": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): the artifact content hash.",
      "title": "Governance ContentHash"
    },
    "crn_seed": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Crn Seed"
    },
    "dependence": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Dependence declaration used for the portfolio sums (\u00a78). Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Dependence"
    },
    "drafted_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Agent principal that drafted the scenario. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Drafted By"
    },
    "endpoint_alias": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Endpoint Alias"
    },
    "engine": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "What computed the scenario. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Engine"
    },
    "expected_regret": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Expected regret against the per-draw best plan. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Expected Regret"
    },
    "fallbacks": {
      "items": {
        "$ref": "#/$defs/FallbackEntry"
      },
      "title": "Fallbacks",
      "type": "array"
    },
    "gate_results": {
      "anyOf": [
        {
          "items": {},
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): gate results of the latest run.",
      "title": "Governance GateResults"
    },
    "group_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Group Id"
    },
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): artifact id.",
      "title": "Governance Id"
    },
    "injection_flagged_findings": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Reader findings flagged as possible prompt injection (\u00a717). Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Injection Flagged Findings"
    },
    "ladder_step": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Fallback-ladder rung the numbers came from (\u00a78). Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Ladder Step"
    },
    "model_content_hash": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Content hash of that model version (\u00a76). Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Model Content Hash"
    },
    "model_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Model Id"
    },
    "model_revision": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The model revision this scenario was scored on (spec \u00a712). The older member name ``revision`` is read for one cycle.",
      "title": "Model Revision"
    },
    "model_version": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Version of the model the scenario was scored on. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Model Version"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Name"
    },
    "newton_session": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Newton session that drafted this scenario. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Newton Session"
    },
    "notes": {
      "items": {
        "$ref": "#/$defs/Note"
      },
      "title": "Notes",
      "type": "array"
    },
    "objective": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optimiser objective: mean, p10 or cvar5. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Objective"
    },
    "optimisation_result_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The optimisation result this scenario came from. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Optimisation Result Id"
    },
    "owner": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): owner principal.",
      "title": "Governance Owner"
    },
    "p_beat_plan": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Probability the scenario beats the baseline plan. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "P Beat Plan"
    },
    "plan": {
      "items": {
        "$ref": "#/$defs/PlanLine"
      },
      "title": "Plan",
      "type": "array"
    },
    "purpose": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Purpose"
    },
    "reader_findings": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Reader finding ids the actor drew on (\u00a717). Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Reader Findings"
    },
    "reader_findings_untrusted": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Reader finding ids marked untrusted text (\u00a717). Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Reader Findings Untrusted"
    },
    "results": {
      "anyOf": [
        {
          "$ref": "#/$defs/ScenarioResult"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "revision": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): content revision (spec \u00a77).",
      "title": "Governance Revision"
    },
    "scenario_kind": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Kind of scenario: `current`, `optimal`, `custom`, ... Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Scenario Kind"
    },
    "seed_key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Seed-run key that made this scenario (e2e seed only). Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Seed Key"
    },
    "stale": {
      "default": false,
      "title": "Stale",
      "type": "boolean"
    },
    "stale_since_version": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Stale Since Version"
    },
    "state": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): lifecycle state of the version.",
      "title": "Governance State"
    },
    "submitted_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): submitter principal.",
      "title": "Governance SubmittedBy"
    },
    "thinning_index": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Thinning Index"
    },
    "total_spend": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Total planned spend. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Total Spend"
    },
    "trust_level": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Trust level shown with the numbers. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Trust Level"
    },
    "uplift": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Uplift over the baseline as a ShownNumber. Written by planner (`service.py`) and Newton's actor (`actor_tools.py`).",
      "title": "Uplift"
    },
    "valid_to": {
      "default": null,
      "description": "Governance member (spec \u00a76): end of the validity window (spec \u00a77).",
      "title": "Governance ValidTo"
    },
    "view": {
      "default": "full",
      "enum": [
        "full",
        "curves",
        "table"
      ],
      "title": "View",
      "type": "string"
    }
  },
  "required": [
    "plan"
  ],
  "title": "Scenario",
  "type": "object"
}
