{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://developers.foreverlearning.ai/schemas/conversation-v1.json",
  "$defs": {
    "ReviewReference": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "session_id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "turn_number": {
              "type": "integer",
              "minimum": 0
            },
            "scenario_id": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                {
                  "type": "null"
                }
              ]
            },
            "kind": {
              "type": "string",
              "enum": [
                "practiced",
                "growth_edge"
              ]
            }
          },
          "required": [
            "session_id",
            "turn_number",
            "scenario_id",
            "kind"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "beat_id": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                {
                  "type": "null"
                }
              ]
            },
            "learner_turn": {
              "type": "integer",
              "minimum": 0
            },
            "marker_id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "kind": {
              "type": "string",
              "enum": [
                "practiced",
                "growth_edge"
              ]
            }
          },
          "required": [
            "beat_id",
            "learner_turn",
            "marker_id",
            "kind"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "beat_id": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                {
                  "type": "null"
                }
              ]
            },
            "learner_turn": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ]
            },
            "trajectory_code": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "required": [
            "beat_id",
            "learner_turn",
            "trajectory_code"
          ]
        }
      ]
    },
    "ReviewClaim": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "template_code": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        },
        "evidence_refs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReviewReference"
          },
          "minItems": 1,
          "maxItems": 10000
        },
        "stage": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        }
      },
      "required": [
        "template_code",
        "text",
        "evidence_refs"
      ]
    },
    "ReviewMarker": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "marker_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "kind": {
          "type": "string",
          "enum": [
            "practiced",
            "growth_edge"
          ]
        }
      },
      "required": [
        "marker_id",
        "label",
        "kind"
      ]
    },
    "ReviewPattern": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "marker_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "distinct_sessions": {
          "type": "integer",
          "minimum": 0
        },
        "milestone": {
          "type": "string",
          "enum": [
            "first_occurrence",
            "repeated",
            "recurring"
          ]
        },
        "growing": {
          "type": "boolean"
        },
        "evidence_refs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReviewReference"
          },
          "minItems": 0,
          "maxItems": 10000
        }
      },
      "required": [
        "marker_id",
        "label",
        "distinct_sessions",
        "milestone",
        "growing",
        "evidence_refs"
      ]
    },
    "ReviewIdentity": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "scenario_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ]
        },
        "scenario_revision": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "scenario_title": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ]
        },
        "goal_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ]
        },
        "coach_lens_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ]
        },
        "practice_mode": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ]
        },
        "challenge": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ]
        },
        "emotional_heat": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ]
        },
        "room_controls_changed": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "minItems": 0,
          "maxItems": 32
        },
        "cast_languages": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "minItems": 0,
          "maxItems": 32
        }
      },
      "required": [
        "scenario_id",
        "scenario_revision",
        "scenario_title",
        "goal_id",
        "coach_lens_id",
        "practice_mode",
        "challenge",
        "emotional_heat"
      ]
    },
    "ReviewComparison": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "available": {
              "const": false
            },
            "reason_code": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "required": [
            "available",
            "reason_code"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "available": {
              "const": true
            },
            "reason_code": {
              "type": "null"
            },
            "prior_comparable_sessions": {
              "type": "integer",
              "minimum": 0
            },
            "comparability": {
              "type": "string",
              "enum": [
                "same_conditions",
                "different_conditions"
              ]
            },
            "conditions": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "challenge": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "emotional_heat": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "challenge",
                "emotional_heat"
              ]
            },
            "recorded_similarities": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "marker_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "marker_id",
                  "label"
                ]
              },
              "minItems": 0,
              "maxItems": 13
            },
            "new_this_session": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "marker_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "marker_id",
                  "label"
                ]
              },
              "minItems": 0,
              "maxItems": 13
            },
            "also_practiced_before": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "marker_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "marker_id",
                  "label"
                ]
              },
              "minItems": 0,
              "maxItems": 13
            }
          },
          "required": [
            "available",
            "reason_code",
            "prior_comparable_sessions",
            "comparability",
            "conditions",
            "recorded_similarities",
            "new_this_session",
            "also_practiced_before"
          ]
        }
      ]
    },
    "PersonaResponseCode": {
      "type": "string",
      "enum": [
        "steady_and_engaged",
        "more_open",
        "more_careful",
        "more_strained",
        "participating_less"
      ]
    },
    "PersonaResponseArcs": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "available",
            "partial",
            "unavailable"
          ]
        },
        "reason_code": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            {
              "type": "null"
            }
          ]
        },
        "disclosure_code": {
          "const": "simulated_cast_responses_not_person_reading"
        },
        "arcs": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "persona_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "persona_revision": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "shape": {
                "type": "string",
                "enum": [
                  "steady",
                  "shifted"
                ]
              },
              "coverage": {
                "type": "string",
                "enum": [
                  "complete",
                  "intermittent"
                ]
              },
              "moments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "stage": {
                      "type": "string",
                      "enum": [
                        "opening",
                        "beat"
                      ]
                    },
                    "response_code": {
                      "$ref": "#/$defs/PersonaResponseCode"
                    },
                    "evidence_ref": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "point": {
                          "type": "string",
                          "enum": [
                            "opening",
                            "beat"
                          ]
                        },
                        "beat_id": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "learner_turn": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "point",
                        "beat_id",
                        "learner_turn"
                      ]
                    }
                  },
                  "required": [
                    "stage",
                    "response_code",
                    "evidence_ref"
                  ]
                },
                "minItems": 0,
                "maxItems": 6
              }
            },
            "required": [
              "persona_id",
              "persona_revision",
              "shape",
              "coverage",
              "moments"
            ]
          },
          "minItems": 0,
          "maxItems": 5
        }
      },
      "required": [
        "status",
        "reason_code",
        "disclosure_code",
        "arcs"
      ]
    },
    "CoachingCloseout": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "final_turn_display_projection",
            "longtermmem_session_summary"
          ]
        },
        "paragraphs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1200
          },
          "minItems": 1,
          "maxItems": 6
        },
        "fallback": {
          "type": "boolean"
        },
        "fallback_reason_code": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "source",
        "paragraphs",
        "fallback",
        "fallback_reason_code"
      ]
    },
    "ConsumerDebrief": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "ccd.insights_session_debrief.v6"
        },
        "session_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "scenario_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ]
        },
        "has_evidence": {
          "type": "boolean"
        },
        "shallow_reason_code": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            {
              "type": "null"
            }
          ]
        },
        "coaching_history": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReviewPattern"
          },
          "minItems": 0,
          "maxItems": 13
        },
        "how_youre_growing": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "marker_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              }
            },
            "required": [
              "marker_id",
              "label"
            ]
          },
          "minItems": 0,
          "maxItems": 13
        },
        "worth_celebrating": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "marker_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "reason_code": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              }
            },
            "required": [
              "marker_id",
              "label",
              "reason_code"
            ]
          },
          "minItems": 0,
          "maxItems": 13
        },
        "practice_arc": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "learner_turn": {
                "type": "integer",
                "minimum": 0
              },
              "markers": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/ReviewMarker"
                },
                "minItems": 0,
                "maxItems": 26
              }
            },
            "required": [
              "learner_turn",
              "markers"
            ]
          },
          "minItems": 0,
          "maxItems": 10000
        },
        "saved_lines": {
          "type": "array",
          "maxItems": 0
        },
        "session_identity": {
          "anyOf": [
            {
              "$ref": "#/$defs/ReviewIdentity"
            },
            {
              "type": "null"
            }
          ]
        },
        "patterns_this_session": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReviewPattern"
          },
          "minItems": 0,
          "maxItems": 13
        },
        "trajectory": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "available": {
              "type": "boolean"
            },
            "reason_code": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ]
            },
            "codes": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "minItems": 0,
              "maxItems": 10000
            }
          },
          "required": [
            "available",
            "reason_code",
            "codes"
          ]
        },
        "same_scenario_comparison": {
          "$ref": "#/$defs/ReviewComparison"
        },
        "export_metadata": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "schema": {
              "const": "ccd.insights_session_debrief.v6"
            },
            "epoch_id": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                {
                  "type": "null"
                }
              ]
            },
            "source": {
              "const": "marker_evidence_ledger"
            }
          },
          "required": [
            "schema",
            "epoch_id",
            "source"
          ]
        },
        "grounded_moments": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "learner_turn": {
                "type": "integer",
                "minimum": 0
              },
              "beat_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "markers": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/ReviewMarker"
                },
                "minItems": 0,
                "maxItems": 26
              }
            },
            "required": [
              "learner_turn",
              "beat_id",
              "markers"
            ]
          },
          "minItems": 0,
          "maxItems": 10000
        },
        "next_practice": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "practice_focus",
                  "build_on_strength",
                  "keep_exploring"
                ]
              },
              "marker_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "label": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "code",
              "marker_id",
              "label"
            ]
          },
          "minItems": 0,
          "maxItems": 2
        },
        "coaching_summary": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "text": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1200
                },
                "source": {
                  "const": "final_turn_safe_projection"
                }
              },
              "required": [
                "text",
                "source"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "reflection": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "what_happened": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "available": {
                  "type": "boolean"
                },
                "reason_code": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "claims": {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/ReviewClaim"
                  },
                  "minItems": 0,
                  "maxItems": 100
                }
              },
              "required": [
                "available",
                "reason_code",
                "claims"
              ]
            },
            "what_it_means": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "available": {
                  "type": "boolean"
                },
                "reason_code": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "claims": {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/ReviewClaim"
                  },
                  "minItems": 0,
                  "maxItems": 100
                }
              },
              "required": [
                "available",
                "reason_code",
                "claims"
              ]
            },
            "key_insights": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "marker_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  },
                  "template_code": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "takeaway": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048
                  },
                  "next_experiment": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048
                  },
                  "evidence_refs": {
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/ReviewReference"
                    },
                    "minItems": 1,
                    "maxItems": 10000
                  }
                },
                "required": [
                  "marker_id",
                  "title",
                  "template_code",
                  "takeaway",
                  "next_experiment",
                  "evidence_refs"
                ]
              },
              "minItems": 0,
              "maxItems": 4
            },
            "pattern_fit": {
              "oneOf": [
                {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "available": {
                      "const": false
                    },
                    "reason_code": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    }
                  },
                  "required": [
                    "available",
                    "reason_code"
                  ]
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "available": {
                      "const": true
                    },
                    "reason_code": {
                      "type": "null"
                    },
                    "current_session_fact": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "template_code": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "text": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2048
                        },
                        "evidence_refs": {
                          "type": "array",
                          "items": {
                            "$ref": "#/$defs/ReviewReference"
                          },
                          "minItems": 1,
                          "maxItems": 10000
                        }
                      },
                      "required": [
                        "template_code",
                        "text",
                        "evidence_refs"
                      ]
                    },
                    "cross_session_pattern": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "template_code": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "text": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2048
                        },
                        "evidence_refs": {
                          "type": "array",
                          "items": {
                            "$ref": "#/$defs/ReviewReference"
                          },
                          "minItems": 1,
                          "maxItems": 10000
                        }
                      },
                      "required": [
                        "template_code",
                        "text",
                        "evidence_refs"
                      ]
                    }
                  },
                  "required": [
                    "available",
                    "reason_code",
                    "current_session_fact",
                    "cross_session_pattern"
                  ]
                }
              ]
            }
          },
          "required": [
            "what_happened",
            "what_it_means",
            "key_insights",
            "pattern_fit"
          ]
        },
        "coaching_closeout": {
          "anyOf": [
            {
              "$ref": "#/$defs/CoachingCloseout"
            },
            {
              "type": "null"
            }
          ]
        },
        "persona_response_arcs": {
          "$ref": "#/$defs/PersonaResponseArcs"
        }
      },
      "required": [
        "schema",
        "session_id",
        "scenario_id",
        "has_evidence",
        "shallow_reason_code",
        "coaching_history",
        "how_youre_growing",
        "worth_celebrating",
        "practice_arc",
        "saved_lines",
        "session_identity",
        "patterns_this_session",
        "trajectory",
        "same_scenario_comparison",
        "export_metadata",
        "grounded_moments",
        "next_practice",
        "coaching_summary",
        "reflection",
        "coaching_closeout",
        "persona_response_arcs"
      ]
    },
    "ConsumerInsights": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "ccd.insights_global.v3"
        },
        "scope": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "all_practice"
            },
            "scenario_id": {
              "type": "null"
            },
            "session_id": {
              "type": "null"
            }
          },
          "required": [
            "kind",
            "scenario_id",
            "session_id"
          ]
        },
        "min_distinct_sessions": {
          "type": "integer",
          "minimum": 0
        },
        "conversations": {
          "type": "integer",
          "minimum": 0
        },
        "has_evidence": {
          "type": "boolean"
        },
        "shallow_reason_code": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            {
              "type": "null"
            }
          ]
        },
        "practiced": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReviewPattern"
          },
          "minItems": 0,
          "maxItems": 13
        },
        "growth_edges": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "marker_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "distinct_sessions": {
                "type": "integer",
                "minimum": 0
              },
              "evidence_refs": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/ReviewReference"
                },
                "minItems": 0,
                "maxItems": 10000
              }
            },
            "required": [
              "marker_id",
              "label",
              "distinct_sessions",
              "evidence_refs"
            ]
          },
          "minItems": 0,
          "maxItems": 13
        },
        "milestones": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "marker_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "status": {
                "type": "string",
                "enum": [
                  "first_occurrence",
                  "repeated",
                  "recurring"
                ]
              },
              "growing": {
                "type": "boolean"
              },
              "distinct_sessions": {
                "type": "integer",
                "minimum": 0
              },
              "reason_code": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              }
            },
            "required": [
              "marker_id",
              "label",
              "status",
              "growing",
              "distinct_sessions",
              "reason_code"
            ]
          },
          "minItems": 0,
          "maxItems": 13
        },
        "practice_partners": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "persona_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "persona_revision": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "descriptors": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "minItems": 0,
                "maxItems": 32
              },
              "conversations": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "persona_id",
              "persona_revision",
              "label",
              "descriptors",
              "conversations"
            ]
          },
          "minItems": 0,
          "maxItems": 1000
        },
        "partner_patterns": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "descriptor": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "markers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "marker_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    },
                    "conversations": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "marker_id",
                    "label",
                    "conversations"
                  ]
                },
                "minItems": 0,
                "maxItems": 13
              }
            },
            "required": [
              "descriptor",
              "markers"
            ]
          },
          "minItems": 0,
          "maxItems": 100
        },
        "partner_patterns_empty_code": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            {
              "type": "null"
            }
          ]
        },
        "persona_response_patterns": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "available": {
              "type": "boolean"
            },
            "reason_code": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ]
            },
            "window": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "const": "most_recent_completed"
                },
                "max_sessions": {
                  "const": 24
                },
                "included_sessions": {
                  "type": "integer",
                  "minimum": 0
                },
                "total_scoped_finalized_sessions": {
                  "type": "integer",
                  "minimum": 0
                },
                "truncated": {
                  "type": "boolean"
                }
              },
              "required": [
                "kind",
                "max_sessions",
                "included_sessions",
                "total_scoped_finalized_sessions",
                "truncated"
              ]
            },
            "patterns": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "persona_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "persona_revision": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "response_code": {
                    "$ref": "#/$defs/PersonaResponseCode"
                  },
                  "distinct_sessions": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "evidence_refs": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "session_id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "beat_id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "learner_turn": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "session_id",
                        "beat_id",
                        "learner_turn"
                      ]
                    },
                    "minItems": 2,
                    "maxItems": 24
                  }
                },
                "required": [
                  "persona_id",
                  "persona_revision",
                  "response_code",
                  "distinct_sessions",
                  "evidence_refs"
                ]
              },
              "minItems": 0,
              "maxItems": 120
            }
          },
          "required": [
            "available",
            "reason_code",
            "window",
            "patterns"
          ]
        }
      },
      "required": [
        "schema",
        "scope",
        "min_distinct_sessions",
        "conversations",
        "has_evidence",
        "shallow_reason_code",
        "practiced",
        "growth_edges",
        "milestones",
        "practice_partners",
        "partner_patterns",
        "partner_patterns_empty_code",
        "persona_response_patterns"
      ]
    },
    "Id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "Timestamp": {
      "type": "string",
      "minLength": 1,
      "maxLength": 32
    },
    "Hash": {
      "type": "string",
      "minLength": 64,
      "maxLength": 64
    },
    "Cursor": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        {
          "type": "null"
        }
      ]
    },
    "Controls": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "cast_language": {
          "type": "string",
          "enum": [
            "en-US",
            "es-US",
            "fr-FR",
            "fr-CA",
            "de-DE",
            "it-IT",
            "pt-BR",
            "ja-JP",
            "ko-KR",
            "cmn-CN"
          ]
        },
        "cast_speech": {
          "type": "string",
          "enum": [
            "simple",
            "everyday",
            "natural"
          ]
        },
        "challenge": {
          "type": "string",
          "enum": [
            "supportive",
            "realistic",
            "resistant"
          ]
        },
        "emotional_heat": {
          "type": "string",
          "enum": [
            "calm",
            "tense",
            "heated",
            "raw"
          ]
        },
        "coach_lens_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 41
        }
      },
      "required": []
    },
    "SetupControls": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "cast_language": {
          "type": "string",
          "enum": [
            "en-US",
            "es-US",
            "fr-FR",
            "fr-CA",
            "de-DE",
            "it-IT",
            "pt-BR",
            "ja-JP",
            "ko-KR",
            "cmn-CN"
          ]
        },
        "cast_speech": {
          "type": "string",
          "enum": [
            "simple",
            "everyday",
            "natural"
          ]
        },
        "challenge": {
          "type": "string",
          "enum": [
            "supportive",
            "realistic",
            "resistant"
          ]
        },
        "emotional_heat": {
          "type": "string",
          "enum": [
            "calm",
            "tense",
            "heated"
          ]
        },
        "coach_lens_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 41
        }
      },
      "required": []
    },
    "AppliedControls": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "cast_language": {
          "type": "string",
          "enum": [
            "en-US",
            "es-US",
            "fr-FR",
            "fr-CA",
            "de-DE",
            "it-IT",
            "pt-BR",
            "ja-JP",
            "ko-KR",
            "cmn-CN"
          ]
        },
        "cast_speech": {
          "type": "string",
          "enum": [
            "simple",
            "everyday",
            "natural"
          ]
        },
        "challenge": {
          "type": "string",
          "enum": [
            "supportive",
            "realistic",
            "resistant"
          ]
        },
        "emotional_heat": {
          "type": "string",
          "enum": [
            "calm",
            "tense",
            "heated",
            "raw"
          ]
        },
        "coach_lens_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 41
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "cast_language",
        "cast_speech",
        "challenge",
        "emotional_heat",
        "coach_lens_id"
      ]
    },
    "Participant": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "persona_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        }
      },
      "required": [
        "persona_id"
      ]
    },
    "Consent": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "topic": {
          "const": true
        },
        "intensive": {
          "const": true
        }
      },
      "required": []
    },
    "ConsentRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "action": {
          "type": "string",
          "enum": [
            "continue",
            "soften"
          ]
        }
      },
      "required": [
        "action"
      ]
    },
    "ConsentStatus": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.conversation.consent.v1"
        },
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "consent_state": {
          "type": "string",
          "enum": [
            "none",
            "granted_at_setup",
            "granted_in_session",
            "softened"
          ]
        },
        "intensity_decision": {
          "type": "string",
          "enum": [
            "undecided",
            "opted_in",
            "softened"
          ]
        },
        "selected_intensity_tier": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "gentle",
                "regular",
                "intensive"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "gentle_latch": {
          "type": "boolean"
        },
        "intensity_preference": {
          "type": "string",
          "enum": [
            "standard",
            "softened"
          ]
        },
        "effective_controls": {
          "type": "string",
          "enum": [
            "standard",
            "gentle"
          ]
        },
        "session_active": {
          "type": "boolean"
        },
        "granted": {
          "type": "boolean"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "schema",
        "session_id",
        "consent_state",
        "intensity_decision",
        "selected_intensity_tier",
        "gentle_latch",
        "intensity_preference",
        "effective_controls",
        "session_active",
        "granted",
        "request_id"
      ]
    },
    "LearnerRole": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "display_name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "role": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        }
      },
      "required": []
    },
    "RoomSetup": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "room"
        },
        "room_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32
        },
        "mode": {
          "type": "string",
          "enum": [
            "guided",
            "simulation",
            "freeform"
          ]
        },
        "participants": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Participant"
          },
          "minItems": 1,
          "maxItems": 5
        },
        "consent": {
          "$ref": "#/$defs/Consent"
        },
        "learner_role": {
          "$ref": "#/$defs/LearnerRole"
        }
      },
      "required": [
        "kind",
        "room_id",
        "mode",
        "participants"
      ]
    },
    "OpenSetup": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "open"
        },
        "mode": {
          "const": "open_practice"
        },
        "cast_shape": {
          "type": "string",
          "enum": [
            "one_on_one",
            "room"
          ]
        },
        "participants": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Participant"
          },
          "minItems": 1,
          "maxItems": 5
        },
        "topic": {
          "type": "string",
          "minLength": 0,
          "maxLength": 240
        },
        "high_care": {
          "type": "boolean"
        },
        "learner_role": {
          "$ref": "#/$defs/LearnerRole"
        }
      },
      "required": [
        "kind",
        "mode",
        "cast_shape",
        "participants"
      ]
    },
    "CreateSession": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "setup": {
          "oneOf": [
            {
              "$ref": "#/$defs/RoomSetup"
            },
            {
              "$ref": "#/$defs/OpenSetup"
            }
          ]
        },
        "controls": {
          "$ref": "#/$defs/SetupControls"
        }
      },
      "required": [
        "setup"
      ]
    },
    "Opening": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "conversation": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "operation": {
              "const": "opening"
            },
            "controls": {
              "$ref": "#/$defs/Controls"
            }
          },
          "required": [
            "operation"
          ]
        }
      },
      "required": [
        "session_id",
        "conversation"
      ]
    },
    "LearnerTurn": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 10000
        },
        "conversation": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "operation": {
              "const": "turn"
            },
            "controls": {
              "$ref": "#/$defs/Controls"
            }
          },
          "required": [
            "operation"
          ]
        }
      },
      "required": [
        "session_id",
        "prompt",
        "conversation"
      ]
    },
    "ChatRequest": {
      "type": "object",
      "oneOf": [
        {
          "$ref": "#/$defs/Opening"
        },
        {
          "$ref": "#/$defs/LearnerTurn"
        }
      ]
    },
    "LifecycleRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "operation_id": {
          "type": "string",
          "minLength": 36,
          "maxLength": 36
        }
      },
      "required": [
        "operation_id"
      ]
    },
    "LifecycleResult": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "operation_id": {
          "type": "string",
          "minLength": 36,
          "maxLength": 36
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "completed"
          ]
        }
      },
      "required": [
        "operation_id",
        "request_id",
        "status"
      ]
    },
    "VoiceRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "turn_id": {
          "$ref": "#/$defs/Id"
        },
        "operation": {
          "type": "string",
          "enum": [
            "generate",
            "regenerate"
          ]
        },
        "replaces_audio_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "session_id",
        "turn_id",
        "operation"
      ]
    },
    "CastMember": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "speaker_id": {
          "$ref": "#/$defs/Id"
        },
        "persona_id": {
          "$ref": "#/$defs/Id"
        },
        "display_name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "role": {
          "type": "string",
          "minLength": 1,
          "maxLength": 160
        },
        "seat": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5
        }
      },
      "required": [
        "speaker_id",
        "persona_id",
        "display_name",
        "role",
        "seat"
      ]
    },
    "Session": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.conversation.session.v1"
        },
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "state": {
          "type": "string",
          "enum": [
            "prepared",
            "active",
            "closed",
            "discarded"
          ]
        },
        "created_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "expires_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "content_release": {
          "$ref": "#/$defs/Id"
        },
        "interface_version": {
          "const": "2026-12-01"
        },
        "setup_fingerprint": {
          "$ref": "#/$defs/Hash"
        },
        "mode": {
          "type": "string",
          "enum": [
            "guided",
            "simulation",
            "freeform",
            "open_practice"
          ]
        },
        "room_id": {
          "anyOf": [
            {
              "$ref": "#/$defs/Id"
            },
            {
              "type": "null"
            }
          ]
        },
        "cast": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CastMember"
          },
          "minItems": 1,
          "maxItems": 5
        },
        "starting_controls": {
          "$ref": "#/$defs/AppliedControls"
        },
        "current_controls": {
          "$ref": "#/$defs/AppliedControls"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "schema",
        "session_id",
        "state",
        "created_at",
        "expires_at",
        "content_release",
        "interface_version",
        "setup_fingerprint",
        "mode",
        "room_id",
        "cast",
        "starting_controls",
        "request_id"
      ]
    },
    "SessionList": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.conversation.sessions.v1"
        },
        "sessions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Session"
          },
          "minItems": 0,
          "maxItems": 100
        },
        "next_cursor": {
          "$ref": "#/$defs/Cursor"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "schema",
        "sessions",
        "next_cursor",
        "request_id"
      ]
    },
    "ExportSession": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "session"
        },
        "session": {
          "$ref": "#/$defs/Session"
        },
        "learner_setup": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "topic": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 0,
                  "maxLength": 240
                },
                {
                  "type": "null"
                }
              ]
            },
            "learner_role": {
              "anyOf": [
                {
                  "$ref": "#/$defs/LearnerRole"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "topic",
            "learner_role"
          ]
        },
        "consent": {
          "$ref": "#/$defs/ConsentStatus"
        }
      },
      "required": [
        "kind",
        "session",
        "learner_setup",
        "consent"
      ]
    },
    "ExportTurn": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "turn"
        },
        "turn": {
          "$ref": "#/$defs/Turn"
        }
      },
      "required": [
        "kind",
        "turn"
      ]
    },
    "ExportPreferences": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "preferences"
        },
        "preferences": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "preferred_coach_lens": {
              "type": "string",
              "minLength": 0,
              "maxLength": 100
            },
            "accessibility_preference": {
              "type": "string",
              "minLength": 0,
              "maxLength": 1000
            },
            "audio_preference": {
              "type": "string",
              "minLength": 0,
              "maxLength": 1000
            }
          },
          "required": []
        }
      },
      "required": [
        "kind",
        "preferences"
      ]
    },
    "ExportMemory": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "practice_memory"
        },
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "summary": {
          "type": "string",
          "minLength": 0,
          "maxLength": 4096
        },
        "room_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            {
              "type": "null"
            }
          ]
        },
        "skills_practiced": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 0,
            "maxLength": 100
          },
          "minItems": 0,
          "maxItems": 13
        },
        "growth_edges": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 0,
            "maxLength": 100
          },
          "minItems": 0,
          "maxItems": 13
        },
        "next_practice_suggestion": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 0,
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "completed",
            "incomplete"
          ]
        }
      },
      "required": [
        "kind",
        "session_id",
        "summary",
        "room_id",
        "skills_practiced",
        "growth_edges",
        "next_practice_suggestion",
        "status"
      ]
    },
    "ExportAudio": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "audio"
        },
        "audio": {
          "$ref": "#/$defs/AudioSummary"
        }
      },
      "required": [
        "kind",
        "audio"
      ]
    },
    "Export": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.conversation.export.v1"
        },
        "items": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "$ref": "#/$defs/ExportSession"
              },
              {
                "$ref": "#/$defs/ExportTurn"
              },
              {
                "$ref": "#/$defs/ExportPreferences"
              },
              {
                "$ref": "#/$defs/ExportMemory"
              },
              {
                "$ref": "#/$defs/ExportAudio"
              }
            ]
          },
          "minItems": 0,
          "maxItems": 100
        },
        "next_cursor": {
          "$ref": "#/$defs/Cursor"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "schema",
        "items",
        "next_cursor",
        "request_id"
      ]
    },
    "Segment": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "segment_id": {
          "$ref": "#/$defs/Id"
        },
        "speaker_id": {
          "$ref": "#/$defs/Id"
        },
        "display_name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "order": {
          "type": "integer",
          "minimum": 0
        },
        "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 16384
        },
        "language": {
          "type": "string",
          "minLength": 1,
          "maxLength": 16
        }
      },
      "required": [
        "segment_id",
        "speaker_id",
        "display_name",
        "order",
        "text",
        "language"
      ]
    },
    "Coach": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "text": {
          "type": "string",
          "minLength": 0,
          "maxLength": 32768
        },
        "language": {
          "const": "en-US"
        }
      },
      "required": [
        "text",
        "language"
      ]
    },
    "Character": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "speaker_id": {
          "$ref": "#/$defs/Id"
        },
        "persona_id": {
          "$ref": "#/$defs/Id"
        },
        "expression": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "composed",
                "attentive",
                "steadying",
                "warmed",
                "candid",
                "collaborative",
                "relieved",
                "guarded",
                "apprehensive",
                "irritated",
                "defensive",
                "dismissed",
                "hurt",
                "withdrawn",
                "sullen",
                "resigned"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "expression_group": {
          "anyOf": [
            {
              "$ref": "#/$defs/PersonaResponseCode"
            },
            {
              "type": "null"
            }
          ]
        },
        "presence": {
          "type": "string",
          "enum": [
            "present",
            "stepped_away",
            "left"
          ]
        }
      },
      "required": [
        "speaker_id",
        "persona_id",
        "expression",
        "expression_group",
        "presence"
      ]
    },
    "Safety": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "const": "safety_status"
        },
        "schema_version": {
          "const": 1
        },
        "evaluated": {
          "type": "boolean"
        },
        "level": {
          "type": "string",
          "enum": [
            "unknown",
            "clear",
            "watch",
            "warning",
            "critical"
          ]
        },
        "response_action": {
          "type": "string",
          "enum": [
            "none",
            "support",
            "escalate"
          ]
        },
        "source": {
          "type": "string",
          "enum": [
            "governed_turn",
            "backstop"
          ]
        }
      },
      "required": [
        "type",
        "schema_version",
        "evaluated",
        "level",
        "response_action",
        "source"
      ]
    },
    "Turn": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.conversation.turn.v1"
        },
        "turn_id": {
          "$ref": "#/$defs/Id"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        },
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "ordinal": {
          "type": "integer",
          "minimum": 0
        },
        "operation": {
          "type": "string",
          "enum": [
            "opening",
            "turn",
            "closeout"
          ]
        },
        "created_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "learner_text": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 10000
            },
            {
              "type": "null"
            }
          ]
        },
        "cast": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Segment"
          },
          "minItems": 0,
          "maxItems": 32
        },
        "coach": {
          "anyOf": [
            {
              "$ref": "#/$defs/Coach"
            },
            {
              "type": "null"
            }
          ]
        },
        "text": {
          "type": "string",
          "minLength": 0,
          "maxLength": 65536
        },
        "applied_controls": {
          "$ref": "#/$defs/AppliedControls"
        },
        "safety": {
          "$ref": "#/$defs/Safety"
        },
        "structure": {
          "type": "string",
          "enum": [
            "available",
            "unavailable"
          ]
        },
        "state": {
          "type": "string",
          "enum": [
            "active",
            "closed"
          ]
        },
        "characters": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Character"
              },
              "minItems": 0,
              "maxItems": 5
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "schema",
        "turn_id",
        "request_id",
        "session_id",
        "ordinal",
        "operation",
        "created_at",
        "learner_text",
        "cast",
        "coach",
        "text",
        "applied_controls",
        "safety",
        "structure",
        "state",
        "characters"
      ]
    },
    "Meter": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "unit": {
          "type": "string",
          "enum": [
            "text_turn",
            "spoken_turn"
          ]
        },
        "units": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1
        },
        "amount_micro_usd": {
          "type": "integer",
          "minimum": 0
        },
        "currency": {
          "const": "USD"
        },
        "rate_version": {
          "$ref": "#/$defs/Id"
        },
        "settlement": {
          "type": "string",
          "enum": [
            "reserved",
            "settled",
            "released",
            "pending"
          ]
        },
        "charge_id": {
          "anyOf": [
            {
              "$ref": "#/$defs/Id"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "unit",
        "units",
        "amount_micro_usd",
        "currency",
        "rate_version",
        "settlement",
        "charge_id"
      ]
    },
    "Receipt": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "request_id": {
          "$ref": "#/$defs/Id"
        },
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "content_release": {
          "$ref": "#/$defs/Id"
        },
        "text": {
          "anyOf": [
            {
              "$ref": "#/$defs/Meter"
            },
            {
              "type": "null"
            }
          ]
        },
        "audio": {
          "anyOf": [
            {
              "$ref": "#/$defs/Meter"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "request_id",
        "session_id",
        "content_release",
        "text",
        "audio"
      ]
    },
    "Playback": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.conversation.playback.v1"
        },
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "status": {
          "type": "string",
          "enum": [
            "available",
            "unavailable"
          ]
        },
        "unavailable_reason": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "no_committed_turns",
                "record_unavailable"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "turns": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Turn"
          },
          "minItems": 0,
          "maxItems": 100
        },
        "next_cursor": {
          "$ref": "#/$defs/Cursor"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "schema",
        "session_id",
        "status",
        "unavailable_reason",
        "turns",
        "next_cursor",
        "request_id"
      ]
    },
    "EvidenceReference": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "turn_id": {
          "$ref": "#/$defs/Id"
        },
        "segment_id": {
          "anyOf": [
            {
              "$ref": "#/$defs/Id"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "session_id",
        "turn_id",
        "segment_id"
      ]
    },
    "Observation": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        },
        "evidence": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EvidenceReference"
          },
          "minItems": 1,
          "maxItems": 100
        }
      },
      "required": [
        "code",
        "text",
        "evidence"
      ]
    },
    "Debrief": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.conversation.debrief.v1"
        },
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "status": {
          "type": "string",
          "enum": [
            "available",
            "unavailable"
          ]
        },
        "unavailable_reason": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "not_closed",
                "insufficient_evidence",
                "record_unavailable"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "review": {
          "anyOf": [
            {
              "$ref": "#/$defs/ConsumerDebrief"
            },
            {
              "type": "null"
            }
          ]
        },
        "setup_fingerprint": {
          "$ref": "#/$defs/Hash"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "schema",
        "session_id",
        "status",
        "unavailable_reason",
        "review",
        "setup_fingerprint",
        "request_id"
      ]
    },
    "Insights": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.conversation.insights.v1"
        },
        "status": {
          "type": "string",
          "enum": [
            "available",
            "unavailable"
          ]
        },
        "review": {
          "$ref": "#/$defs/ConsumerInsights"
        },
        "next_cursor": {
          "$ref": "#/$defs/Cursor"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "schema",
        "status",
        "review",
        "next_cursor",
        "request_id"
      ]
    },
    "AudioSegment": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "segment_id": {
          "$ref": "#/$defs/Id"
        },
        "speaker_id": {
          "$ref": "#/$defs/Id"
        },
        "order": {
          "type": "integer",
          "minimum": 0
        },
        "href": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "media_type": {
          "const": "audio/mpeg"
        },
        "bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 8388608
        }
      },
      "required": [
        "segment_id",
        "speaker_id",
        "order",
        "href",
        "media_type",
        "bytes"
      ]
    },
    "AudioSummary": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "audio_id": {
          "$ref": "#/$defs/Id"
        },
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "turn_id": {
          "$ref": "#/$defs/Id"
        },
        "generation": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2147483647
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "ready",
            "failed",
            "expired",
            "deleted"
          ]
        },
        "created_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "expires_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "settlement": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "reserved",
                "settled",
                "released"
              ]
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "audio_id",
        "session_id",
        "turn_id",
        "generation",
        "status",
        "created_at",
        "expires_at",
        "settlement"
      ]
    },
    "AudioList": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.conversation.audio_list.v1"
        },
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AudioSummary"
          },
          "minItems": 0,
          "maxItems": 100
        },
        "next_cursor": {
          "$ref": "#/$defs/Cursor"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "schema",
        "session_id",
        "items",
        "next_cursor",
        "request_id"
      ]
    },
    "Audio": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.conversation.audio.v1"
        },
        "audio_id": {
          "$ref": "#/$defs/Id"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        },
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "turn_id": {
          "$ref": "#/$defs/Id"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "ready",
            "failed",
            "expired",
            "deleted"
          ]
        },
        "created_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "expires_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "segments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AudioSegment"
          },
          "minItems": 0,
          "maxItems": 128
        },
        "receipt": {
          "$ref": "#/$defs/Receipt"
        }
      },
      "required": [
        "schema",
        "audio_id",
        "request_id",
        "session_id",
        "turn_id",
        "status",
        "created_at",
        "expires_at",
        "segments",
        "receipt"
      ]
    },
    "Room": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "room_id": {
          "$ref": "#/$defs/Id"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "category_id": {
          "$ref": "#/$defs/Id"
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "modes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "guided",
              "simulation",
              "freeform"
            ]
          },
          "minItems": 1,
          "maxItems": 3
        },
        "min_participants": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5
        },
        "max_participants": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5
        },
        "recommended_personas": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Id"
          },
          "minItems": 0,
          "maxItems": 5
        },
        "coach_lenses": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Id"
          },
          "minItems": 0,
          "maxItems": 32
        },
        "tiers": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "standard",
              "gentle",
              "intensive"
            ]
          },
          "minItems": 1,
          "maxItems": 3
        },
        "default_tier": {
          "type": "string",
          "enum": [
            "standard",
            "gentle",
            "intensive"
          ]
        },
        "topic_consent_required": {
          "type": "boolean"
        }
      },
      "required": [
        "room_id",
        "title",
        "category_id",
        "description",
        "modes",
        "min_participants",
        "max_participants",
        "recommended_personas",
        "coach_lenses",
        "tiers",
        "default_tier",
        "topic_consent_required"
      ]
    },
    "Persona": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "persona_id": {
          "$ref": "#/$defs/Id"
        },
        "display_name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "role": {
          "type": "string",
          "minLength": 1,
          "maxLength": 160
        },
        "role_family": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "persona_id",
        "display_name",
        "role",
        "role_family"
      ]
    },
    "Option": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 160
        }
      },
      "required": [
        "id",
        "label"
      ]
    },
    "Catalog": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.conversation.catalog.v1"
        },
        "content_release": {
          "$ref": "#/$defs/Id"
        },
        "rooms": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Room"
          },
          "minItems": 0,
          "maxItems": 100
        },
        "personas": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Persona"
          },
          "minItems": 0,
          "maxItems": 100
        },
        "categories": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Option"
          },
          "minItems": 0,
          "maxItems": 32
        },
        "coach_lenses": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Option"
          },
          "minItems": 0,
          "maxItems": 32
        },
        "languages": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Option"
          },
          "minItems": 0,
          "maxItems": 32
        },
        "modes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Option"
          },
          "minItems": 0,
          "maxItems": 8
        },
        "next_cursor": {
          "$ref": "#/$defs/Cursor"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "schema",
        "content_release",
        "rooms",
        "personas",
        "categories",
        "coach_lenses",
        "languages",
        "modes",
        "next_cursor",
        "request_id"
      ]
    },
    "Error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "error": {
          "const": true
        },
        "code": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "message": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "error",
        "code",
        "message",
        "request_id"
      ]
    },
    "StreamEvent": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "metadata"
            },
            "request_id": {
              "$ref": "#/$defs/Id"
            },
            "sessionId": {
              "$ref": "#/$defs/Id"
            }
          },
          "required": [
            "type",
            "request_id",
            "sessionId"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "content"
            },
            "part": {
              "type": "string",
              "enum": [
                "conversation",
                "display"
              ]
            },
            "text": {
              "type": "string",
              "minLength": 0,
              "maxLength": 8192
            }
          },
          "required": [
            "type",
            "part",
            "text"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "display_complete"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "$ref": "#/$defs/Safety"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "conversation_turn"
            },
            "turn": {
              "$ref": "#/$defs/Turn"
            }
          },
          "required": [
            "type",
            "turn"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "session_ended"
            },
            "sessionId": {
              "$ref": "#/$defs/Id"
            }
          },
          "required": [
            "type",
            "sessionId"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "done"
            },
            "sessionId": {
              "$ref": "#/$defs/Id"
            },
            "receipt": {
              "$ref": "#/$defs/Receipt"
            }
          },
          "required": [
            "type",
            "sessionId",
            "receipt"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "error"
            },
            "error": {
              "const": true
            },
            "code": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "message": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            },
            "request_id": {
              "$ref": "#/$defs/Id"
            }
          },
          "required": [
            "type",
            "error",
            "code",
            "message",
            "request_id"
          ]
        }
      ]
    }
  }
}
