{
  "$defs": {
    "AcceptanceLayer": {
      "additionalProperties": false,
      "properties": {
        "detail": {
          "default": "",
          "title": "Detail",
          "type": "string"
        },
        "metrics": {
          "items": {
            "$ref": "#/$defs/AcceptanceMetric"
          },
          "title": "Metrics",
          "type": "array"
        },
        "name": {
          "enum": [
            "computation",
            "identification",
            "decisions"
          ],
          "title": "Name",
          "type": "string"
        },
        "status": {
          "default": "untested",
          "enum": [
            "untested",
            "passed",
            "failed"
          ],
          "title": "Status",
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "title": "AcceptanceLayer",
      "type": "object"
    },
    "AcceptanceMetric": {
      "additionalProperties": false,
      "properties": {
        "comparator": {
          "default": "le",
          "enum": [
            "lt",
            "le",
            "gt",
            "ge",
            "abs_le"
          ],
          "title": "Comparator",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "passed": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Passed"
        },
        "threshold": {
          "$ref": "#/$defs/Proposed"
        },
        "value": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Value"
        }
      },
      "required": [
        "name",
        "value",
        "threshold"
      ],
      "title": "AcceptanceMetric",
      "type": "object"
    },
    "ControlOutcome": {
      "additionalProperties": false,
      "properties": {
        "engine": {
          "title": "Engine",
          "type": "string"
        },
        "expected": {
          "enum": [
            "pass",
            "fail"
          ],
          "title": "Expected",
          "type": "string"
        },
        "model_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Model Id"
        },
        "observed": {
          "default": "untested",
          "enum": [
            "pass",
            "fail",
            "untested"
          ],
          "title": "Observed",
          "type": "string"
        }
      },
      "required": [
        "engine",
        "expected"
      ],
      "title": "ControlOutcome",
      "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"
    },
    "Proposed": {
      "additionalProperties": false,
      "description": "A threshold value that the spec marks *proposed* (pending the pre-rollout studies).",
      "properties": {
        "proposed": {
          "default": true,
          "title": "Proposed",
          "type": "boolean"
        },
        "source": {
          "default": "",
          "description": "Spec section the value comes from, e.g. '\u00a714'.",
          "title": "Source",
          "type": "string"
        },
        "value": {
          "title": "Value",
          "type": "number"
        }
      },
      "required": [
        "value"
      ],
      "title": "Proposed",
      "type": "object"
    }
  },
  "$id": "https://schemas.ump.dev/v1/acceptance-report.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "approved_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): approver principal.",
      "title": "Governance ApprovedBy"
    },
    "bar_broken": {
      "default": false,
      "description": "True if the bar passes MTM or fails the positive control.",
      "title": "Bar Broken",
      "type": "boolean"
    },
    "capability_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Capability Id"
    },
    "content_hash": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): the artifact content hash.",
      "title": "Governance ContentHash"
    },
    "details": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Per-layer detail of the acceptance run. Written by models (`acceptance.py`) and Newton's seed.",
      "title": "Details"
    },
    "engine": {
      "title": "Engine",
      "type": "string"
    },
    "engine_adapter": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Adapter that ran the battery. Written by models (`acceptance.py`) and Newton's seed.",
      "title": "Engine Adapter"
    },
    "family": {
      "default": "media_mix",
      "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"
    },
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): artifact id.",
      "title": "Governance Id"
    },
    "layers": {
      "items": {
        "$ref": "#/$defs/AcceptanceLayer"
      },
      "title": "Layers",
      "type": "array"
    },
    "model_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Model Id"
    },
    "negative_control": {
      "anyOf": [
        {
          "$ref": "#/$defs/ControlOutcome"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "notes": {
      "items": {
        "$ref": "#/$defs/Note"
      },
      "title": "Notes",
      "type": "array"
    },
    "null_battery": {
      "additionalProperties": true,
      "title": "Null Battery",
      "type": "object"
    },
    "owner": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): owner principal.",
      "title": "Governance Owner"
    },
    "positive_control": {
      "anyOf": [
        {
          "$ref": "#/$defs/ControlOutcome"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "preregistration": {
      "additionalProperties": true,
      "title": "Preregistration",
      "type": "object"
    },
    "regrade_by": {
      "anyOf": [
        {
          "format": "date",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "\u00a714: re-run due by this date after a mark binds or changes (90 days, proposed).",
      "title": "Regrade By"
    },
    "revision": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): content revision (spec \u00a77).",
      "title": "Governance Revision"
    },
    "role": {
      "default": "candidate",
      "enum": [
        "candidate",
        "negative_control",
        "positive_control"
      ],
      "title": "Role",
      "type": "string"
    },
    "seed_tag": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Seed label (Newton seed data). Written by models (`acceptance.py`) and Newton's seed.",
      "title": "Seed Tag"
    },
    "state": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): lifecycle state of the version.",
      "title": "Governance State"
    },
    "status": {
      "default": "untested",
      "enum": [
        "untested",
        "passed",
        "failed"
      ],
      "title": "Status",
      "type": "string"
    },
    "stub": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "True when a stub engine produced the report. Written by models (`acceptance.py`) and Newton's seed.",
      "title": "Stub"
    },
    "submitted_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): submitter principal.",
      "title": "Governance SubmittedBy"
    },
    "threshold_set_version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "\u00a714: the threshold-set version the bar was tested against, e.g. thresholds/0.1.0.",
      "title": "Threshold Set Version"
    },
    "valid_to": {
      "default": null,
      "description": "Governance member (spec \u00a76): end of the validity window (spec \u00a77).",
      "title": "Governance ValidTo"
    }
  },
  "required": [
    "engine"
  ],
  "title": "AcceptanceReport",
  "type": "object"
}
