{
  "$defs": {
    "DecisionAuthorityRole": {
      "enum": [
        "mission_owner",
        "advisory",
        "informed"
      ],
      "title": "DecisionAuthorityRole",
      "type": "string"
    },
    "DecisionPointOpenedAdrPayload": {
      "additionalProperties": false,
      "description": "3.x-compatible ADR-style Opened payload.",
      "properties": {
        "actor_id": {
          "minLength": 1,
          "title": "Actor Id",
          "type": "string"
        },
        "actor_type": {
          "enum": [
            "human",
            "llm",
            "service"
          ],
          "title": "Actor Type",
          "type": "string"
        },
        "alternatives_considered": {
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "title": "Alternatives Considered",
          "type": "array"
        },
        "authority_role": {
          "$ref": "#/$defs/DecisionAuthorityRole"
        },
        "decision_point_id": {
          "minLength": 1,
          "title": "Decision Point Id",
          "type": "string"
        },
        "evidence_refs": {
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "title": "Evidence Refs",
          "type": "array"
        },
        "mission_id": {
          "minLength": 1,
          "title": "Mission Id",
          "type": "string"
        },
        "mission_owner_authority_flag": {
          "title": "Mission Owner Authority Flag",
          "type": "boolean"
        },
        "mission_owner_authority_path": {
          "title": "Mission Owner Authority Path",
          "type": "string"
        },
        "mission_slug": {
          "minLength": 1,
          "title": "Mission Slug",
          "type": "string"
        },
        "mission_type": {
          "minLength": 1,
          "title": "Mission Type",
          "type": "string"
        },
        "origin_surface": {
          "const": "adr",
          "title": "Origin Surface",
          "type": "string"
        },
        "phase": {
          "minLength": 1,
          "title": "Phase",
          "type": "string"
        },
        "rationale": {
          "minLength": 1,
          "title": "Rationale",
          "type": "string"
        },
        "recorded_at": {
          "format": "date-time",
          "title": "Recorded At",
          "type": "string"
        },
        "run_id": {
          "minLength": 1,
          "title": "Run Id",
          "type": "string"
        },
        "state_entered_at": {
          "format": "date-time",
          "title": "State Entered At",
          "type": "string"
        }
      },
      "required": [
        "origin_surface",
        "decision_point_id",
        "mission_id",
        "run_id",
        "mission_slug",
        "mission_type",
        "phase",
        "actor_id",
        "actor_type",
        "authority_role",
        "mission_owner_authority_flag",
        "mission_owner_authority_path",
        "rationale",
        "alternatives_considered",
        "evidence_refs",
        "state_entered_at",
        "recorded_at"
      ],
      "title": "DecisionPointOpenedAdrPayload",
      "type": "object"
    },
    "DecisionPointOpenedInterviewPayload": {
      "additionalProperties": false,
      "description": "V1 interview-origin Opened payload (ask-time).",
      "properties": {
        "actor_id": {
          "minLength": 1,
          "title": "Actor Id",
          "type": "string"
        },
        "actor_type": {
          "enum": [
            "human",
            "llm",
            "service"
          ],
          "title": "Actor Type",
          "type": "string"
        },
        "decision_point_id": {
          "minLength": 1,
          "title": "Decision Point Id",
          "type": "string"
        },
        "input_key": {
          "minLength": 1,
          "title": "Input Key",
          "type": "string"
        },
        "mission_id": {
          "minLength": 1,
          "title": "Mission Id",
          "type": "string"
        },
        "mission_slug": {
          "minLength": 1,
          "title": "Mission Slug",
          "type": "string"
        },
        "mission_type": {
          "minLength": 1,
          "title": "Mission Type",
          "type": "string"
        },
        "options": {
          "items": {
            "type": "string"
          },
          "minItems": 0,
          "title": "Options",
          "type": "array"
        },
        "origin_flow": {
          "$ref": "#/$defs/OriginFlow"
        },
        "origin_surface": {
          "const": "planning_interview",
          "title": "Origin Surface",
          "type": "string"
        },
        "phase": {
          "minLength": 1,
          "title": "Phase",
          "type": "string"
        },
        "question": {
          "minLength": 1,
          "title": "Question",
          "type": "string"
        },
        "recorded_at": {
          "format": "date-time",
          "title": "Recorded At",
          "type": "string"
        },
        "run_id": {
          "minLength": 1,
          "title": "Run Id",
          "type": "string"
        },
        "state_entered_at": {
          "format": "date-time",
          "title": "State Entered At",
          "type": "string"
        },
        "step_id": {
          "minLength": 1,
          "title": "Step Id",
          "type": "string"
        }
      },
      "required": [
        "origin_surface",
        "decision_point_id",
        "mission_id",
        "run_id",
        "mission_slug",
        "mission_type",
        "phase",
        "origin_flow",
        "question",
        "options",
        "input_key",
        "step_id",
        "actor_id",
        "actor_type",
        "state_entered_at",
        "recorded_at"
      ],
      "title": "DecisionPointOpenedInterviewPayload",
      "type": "object"
    },
    "OriginFlow": {
      "description": "Spec-kitty flow that originated the decision point.",
      "enum": [
        "charter",
        "specify",
        "plan"
      ],
      "title": "OriginFlow",
      "type": "string"
    }
  },
  "$id": "spec-kitty-events/decision_point_opened_payload",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "discriminator": {
    "mapping": {
      "adr": "#/$defs/DecisionPointOpenedAdrPayload",
      "planning_interview": "#/$defs/DecisionPointOpenedInterviewPayload"
    },
    "propertyName": "origin_surface"
  },
  "oneOf": [
    {
      "$ref": "#/$defs/DecisionPointOpenedAdrPayload"
    },
    {
      "$ref": "#/$defs/DecisionPointOpenedInterviewPayload"
    }
  ]
}
