{
  "$defs": {
    "DecisionBindingProposal": {
      "additionalProperties": false,
      "properties": {
        "binding_id": {
          "title": "Binding Id",
          "type": "string"
        },
        "confidence": {
          "maximum": 1,
          "minimum": 0,
          "title": "Confidence",
          "type": "number"
        },
        "decision": {
          "$ref": "#/$defs/RecipeDecision"
        },
        "evidence": {
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "title": "Evidence",
          "type": "array"
        },
        "relationship": {
          "enum": [
            "equivalent_to",
            "convertible_to",
            "broader_than",
            "narrower_than",
            "derived_from",
            "measures",
            "associated_with",
            "not_comparable",
            "unknown",
            "requires_human_review"
          ],
          "title": "Relationship",
          "type": "string"
        }
      },
      "required": [
        "binding_id",
        "relationship",
        "evidence",
        "confidence",
        "decision"
      ],
      "title": "DecisionBindingProposal",
      "type": "object"
    },
    "ParameterizeDecision": {
      "additionalProperties": false,
      "properties": {
        "authority": {
          "const": "PARAMETERIZE",
          "default": "PARAMETERIZE",
          "title": "Authority",
          "type": "string"
        },
        "offset_source": {
          "anyOf": [
            {
              "const": "source_metadata.calibration_offset",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Offset Source"
        },
        "operation_id": {
          "maxLength": 100,
          "minLength": 1,
          "title": "Operation Id",
          "type": "string"
        },
        "operation_version": {
          "const": "1",
          "default": "1",
          "title": "Operation Version",
          "type": "string"
        },
        "option_id": {
          "maxLength": 100,
          "minLength": 1,
          "title": "Option Id",
          "type": "string"
        },
        "scale_source": {
          "anyOf": [
            {
              "const": "source_metadata.calibration_scale",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Scale Source"
        },
        "target_unit": {
          "anyOf": [
            {
              "enum": [
                "degC",
                "K",
                "cm",
                "m",
                "1"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Target Unit"
        }
      },
      "required": [
        "operation_id",
        "option_id"
      ],
      "title": "ParameterizeDecision",
      "type": "object"
    },
    "RecipeDecision": {
      "additionalProperties": false,
      "properties": {
        "capability_digest": {
          "pattern": "^[a-f0-9]{64}$",
          "title": "Capability Digest",
          "type": "string"
        },
        "ir_version": {
          "const": "1",
          "default": "1",
          "title": "Ir Version",
          "type": "string"
        },
        "rationale": {
          "maxLength": 2000,
          "minLength": 1,
          "title": "Rationale",
          "type": "string"
        },
        "status": {
          "enum": [
            "PROPOSED",
            "NEEDS_EVIDENCE",
            "NEEDS_HUMAN_REVIEW"
          ],
          "title": "Status",
          "type": "string"
        },
        "steps": {
          "default": [],
          "items": {
            "discriminator": {
              "mapping": {
                "PARAMETERIZE": "#/$defs/ParameterizeDecision",
                "SELECT": "#/$defs/SelectDecision"
              },
              "propertyName": "authority"
            },
            "oneOf": [
              {
                "$ref": "#/$defs/SelectDecision"
              },
              {
                "$ref": "#/$defs/ParameterizeDecision"
              }
            ]
          },
          "maxItems": 64,
          "title": "Steps",
          "type": "array"
        }
      },
      "required": [
        "capability_digest",
        "status",
        "rationale"
      ],
      "title": "RecipeDecision",
      "type": "object"
    },
    "SelectDecision": {
      "additionalProperties": false,
      "properties": {
        "authority": {
          "const": "SELECT",
          "default": "SELECT",
          "title": "Authority",
          "type": "string"
        },
        "operation_id": {
          "maxLength": 100,
          "minLength": 1,
          "title": "Operation Id",
          "type": "string"
        },
        "operation_version": {
          "const": "1",
          "default": "1",
          "title": "Operation Version",
          "type": "string"
        },
        "option_id": {
          "maxLength": 100,
          "minLength": 1,
          "title": "Option Id",
          "type": "string"
        }
      },
      "required": [
        "operation_id",
        "option_id"
      ],
      "title": "SelectDecision",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "bindings": {
      "items": {
        "$ref": "#/$defs/DecisionBindingProposal"
      },
      "maxItems": 16,
      "minItems": 1,
      "title": "Bindings",
      "type": "array"
    },
    "rationale": {
      "minLength": 1,
      "title": "Rationale",
      "type": "string"
    },
    "responds_to": {
      "items": {
        "type": "string"
      },
      "minItems": 1,
      "title": "Responds To",
      "type": "array"
    }
  },
  "required": [
    "bindings",
    "rationale",
    "responds_to"
  ],
  "title": "DecisionRecipeDraft",
  "type": "object"
}
