{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coldstate-ai/json-schema/coldstate-ai-index-search-response-schema.json",
  "title": "IndexSearchResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coldstate-ai-openapi.yml#/components/schemas/IndexSearchResponse",
  "type": "object",
  "properties": {
    "index_id": {
      "type": "string"
    },
    "collection": {
      "type": "string"
    },
    "query": {
      "type": "string"
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "ref_id": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          },
          "score": {
            "$ref": "#/$defs/Score"
          },
          "state": {
            "$ref": "#/$defs/State"
          }
        }
      }
    },
    "diagnostics": {
      "type": "object"
    },
    "pagination": {
      "$ref": "#/$defs/Pagination"
    }
  },
  "$defs": {
    "Pagination": {
      "type": "object",
      "properties": {
        "offset": {
          "type": "integer"
        },
        "limit": {
          "type": "integer"
        },
        "total": {
          "type": "integer"
        },
        "has_more": {
          "type": "boolean"
        }
      }
    },
    "Score": {
      "type": "object",
      "properties": {
        "Ψ": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      },
      "required": [
        "Ψ"
      ]
    },
    "State": {
      "type": "string",
      "enum": [
        "CRYSTALLINE",
        "FLUID",
        "REACTIVE",
        "DECOHERENT"
      ],
      "description": "Result confidence state derived from the Ψ score"
    }
  }
}