{
  "$defs": {
    "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"
    },
    "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": {
    "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"
}
