{
  "$defs": {
    "AcceptanceStatus": {
      "additionalProperties": false,
      "description": "\u00a714: three layers. Untested is usable with reduced trust; failed is excluded (G-ACC-01).",
      "properties": {
        "computation": {
          "$ref": "#/$defs/LayerStatus"
        },
        "decisions": {
          "$ref": "#/$defs/LayerStatus"
        },
        "identification": {
          "$ref": "#/$defs/LayerStatus"
        },
        "negative_control": {
          "default": false,
          "description": "True for MTM: the bar must fail it.",
          "title": "Negative Control",
          "type": "boolean"
        },
        "regrade_by": {
          "anyOf": [
            {
              "format": "date",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "\u00a714: date by which the status must be re-run.",
          "title": "Regrade By"
        },
        "report_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Report Id"
        },
        "status": {
          "default": "untested",
          "enum": [
            "untested",
            "pilot",
            "passed",
            "failed"
          ],
          "title": "Status",
          "type": "string"
        },
        "threshold_set_version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "\u00a714: the threshold-set version the status was earned against.",
          "title": "Threshold Set Version"
        }
      },
      "title": "AcceptanceStatus",
      "type": "object"
    },
    "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"
    },
    "CurveParams": {
      "additionalProperties": false,
      "description": "Tier B per-channel curve.",
      "properties": {
        "adstock": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Adstock"
        },
        "channel": {
          "title": "Channel",
          "type": "string"
        },
        "curve_family": {
          "default": "hill",
          "enum": [
            "hill",
            "logistic",
            "power",
            "neg_exponential"
          ],
          "title": "Curve Family",
          "type": "string"
        },
        "input_scaling": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Input Scaling"
        },
        "param_draws": {
          "anyOf": [
            {
              "additionalProperties": {
                "items": {
                  "type": "number"
                },
                "type": "array"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Param Draws"
        },
        "params": {
          "additionalProperties": {
            "type": "number"
          },
          "title": "Params",
          "type": "object"
        }
      },
      "required": [
        "channel"
      ],
      "title": "CurveParams",
      "type": "object"
    },
    "DependenceDeclaration": {
      "additionalProperties": false,
      "properties": {
        "assumption": {
          "anyOf": [
            {
              "enum": [
                "copula",
                "independence"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Required when kind is declared_assumption.",
          "title": "Assumption"
        },
        "kind": {
          "enum": [
            "joint_draws",
            "joint_gaussian",
            "declared_assumption",
            "per_channel",
            "none"
          ],
          "title": "Kind",
          "type": "string"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Note"
        }
      },
      "required": [
        "kind"
      ],
      "title": "DependenceDeclaration",
      "type": "object"
    },
    "DimSpec": {
      "additionalProperties": false,
      "properties": {
        "freq": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Freq"
        },
        "kind": {
          "default": "categorical",
          "enum": [
            "categorical",
            "time",
            "integer",
            "float",
            "index"
          ],
          "title": "Kind",
          "type": "string"
        },
        "policy": {
          "default": "fixed",
          "enum": [
            "fixed",
            "extend",
            "new_levels"
          ],
          "title": "Policy",
          "type": "string"
        }
      },
      "title": "DimSpec",
      "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"
    },
    "HostedEndpoint": {
      "additionalProperties": false,
      "description": "Tier X.",
      "properties": {
        "endpoint_url": {
          "title": "Endpoint Url",
          "type": "string"
        },
        "revision": {
          "title": "Revision",
          "type": "string"
        },
        "validated_revision": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Validated Revision"
        }
      },
      "required": [
        "endpoint_url",
        "revision"
      ],
      "title": "HostedEndpoint",
      "type": "object"
    },
    "InputContract": {
      "additionalProperties": false,
      "description": "What new input must look like for a saved workflow to rerun on it.",
      "properties": {
        "dims": {
          "additionalProperties": {
            "$ref": "#/$defs/DimSpec"
          },
          "title": "Dims",
          "type": "object"
        },
        "extra": {
          "default": "drop",
          "description": "Columns the contract does not name: drop (info note) or allow (passed silently). Never a failure.",
          "enum": [
            "allow",
            "drop"
          ],
          "title": "Extra",
          "type": "string"
        },
        "key": {
          "description": "Columns that identify a row (each one required); empty means the time column plus the categorical dims.",
          "items": {
            "type": "string"
          },
          "title": "Key",
          "type": "array"
        },
        "level_sets": {
          "additionalProperties": {
            "$ref": "#/$defs/LevelSet"
          },
          "description": "Trained level set per fixed categorical dim (hash and count, never values).",
          "title": "Level Sets",
          "type": "object"
        },
        "min_rows": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Fewest rows the workflow expects (proposed; below it is a warning).",
          "title": "Min Rows"
        },
        "schema_version": {
          "default": "ump.input_contract/0.1",
          "title": "Schema Version",
          "type": "string"
        },
        "target": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The target column; required to refit, not to score.",
          "title": "Target"
        },
        "target_dtype": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The target's dtype; on a refit the target must cast to it and have no missing values.",
          "title": "Target Dtype"
        },
        "time": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The time column, if any; its dim (policy, freq) is in dims.",
          "title": "Time"
        },
        "vars": {
          "additionalProperties": {
            "$ref": "#/$defs/InputVar"
          },
          "title": "Vars",
          "type": "object"
        }
      },
      "title": "InputContract",
      "type": "object"
    },
    "InputVar": {
      "additionalProperties": false,
      "description": "A variable the workflow reads. ``required: false`` makes it optional: absent gives a warning.",
      "properties": {
        "dims": {
          "items": {
            "type": "string"
          },
          "title": "Dims",
          "type": "array"
        },
        "dtype": {
          "default": "float64",
          "title": "Dtype",
          "type": "string"
        },
        "missing": {
          "default": "forbid",
          "enum": [
            "forbid",
            "allow",
            "mask"
          ],
          "title": "Missing",
          "type": "string"
        },
        "required": {
          "default": true,
          "title": "Required",
          "type": "boolean"
        },
        "role": {
          "default": "covariate",
          "enum": [
            "target",
            "covariate",
            "media",
            "spend",
            "control",
            "index",
            "mask",
            "constant",
            "weight",
            "exposure"
          ],
          "title": "Role",
          "type": "string"
        },
        "units": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Units"
        }
      },
      "title": "InputVar",
      "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"
    },
    "LayerStatus": {
      "additionalProperties": false,
      "properties": {
        "metrics": {
          "additionalProperties": true,
          "title": "Metrics",
          "type": "object"
        },
        "report_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Report Id"
        },
        "status": {
          "default": "untested",
          "enum": [
            "untested",
            "passed",
            "failed"
          ],
          "title": "Status",
          "type": "string"
        }
      },
      "title": "LayerStatus",
      "type": "object"
    },
    "LevelSet": {
      "additionalProperties": false,
      "description": "A categorical column's levels without the values: the sha256 (hex) of the canonical JSON of the sorted\nunique non-null level values (as strings), their count, and the sorted sha256 of each level's canonical JSON\n(empty in contracts written before per-level hashes; the check then compares the set hash and count only).",
      "properties": {
        "count": {
          "minimum": 0,
          "title": "Count",
          "type": "integer"
        },
        "hashes": {
          "description": "sha256 (hex) of each level's canonical JSON string, sorted; never values.",
          "items": {
            "pattern": "^[0-9a-f]{64}$",
            "type": "string"
          },
          "title": "Hashes",
          "type": "array"
        },
        "sha256": {
          "pattern": "^[0-9a-f]{64}$",
          "title": "Sha256",
          "type": "string"
        }
      },
      "required": [
        "sha256",
        "count"
      ],
      "title": "LevelSet",
      "type": "object"
    },
    "ModelManifest": {
      "additionalProperties": false,
      "properties": {
        "acceptance": {
          "$ref": "#/$defs/AcceptanceStatus"
        },
        "acceptance_notes": {
          "anyOf": [
            {
              "items": {},
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Notes from the acceptance bar (code, severity, message). Written by models (`registry.py`, `intake.py`), planner, experiments and Newton's seed.",
          "title": "Acceptance Notes"
        },
        "adapter_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Adapter Url"
        },
        "adstock_alpha_draws": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Adstock alpha draws per channel. Written by models (`registry.py`, `intake.py`), planner, experiments and Newton's seed.",
          "title": "Adstock Alpha Draws"
        },
        "applies_to": {
          "$ref": "#/$defs/AppliesTo"
        },
        "approved_by": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Governance member (spec \u00a76): approver principal.",
          "title": "Governance ApprovedBy"
        },
        "audit_level": {
          "default": 2,
          "enum": [
            1,
            2,
            3,
            4
          ],
          "title": "Audit Level",
          "type": "integer"
        },
        "calibrated_channels": {
          "items": {
            "type": "string"
          },
          "title": "Calibrated Channels",
          "type": "array"
        },
        "calibrated_from": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The model version this one was calibrated from, with routes and adjustments. Written by models (`registry.py`, `intake.py`), planner, experiments and Newton's seed.",
          "title": "Calibrated From"
        },
        "capability_manifest_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Capability Manifest Id"
        },
        "capability_status": {
          "default": "sandbox",
          "enum": [
            "sandbox",
            "pilot",
            "certified",
            "restricted",
            "withdrawn"
          ],
          "title": "Capability Status",
          "type": "string"
        },
        "certification": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Certification requirements and their status (\u00a716). Written by models (`registry.py`, `intake.py`), planner, experiments and Newton's seed.",
          "title": "Certification"
        },
        "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"
        },
        "current_spend": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Current spend per channel. Written by models (`registry.py`, `intake.py`), planner, experiments and Newton's seed.",
          "title": "Current Spend"
        },
        "curves": {
          "items": {
            "$ref": "#/$defs/CurveParams"
          },
          "title": "Curves",
          "type": "array"
        },
        "data_fetch": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Dataset fetch record the fit used (`storage`, `use`, `fetch_record`). Written by models (`registry.py`, `intake.py`), planner, experiments and Newton's seed.",
          "title": "Data Fetch"
        },
        "dataset_refs": {
          "items": {
            "type": "string"
          },
          "title": "Dataset Refs",
          "type": "array"
        },
        "dependence": {
          "$ref": "#/$defs/DependenceDeclaration"
        },
        "endpoint": {
          "anyOf": [
            {
              "$ref": "#/$defs/HostedEndpoint"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "engine": {
          "description": "in-house frameworks, pymc-marketing, meridian, robyn, vendor:nielsen, stub, ...",
          "title": "Engine",
          "type": "string"
        },
        "engine_version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Engine Version"
        },
        "estimands": {
          "additionalProperties": {
            "$ref": "#/$defs/Estimand"
          },
          "title": "Estimands",
          "type": "object"
        },
        "family": {
          "default": "media_mix",
          "enum": [
            "media_mix",
            "audience",
            "reach_frequency",
            "attribution",
            "brand_funnel",
            "forecasting",
            "creative",
            "media_tracking",
            "effectiveness_index"
          ],
          "title": "Family",
          "type": "string"
        },
        "gate_results": {
          "anyOf": [
            {
              "items": {},
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Governance member (spec \u00a76): gate results of the latest run.",
          "title": "Governance GateResults"
        },
        "grids": {
          "items": {
            "$ref": "#/$defs/SpendGrid"
          },
          "title": "Grids",
          "type": "array"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Governance member (spec \u00a76): artifact id.",
          "title": "Governance Id"
        },
        "input_contract": {
          "anyOf": [
            {
              "$ref": "#/$defs/InputContract"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The input shape a saved workflow reruns on (optional; checked by G-DATA-07)."
        },
        "intake": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Intake record for a vendor or summary model: fallbacks applied and mapping. Written by models (`registry.py`, `intake.py`), planner, experiments and Newton's seed.",
          "title": "Intake"
        },
        "licence_limits": {
          "items": {
            "type": "string"
          },
          "title": "Licence Limits",
          "type": "array"
        },
        "metric_family": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Legacy top-level metric family (sales_return, brand_awareness, ...); the estimand's own `metric_family` is preferred. Read by G-EXP-05 (`gates._calibration_target`) and experiments `calibrate.py`.",
          "title": "Metric Family"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "notes": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "title": "Notes",
          "type": "array"
        },
        "owner": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Governance member (spec \u00a76): owner principal.",
          "title": "Governance Owner"
        },
        "payload_refs": {
          "additionalProperties": {
            "type": "string"
          },
          "title": "Payload Refs",
          "type": "object"
        },
        "reach_curves": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Reach and frequency family profile curves (spec \u00a716: reach curve, frequency, dedupe), carried beside the declared estimands. Written by notebook 12 through babelfin `Model.from_table`.",
          "title": "Reach Curves"
        },
        "refit_date": {
          "anyOf": [
            {
              "format": "date",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Refit Date"
        },
        "representation": {
          "default": "draws",
          "enum": [
            "draws",
            "quantiles",
            "interval",
            "point",
            "moments",
            "moments_cov"
          ],
          "title": "Representation",
          "type": "string"
        },
        "response_curves": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Response curves on a spend grid: channels, multipliers, spend grid, values. Written by models (`registry.py`, `intake.py`), planner, experiments and Newton's seed.",
          "title": "Response Curves"
        },
        "revision": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Governance member (spec \u00a76): content revision (spec \u00a77).",
          "title": "Governance Revision"
        },
        "role": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Role in the acceptance bar, e.g. `negative_control` (core's mirror reads it). Written by models (`registry.py`, `intake.py`), planner, experiments and Newton's seed.",
          "title": "Role"
        },
        "run_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Run Id"
        },
        "seed_tag": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Seed label (Newton seed data). Written by models (`registry.py`, `intake.py`), planner, experiments and Newton's seed.",
          "title": "Seed Tag"
        },
        "segments": {
          "anyOf": [
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Audience output segments `{id, size}` read by G-PRIV-01. Written by models (`registry.py`, `intake.py`), planner, experiments and Newton's seed.",
          "title": "Segments"
        },
        "source_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Source type for vendor intake (`registries/source_types.yaml`). Written by models (`registry.py`, `intake.py`), planner, experiments and Newton's seed.",
          "title": "Source Type"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Governance member (spec \u00a76): lifecycle state of the version.",
          "title": "Governance State"
        },
        "stub": {
          "default": false,
          "title": "Stub",
          "type": "boolean"
        },
        "submitted_by": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Governance member (spec \u00a76): submitter principal.",
          "title": "Governance SubmittedBy"
        },
        "summaries": {
          "items": {
            "$ref": "#/$defs/SummaryNumber"
          },
          "title": "Summaries",
          "type": "array"
        },
        "tier": {
          "enum": [
            "A",
            "B",
            "C",
            "D",
            "X"
          ],
          "title": "Tier",
          "type": "string"
        },
        "trust_level": {
          "default": 2,
          "maximum": 4,
          "minimum": 1,
          "title": "Trust Level",
          "type": "integer"
        },
        "valid_from": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Spec \u00a77: start of the half-open validity window [valid_from, valid_to), an RFC 3339 instant (UTC, Z, milliseconds). A calendar date reads as midnight UTC.",
          "title": "Valid From"
        },
        "valid_to": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Spec \u00a77: end of the half-open validity window; the model is expired when valid_to <= now. An RFC 3339 instant; a calendar date reads as midnight UTC.",
          "title": "Valid To"
        },
        "vendor_validated": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "G-VEN-01 outcome for vendor tables.",
          "title": "Vendor Validated"
        }
      },
      "required": [
        "name",
        "tier",
        "engine"
      ],
      "title": "ModelManifest",
      "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"
    },
    "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"
    },
    "RunRecord": {
      "additionalProperties": false,
      "properties": {
        "artifact_ids": {
          "items": {
            "type": "string"
          },
          "title": "Artifact Ids",
          "type": "array"
        },
        "audit_level": {
          "default": 2,
          "enum": [
            1,
            2,
            3,
            4
          ],
          "title": "Audit Level",
          "type": "integer"
        },
        "code_commit": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Code Commit"
        },
        "dataset_hashes": {
          "items": {
            "type": "string"
          },
          "title": "Dataset Hashes",
          "type": "array"
        },
        "ended_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ended At"
        },
        "engine": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Engine"
        },
        "engine_version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Engine Version"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "image_digest": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Image Digest"
        },
        "inputs_digest": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Inputs Digest"
        },
        "lockfile_hash": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Lockfile Hash"
        },
        "outputs_digest": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Outputs Digest"
        },
        "principal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Principal"
        },
        "seeds": {
          "items": {
            "type": "integer"
          },
          "title": "Seeds",
          "type": "array"
        },
        "session_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Agent or UI session the call belonged to (Newton reader/actor sessions).",
          "title": "Session Id"
        },
        "started_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Started At"
        },
        "status": {
          "default": "succeeded",
          "enum": [
            "succeeded",
            "failed",
            "refused"
          ],
          "title": "Status",
          "type": "string"
        },
        "tool": {
          "description": "e.g. 'adapter:redacted-engine/fit' or 'newton:actor/draft_decision'.",
          "title": "Tool",
          "type": "string"
        }
      },
      "required": [
        "tool"
      ],
      "title": "RunRecord",
      "type": "object"
    },
    "SpendGrid": {
      "additionalProperties": false,
      "description": "Tier C declaration. Grid >= 21 points from 0 to 2.5x current spend is *proposed* (\u00a77).",
      "properties": {
        "adstock_treatment": {
          "default": "unknown",
          "enum": [
            "included",
            "excluded",
            "unknown"
          ],
          "title": "Adstock Treatment",
          "type": "string"
        },
        "channel": {
          "title": "Channel",
          "type": "string"
        },
        "contribution": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Contribution"
        },
        "contribution_hi": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Contribution Hi"
        },
        "contribution_lo": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Contribution Lo"
        },
        "current_spend": {
          "title": "Current Spend",
          "type": "number"
        },
        "max_seen_spend": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Max Seen Spend"
        },
        "multipliers": {
          "items": {
            "type": "number"
          },
          "title": "Multipliers",
          "type": "array"
        },
        "spend": {
          "items": {
            "type": "number"
          },
          "title": "Spend",
          "type": "array"
        },
        "time_aggregation": {
          "default": "annual",
          "enum": [
            "per_week",
            "per_flight",
            "annual"
          ],
          "title": "Time Aggregation",
          "type": "string"
        },
        "uncertainty": {
          "default": "none",
          "enum": [
            "draws",
            "quantiles",
            "none"
          ],
          "title": "Uncertainty",
          "type": "string"
        }
      },
      "required": [
        "channel",
        "multipliers",
        "spend",
        "current_spend"
      ],
      "title": "SpendGrid",
      "type": "object"
    },
    "SummaryNumber": {
      "additionalProperties": false,
      "description": "Tier D: ROI or mROI at current spend only.",
      "properties": {
        "channel": {
          "title": "Channel",
          "type": "string"
        },
        "current_spend": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Current Spend"
        },
        "hi": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Hi"
        },
        "level": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Level"
        },
        "lo": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Lo"
        },
        "metric": {
          "enum": [
            "roi",
            "mroi"
          ],
          "title": "Metric",
          "type": "string"
        },
        "value": {
          "title": "Value",
          "type": "number"
        }
      },
      "required": [
        "channel",
        "metric",
        "value"
      ],
      "title": "SummaryNumber",
      "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/adapter-update-response.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "dependence": {
      "anyOf": [
        {
          "$ref": "#/$defs/DependenceDeclaration"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "diagnostics": {
      "additionalProperties": true,
      "title": "Diagnostics",
      "type": "object"
    },
    "engine": {
      "title": "Engine",
      "type": "string"
    },
    "engine_version": {
      "title": "Engine Version",
      "type": "string"
    },
    "estimands": {
      "additionalProperties": {
        "$ref": "#/$defs/Estimand"
      },
      "title": "Estimands",
      "type": "object"
    },
    "fallbacks": {
      "items": {
        "$ref": "#/$defs/FallbackEntry"
      },
      "title": "Fallbacks",
      "type": "array"
    },
    "fit_id": {
      "description": "Handle of the updated fit.",
      "title": "Fit Id",
      "type": "string"
    },
    "manifest": {
      "anyOf": [
        {
          "$ref": "#/$defs/ModelManifest"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "notes": {
      "items": {
        "$ref": "#/$defs/Note"
      },
      "title": "Notes",
      "type": "array"
    },
    "run": {
      "anyOf": [
        {
          "$ref": "#/$defs/RunRecord"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "source_fit_id": {
      "title": "Source Fit Id",
      "type": "string"
    },
    "stub": {
      "default": false,
      "title": "Stub",
      "type": "boolean"
    }
  },
  "required": [
    "engine",
    "engine_version",
    "fit_id",
    "source_fit_id"
  ],
  "title": "UpdateResponse",
  "type": "object"
}
