{
  "$defs": {
    "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"
    },
    "GateResult": {
      "additionalProperties": false,
      "properties": {
        "artifact_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Artifact Id"
        },
        "artifact_version": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Artifact Version"
        },
        "evidence": {
          "additionalProperties": true,
          "title": "Evidence",
          "type": "object"
        },
        "fallback_applied": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Fallback Applied"
        },
        "fallbacks": {
          "items": {
            "$ref": "#/$defs/FallbackEntry"
          },
          "title": "Fallbacks",
          "type": "array"
        },
        "gate_id": {
          "title": "Gate Id",
          "type": "string"
        },
        "message": {
          "default": "",
          "title": "Message",
          "type": "string"
        },
        "notes": {
          "items": {
            "$ref": "#/$defs/Note"
          },
          "title": "Notes",
          "type": "array"
        },
        "on_fail": {
          "anyOf": [
            {
              "enum": [
                "hard_stop",
                "exclude_and_continue",
                "fallback",
                "route",
                "warn",
                "info",
                "computed"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "On Fail"
        },
        "outcome": {
          "enum": [
            "pass",
            "hard_stop",
            "strict_stop",
            "exclude_and_continue",
            "fallback",
            "route",
            "warn",
            "info",
            "computed"
          ],
          "title": "Outcome",
          "type": "string"
        },
        "passed": {
          "default": true,
          "title": "Passed",
          "type": "boolean"
        },
        "policy_version": {
          "default": "gates/0.1.0",
          "title": "Policy Version",
          "type": "string"
        },
        "predicate": {
          "default": "",
          "description": "Python predicate name; 'not_implemented_in_poc' if none.",
          "title": "Predicate",
          "type": "string"
        },
        "route_to": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Route To"
        },
        "strict": {
          "default": false,
          "title": "Strict",
          "type": "boolean"
        },
        "ts": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ts"
        }
      },
      "required": [
        "gate_id",
        "outcome"
      ],
      "title": "GateResult",
      "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"
    },
    "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"
    }
  },
  "$id": "https://schemas.ump.dev/v1/artifact.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Catalogue row (one per version). ``doc`` holds the kind-specific body.",
  "properties": {
    "approved_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Approved By"
    },
    "client_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Client Id"
    },
    "content_hash": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Content Hash"
    },
    "created_at": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Created At"
    },
    "doc": {
      "additionalProperties": true,
      "title": "Doc",
      "type": "object"
    },
    "fallbacks": {
      "items": {
        "$ref": "#/$defs/FallbackEntry"
      },
      "title": "Fallbacks",
      "type": "array"
    },
    "gate_results": {
      "items": {
        "$ref": "#/$defs/GateResult"
      },
      "title": "Gate Results",
      "type": "array"
    },
    "id": {
      "title": "Id",
      "type": "string"
    },
    "kind": {
      "enum": [
        "dataset",
        "transform_step",
        "model_manifest",
        "capability_manifest",
        "test_plan",
        "test_result",
        "calibration",
        "scenario",
        "optimisation_result",
        "decision_record",
        "evidence_card",
        "acceptance_report",
        "benchmark_row",
        "prior_card",
        "benchmark_cell",
        "priority_snapshot",
        "agent_eval_report",
        "data_connection"
      ],
      "title": "Kind",
      "type": "string"
    },
    "owner": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Owner"
    },
    "parents": {
      "items": {
        "type": "string"
      },
      "title": "Parents",
      "type": "array"
    },
    "revision": {
      "default": 1,
      "description": "Spec \u00a77 revision of the artifact; ``version`` is read as an alias.",
      "minimum": 1,
      "title": "Revision",
      "type": "integer"
    },
    "spec_version": {
      "default": "2.3.0-draft",
      "title": "Spec Version",
      "type": "string"
    },
    "state": {
      "default": "draft",
      "enum": [
        "draft",
        "checks_running",
        "checks_passed",
        "checks_failed",
        "awaiting_approval",
        "validated",
        "rejected",
        "deprecated"
      ],
      "title": "State",
      "type": "string"
    },
    "submitted_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Submitted By"
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Title"
    },
    "updated_at": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Updated At"
    }
  },
  "required": [
    "id",
    "kind",
    "doc"
  ],
  "title": "Artifact",
  "type": "object"
}
