{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mantic/json-schema/mantic-condition-view-schema.json",
  "title": "ConditionView",
  "description": "A condition on a base question, with its reconciled result when available.\n\n``pa_status`` / ``conditional_status`` let the client render the per-condition\npipeline (p(a) forecast, then the branch super-job) without extra lookups.",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mantic-openapi.json#/components/schemas/ConditionView",
  "properties": {
    "condition_id": {
      "type": "integer",
      "title": "Condition Id"
    },
    "base_question_id": {
      "type": "integer",
      "title": "Base Question Id"
    },
    "condition_question_id": {
      "type": "integer",
      "title": "Condition Question Id"
    },
    "condition_question_title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Condition Question Title"
    },
    "condition_statement": {
      "type": "string",
      "title": "Condition Statement"
    },
    "branch_statement_if_yes": {
      "type": "string",
      "title": "Branch Statement If Yes"
    },
    "branch_statement_if_no": {
      "type": "string",
      "title": "Branch Statement If No"
    },
    "short_label_if_yes": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Short Label If Yes"
    },
    "short_label_if_no": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Short Label If No"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created At"
    },
    "pa_status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pa Status"
    },
    "pa_started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pa Started At"
    },
    "pa_completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pa Completed At"
    },
    "pa_reused": {
      "type": "boolean",
      "title": "Pa Reused",
      "default": false
    },
    "conditional_status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Conditional Status"
    },
    "conditional_started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Conditional Started At"
    },
    "conditional_completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Conditional Completed At"
    },
    "result": {
      "anyOf": [
        {
          "$ref": "#/$defs/ConditionalForecastResult"
        },
        {
          "type": "null"
        }
      ]
    },
    "is_stale": {
      "type": "boolean",
      "title": "Is Stale",
      "default": false
    },
    "updating": {
      "type": "boolean",
      "title": "Updating",
      "default": false
    },
    "pa_is_outdated": {
      "type": "boolean",
      "title": "Pa Is Outdated",
      "default": false
    },
    "condition_output_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Condition Output Type"
    },
    "threshold_comparator": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Threshold Comparator"
    },
    "threshold_numeric": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Threshold Numeric"
    },
    "threshold_date": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Threshold Date"
    },
    "threshold_outcome": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Threshold Outcome"
    },
    "condition_event_label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Condition Event Label"
    },
    "condition_forecast_ticks_epoch": {
      "anyOf": [
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Condition Forecast Ticks Epoch"
    },
    "condition_forecast_cdf_ticks": {
      "anyOf": [
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Condition Forecast Cdf Ticks"
    },
    "condition_forecast_cdf": {
      "anyOf": [
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Condition Forecast Cdf"
    },
    "condition_chart": {
      "anyOf": [
        {
          "$ref": "#/$defs/DrawnRun"
        },
        {
          "type": "null"
        }
      ],
      "description": "A numerical condition question's own forecast as its chart draws it."
    },
    "condition_state": {
      "anyOf": [
        {
          "$ref": "#/$defs/ConditionState"
        },
        {
          "type": "null"
        }
      ]
    },
    "pa_as_of": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pa As Of"
    },
    "resolved_value": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Resolved Value"
    },
    "realised_branch": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "yes",
            "no"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Realised Branch"
    },
    "realised_day": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Realised Day"
    },
    "membership_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Membership Id"
    },
    "position": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Position"
    },
    "auto_run": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Auto Run",
      "description": "Whether the scenario reruns on each new base forecast; set only on a scenario the viewer's own set holds"
    },
    "can_make_public": {
      "type": "boolean",
      "title": "Can Make Public",
      "description": "Whether the viewer, an admin, holds this scenario in their own set and so is offered moving it into the public one",
      "default": false
    },
    "make_public_refusal": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Make Public Refusal",
      "description": "Why that move would be refused, when it would"
    },
    "blocked_reason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Blocked Reason",
      "description": "Why the base question's latest forecast cannot be rerun for this scenario"
    },
    "run_state": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "not_run",
            "stale",
            "queued",
            "in_flight",
            "current"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Run State",
      "description": "Whether the scenario's result is missing, behind the base forecast, being computed or current; set only on a scenario the viewer's own set holds"
    },
    "run_queued": {
      "type": "boolean",
      "title": "Run Queued",
      "description": "Whether a run Mantic asked for on the public set waits for a free slot; set for admins on public scenarios, which carry no run_state",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "condition_id",
    "base_question_id",
    "condition_question_id",
    "condition_statement",
    "branch_statement_if_yes",
    "branch_statement_if_no"
  ],
  "$defs": {
    "Beyond": {
      "type": "string",
      "enum": [
        "below",
        "above"
      ]
    },
    "CentreKind": {
      "type": "string",
      "enum": [
        "mean",
        "median"
      ]
    },
    "ChartStatistics": {
      "properties": {
        "most_likely_value": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Most Likely Value"
        },
        "percentiles": {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": "object",
          "title": "Percentiles"
        },
        "date_percentiles": {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Timezone-aware timestamp; any offset is accepted and normalized to UTC"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": "object",
          "title": "Date Percentiles"
        },
        "date_default_end": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Timezone-aware timestamp; any offset is accepted and normalized to UTC"
            },
            {
              "type": "null"
            }
          ],
          "title": "Date Default End",
          "description": "End of the date chart's default view."
        },
        "discrete_grid": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiscreteChartGrid"
            },
            {
              "type": "null"
            }
          ]
        },
        "density": {
          "anyOf": [
            {
              "$ref": "#/$defs/NumericalDensity"
            },
            {
              "type": "null"
            }
          ]
        },
        "crest": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Crest",
          "description": "Crest of the drawn density within the drawn range."
        },
        "outcome_step": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Outcome Step",
          "description": "Value step between the outcomes of the question's declared grid."
        },
        "outcome_edges": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Outcome Edges",
          "description": "True where the drawn grid's ticks are the declared grid's cell edges."
        },
        "mean": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Mean",
          "description": "The forecast's expected value."
        },
        "hdi_50": {
          "anyOf": [
            {
              "$ref": "#/$defs/NumericalSupport"
            },
            {
              "type": "null"
            }
          ],
          "description": "The drawn run's 50% highest-density interval."
        },
        "hdi_80": {
          "anyOf": [
            {
              "$ref": "#/$defs/NumericalSupport"
            },
            {
              "type": "null"
            }
          ],
          "description": "The drawn run's 80% highest-density interval."
        },
        "question_range": {
          "anyOf": [
            {
              "$ref": "#/$defs/QuestionRange"
            },
            {
              "type": "null"
            }
          ],
          "description": "The question's range, where the run holds less than 80% of its mass on it."
        }
      },
      "type": "object",
      "title": "ChartStatistics"
    },
    "ConditionState": {
      "type": "string",
      "enum": [
        "live",
        "expected_settled",
        "settled"
      ],
      "title": "ConditionState",
      "description": "Whether a condition's event can still move, and if not, whether the outcome is known.\n\nLives here rather than beside the settlement helper so the API schema can use it without\npulling the forecasting stack in. The rules are in\n:mod:`service.conditional_forecasting.settlement`."
    },
    "ConditionalForecastResult": {
      "properties": {
        "base_execution_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Base Execution Id"
        },
        "forecast_kind": {
          "type": "string",
          "enum": [
            "numerical",
            "date",
            "categorical"
          ],
          "title": "Forecast Kind",
          "default": "numerical"
        },
        "schema_version": {
          "type": "integer",
          "title": "Schema Version",
          "default": 0
        },
        "condition_id": {
          "type": "integer",
          "title": "Condition Id"
        },
        "definition_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Definition Id"
        },
        "condition_statement": {
          "type": "string",
          "title": "Condition Statement"
        },
        "branch_statement_if_yes": {
          "type": "string",
          "title": "Branch Statement If Yes"
        },
        "branch_statement_if_no": {
          "type": "string",
          "title": "Branch Statement If No"
        },
        "p_a": {
          "type": "number",
          "title": "P A"
        },
        "p_a_raw": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "P A Raw"
        },
        "p_a_effective": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "P A Effective"
        },
        "separation": {
          "type": "number",
          "title": "Separation"
        },
        "separation_metric": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Separation Metric"
        },
        "warnings": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Warnings"
        },
        "unconditional_cdf": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Unconditional Cdf"
        },
        "given_a_cdf": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Given A Cdf"
        },
        "given_not_a_cdf": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Given Not A Cdf"
        },
        "median_unconditional": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Median Unconditional"
        },
        "median_given_a": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Median Given A"
        },
        "median_given_not_a": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Median Given Not A"
        },
        "cdf_ticks": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cdf Ticks"
        },
        "range_min": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Range Min"
        },
        "range_max": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Range Max"
        },
        "zero_point": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Zero Point"
        },
        "outcome_step": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Outcome Step",
          "description": "The declared step between outcomes, set on bars and on a curve whose ticks are the declared grid's edges."
        },
        "drawn": {
          "anyOf": [
            {
              "$ref": "#/$defs/DrawnScenarios"
            },
            {
              "type": "null"
            }
          ],
          "description": "The three numerical curves as the base question's chart draws them."
        },
        "ticks_epoch": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ticks Epoch"
        },
        "outcome_ids": {
          "anyOf": [
            {
              "items": {
                "type": "integer"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Outcome Ids"
        },
        "labels": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Labels"
        },
        "unconditional": {
          "anyOf": [
            {
              "additionalProperties": {
                "type": "number"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Unconditional"
        },
        "given_a": {
          "anyOf": [
            {
              "additionalProperties": {
                "type": "number"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Given A"
        },
        "given_not_a": {
          "anyOf": [
            {
              "additionalProperties": {
                "type": "number"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Given Not A"
        },
        "branch_explanations": {
          "anyOf": [
            {
              "$ref": "#/$defs/ScenarioBranchExplanations"
            },
            {
              "type": "null"
            }
          ]
        },
        "scenario_statistics": {
          "anyOf": [
            {
              "$ref": "#/$defs/ScenarioStatistics"
            },
            {
              "type": "null"
            }
          ],
          "description": "The figures each side is published with, read off the curves as served."
        }
      },
      "type": "object",
      "required": [
        "condition_id",
        "condition_statement",
        "branch_statement_if_yes",
        "branch_statement_if_no",
        "p_a",
        "separation"
      ],
      "title": "ConditionalForecastResult",
      "description": "Reconciled coherent conditional forecast (mirrors the stored conditional result).\n\nOne wire shape for every base-question type rather than a union, so a client reads the same\nfields whatever produced the row: ``forecast_kind`` says which type-specific group is\npopulated, and ``_require_kind_fields`` keeps that group mandatory for its own kind. Rows\nwritten before the versioned storage schema carry no discriminator and are numerical by\ndefinition, so the default is ``numerical``."
    },
    "DateGridDistribution": {
      "properties": {
        "kind": {
          "type": "string",
          "const": "date_grid",
          "title": "Kind",
          "default": "date_grid"
        },
        "forecast_type": {
          "anyOf": [
            {
              "$ref": "#/$defs/ForecastType"
            },
            {
              "type": "null"
            }
          ]
        },
        "times": {
          "items": {
            "type": "string",
            "format": "date-time",
            "description": "Timezone-aware timestamp; any offset is accepted and normalized to UTC"
          },
          "type": "array",
          "minItems": 2,
          "title": "Times",
          "description": "Strictly increasing canonical outcome time grid"
        },
        "cdf_probabilities": {
          "items": {
            "type": "number"
          },
          "type": "array",
          "minItems": 2,
          "title": "Cdf Probabilities",
          "description": "CDF on the canonical time grid; the first value is mass at the closed lower endpoint, and for an open upper bound one minus the final value is upper-tail mass"
        },
        "cdf_below_probabilities": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cdf Below Probabilities",
          "description": "Strict CDF values at grid coordinates when interior point masses are present"
        },
        "lower_tail_probability": {
          "type": "number",
          "maximum": 0.0,
          "minimum": 0.0,
          "title": "Lower Tail Probability",
          "default": 0.0
        },
        "interpolation": {
          "type": "string",
          "enum": [
            "linear",
            "step"
          ],
          "title": "Interpolation",
          "default": "linear"
        },
        "never_probability": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 1.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Never Probability",
          "description": "Probability the event never happens, part of the mass after the last time; None when the grid does not separate it"
        },
        "layout": {
          "anyOf": [
            {
              "$ref": "#/$defs/DateGridLayout"
            },
            {
              "type": "null"
            }
          ],
          "description": "Regular grid the times are, when they are one"
        },
        "draw_count": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Draw Count",
          "description": "Draws binned into the grid, when built from equal draws"
        }
      },
      "type": "object",
      "required": [
        "times",
        "cdf_probabilities"
      ],
      "title": "DateGridDistribution",
      "description": "Date probability distribution stored on an ordered time grid."
    },
    "DateGridLayout": {
      "properties": {
        "start": {
          "type": "string",
          "format": "date-time",
          "title": "Start",
          "description": "Timezone-aware timestamp; any offset is accepted and normalized to UTC"
        },
        "step_hours": {
          "type": "integer",
          "title": "Step Hours",
          "description": "Hours per cell, dividing a day"
        },
        "cells": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Cells"
        }
      },
      "type": "object",
      "required": [
        "start",
        "step_hours",
        "cells"
      ],
      "title": "DateGridLayout",
      "description": "Steps of whole hours from a UTC midnight, so calendar scoring times are layout times."
    },
    "Direction": {
      "type": "string",
      "enum": [
        "up",
        "down",
        "later",
        "earlier",
        "unchanged"
      ]
    },
    "DiscreteChartGrid": {
      "properties": {
        "values": {
          "items": {
            "type": "number"
          },
          "type": "array",
          "minItems": 1,
          "title": "Values"
        },
        "cdf_probabilities": {
          "items": {
            "type": "number"
          },
          "type": "array",
          "minItems": 1,
          "title": "Cdf Probabilities"
        },
        "lower_tail_probability": {
          "type": "number",
          "title": "Lower Tail Probability"
        }
      },
      "type": "object",
      "required": [
        "values",
        "cdf_probabilities",
        "lower_tail_probability"
      ],
      "title": "DiscreteChartGrid"
    },
    "DrawnRun": {
      "properties": {
        "distribution": {
          "oneOf": [
            {
              "$ref": "#/$defs/NumericalGridDistribution"
            },
            {
              "$ref": "#/$defs/DateGridDistribution"
            }
          ],
          "title": "Distribution"
        },
        "chart_statistics": {
          "$ref": "#/$defs/ChartStatistics"
        }
      },
      "type": "object",
      "required": [
        "distribution",
        "chart_statistics"
      ],
      "title": "DrawnRun",
      "description": "A run as its chart draws it; step interpolation means bars."
    },
    "DrawnScenarios": {
      "properties": {
        "unconditional": {
          "$ref": "#/$defs/DrawnRun"
        },
        "given_a": {
          "$ref": "#/$defs/DrawnRun"
        },
        "given_not_a": {
          "$ref": "#/$defs/DrawnRun"
        }
      },
      "type": "object",
      "required": [
        "unconditional",
        "given_a",
        "given_not_a"
      ],
      "title": "DrawnScenarios",
      "description": "A scenario's three curves in the shape its base's chart takes."
    },
    "ForecastType": {
      "type": "string",
      "enum": [
        "event_happens",
        "event_not_happens",
        "event_outcome",
        "measure_variable",
        "count_of_events",
        "composition_of_variables",
        "other"
      ],
      "title": "ForecastType",
      "description": "Underlying type of the object of the forecast."
    },
    "NumericalDensity": {
      "properties": {
        "kind": {
          "type": "string",
          "const": "density",
          "title": "Kind",
          "default": "density"
        },
        "values": {
          "items": {
            "type": "number"
          },
          "type": "array",
          "minItems": 2,
          "title": "Values",
          "description": "Strictly increasing grid"
        },
        "density": {
          "items": {
            "type": "number"
          },
          "type": "array",
          "minItems": 2,
          "title": "Density",
          "description": "Non-negative probability density at each grid value"
        },
        "bandwidth": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Bandwidth",
          "description": "Gaussian kernel bandwidth of the sample components; null for an exact density"
        },
        "mode": {
          "type": "number",
          "title": "Mode",
          "description": "Grid value carrying the maximum density"
        }
      },
      "type": "object",
      "required": [
        "values",
        "density",
        "mode"
      ],
      "title": "NumericalDensity",
      "description": "Probability density on a body-resolved grid whose mode carries the maximum density."
    },
    "NumericalGridDistribution": {
      "properties": {
        "kind": {
          "type": "string",
          "const": "numerical_grid",
          "title": "Kind",
          "default": "numerical_grid"
        },
        "values": {
          "items": {
            "type": "number"
          },
          "type": "array",
          "minItems": 2,
          "title": "Values",
          "description": "Strictly increasing canonical outcome grid"
        },
        "cdf_probabilities": {
          "items": {
            "type": "number"
          },
          "type": "array",
          "minItems": 2,
          "title": "Cdf Probabilities",
          "description": "CDF on the canonical grid; for open bounds, the first value carries the lower-tail mass and one minus the final value carries the upper-tail mass"
        },
        "cdf_below_probabilities": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cdf Below Probabilities",
          "description": "Strict CDF values at grid coordinates when interior point masses are present"
        },
        "lower_tail_probability": {
          "type": "number",
          "maximum": 1.0,
          "minimum": 0.0,
          "title": "Lower Tail Probability"
        },
        "interpolation": {
          "type": "string",
          "enum": [
            "linear",
            "step"
          ],
          "title": "Interpolation",
          "default": "linear"
        },
        "layout": {
          "anyOf": [
            {
              "$ref": "#/$defs/NumericalGridLayout"
            },
            {
              "type": "null"
            }
          ],
          "description": "Regular grid the values are, when they are one"
        },
        "draw_count": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Draw Count",
          "description": "Draws binned into the grid, when built from equal draws"
        }
      },
      "type": "object",
      "required": [
        "values",
        "cdf_probabilities",
        "lower_tail_probability"
      ],
      "title": "NumericalGridDistribution",
      "description": "Numerical probability distribution stored on an ordered grid."
    },
    "NumericalGridLayout": {
      "properties": {
        "range_min": {
          "type": "number",
          "title": "Range Min"
        },
        "range_max": {
          "type": "number",
          "title": "Range Max"
        },
        "scoring_precision": {
          "type": "number",
          "title": "Scoring Precision"
        },
        "log_origin": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Log Origin"
        },
        "reporting_quantum": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reporting Quantum"
        },
        "bin_count": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Bin Count",
          "description": "Scoring bins in the range"
        },
        "subdivisions": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Subdivisions",
          "description": "Equal parts each scoring bin is split into"
        },
        "padding": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Padding",
          "description": "Cells added past each end of the scoring range"
        }
      },
      "type": "object",
      "required": [
        "range_min",
        "range_max",
        "scoring_precision",
        "bin_count",
        "subdivisions",
        "padding"
      ],
      "title": "NumericalGridLayout",
      "description": "An outcome's scoring ticks with each scoring bin split into equal parts, plus padding.\n\nBins are split in scoring coordinates: values for linear outcomes, ``log(value - log_origin)``\nfor logarithmic ones. The scoring ticks are values of the layout exactly."
    },
    "NumericalSupport": {
      "properties": {
        "lower": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Lower"
        },
        "upper": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Upper"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "lower",
        "upper"
      ],
      "title": "NumericalSupport",
      "description": "The numerical values that may resolve an outcome."
    },
    "PublishedChange": {
      "properties": {
        "size": {
          "type": "number",
          "title": "Size",
          "description": "Distance between the published figures: in outcome units, whole days for a date, or whole percentage points for a probability."
        },
        "decimals": {
          "type": "integer",
          "title": "Decimals",
          "description": "Decimals `size` is written to, as for a published value."
        },
        "direction": {
          "$ref": "#/$defs/Direction"
        }
      },
      "type": "object",
      "required": [
        "size",
        "decimals",
        "direction"
      ],
      "title": "PublishedChange",
      "description": "A side's move from the default, read between the two published figures."
    },
    "PublishedProbability": {
      "properties": {
        "estimate": {
          "type": "number",
          "title": "Estimate",
          "description": "The probability as computed, from 0 to 1."
        },
        "percent": {
          "type": "integer",
          "title": "Percent",
          "description": "The probability in whole percent, rounded half up."
        },
        "text": {
          "type": "string",
          "title": "Text",
          "description": "The probability as published, e.g. \"37%\", \"<1%\" or \">99%\"."
        }
      },
      "type": "object",
      "required": [
        "estimate",
        "percent",
        "text"
      ],
      "title": "PublishedProbability"
    },
    "PublishedValue": {
      "properties": {
        "estimate": {
          "type": "number",
          "title": "Estimate",
          "description": "The statistic as computed from the side's curve."
        },
        "shown": {
          "type": "number",
          "title": "Shown",
          "description": "The published figure: `estimate` rounded half away from zero to `decimals`, or for a date the start of its UTC day, in epoch seconds."
        },
        "decimals": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Decimals",
          "description": "Decimals `shown` is rounded to; negative where it is written compactly (-5 for 0.1M, -8 for 0.1B). None for a date."
        },
        "beyond": {
          "anyOf": [
            {
              "$ref": "#/$defs/Beyond"
            },
            {
              "type": "null"
            }
          ],
          "description": "Set where the statistic lies at or past that end of the grid, so `estimate` is the grid's end, a bound rather than an estimate of it."
        }
      },
      "type": "object",
      "required": [
        "estimate",
        "shown",
        "decimals"
      ],
      "title": "PublishedValue",
      "description": "A statistic of one side, as computed and as published."
    },
    "QuestionRange": {
      "properties": {
        "lower": {
          "type": "number",
          "title": "Lower",
          "description": "The question range's lowest value."
        },
        "upper": {
          "type": "number",
          "title": "Upper",
          "description": "The question range's highest value."
        },
        "below": {
          "type": "number",
          "title": "Below",
          "description": "Forecast probability below the range."
        },
        "above": {
          "type": "number",
          "title": "Above",
          "description": "Forecast probability above the range."
        }
      },
      "type": "object",
      "required": [
        "lower",
        "upper",
        "below",
        "above"
      ],
      "title": "QuestionRange"
    },
    "ScenarioBranchExplanations": {
      "properties": {
        "yes": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Yes"
        },
        "no": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "No"
        }
      },
      "type": "object",
      "title": "ScenarioBranchExplanations",
      "description": "Why the forecast under each side of a scenario's condition differs from the base, as a\nmarkdown bulleted list (the move first, then its reasons) with inline source links; a side\nis None where its explanation is missing."
    },
    "ScenarioMove": {
      "properties": {
        "centre": {
          "anyOf": [
            {
              "$ref": "#/$defs/PublishedChange"
            },
            {
              "type": "null"
            }
          ],
          "description": "The centre's move; None where either centre is unavailable."
        },
        "by_end": {
          "anyOf": [
            {
              "$ref": "#/$defs/PublishedChange"
            },
            {
              "type": "null"
            }
          ],
          "description": "A date's move in the chance it happens by the grid's end."
        },
        "outcomes": {
          "anyOf": [
            {
              "additionalProperties": {
                "$ref": "#/$defs/PublishedChange"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Outcomes",
          "description": "Each categorical outcome's move, keyed by outcome id."
        },
        "barely_moves": {
          "type": "boolean",
          "title": "Barely Moves",
          "description": "Whether every published figure of the side equals the default's."
        }
      },
      "type": "object",
      "required": [
        "barely_moves"
      ],
      "title": "ScenarioMove"
    },
    "ScenarioSide": {
      "properties": {
        "centre": {
          "anyOf": [
            {
              "$ref": "#/$defs/PublishedValue"
            },
            {
              "type": "null"
            }
          ],
          "description": "The side's centre, of the result's `centre_kind`. None where unavailable, as for a date whose curve never reaches half by the grid's end."
        },
        "below_range": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Below Range",
          "description": "Numerical probability at or below the grid's first value."
        },
        "above_range": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Above Range",
          "description": "Numerical probability above the grid's last value."
        },
        "timing": {
          "anyOf": [
            {
              "additionalProperties": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/PublishedValue"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Timing",
          "description": "Date percentiles, keyed 10, 50 and 90: where the curve reaches each; None for a percentile it does not reach by the grid's end."
        },
        "by_end": {
          "anyOf": [
            {
              "$ref": "#/$defs/PublishedProbability"
            },
            {
              "type": "null"
            }
          ],
          "description": "The chance a date happens by the grid's end."
        },
        "outcomes": {
          "anyOf": [
            {
              "additionalProperties": {
                "$ref": "#/$defs/PublishedProbability"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Outcomes",
          "description": "Each categorical outcome's probability, keyed by outcome id."
        },
        "move": {
          "anyOf": [
            {
              "$ref": "#/$defs/ScenarioMove"
            },
            {
              "type": "null"
            }
          ],
          "description": "The side's move from the default; None on the default."
        }
      },
      "type": "object",
      "title": "ScenarioSide"
    },
    "ScenarioStatistics": {
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "numerical",
            "date",
            "categorical"
          ],
          "title": "Kind"
        },
        "centre_kind": {
          "anyOf": [
            {
              "$ref": "#/$defs/CentreKind"
            },
            {
              "type": "null"
            }
          ],
          "description": "The statistic each side's centre is: the median for numerical and date scenarios; None for categorical."
        },
        "base": {
          "$ref": "#/$defs/ScenarioSide"
        },
        "yes": {
          "$ref": "#/$defs/ScenarioSide"
        },
        "no": {
          "$ref": "#/$defs/ScenarioSide"
        }
      },
      "type": "object",
      "required": [
        "kind",
        "base",
        "yes",
        "no"
      ],
      "title": "ScenarioStatistics",
      "description": "The published figures of a scenario's default, yes and no sides."
    }
  }
}