{
  "$defs": {
    "CategoryCapRule": {
      "additionalProperties": false,
      "properties": {
        "below": {
          "maximum": 100,
          "minimum": 0,
          "title": "Below",
          "type": "number"
        },
        "categories": {
          "items": {
            "enum": [
              "mission",
              "resource",
              "architecture",
              "programmatic"
            ],
            "type": "string"
          },
          "maxItems": 4,
          "minItems": 1,
          "title": "Categories",
          "type": "array"
        },
        "maximum_overall": {
          "maximum": 100,
          "minimum": 0,
          "title": "Maximum Overall",
          "type": "number"
        }
      },
      "required": [
        "categories",
        "below",
        "maximum_overall"
      ],
      "title": "CategoryCapRule",
      "type": "object"
    },
    "CategoryPolicy": {
      "additionalProperties": false,
      "properties": {
        "category": {
          "enum": [
            "mission",
            "resource",
            "architecture",
            "programmatic"
          ],
          "title": "Category",
          "type": "string"
        },
        "weight": {
          "exclusiveMinimum": 0,
          "title": "Weight",
          "type": "number"
        }
      },
      "required": [
        "category",
        "weight"
      ],
      "title": "CategoryPolicy",
      "type": "object"
    },
    "DesirabilityAnchor": {
      "additionalProperties": false,
      "properties": {
        "score": {
          "maximum": 100,
          "minimum": 0,
          "title": "Score",
          "type": "number"
        },
        "value": {
          "title": "Value",
          "type": "number"
        }
      },
      "required": [
        "value",
        "score"
      ],
      "title": "DesirabilityAnchor",
      "type": "object"
    },
    "DesirabilityMapping": {
      "additionalProperties": false,
      "properties": {
        "anchors": {
          "items": {
            "$ref": "#/$defs/DesirabilityAnchor"
          },
          "maxItems": 32,
          "minItems": 2,
          "title": "Anchors",
          "type": "array"
        },
        "component_id": {
          "default": "value",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Component Id",
          "type": "string"
        },
        "unit": {
          "enum": [
            "ratio",
            "1",
            "K",
            "deg",
            "m/s",
            "s",
            "W",
            "Wh",
            "W/kg",
            "W/m3",
            "W/m2",
            "kg",
            "m3",
            "m2",
            "dB",
            "bit/day",
            "bit",
            "USD",
            "EUR",
            "GBP",
            "count",
            "composite",
            "inventory",
            "score_points",
            "text",
            "bool",
            "V",
            "A",
            "m",
            "N",
            "degC",
            "km",
            "year",
            "deg/s",
            "rpm",
            "N*m",
            "N*m*s",
            "A*m2",
            "bit/s",
            "USD_2025",
            "arcsec",
            "enum",
            "m/s2"
          ],
          "title": "Unit",
          "type": "string"
        }
      },
      "required": [
        "unit",
        "anchors"
      ],
      "title": "DesirabilityMapping",
      "type": "object"
    },
    "KpiPolicy": {
      "additionalProperties": false,
      "properties": {
        "applicability_rule": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Applicability Rule",
          "type": "string"
        },
        "category": {
          "enum": [
            "mission",
            "resource",
            "architecture",
            "programmatic"
          ],
          "title": "Category",
          "type": "string"
        },
        "formula_id": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Formula Id",
          "type": "string"
        },
        "kpi_id": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Kpi Id",
          "type": "string"
        },
        "mappings": {
          "default": [],
          "items": {
            "$ref": "#/$defs/DesirabilityMapping"
          },
          "title": "Mappings",
          "type": "array"
        },
        "rationale": {
          "maxLength": 2000,
          "minLength": 1,
          "title": "Rationale",
          "type": "string"
        },
        "role": {
          "enum": [
            "scored",
            "advisory",
            "deferred"
          ],
          "title": "Role",
          "type": "string"
        },
        "unit": {
          "enum": [
            "ratio",
            "1",
            "K",
            "deg",
            "m/s",
            "s",
            "W",
            "Wh",
            "W/kg",
            "W/m3",
            "W/m2",
            "kg",
            "m3",
            "m2",
            "dB",
            "bit/day",
            "bit",
            "USD",
            "EUR",
            "GBP",
            "count",
            "composite",
            "inventory",
            "score_points",
            "text",
            "bool",
            "V",
            "A",
            "m",
            "N",
            "degC",
            "km",
            "year",
            "deg/s",
            "rpm",
            "N*m",
            "N*m*s",
            "A*m2",
            "bit/s",
            "USD_2025",
            "arcsec",
            "enum",
            "m/s2"
          ],
          "title": "Unit",
          "type": "string"
        },
        "weight": {
          "default": 0,
          "minimum": 0,
          "title": "Weight",
          "type": "number"
        }
      },
      "required": [
        "kpi_id",
        "formula_id",
        "category",
        "role",
        "unit",
        "applicability_rule",
        "rationale"
      ],
      "title": "KpiPolicy",
      "type": "object"
    }
  },
  "$id": "urn:sindri:contracts:1.0.0:evaluation-policy",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "approval_reference": {
      "maxLength": 512,
      "minLength": 1,
      "title": "Approval Reference",
      "type": "string"
    },
    "approved_draft_sha256": {
      "pattern": "^[0-9a-f]{64}$",
      "title": "Approved Draft Sha256",
      "type": "string"
    },
    "authority": {
      "const": "human_approved_preference",
      "default": "human_approved_preference",
      "title": "Authority",
      "type": "string"
    },
    "caps": {
      "default": [],
      "items": {
        "$ref": "#/$defs/CategoryCapRule"
      },
      "title": "Caps",
      "type": "array"
    },
    "categories": {
      "items": {
        "$ref": "#/$defs/CategoryPolicy"
      },
      "maxItems": 4,
      "minItems": 4,
      "title": "Categories",
      "type": "array"
    },
    "formula_registry_version": {
      "const": "1.0.0",
      "default": "1.0.0",
      "title": "Formula Registry Version",
      "type": "string"
    },
    "material_difference_points": {
      "default": 2,
      "maximum": 100,
      "minimum": 0,
      "title": "Material Difference Points",
      "type": "number"
    },
    "maximum_candidates": {
      "default": 100,
      "maximum": 100,
      "minimum": 1,
      "title": "Maximum Candidates",
      "type": "integer"
    },
    "metrics": {
      "items": {
        "$ref": "#/$defs/KpiPolicy"
      },
      "maxItems": 20,
      "minItems": 1,
      "title": "Metrics",
      "type": "array"
    },
    "override_statement_ids": {
      "default": [],
      "items": {
        "maxLength": 128,
        "minLength": 1,
        "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
        "type": "string"
      },
      "title": "Override Statement Ids",
      "type": "array"
    },
    "policy_id": {
      "maxLength": 128,
      "minLength": 1,
      "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
      "title": "Policy Id",
      "type": "string"
    },
    "presentation_driver_limit": {
      "default": 3,
      "maximum": 3,
      "minimum": 1,
      "title": "Presentation Driver Limit",
      "type": "integer"
    },
    "schema_kind": {
      "const": "evaluation_policy",
      "default": "evaluation_policy",
      "title": "Schema Kind",
      "type": "string"
    },
    "schema_version": {
      "const": "1.0.0",
      "default": "1.0.0",
      "title": "Schema Version",
      "type": "string"
    },
    "supported_classes": {
      "items": {
        "enum": [
          "nanosat",
          "microsat",
          "kw_class"
        ],
        "type": "string"
      },
      "minItems": 1,
      "title": "Supported Classes",
      "type": "array"
    },
    "version": {
      "const": "1.0.0",
      "default": "1.0.0",
      "title": "Version",
      "type": "string"
    }
  },
  "required": [
    "policy_id",
    "approval_reference",
    "approved_draft_sha256",
    "supported_classes",
    "metrics",
    "categories"
  ],
  "title": "EvaluationPolicySnapshot",
  "type": "object",
  "x-sindri-contract-suite": "sindri.contracts",
  "x-sindri-contract-version": "1.0.0"
}
