{
  "$defs": {
    "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"
    },
    "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/agent-eval-report.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "\u00a717 agent evaluation harness run (G-NEW-03 release gate) for one agent version.\n\n``evaluate()`` sets each measure's ``passed`` and the overall ``status``: failed if any measured\nvalue misses its (proposed) mark, passed only when all six measures were run and pass, untested\notherwise. G-NEW-03 reads this report: anything but passed holds the version (AGENT_VERSION_HELD).",
  "properties": {
    "agent": {
      "description": "Agent principal, e.g. agent:newton-actor.",
      "title": "Agent",
      "type": "string"
    },
    "agent_version": {
      "title": "Agent Version",
      "type": "string"
    },
    "approved_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): approver principal.",
      "title": "Governance ApprovedBy"
    },
    "content_hash": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): the artifact content hash.",
      "title": "Governance ContentHash"
    },
    "gate_results": {
      "anyOf": [
        {
          "items": {},
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): gate results of the latest run.",
      "title": "Governance GateResults"
    },
    "golden_set": {
      "additionalProperties": true,
      "description": "{id, n_questions, held_out_share}; held-out third never shared.",
      "title": "Golden Set",
      "type": "object"
    },
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): artifact id.",
      "title": "Governance Id"
    },
    "measures": {
      "items": {
        "$ref": "#/$defs/AcceptanceMetric"
      },
      "title": "Measures",
      "type": "array"
    },
    "notes": {
      "items": {
        "$ref": "#/$defs/Note"
      },
      "title": "Notes",
      "type": "array"
    },
    "owner": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): owner principal.",
      "title": "Governance Owner"
    },
    "playbook_version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Playbook Version"
    },
    "previous_passing_version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Version that stays live if this one is held.",
      "title": "Previous Passing Version"
    },
    "revision": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): content revision (spec \u00a77).",
      "title": "Governance Revision"
    },
    "run_ids": {
      "items": {
        "type": "string"
      },
      "title": "Run Ids",
      "type": "array"
    },
    "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"
    },
    "submitted_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Governance member (spec \u00a76): submitter principal.",
      "title": "Governance SubmittedBy"
    },
    "tool_server_version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Tool Server Version"
    },
    "valid_to": {
      "default": null,
      "description": "Governance member (spec \u00a76): end of the validity window (spec \u00a77).",
      "title": "Governance ValidTo"
    }
  },
  "required": [
    "agent",
    "agent_version"
  ],
  "title": "AgentEvalReport",
  "type": "object"
}
