{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/livetennisapi-com/json-schema/livetennisapi-com-analysis-schema.json",
  "title": "Analysis",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/livetennisapi-com-matches-api-openapi.yml#/components/schemas/Analysis",
  "type": "object",
  "properties": {
    "thesis": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "pick_side": {
          "type": "integer",
          "enum": [
            1,
            2
          ]
        },
        "confidence": {
          "type": [
            "number",
            "null"
          ]
        },
        "win_probability_pick": {
          "type": [
            "number",
            "null"
          ]
        },
        "state": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "valid",
            "confirmed",
            "weakened",
            "broken",
            null
          ]
        },
        "reasoning": {
          "type": [
            "string",
            "null"
          ]
        },
        "notes": {
          "type": "object",
          "properties": {
            "matchup": {
              "type": [
                "string",
                "null"
              ]
            },
            "environment": {
              "type": [
                "string",
                "null"
              ]
            },
            "fatigue": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "scenario_playbook": {
          "type": [
            "array",
            "null"
          ]
        },
        "created_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "profile": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "win_probability_p1": {
          "type": [
            "number",
            "null"
          ]
        },
        "expected_closeness": {
          "type": [
            "number",
            "null"
          ]
        },
        "volatility_rating": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "low",
            "med",
            "high",
            null
          ]
        },
        "stage": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "pregame",
            "live",
            null
          ],
          "description": "Did this forecast already see the match? null = UNKNOWN, never pregame."
        },
        "model_version": {
          "type": [
            "string",
            "null"
          ],
          "description": "The prompt-scaffold version this forecast was produced under, so a forecast can be evaluated against the framing that produced it and a scaffold change reads as a regime break rather than unexplained drift. Null on profiles written before the stamp existed."
        },
        "input_state": {
          "type": [
            "object",
            "null"
          ],
          "description": "For an in-play forecast (stage=live), the score it was actually looking at, so it can be evaluated against the position rather than only excluded. Null on a pregame profile (it saw no score) and null wherever the state could not be established. NOT reconstructed from the score at created_at — that timestamp is written after the model finishes, so it lands later than what the model saw.",
          "properties": {
            "capture": {
              "type": "string",
              "enum": [
                "writer",
                "recovered"
              ],
              "description": "writer = stamped as the forecast was produced, from the score row itself (carries live_score_id and stats). recovered = reconstructed from the stored prompt text of that same forecast; the score is exact but there is no live_score_id and no stats."
            },
            "live_score_id": {
              "type": [
                "integer",
                "null"
              ]
            },
            "total_games": {
              "type": [
                "integer",
                "null"
              ]
            },
            "score": {
              "type": [
                "object",
                "null"
              ],
              "description": "server is the serving SIDE (1 or 2); on doubles that is the team, not the individual.",
              "properties": {
                "sets": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "integer"
                  }
                },
                "games": {
                  "type": [
                    "array",
                    "null"
                  ]
                },
                "points": {
                  "type": [
                    "array",
                    "null"
                  ]
                },
                "server": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "is_tiebreak": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "timestamp": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              }
            },
            "stats": {
              "type": [
                "object",
                "null"
              ]
            }
          }
        },
        "key_factors": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "created_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}