{
  "type": "object",
  "properties": {
    "queryId": {
      "type": "string",
      "description": "Present on async queries \u2014 pass it to council_result."
    },
    "status": {
      "type": "string",
      "enum": [
        "running",
        "complete",
        "failed"
      ],
      "description": "Only present on async queries: \"running\" means poll council_result with the queryId."
    },
    "synthesis": {
      "type": "string",
      "description": "Moderator-synthesized consensus answer, grounded in the retrieved library chunks. Absent while an async query is still running."
    },
    "consensusScore": {
      "type": [
        "number",
        "null"
      ],
      "description": "Cross-model agreement score on the 0-100 scale. Null when synthesize=false; absent while an async query is still running."
    },
    "perModelResponses": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Each model's independent response, keyed by model name. Absent while an async query is still running."
    },
    "retrievedChunks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "chunkId": {
            "type": "string",
            "description": "ID of the retrieved chunk."
          },
          "documentId": {
            "type": "string",
            "description": "ID of the parent document."
          },
          "filename": {
            "type": "string",
            "description": "Source document filename."
          },
          "content": {
            "type": "string",
            "description": "The retrieved passage text."
          },
          "pageNumber": {
            "type": [
              "number",
              "null"
            ],
            "description": "Page number in the source document, when known."
          },
          "distance": {
            "type": "number",
            "description": "Vector distance \u2014 lower is more relevant."
          }
        },
        "additionalProperties": false
      },
      "description": "Library chunks that were injected into every model's prompt. Empty when the library had no relevant content."
    },
    "ragSkipped": {
      "type": "boolean",
      "description": "True when retrieval found nothing and the query fell through to a plain council_query."
    }
  },
  "required": [
    "retrievedChunks"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}