{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mensageiro-ai/json-schema/mensageiro-ai-status-feed-schema.json",
  "title": "StatusFeed",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mensageiro-ai-openapi.json#/components/schemas/StatusFeed",
  "type": "object",
  "required": [
    "generated_at",
    "services",
    "incidents",
    "failover_rehearsals"
  ],
  "properties": {
    "generated_at": {
      "type": "string",
      "format": "date-time"
    },
    "incidents": {
      "type": "array",
      "description": "The last 90 days of incidents and any still open, newest first. Opened by the hourly check when a service turns degraded or down, resolved when it is operational again.",
      "items": {
        "type": "object",
        "required": [
          "id",
          "service",
          "severity",
          "started_at",
          "resolved_at",
          "title",
          "detail",
          "post_mortem"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "service": {
            "type": "string",
            "enum": [
              "api",
              "claude",
              "gpt",
              "gemini"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "degraded",
              "down"
            ],
            "description": "The worst the incident reached."
          },
          "started_at": {
            "type": "integer",
            "description": "Unix milliseconds."
          },
          "resolved_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Unix milliseconds; null while open."
          },
          "title": {
            "type": "string"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "`status 503`, `no answer`, `elevated errors` or `requests failed`."
          },
          "post_mortem": {
            "type": [
              "string",
              "null"
            ],
            "description": "Staff text, added after the fact."
          }
        }
      }
    },
    "services": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "last_check_at",
          "latency_ms",
          "days",
          "last_incident"
        ],
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "api",
              "claude",
              "gpt",
              "gemini"
            ]
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "operational",
              "degraded",
              "down",
              "unknown"
            ],
            "description": "down: the latest check failed. degraded: a check failed in the last 24 hours. unknown: no check in 30 days."
          },
          "last_check_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Unix milliseconds."
          },
          "latency_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "days": {
            "type": "array",
            "description": "30 entries, oldest first, every day present.",
            "items": {
              "type": "object",
              "required": [
                "date",
                "checks",
                "failures"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "checks": {
                  "type": "integer"
                },
                "failures": {
                  "type": "integer"
                }
              }
            }
          },
          "last_incident": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "at",
                  "detail"
                ],
                "properties": {
                  "at": {
                    "type": "integer",
                    "description": "Unix milliseconds."
                  },
                  "detail": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "`status 503` or `no answer`."
                  }
                }
              }
            ]
          }
        }
      }
    },
    "failover_rehearsals": {
      "type": "array",
      "description": "The latest daily real request on each wire format's fallback route.",
      "items": {
        "type": "object",
        "required": [
          "wire_format",
          "ts",
          "ok",
          "latency_ms"
        ],
        "properties": {
          "wire_format": {
            "type": "string",
            "enum": [
              "openai",
              "anthropic",
              "gemini"
            ]
          },
          "ts": {
            "type": "integer",
            "description": "Unix milliseconds."
          },
          "ok": {
            "type": "boolean"
          },
          "latency_ms": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      }
    }
  }
}