{
  "type": "object",
  "properties": {
    "queryId": {
      "type": "string",
      "description": "The polled query ID."
    },
    "status": {
      "type": "string",
      "enum": [
        "running",
        "complete",
        "failed"
      ],
      "description": "running \u2192 poll again in 30-60s. complete \u2192 full result below. failed \u2192 see error."
    },
    "error": {
      "type": "string",
      "description": "Failure reason when status is \"failed\"."
    },
    "elapsedMs": {
      "type": [
        "number",
        "null"
      ],
      "description": "Time since the query started, while running."
    },
    "synthesis": {
      "type": "string",
      "description": "Moderator-synthesized consensus answer. Present when status is \"complete\"."
    },
    "consensusScore": {
      "type": [
        "number",
        "null"
      ],
      "description": "Cross-model agreement score, 0-100. Null when the query ran with synthesize=false."
    },
    "agreementType": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "high",
            "divergent"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Agreement classification from the moderator's analysis."
    },
    "keyDisagreement": {
      "type": [
        "string",
        "null"
      ],
      "description": "The main point the models disagreed on, when one was identified."
    },
    "perModelResponses": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Each model's independent response, keyed by anonymous label (M1..Mn)."
    },
    "modelMapping": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Anonymous label (M1..Mn) to model ID mapping."
    },
    "totalTokens": {
      "type": "object",
      "properties": {
        "input": {
          "type": "number"
        },
        "output": {
          "type": "number"
        }
      },
      "required": [
        "input",
        "output"
      ],
      "additionalProperties": false,
      "description": "Aggregate token usage across the whole council."
    },
    "durationMs": {
      "type": [
        "number",
        "null"
      ],
      "description": "Wall-clock duration of the council run, in milliseconds."
    },
    "budgetPercentUsed": {
      "type": [
        "number",
        "null"
      ],
      "description": "Monthly Council budget consumption, as a percentage (0-100+). Never dollars."
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "modelId": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "modelId",
          "message"
        ],
        "additionalProperties": false
      },
      "description": "Per-model failures, if any. The synthesis covers the models that responded."
    },
    "droppedModelIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Requested model IDs that were skipped (unknown or retired)."
    },
    "synthesisError": {
      "type": [
        "string",
        "null"
      ],
      "description": "Set when moderator synthesis failed and the response degraded to raw per-model output."
    }
  },
  "required": [
    "queryId",
    "status"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}