{
  "$defs": {
    "DecisionAuthorityRole": {
      "enum": [
        "mission_owner",
        "advisory",
        "informed"
      ],
      "title": "DecisionAuthorityRole",
      "type": "string"
    },
    "DecisionPointDiscussingAdrPayload": {
      "additionalProperties": false,
      "description": "3.x-compatible ADR-style Discussing 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": "DecisionPointDiscussingAdrPayload",
      "type": "object"
    },
    "DecisionPointDiscussingInterviewPayload": {
      "additionalProperties": false,
      "description": "V1: synthesized contribution snapshot for interview-origin discussion.",
      "properties": {
        "actor_id": {
          "minLength": 1,
          "title": "Actor Id",
          "type": "string"
        },
        "actor_type": {
          "enum": [
            "human",
            "llm",
            "service"
          ],
          "title": "Actor Type",
          "type": "string"
        },
        "contributions": {
          "items": {
            "type": "string"
          },
          "title": "Contributions",
          "type": "array"
        },
        "decision_point_id": {
          "minLength": 1,
          "title": "Decision Point Id",
          "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"
        },
        "origin_surface": {
          "const": "planning_interview",
          "title": "Origin Surface",
          "type": "string"
        },
        "recorded_at": {
          "format": "date-time",
          "title": "Recorded At",
          "type": "string"
        },
        "run_id": {
          "minLength": 1,
          "title": "Run Id",
          "type": "string"
        },
        "snapshot_kind": {
          "$ref": "#/$defs/DiscussingSnapshotKind"
        },
        "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",
        "snapshot_kind",
        "actor_id",
        "actor_type",
        "state_entered_at",
        "recorded_at"
      ],
      "title": "DecisionPointDiscussingInterviewPayload",
      "type": "object"
    },
    "DiscussingSnapshotKind": {
      "description": "Kind of contribution snapshot in a DecisionPointDiscussing event.",
      "enum": [
        "participant_contribution",
        "digest",
        "owner_note"
      ],
      "title": "DiscussingSnapshotKind",
      "type": "string"
    }
  },
  "$id": "spec-kitty-events/decision_point_discussing_payload",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "discriminator": {
    "mapping": {
      "adr": "#/$defs/DecisionPointDiscussingAdrPayload",
      "planning_interview": "#/$defs/DecisionPointDiscussingInterviewPayload"
    },
    "propertyName": "origin_surface"
  },
  "oneOf": [
    {
      "$ref": "#/$defs/DecisionPointDiscussingAdrPayload"
    },
    {
      "$ref": "#/$defs/DecisionPointDiscussingInterviewPayload"
    }
  ]
}
