{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/antfly/json-schema/antfly-table-schema.json",
  "title": "Table",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/antfly-table-management-api-openapi.yml#/components/schemas/Table",
  "type": "object",
  "required": [
    "name",
    "shards",
    "indexes"
  ],
  "properties": {
    "storage": {
      "$ref": "#/$defs/TableStorageSettings"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string",
      "maxLength": 500,
      "description": "Optional description of the table."
    },
    "indexes": {
      "type": "object",
      "additionalProperties": {
        "x-go-type-skip-optional-pointer": false,
        "$ref": "#/$defs/CreatedIndex"
      }
    },
    "shards": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/ShardConfig"
      }
    },
    "schema": {
      "$ref": "#/$defs/TableSchema"
    },
    "migration": {
      "description": "Present only when the table is migrating between schema versions. Absent means the table is stable.",
      "$ref": "#/$defs/TableMigration"
    },
    "replication_sources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReplicationSource"
      },
      "description": "PostgreSQL CDC replication sources configured for this table.\n"
    },
    "field_capabilities": {
      "type": "array",
      "description": "Effective logical-field capabilities for this table. Queries use each\nentry's field; concrete types, analyzers and index-relative query modes\nare nested under representations. Declared sortable fields validate\ncoverage on first use. Computed _score ordering requires a score-bearing query.\n",
      "items": {
        "$ref": "#/$defs/FieldCapability"
      }
    }
  },
  "$defs": {
    "AlgebraicAggregateConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "op"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "op": {
          "type": "string",
          "enum": [
            "count",
            "sum",
            "avg",
            "min",
            "max"
          ]
        },
        "group_by": {
          "type": "array",
          "maxItems": 32,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "measure": {
          "type": "string",
          "minLength": 1,
          "description": "Required except for count. Omitted count means COUNT(*); a supplied column means COUNT(column), excluding SQL NULL values."
        }
      }
    },
    "AlgebraicIndexConfig": {
      "type": "object",
      "description": "Schema-derived algebraic index capabilities with optional declarative aggregate recipes. Physical materialization state remains engine-owned.",
      "properties": {
        "derive_from_schema": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "When true, derive typed fields and capabilities from the table schema. Physical fields, laws, joins and state remain engine-owned."
        },
        "aggregates": {
          "type": "array",
          "maxItems": 64,
          "description": "Desired exact aggregate recipes over schema column names. Eligible SQL automatically reuses complete, snapshot-bound materializations; unsupported SQL shapes retain scanning.",
          "items": {
            "$ref": "#/$defs/AlgebraicAggregateConfig"
          }
        }
      }
    },
    "AntflyChunkerConfig": {
      "description": "Configuration for the Antfly inference chunking provider.\n\nAntfly inference is Antfly's built-in ML service for local chunking.\n\n**Chunking Models:**\n- fixed: Fixed-size chunking by token count, with fixed time windows for audio\n  (aliases `fixed_bert`, `fixed_bpe`, and `fixed-bert-tokenizer`). This is the\n  only chunking model Antfly inference implements; other model names are\n  rejected as unsupported.\n\n**Deduplication:**\n- Within a single document write, chunk results are deduplicated when multiple\n  indexes share the same source text and chunker configuration, so the source\n  is chunked at most once per write.\n",
      "allOf": [
        {
          "$ref": "#/$defs/ChunkOptions"
        },
        {
          "type": "object",
          "properties": {
            "api_url": {
              "type": "string",
              "format": "uri",
              "description": "The URL of the Inference API endpoint (e.g., 'http://localhost:8080'). Can also be set via ANTFLY_INFERENCE_URL environment variable."
            },
            "model": {
              "type": "string",
              "description": "The chunking model to use. Defaults to 'fixed' for simple token-based chunking; other values select a model from models/chunkers/{name}/. Successful create responses include the effective model.",
              "default": "fixed"
            }
          }
        }
      ]
    },
    "AntflyGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Antfly inference generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "antfly"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the generator model."
        },
        "api_url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Inference API endpoint. Can also be set via ANTFLY_INFERENCE_URL environment variable."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        },
        "timeout": {
          "type": "integer",
          "description": "HTTP response timeout in seconds for Inference API calls.",
          "minimum": 1
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "AntflyType": {
      "type": "string",
      "enum": [
        "search_as_you_type",
        "substring",
        "keyword",
        "text",
        "html",
        "numeric",
        "datetime",
        "boolean",
        "link",
        "geopoint",
        "geoshape",
        "embedding",
        "blob"
      ]
    },
    "AnthropicGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Anthropic generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "anthropic"
          ]
        },
        "workspace_id": {
          "type": "string",
          "description": "Anthropic workspace for keys not scoped to a workspace. Defaults to ANTHROPIC_WORKSPACE_ID."
        },
        "model": {
          "type": "string",
          "description": "The full model ID of the Anthropic model to use.",
          "default": "claude-sonnet-4-5-20250929"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "Anthropic API key or secret reference. Defaults to ANTHROPIC_API_KEY."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Messages API base URL. Defaults to https://api.anthropic.com/v1."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate in the response."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "AppleGeneratorConfig": {
      "type": "object",
      "description": "On-device Apple Foundation Models generation. Requires a macOS Apple provider build, Apple Intelligence enabled, and its system model ready. Supports text conversations; tool calling and media attachments are not supported.",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "apple"
          ]
        },
        "max_tokens": {
          "type": "integer",
          "minimum": 1,
          "default": 256
        },
        "temperature": {
          "type": "number",
          "minimum": 0,
          "maximum": 2
        }
      }
    },
    "ArtifactIndexSource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact"
      ],
      "description": "Named generated artifact stream consumed by an index. Producer inputs belong on the matching enrichment.",
      "properties": {
        "artifact": {
          "type": "string",
          "minLength": 1,
          "description": "Stable name of a generated artifact stream."
        }
      }
    },
    "AudioChunkOptions": {
      "type": "object",
      "description": "Options specific to audio chunking.",
      "properties": {
        "window_duration_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 86400000,
          "description": "Window duration in milliseconds for fixed-window audio chunking (default: 30000)."
        },
        "overlap_duration_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 86400000,
          "description": "Overlap duration in milliseconds between audio chunks (default: 0)."
        }
      }
    },
    "AutocompleteQuery": {
      "type": "object",
      "additionalProperties": false,
      "description": "Analyzed bool-prefix search on a logical field. The planner selects\ndeclared search-as-you-type root, shingle and prefix representations.\nRequires a compatible representation; never silently becomes raw prefix search.\n",
      "required": [
        "autocomplete",
        "field"
      ],
      "properties": {
        "autocomplete": {
          "type": "string"
        },
        "field": {
          "type": "string",
          "minLength": 1
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "BedrockGeneratorConfig": {
      "type": "object",
      "description": "AWS Bedrock Converse generation, including image inputs and tools for\nmodels that support them. Uses the AWS default credential chain unless\nan explicit Bedrock API key is configured. Image capability is declared\nper target through inference_capabilities; model IDs are not allowlisted.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "bedrock"
          ]
        },
        "url": {
          "type": "string",
          "description": "Optional Bedrock Runtime endpoint override. Defaults to the regional AWS endpoint."
        },
        "api_key": {
          "type": "string",
          "description": "Optional Bedrock bearer API key or secret reference. Omit to use signed AWS requests and the default credential chain."
        },
        "model": {
          "type": "string",
          "description": "The Bedrock model ID to use."
        },
        "region": {
          "type": "string",
          "description": "AWS region. Defaults to AWS_REGION, then AWS_DEFAULT_REGION, then us-east-1."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "BoolFieldQuery": {
      "type": "object",
      "properties": {
        "bool": {
          "type": "boolean"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "bool"
      ]
    },
    "BoolQuery": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "bool"
      ],
      "description": "Canonical Boolean wrapper. Must clauses score; filter clauses constrain without scoring.",
      "properties": {
        "bool": {
          "$ref": "#/$defs/BoolQueryBody"
        }
      }
    },
    "BoolQueryBody": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "must": {
          "$ref": "#/$defs/BoolQueryClause"
        },
        "should": {
          "$ref": "#/$defs/BoolQueryClause"
        },
        "must_not": {
          "$ref": "#/$defs/BoolQueryClause"
        },
        "filter": {
          "$ref": "#/$defs/BoolQueryClause"
        },
        "minimum_should_match": {
          "type": "integer",
          "format": "uint32",
          "minimum": 0,
          "description": "Minimum optional clauses required; omission follows the runtime's required-clause defaults."
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "BoolQueryClause": {
      "oneOf": [
        {
          "$ref": "#/$defs/Query"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Query"
          }
        }
      ]
    },
    "BooleanQuery": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "must": {
          "$ref": "#/$defs/ConjunctionQuery"
        },
        "should": {
          "$ref": "#/$defs/DisjunctionQuery"
        },
        "must_not": {
          "$ref": "#/$defs/DisjunctionQuery"
        },
        "filter": {
          "$ref": "#/$defs/Query"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "Boost": {
      "type": [
        "number",
        "null"
      ],
      "format": "double",
      "description": "A floating-point number used to decrease or increase the relevance scores of a query.",
      "default": 1.0
    },
    "ByteRange": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "byte"
      },
      "minItems": 2,
      "maxItems": 2
    },
    "ChatGPTGeneratorConfig": {
      "type": "object",
      "description": "Personal ChatGPT plan for interactive generation. Credentials stay in the local runtime.",
      "required": [
        "provider",
        "model",
        "connection_id"
      ],
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "chatgpt"
          ]
        },
        "reasoning_effort": {
          "$ref": "#/$defs/OpenAIReasoningEffort"
        },
        "model": {
          "type": "string"
        },
        "connection_id": {
          "type": "string",
          "description": "Opaque personal registration owned by the authenticated caller."
        }
      }
    },
    "ChoiceDecisionQuestion": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "name",
        "instructions",
        "choices"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "choice"
          ]
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "instructions": {
          "type": "string",
          "minLength": 1
        },
        "choices": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DecisionChoice"
          },
          "minItems": 2,
          "maxItems": 64
        },
        "embedding_options": {
          "$ref": "#/$defs/EmbeddingDecisionAcceptance"
        }
      }
    },
    "ChunkDiarizationConfig": {
      "type": "object",
      "description": "Source-wide online speaker clustering on a fixed 1.5 s grid with 3 s embedding windows. Identities are stable within a source and recipe. Silence and ambiguous voices remain unassigned. Analysis advances incrementally; admitted cached timelines and durable centroid/sample-position checkpoints are shared across matching outputs and continuations. Missing checkpoints reconstruct the required prefix deterministically.",
      "properties": {
        "model": {
          "type": "string",
          "description": "Speaker ONNX registry reference; defaults to 3D-Speaker CAM++. For kind=diarize the target model selects the speaker model."
        },
        "model_identity": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Optional SHA-256 pin of the speaker ONNX file, including when paired with a transcription model."
        },
        "similarity_threshold": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "default": 0.45
        },
        "ambiguity_margin": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "default": 0.03
        },
        "min_rms": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "default": 0.01
        },
        "max_speakers": {
          "type": "integer",
          "minimum": 1,
          "maximum": 64,
          "default": 64
        }
      }
    },
    "ChunkEmbeddingTarget": {
      "type": "object",
      "required": [
        "model"
      ],
      "properties": {
        "model": {
          "type": "string",
          "minLength": 1
        },
        "model_identity": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[0-9a-f]{64}$",
          "description": "Optional required embedding-weight/recipe identity; a changed model is rejected before delivery."
        },
        "task_type": {
          "type": "string",
          "default": "RETRIEVAL_DOCUMENT"
        },
        "dimensions": {
          "type": "integer",
          "minimum": 1
        },
        "execute": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "default": true,
          "description": "False resolves model limits and plans descriptors without running embedding inference."
        },
        "allow_partial": {
          "type": "boolean",
          "default": false,
          "description": "Return explicit per-chunk failures and gaps instead of aborting on the first non-retryable embedding failure."
        }
      }
    },
    "ChunkOptions": {
      "type": "object",
      "description": "Per-request configuration for chunking. All fields are optional - zero/omitted values use chunker defaults.",
      "properties": {
        "max_chunks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4096,
          "description": "Maximum chunks in one response; zero requests the full result. Model-aware responses return continuation coverage when a page is full: follow next_continuation until source_complete. Embedded model-aware enrichment uses this as its page size and continues through the entire source. Fixed chunking without model-aware outputs retains its per-call truncation behavior."
        },
        "threshold": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence threshold for model-based chunking (0.0-1.0)."
        },
        "text": {
          "$ref": "#/$defs/TextChunkOptions"
        },
        "audio": {
          "$ref": "#/$defs/AudioChunkOptions"
        },
        "embedding": {
          "$ref": "#/$defs/ChunkEmbeddingTarget"
        },
        "outputs": {
          "$ref": "#/$defs/ChunkOutputs"
        },
        "policy": {
          "$ref": "#/$defs/MediaChunkPolicy"
        }
      }
    },
    "ChunkOutputTarget": {
      "type": "object",
      "required": [
        "name",
        "kind",
        "model"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "kind": {
          "type": "string",
          "enum": [
            "embedding",
            "transcribe",
            "classify",
            "diarize"
          ]
        },
        "model": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "execute": {
          "type": "boolean",
          "default": true,
          "description": "False retains this model as a planning boundary while skipping its inference; used for independent output repairs."
        },
        "skip_windows": {
          "type": "array",
          "maxItems": 4096,
          "description": "Execution-only repair mask for already accepted sub-windows; does not affect the model recipe or boundary plan. Skipped windows return receipts with status skipped.",
          "items": {
            "type": "object",
            "required": [
              "ordinal",
              "sub_index"
            ],
            "properties": {
              "ordinal": {
                "type": "integer",
                "format": "uint64",
                "minimum": 0
              },
              "sub_index": {
                "type": "integer",
                "format": "uint32",
                "minimum": 0
              }
            }
          }
        },
        "required": {
          "type": "boolean",
          "default": true
        },
        "model_identity": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "task_type": {
          "type": "string",
          "default": "RETRIEVAL_DOCUMENT"
        },
        "dimensions": {
          "type": "integer",
          "minimum": 1
        },
        "language": {
          "type": "string"
        },
        "diarize": {
          "type": "boolean",
          "default": false,
          "description": "Convenience option on transcription outputs; enables source-wide diarization with the default speaker model."
        },
        "diarization": {
          "description": "Speaker settings for diarize or transcribe outputs; also accepted on the selected audio embedding boundary with audio_speaker_turns=true.",
          "$ref": "#/$defs/ChunkDiarizationConfig"
        },
        "top_k": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128,
          "default": 5
        }
      }
    },
    "ChunkOutputs": {
      "type": "object",
      "required": [
        "boundary_model",
        "targets"
      ],
      "description": "Named independent media outputs. The named boundary model alone determines the shared plan; adding or changing another output preserves parent IDs. The compatibility embedding target is named embedding. Smaller output windows are identified by the parent ordinal and sub_index.",
      "properties": {
        "boundary_model": {
          "type": "string",
          "minLength": 1
        },
        "targets": {
          "type": "array",
          "minItems": 1,
          "maxItems": 16,
          "items": {
            "$ref": "#/$defs/ChunkOutputTarget"
          }
        }
      }
    },
    "ChunkerConfig": {
      "description": "A unified configuration for a chunking provider.",
      "allOf": [
        {
          "$ref": "#/$defs/AntflyChunkerConfig"
        },
        {
          "type": "object",
          "properties": {
            "provider": {
              "$ref": "#/$defs/ChunkerProvider"
            },
            "store_chunks": {
              "x-go-type-skip-optional-pointer": true,
              "type": "boolean",
              "description": "Controls whether chunk data is persisted to storage. When false (default), fixed chunks are generated in memory and only embeddings are stored. Model-aware streams always retain descriptor recipes; false omits their payloads. When true, chunk payloads are also stored. Vectors remain in the embedding artifact family.",
              "default": false
            },
            "full_text_index": {
              "x-go-type-skip-optional-pointer": true,
              "type": "object",
              "description": "Configuration for full-text indexing of chunks.\nWhen present (even if empty), chunk artifacts are persisted and indexed in Antfly's native full-text index, queryable and projectable via the document's `_chunks` field.\nWhen absent, chunks are generated only to drive vector embeddings and are not indexed for full-text search (unless `store_chunks` is also set).\n",
              "additionalProperties": true
            },
            "api_url": {
              "type": "string",
              "format": "uri",
              "description": "The URL of the Inference API endpoint. Can also be set via ANTFLY_INFERENCE_URL."
            },
            "model": {
              "type": "string",
              "description": "The chunking model to use. Defaults to 'fixed' for simple token-based chunking; other values select a model from models/chunkers/{name}/. Successful create responses include the effective model.",
              "default": "fixed"
            },
            "max_chunks": {
              "type": "integer",
              "minimum": 0,
              "maximum": 4096,
              "description": "Maximum chunks per invocation. Model-aware enrichment treats this as a page size and resumes until source completion; zero selects the worker page size. Fixed chunking retains its per-document cap, with zero meaning unlimited."
            },
            "threshold": {
              "type": "number",
              "format": "float",
              "minimum": 0,
              "maximum": 1
            },
            "text": {
              "$ref": "#/$defs/TextChunkOptions"
            },
            "audio": {
              "$ref": "#/$defs/AudioChunkOptions"
            },
            "embedding": {
              "$ref": "#/$defs/ChunkEmbeddingTarget"
            },
            "outputs": {
              "$ref": "#/$defs/ChunkOutputs"
            },
            "policy": {
              "$ref": "#/$defs/MediaChunkPolicy"
            }
          },
          "required": [
            "provider"
          ]
        }
      ]
    },
    "ChunkerProvider": {
      "type": "string",
      "enum": [
        "mock",
        "antfly"
      ],
      "description": "The chunking provider to use."
    },
    "CloudflareGeneratorConfig": {
      "type": "object",
      "description": "Cloudflare Workers AI generation. Uses CLOUDFLARE_API_TOKEN or an Antfly secret reference.",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "cloudflare"
          ]
        },
        "account_id": {
          "type": "string",
          "minLength": 1
        },
        "gateway_id": {
          "type": "string",
          "minLength": 1,
          "description": "Optional AI Gateway ID, sent through cf-aig-gateway-id."
        },
        "model": {
          "type": "string",
          "default": "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true
        },
        "url": {
          "type": "string",
          "description": "Optional deployment-owned endpoint override."
        },
        "max_tokens": {
          "type": "integer",
          "minimum": 1
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 2
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1
        },
        "frequency_penalty": {
          "type": "number",
          "format": "float",
          "minimum": -2,
          "maximum": 2
        },
        "presence_penalty": {
          "type": "number",
          "format": "float",
          "minimum": -2,
          "maximum": 2
        }
      },
      "required": [
        "provider",
        "account_id",
        "model"
      ]
    },
    "ConjunctionQuery": {
      "type": "object",
      "properties": {
        "conjuncts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Query"
          }
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "conjuncts"
      ]
    },
    "ConstrainedGenerationBatch": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "max_items_per_call": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "default": 8
        },
        "max_input_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4194304,
          "default": 65536
        }
      }
    },
    "ConstrainedOutput": {
      "type": "string",
      "enum": [
        "auto",
        "tool_call",
        "json_schema",
        "grammar"
      ],
      "default": "auto",
      "description": "Provider and model admission selects a supported constrained mechanism. Auto prefers forced tools, then provider JSON schema, then native grammar. Free-text parsing is not a mode."
    },
    "ConstrainedProbabilities": {
      "type": "string",
      "enum": [
        "token_logprobs",
        "verdict_only"
      ],
      "default": "token_logprobs",
      "description": "Token probabilities require complete decoder evidence for the allowed values. Verdict-only is explicit opt-in; model-reported confidence is never used."
    },
    "ContainsQuery": {
      "type": "object",
      "additionalProperties": false,
      "description": "Contiguous substring search on the original logical field value, including whitespace and punctuation.\nNo normalization is applied. Case-sensitive by default; case_sensitive=false\nuses Unicode simple case folding, not locale-specific or multi-character folding.\nMissing, null, and non-string values do not match. Arrays use any-element\nsemantics; a match never spans array elements. Indexes select conservative\ncandidates and original values are verified before counting and pagination.\n",
      "required": [
        "contains",
        "field"
      ],
      "properties": {
        "contains": {
          "type": "string"
        },
        "field": {
          "type": "string",
          "minLength": 1,
          "description": "Logical source field path, not a companion index name."
        },
        "case_sensitive": {
          "type": "boolean",
          "default": true,
          "x-go-type-skip-optional-pointer": false
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "CreatedAlgebraicIndex": {
      "description": "Normalized effective schema-derived algebraic index configuration returned after creation.",
      "allOf": [
        {
          "$ref": "#/$defs/CreatedIndexCommon"
        },
        {
          "$ref": "#/$defs/AlgebraicIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "algebraic"
              ]
            }
          }
        }
      ]
    },
    "CreatedEmbeddingsIndex": {
      "description": "Normalized effective dense or sparse embeddings index configuration returned after creation.",
      "allOf": [
        {
          "$ref": "#/$defs/CreatedIndexCommon"
        },
        {
          "$ref": "#/$defs/CreatedEmbeddingsIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "embeddings"
              ]
            }
          }
        }
      ]
    },
    "CreatedEmbeddingsIndexConfig": {
      "type": "object",
      "description": "Credential-free normalized embeddings configuration returned after creation. Single-source v0.2 fields are preserved alongside canonical sources for read compatibility.",
      "properties": {
        "publication_policy": {
          "$ref": "#/$defs/IndexPublicationPolicy"
        },
        "coverage_policy": {
          "$ref": "#/$defs/DerivedCoveragePolicy"
        },
        "external": {
          "type": "boolean",
          "default": false
        },
        "sparse": {
          "type": "boolean",
          "default": false
        },
        "dimension": {
          "type": "integer",
          "minimum": 1
        },
        "field": {
          "type": "string"
        },
        "sources": {
          "type": "array",
          "minItems": 1,
          "maxItems": 64,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/ArtifactIndexSource"
          },
          "description": "Embedding artifact streams indexed together as independent vector members."
        },
        "embedding_name": {
          "type": "string",
          "readOnly": true,
          "description": "Released v0.2 single-source read field, preserved when that request form created the index. Canonical source identity is also returned through sources."
        },
        "source_artifact_name": {
          "type": "string",
          "readOnly": true,
          "deprecated": true,
          "x-deprecated-reason": "Use the matching embedding enrichment's source_artifact_name; it is authoritative.",
          "description": "Deprecated v0.2 descriptive source read field, preserved when supplied with embedding_name. The matching enrichment is authoritative."
        },
        "template": {
          "type": "string"
        },
        "distance_metric": {
          "$ref": "#/$defs/DistanceMetric"
        },
        "mem_only": {
          "type": "boolean"
        },
        "embedder": {
          "$ref": "#/$defs/CreatedProviderConfig"
        },
        "chunker": {
          "$ref": "#/$defs/ChunkerConfig"
        },
        "top_k": {
          "type": "integer",
          "minimum": 1,
          "default": 10
        },
        "min_weight": {
          "type": "number",
          "format": "float",
          "default": 0.0
        },
        "chunk_size": {
          "type": "integer",
          "minimum": 64,
          "default": 1024
        },
        "execution": {
          "$ref": "#/$defs/IndexExecutionConfig"
        }
      }
    },
    "CreatedEnrichmentConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "kind"
      ],
      "description": "Credential-free normalized enrichment configuration returned after index creation.",
      "properties": {
        "name": {
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/EnrichmentKind"
        },
        "source": {
          "$ref": "#/$defs/GroupedArtifactSource"
        },
        "prior_context": {
          "$ref": "#/$defs/PriorArtifactContext"
        },
        "field": {
          "type": "string"
        },
        "template": {
          "type": "string"
        },
        "source_artifact_name": {
          "type": "string"
        },
        "expected_dims": {
          "type": "integer",
          "minimum": 0
        },
        "vector_space": {
          "type": "string",
          "minLength": 1,
          "description": "Optional stable model/token-space identifier asserted for this embedding artifact."
        },
        "chunk_size": {
          "type": "integer",
          "minimum": 0
        },
        "chunk_overlap": {
          "type": "integer",
          "minimum": 0
        },
        "chunker": {
          "$ref": "#/$defs/ChunkerConfig"
        },
        "chunker_json": {
          "type": "string",
          "deprecated": true,
          "x-deprecated-reason": "Use the typed chunker field."
        },
        "full_text_index": {
          "type": "boolean",
          "default": false
        },
        "content_type": {
          "type": "string"
        },
        "neighbor_context": {
          "$ref": "#/$defs/EnrichmentNeighborContextConfig"
        },
        "execution": {
          "$ref": "#/$defs/ExecutionPolicy"
        }
      }
    },
    "CreatedFullTextIndex": {
      "description": "Normalized effective full-text index configuration returned after creation.",
      "allOf": [
        {
          "$ref": "#/$defs/CreatedIndexCommon"
        },
        {
          "$ref": "#/$defs/CreatedFullTextIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "full_text"
              ]
            }
          }
        }
      ]
    },
    "CreatedFullTextIndexConfig": {
      "type": "object",
      "description": "Canonical full-text configuration returned after creation. Single-source alternative request forms are represented through sources.",
      "properties": {
        "sources": {
          "type": "array",
          "minItems": 1,
          "maxItems": 64,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/FullTextArtifactIndexSource"
          }
        },
        "mem_only": {
          "type": "boolean"
        },
        "field": {
          "type": "string"
        },
        "store_source": {
          "type": "boolean"
        },
        "analysis_config": {
          "$ref": "#/$defs/TextAnalysisConfig"
        }
      }
    },
    "CreatedGraphArtifactProducerConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "kind",
        "source"
      ],
      "description": "Credential-free graph artifact producer configuration returned after creation.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "type": "string",
          "enum": [
            "asset"
          ]
        },
        "source": {
          "$ref": "#/$defs/GraphArtifactProducerSourceConfig"
        },
        "content_type": {
          "type": "string"
        },
        "execution": {
          "$ref": "#/$defs/ExecutionPolicy"
        }
      }
    },
    "CreatedGraphArtifactSourceConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact"
      ],
      "description": "Canonical artifact stream materialized into graph edges.",
      "properties": {
        "artifact": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string"
        },
        "format": {
          "type": "string",
          "enum": [
            "extraction_relation",
            "extraction_graph"
          ],
          "default": "extraction_relation"
        },
        "mention_edge_type": {
          "type": "string"
        },
        "nodes": {
          "$ref": "#/$defs/GraphArtifactNodeMappingConfig"
        },
        "edge": {
          "$ref": "#/$defs/GraphArtifactEdgeMappingConfig"
        },
        "context": {
          "$ref": "#/$defs/GraphArtifactContextConfig"
        }
      }
    },
    "CreatedGraphIndex": {
      "description": "Normalized effective graph index configuration returned after creation.",
      "allOf": [
        {
          "$ref": "#/$defs/CreatedIndexCommon"
        },
        {
          "$ref": "#/$defs/CreatedGraphIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "graph"
              ]
            }
          }
        }
      ]
    },
    "CreatedGraphIndexConfig": {
      "type": "object",
      "description": "Credential-free normalized graph configuration returned after creation.",
      "properties": {
        "metrics": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/GraphMetricConfig"
          }
        },
        "summarizer": {
          "$ref": "#/$defs/CreatedProviderConfig"
        },
        "template": {
          "type": "string"
        },
        "edge_types": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EdgeTypeConfig"
          }
        },
        "max_edges_per_document": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000,
          "description": "Maximum number of distinct visible edges materialized per document after source precedence and identity deduplication. Zero uses the server safety limit (currently 1,000,000). Independent aggregate reconciliation budgets bound work across overlapping source manifests."
        },
        "sources": {
          "type": "array",
          "minItems": 1,
          "maxItems": 64,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/CreatedGraphArtifactSourceConfig"
          }
        },
        "artifact": {
          "$ref": "#/$defs/CreatedGraphArtifactProducerConfig"
        },
        "algebraic_planning": {
          "$ref": "#/$defs/GraphAlgebraicPlanningConfig"
        },
        "resolvers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GraphResolverConfig"
          }
        }
      }
    },
    "CreatedIndex": {
      "description": "Discriminated normalized configuration returned after an index is created.",
      "oneOf": [
        {
          "$ref": "#/$defs/CreatedFullTextIndex"
        },
        {
          "$ref": "#/$defs/CreatedEmbeddingsIndex"
        },
        {
          "$ref": "#/$defs/CreatedGraphIndex"
        },
        {
          "$ref": "#/$defs/CreatedAlgebraicIndex"
        },
        {
          "$ref": "#/$defs/CreatedRelationalIndex"
        }
      ]
    },
    "CreatedIndexCommon": {
      "type": "object",
      "description": "Fields returned for every newly created index. Provider credentials are write-only and are never returned.",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the created index"
        },
        "description": {
          "type": "string",
          "description": "Optional description of the index and its purpose"
        },
        "version": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "default": 0,
          "description": "Version of the index implementation. Defaults to 0."
        },
        "enrichments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CreatedEnrichmentConfig"
          },
          "x-go-type-skip-optional-pointer": true,
          "description": "Normalized inline managed enrichment definitions required by this index."
        }
      }
    },
    "CreatedProviderConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "provider"
      ],
      "description": "Credential-free provider configuration returned after index creation. Only non-secret provider settings are represented.",
      "properties": {
        "provider": {
          "type": "string",
          "description": "Configured provider discriminator."
        },
        "model": {
          "type": "string",
          "description": "Configured provider model when applicable."
        },
        "request_format": {
          "type": "string"
        },
        "task_encoding": {
          "type": "string"
        },
        "model_identity": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Pinned immutable embedding asset and recipe identity."
        },
        "models": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "project_id": {
          "type": "string"
        },
        "location": {
          "type": "string"
        },
        "region": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "api_url": {
          "type": "string",
          "format": "uri"
        },
        "dimension": {
          "type": "integer",
          "minimum": 1
        },
        "dimensions": {
          "type": "integer",
          "minimum": 1
        },
        "input_type": {
          "type": "string"
        },
        "truncate": {
          "type": "string"
        },
        "strip_new_lines": {
          "type": "boolean"
        },
        "batch_size": {
          "type": "integer",
          "minimum": 1
        },
        "temperature": {
          "type": "number",
          "format": "float"
        },
        "max_tokens": {
          "type": "integer",
          "minimum": 1
        },
        "top_p": {
          "type": "number",
          "format": "float"
        },
        "top_k": {
          "type": "integer"
        },
        "frequency_penalty": {
          "type": "number",
          "format": "float"
        },
        "presence_penalty": {
          "type": "number",
          "format": "float"
        },
        "timeout": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "CreatedRelationalIndex": {
      "description": "Effective schema-bound composite index configuration.",
      "allOf": [
        {
          "$ref": "#/$defs/CreatedIndexCommon"
        },
        {
          "$ref": "#/$defs/RelationalIndexConfig"
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "relational"
              ]
            }
          }
        }
      ]
    },
    "DateRangeStringQuery": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "start": {
          "type": "string",
          "format": "date-time",
          "x-go-type-skip-optional-pointer": false
        },
        "end": {
          "type": "string",
          "format": "date-time",
          "x-go-type-skip-optional-pointer": false
        },
        "inclusive_start": {
          "type": [
            "boolean",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "inclusive_end": {
          "type": [
            "boolean",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        },
        "datetime_parser": {
          "type": "string"
        }
      }
    },
    "DeciderConfig": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "antfly",
            "jev",
            "openai",
            "cloudflare"
          ]
        },
        "decision_method": {
          "type": "string",
          "enum": [
            "typed",
            "embedding_similarity",
            "generated"
          ],
          "default": "typed",
          "description": "Explicit result contract. embedding_similarity is available with Antfly EmbeddingGemma 2 choice and multi_choice questions; rejects score and predicate requests and returns raw cosine similarities."
        },
        "generator": {
          "$ref": "#/$defs/GeneratorConfig",
          "description": "Required with decision_method=generated. Provider configuration belongs here rather than in the outer typed-decider fields."
        },
        "instructions": {
          "type": "string",
          "maxLength": 65536
        },
        "output": {
          "$ref": "#/$defs/ConstrainedOutput"
        },
        "probabilities": {
          "$ref": "#/$defs/ConstrainedProbabilities"
        },
        "batch": {
          "$ref": "#/$defs/ConstrainedGenerationBatch"
        },
        "model": {
          "type": "string",
          "description": "Required for Antfly, OpenAI, and Cloudflare; Jev defaults to jev-latest. Cloudflare uses @cf/cloudflare/clef or @cf/cloudflare/clef-flash."
        },
        "account_id": {
          "type": "string",
          "description": "Required with the cloudflare provider; Workers AI account identifier."
        },
        "gateway_id": {
          "type": "string",
          "description": "Optional Cloudflare AI Gateway identifier."
        },
        "model_identity": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Pin the exact EmbeddingGemma 2 assets and recipe. Requires embedding_similarity."
        },
        "embedder": {
          "type": "string",
          "minLength": 1,
          "description": "Named dense embedder for provider-neutral embedding_similarity routing. Specify matching embedding_options.dimensions. Native fitted calibrations require the original Antfly model path; hosted routes use explicit thresholds and estimated token admission."
        },
        "embedding_options": {
          "type": "object",
          "additionalProperties": false,
          "description": "Geometry and acceptance defaults for embedding_similarity decisions. Named embedders require dimensions matching their configured dense output. Direct Antfly model routes support EmbeddingGemma 2 dimensions and fitted calibrations. Acceptance is serialized onto each question and can be overridden per question. Raw cosine similarities never represent probabilities.",
          "properties": {
            "calibration_id": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,64}$",
              "description": "Qualified fitted raw thresholds in model/calibrations/{id}.json. Bound to the exact asset identity, task, renderer, dimensions and category prototypes; mutually exclusive with manual thresholds. Does not produce probabilities."
            },
            "task_type": {
              "type": "string",
              "enum": [
                "CLUSTERING",
                "CLASSIFICATION"
              ],
              "default": "CLUSTERING"
            },
            "dimensions": {
              "type": "integer",
              "minimum": 1,
              "maximum": 65535,
              "default": 768,
              "description": "Must match the named embedder's configured dimensions. Without embedder, the direct EmbeddingGemma 2 route accepts only 768, 512, 256 or 128."
            },
            "min_similarity": {
              "type": "number",
              "minimum": -1,
              "maximum": 1
            },
            "min_margin": {
              "type": "number",
              "minimum": 0,
              "maximum": 2
            }
          }
        },
        "url": {
          "type": "string",
          "description": "Provider base URL; endpoint path is selected by provider. OpenAI defaults to https://api.openai.com/v1 and appends /decisions."
        },
        "api_key": {
          "type": "string",
          "description": "API key or secret reference. Defaults to the provider environment variable."
        },
        "max_rows": {
          "type": "integer",
          "minimum": 1,
          "default": 10000
        },
        "max_input_tokens": {
          "type": "integer",
          "minimum": 1,
          "default": 1000000
        },
        "max_image_input_tokens": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "description": "Provider/model upper bound on the input-token contribution of one image. Required when sending images through typed hosted or generated deciders, including native generators and image URLs. The runtime reserves this allowance per image in addition to serialized non-image request bytes; actual usage can add shared quota debt. Generated deciders apply the allowance to the selected generator's shared quota. Omit for text-only deciders."
        },
        "rate_limit": {
          "$ref": "#/$defs/RateLimitConfig"
        },
        "batch_size": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "default": 32
        }
      }
    },
    "DecisionChoice": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value"
      ],
      "properties": {
        "value": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string",
          "minLength": 1
        }
      },
      "description": "Local decision models use string choice identifiers. Embedding category examples replace the description with their normalized centroid; trained models reject examples."
    },
    "DerivedCoveragePolicy": {
      "type": "string",
      "enum": [
        "strict",
        "partial",
        "best_effort"
      ],
      "default": "strict",
      "description": "How generation-scoped source outcomes determine derived-index completeness."
    },
    "DisjunctionQuery": {
      "type": "object",
      "properties": {
        "disjuncts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Query"
          }
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        },
        "min": {
          "type": "integer",
          "format": "uint32",
          "minimum": 0,
          "x-go-type-skip-optional-pointer": false,
          "description": "Minimum number of disjuncts that must match. Omit for conventional disjunction semantics; set to 0 to make a pure disjunction optional."
        }
      },
      "required": [
        "disjuncts"
      ]
    },
    "DistanceMetric": {
      "x-go-type-skip-optional-pointer": true,
      "type": "string",
      "enum": [
        "l2_squared",
        "inner_product",
        "cosine"
      ],
      "default": "l2_squared",
      "description": "Distance metric for the vector index (dense only). Use \"cosine\" for models trained with cosine similarity (e.g. CLIP, OpenAI). Use \"inner_product\" for models trained with dot product similarity. Use \"l2_squared\" for models trained with Euclidean distance. The default is \"l2_squared\"."
    },
    "DocIdQuery": {
      "type": "object",
      "properties": {
        "ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "ids"
      ]
    },
    "DocumentFieldMapping": {
      "type": "object",
      "additionalProperties": false,
      "description": "Executable physical mapping used by a document property's `x-antfly-field` annotation. The mapping must accept the JSON Schema value type. Declarations for the same dotted path across document types must normalize to an identical physical mapping, and present values that cannot be encoded are rejected at write admission. Mappings contributed by `anyOf` or `oneOf` must normalize to the same mapping in every alternative; conditional and dynamically named mappings are rejected.",
      "properties": {
        "type": {
          "$ref": "#/$defs/FieldMappingType"
        },
        "analyzer": {
          "type": "string",
          "description": "Analyzer name for text-oriented mappings."
        },
        "index": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "description": "Whether to index the field. Omit to use the server default of true."
        },
        "store": {
          "type": "boolean",
          "default": false,
          "description": "Whether to store the field value (default false)"
        },
        "include_in_all": {
          "type": "boolean",
          "default": false,
          "description": "Whether to include in the _all field for cross-field search"
        },
        "sortable": {
          "type": "boolean",
          "default": false,
          "description": "Whether this exact scalar field can be used in order_by. Supported\nsortable mapping types are keyword, numeric/number/integer,\nboolean/bool, datetime/date/timestamp, and link. Analyzed text,\nsearch_as_you_type, geo, embedding, blob, html, object, and array\nfields are not directly sortable; use an exact scalar subfield such\nas title.keyword for sorted string pagination. Antfly derives the\nrequired typed doc values when enabled.\n"
        },
        "missing_null_policy": {
          "type": "string",
          "enum": [
            "missing_rejected",
            "nulls_ordered"
          ],
          "default": "missing_rejected",
          "description": "Missing/null sort policy. The default missing_rejected rejects missing or null native sort values. Opt in to nulls_ordered for nulls first ascending and last descending, with JSON null cursor components. Nullable native layouts require a complete producer proof."
        },
        "fields": {
          "type": "object",
          "description": "Named one-level multifields emitted from this property's value. For example, a text title can expose a sortable keyword subfield.",
          "additionalProperties": {
            "$ref": "#/$defs/DocumentSubfieldMapping"
          }
        }
      }
    },
    "DocumentSchema": {
      "type": "object",
      "description": "Defines the structure of a document type",
      "properties": {
        "description": {
          "type": "string",
          "description": "A description of the document type."
        },
        "schema": {
          "type": "object",
          "additionalProperties": true,
          "description": "A valid JSON Schema defining the document's structure.\nThis is used to infer indexing rules and field types.\n",
          "x-antfly-field-mapping-schema": {
            "$ref": "#/$defs/DocumentFieldMapping"
          },
          "x-antfly-sql-type-schema": {
            "$ref": "#/$defs/SQLBuiltinType"
          },
          "x-antfly-sql-numeric-modifier-schema": {
            "$ref": "#/$defs/SQLNumericModifier"
          },
          "x-antfly-sql-array-column-schema": {
            "$ref": "#/$defs/SQLArrayColumnSchema"
          }
        }
      }
    },
    "DocumentSubfieldMapping": {
      "type": "object",
      "additionalProperties": false,
      "description": "Mapping for one named multifield emitted from its parent document property. Multifields are intentionally one level deep and read the parent property's JSON value rather than a nested JSON property.",
      "properties": {
        "type": {
          "$ref": "#/$defs/FieldMappingType"
        },
        "analyzer": {
          "type": "string",
          "description": "Analyzer name for text-oriented mappings."
        },
        "index": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "description": "Whether to index the field. Omit to use the server default of true."
        },
        "store": {
          "type": "boolean",
          "default": false,
          "description": "Whether to store the field value (default false)"
        },
        "include_in_all": {
          "type": "boolean",
          "default": false,
          "description": "Whether to include in the _all field for cross-field search"
        },
        "sortable": {
          "type": "boolean",
          "default": false,
          "description": "Whether this exact scalar subfield can be used in order_by. Antfly derives the required typed doc values when enabled."
        },
        "missing_null_policy": {
          "type": "string",
          "enum": [
            "missing_rejected",
            "nulls_ordered"
          ],
          "default": "missing_rejected",
          "description": "Missing/null sort policy. The default missing_rejected rejects missing or null native sort values. Opt in to nulls_ordered for nulls first ascending and last descending, with JSON null cursor components. Nullable native layouts require a complete producer proof."
        }
      }
    },
    "DynamicTemplate": {
      "type": "object",
      "additionalProperties": false,
      "description": "A rule for mapping dynamically detected fields. Templates are checked in order\nand the first matching template's mapping is used.\n",
      "properties": {
        "name": {
          "type": "string",
          "description": "Optional identifier for the template (useful for debugging)"
        },
        "match": {
          "type": "string",
          "description": "Glob pattern for field name (last path element).\nSupports * and ** wildcards. Example: \"*_text\" matches \"title_text\", \"body_text\"\n"
        },
        "unmatch": {
          "type": "string",
          "description": "Exclusion pattern for field name. If it matches, the template is skipped.\nExample: \"skip_*\" would exclude fields like \"skip_this\"\n"
        },
        "path_match": {
          "type": "string",
          "description": "Glob pattern for the full dotted path. Supports ** for matching multiple segments.\nExample: \"metadata.**\" matches \"metadata.author\", \"metadata.tags.primary\"\n"
        },
        "path_unmatch": {
          "type": "string",
          "description": "Path exclusion pattern. If it matches the full path, the template is skipped."
        },
        "match_mapping_type": {
          "type": "string",
          "enum": [
            "string",
            "number",
            "boolean",
            "date",
            "object"
          ],
          "description": "Filter by detected JSON type"
        },
        "mapping": {
          "$ref": "#/$defs/TemplateFieldMapping"
        }
      }
    },
    "EdgeTypeConfig": {
      "type": "object",
      "description": "Configuration for a specific edge type",
      "properties": {
        "name": {
          "$ref": "#/$defs/GraphEdgeType"
        },
        "field": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Document field containing target node key(s) for automatic edge creation.\nSupports string (single target) or array of strings (multiple targets).\nWhen omitted, edges must be provided explicitly via _edges.\n"
        },
        "topology": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "enum": [
            "tree",
            "graph"
          ],
          "default": "graph",
          "description": "Topology constraint for this edge type:\n- tree: Single parent per node, no cycles\n- graph: No constraints (default)\n"
        }
      },
      "required": [
        "name"
      ]
    },
    "EmbeddingDecisionAcceptance": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "calibration_id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,64}$",
          "description": "Public API identifier for a server-side fitted threshold artifact at model/calibrations/{id}.json. The server verifies qualification and the exact asset identity, prompt profile, dimensions, renderer and this question's label/prototype set. Mutually exclusive with manual thresholds; never produces probabilities."
        },
        "min_similarity": {
          "type": "number",
          "minimum": -1,
          "maximum": 1,
          "description": "For a single choice, abstain when the highest cosine similarity is below this value. It is a similarity threshold, not an accuracy or probability estimate."
        },
        "min_margin": {
          "type": "number",
          "minimum": 0,
          "maximum": 2,
          "description": "For a single choice, require this gap between the highest and second-highest cosine similarities. For multi_choice, require every score to be at least this distance from its own selection threshold; otherwise abstain."
        }
      },
      "description": "Question-specific acceptance policy for embedding similarity. Trained decision models reject it."
    },
    "EnrichmentKind": {
      "type": "string",
      "enum": [
        "chunk",
        "asset",
        "embedding",
        "group"
      ],
      "description": "Managed generated artifact kind."
    },
    "EnrichmentNeighborContextConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "graph_index"
      ],
      "description": "Bounded sample of the document's same-shard graph neighbors appended to an asset producer's rendered input as a compact JSON block ({\"neighbors\":[{\"edge_type\":...,\"direction\":...,\"target\":...,\"weight\":...}]}), ordered by edge type then target key. A conceptualizer enrichment on an entities table can thereby ground its abstractions in adjacent facts (\"started_by -> John Andrew Rice\"). The sampled block participates in the producer's skip state, so a changed adjacency re-runs the producer.",
      "properties": {
        "graph_index": {
          "type": "string",
          "minLength": 1,
          "description": "Name of a graph index on the same table whose local state is sampled. Validated at admission; cross-shard neighbors are not sampled."
        },
        "edge_types": {
          "x-go-type-skip-optional-pointer": true,
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "description": "Edge types to sample. Empty admits every edge type."
        },
        "direction": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "enum": [
            "out",
            "in",
            "both"
          ],
          "default": "both",
          "description": "Adjacency orientation to sample relative to the document."
        },
        "limit": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint32",
          "minimum": 1,
          "maximum": 64,
          "default": 8,
          "description": "Maximum neighbors rendered into the producer input, applied after deterministic ordering."
        }
      }
    },
    "EqualsQuery": {
      "type": "object",
      "additionalProperties": false,
      "description": "Whole string equality on the original logical field value.\nNo normalization is applied. Case-sensitive by default; case_sensitive=false\nuses Unicode simple case folding, not locale-specific or multi-character folding.\nMissing, null, and non-string values do not match. Arrays use any-element\nsemantics; a match never spans array elements. Indexes select conservative\ncandidates and original values are verified before counting and pagination.\n",
      "required": [
        "equals",
        "field"
      ],
      "properties": {
        "equals": {
          "type": "string"
        },
        "field": {
          "type": "string",
          "minLength": 1,
          "description": "Logical source field path, not a companion index name."
        },
        "case_sensitive": {
          "type": "boolean",
          "default": true,
          "x-go-type-skip-optional-pointer": false
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "ExecutionPolicy": {
      "type": "object",
      "additionalProperties": false,
      "description": "Non-semantic execution policy for one producer or index maintenance operation. These fields tune how work is batched and do not change generated artifact identity.",
      "properties": {
        "batch_items": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "description": "Maximum items to process in one batch for this operation."
        },
        "batch_bytes": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "format": "uint64",
          "description": "Approximate maximum source bytes to process in one batch for this operation."
        },
        "max_document_pages": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "minimum": 1,
          "format": "uint32",
          "description": "Maximum PDF pages admitted for one request-atomic document operation."
        }
      }
    },
    "ExternalLakeCredentialRef": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ref"
      ],
      "properties": {
        "ref": {
          "type": "string",
          "minLength": 1,
          "description": "Name of a configured external_io connection with lake.read capability."
        },
        "scope": {
          "type": "string",
          "description": "Allowed object prefix relative to the configured bucket or filesystem root."
        }
      }
    },
    "ExternalLakeSnapshotSelector": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode"
      ],
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "current",
            "snapshot_id",
            "object_version_digest"
          ]
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "description": "Required for snapshot_id; selects an Iceberg snapshot."
        },
        "digest": {
          "type": "string",
          "minLength": 1,
          "description": "Required for object_version_digest; pins a Parquet object inventory."
        }
      }
    },
    "ExternalLakeTableSource": {
      "type": "object",
      "additionalProperties": false,
      "description": "Authoritative Parquet or Iceberg source. A serving statement pins its inventory and object versions before returning rows. Iceberg catalog commits require an explicit writable catalog binding; ordinary row mutations remain unsupported.",
      "required": [
        "kind",
        "table_id",
        "format",
        "uri"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "external"
          ]
        },
        "table_id": {
          "type": "string",
          "minLength": 1
        },
        "format": {
          "type": "string",
          "enum": [
            "parquet",
            "iceberg"
          ]
        },
        "uri": {
          "type": "string",
          "minLength": 1,
          "description": "Parquet prefix, Iceberg table, or an explicit Parquet snapshot head ending in .parquet-manifest.json. Snapshot heads name immutable checksummed file-list chunks; each query revalidates the head without listing the data prefix."
        },
        "row_identity_version": {
          "type": "integer",
          "enum": [
            1,
            2
          ],
          "readOnly": true,
          "description": "Server-assigned public row identity version, fixed when the source is attached and preserved across index creation and schema updates."
        },
        "row_identity": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "key_columns"
          ],
          "description": "Optional verified stable identity for external rewrites. Keys must be non-null and unique in each published snapshot. Uses native typed equality; an unchanged key alone never authorizes index reuse.",
          "properties": {
            "key_columns": {
              "type": "array",
              "minItems": 1,
              "maxItems": 32,
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        },
        "schema_fingerprint": {
          "type": "string",
          "default": "auto",
          "minLength": 1
        },
        "write_policy": {
          "type": "string",
          "enum": [
            "read_only",
            "iceberg_writer"
          ],
          "default": "read_only",
          "description": "iceberg_writer authorizes explicit Iceberg catalog commits and requires catalog plus a current snapshot selector. It does not enable ordinary row batch writes."
        },
        "object_mutability": {
          "type": "string",
          "enum": [
            "mutable",
            "immutable"
          ],
          "default": "mutable",
          "description": "Set immutable only when data files are never replaced at an existing URI. Allows authenticated provider-version proofs from retained index generations to be reused for unchanged data files. Metadata and delete files are still verified."
        },
        "credentials": {
          "$ref": "#/$defs/ExternalLakeCredentialRef"
        },
        "snapshot": {
          "$ref": "#/$defs/ExternalLakeSnapshotSelector"
        },
        "catalog": {
          "$ref": "#/$defs/LakeCatalogConfig"
        }
      }
    },
    "FieldCapability": {
      "type": "object",
      "description": "One public logical field with its supported value operations and nested\nconcrete representations. Queries name field; Antfly resolves compatible\nrepresentations. Unknown source associations remain explicit diagnostics.\n",
      "required": [
        "kind",
        "value_operations",
        "sortable",
        "sort_lifecycle_state",
        "sort_requires_scoring",
        "representations"
      ],
      "properties": {
        "field": {
          "type": "string",
          "description": "Public source or reserved/computed field accepted by queries. Absent for pattern-only templates and unassociated index representations."
        },
        "kind": {
          "type": "string",
          "enum": [
            "source",
            "reserved",
            "computed",
            "template",
            "unassociated"
          ],
          "description": "Field origin. Unassociated entries do not assert a document source path."
        },
        "value_operations": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "equals",
              "contains",
              "matches",
              "autocomplete"
            ]
          },
          "description": "Supported logical query operations on field. Equals, contains and matches\nverify original values; autocomplete performs analyzed bool-prefix matching. Availability does not\nattest index coverage or authorize scans. Case sensitivity, execution\npolicy and work budgets apply. Reserved/computed/template/unassociated\nentries do not advertise original-document value operations.\n"
        },
        "sortable": {
          "type": "boolean",
          "description": "Whether field resolves to one compatible sortable representation. Cold declared fields validate coverage on first exact-sort use; callers do not route through representation names."
        },
        "sort_lifecycle_state": {
          "type": "string",
          "enum": [
            "unsupported",
            "declared",
            "indexed",
            "covered",
            "queryable",
            "accelerated"
          ],
          "description": "Conservative cached lifecycle for the representation selected by the query resolver. Ambiguous or unavailable routing is unsupported."
        },
        "sort_requires_scoring": {
          "type": "boolean",
          "description": "True for query-computed score ordering, which requires a score-bearing query. This does not authorize ordering a non-scoring query by _score."
        },
        "representations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FieldRepresentation"
          },
          "description": "Concrete representations with analyzer, type, legacy query modes and readiness diagnostics. Multiple representations never require clients to reproduce Antfly routing."
        }
      }
    },
    "FieldMappingType": {
      "type": "string",
      "description": "Field types accepted by detailed `x-antfly-field` and dynamic-template\nmappings. JSON-schema-oriented aliases are normalized to Antfly's\ncorresponding runtime type: number/integer to numeric, bool to boolean,\ndate/timestamp to datetime, geo_point to geopoint, and geo_shape to\ngeoshape.\n",
      "enum": [
        "text",
        "html",
        "keyword",
        "numeric",
        "number",
        "integer",
        "boolean",
        "bool",
        "datetime",
        "date",
        "timestamp",
        "geopoint",
        "geo_point",
        "geoshape",
        "geo_shape",
        "embedding",
        "blob",
        "link",
        "search_as_you_type",
        "substring"
      ]
    },
    "FieldRepresentation": {
      "type": "object",
      "description": "Concrete index or reserved-field representation. Diagnostic targets and index-relative query modes are scoped to this representation.",
      "required": [
        "type",
        "query_modes",
        "sortable",
        "provenance",
        "missing_null_policy",
        "sort_lifecycle_state",
        "doc_value_coverage",
        "queryability_state"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Mapping or dynamic-template name, when applicable."
        },
        "field": {
          "type": "string",
          "description": "Concrete representation target for diagnostics and advanced index-relative queries. Pattern-only templates may omit this."
        },
        "path_pattern": {
          "type": "string",
          "description": "Dynamic-template path_match pattern, when applicable."
        },
        "field_pattern": {
          "type": "string",
          "description": "Dynamic-template match pattern, when applicable."
        },
        "match_mapping_type": {
          "type": "string",
          "description": "Dynamic-template match_mapping_type, when applicable."
        },
        "document_schema": {
          "type": "string",
          "description": "Document schema that produced this capability, when applicable."
        },
        "type": {
          "$ref": "#/$defs/AntflyType"
        },
        "query_modes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "full_text",
              "exact",
              "range",
              "geo",
              "autocomplete",
              "substring"
            ]
          },
          "description": "Query modes supported by this concrete field variant. These modes are derived from\nAntfly field types such as `text`, `keyword`, `datetime`, `geopoint`, and\n`search_as_you_type`; they are not separate schema toggles.\n"
        },
        "sortable": {
          "type": "boolean",
          "description": "Whether this concrete field is declared sortable in the effective\ncapability model. A cold declared field is validated on first\nexact order_by use; clients do not need to poll lifecycle status.\n"
        },
        "provenance": {
          "type": "string",
          "description": "Capability source, such as reserved, document_schema, dynamic_template, or observed_dynamic."
        },
        "missing_null_policy": {
          "type": "string",
          "description": "Current missing/null handling policy for this field."
        },
        "sort_lifecycle_state": {
          "type": "string",
          "enum": [
            "unsupported",
            "declared",
            "indexed",
            "covered",
            "queryable",
            "accelerated"
          ],
          "description": "Cached operational lifecycle state for exact sort use. Declared or indexed fields are validated on first public exact-sort use; queryable fields have validated native coverage; accelerated fields are queryable and participate in the configured index_sort tuple."
        },
        "analyzer": {
          "type": "string",
          "description": "Analyzer name for text/searchable fields, when applicable."
        },
        "index_sort_position": {
          "type": "integer",
          "format": "int64",
          "description": "Zero-based position in the table index_sort tuple when this field participates."
        },
        "index_sort_order": {
          "type": "string",
          "enum": [
            "asc",
            "desc"
          ],
          "description": "Sort direction in the table index_sort tuple when this field participates."
        },
        "doc_value_coverage": {
          "type": "string",
          "description": "Observed or declared doc-value coverage; declaration alone does not establish complete coverage."
        },
        "queryability_state": {
          "type": "string",
          "description": "Cached execution/readiness state of this representation. Capability inspection does not initiate coverage scans."
        }
      }
    },
    "ForeignKeyAction": {
      "type": "string",
      "enum": [
        "restrict",
        "set_null",
        "cascade",
        "no_action"
      ],
      "description": "Action on referencing rows when a referenced row is changed or removed."
    },
    "ForeignKeyMatch": {
      "type": "string",
      "enum": [
        "simple",
        "full",
        "partial"
      ],
      "description": "Null matching semantics of a composite foreign key. Partial requires\nat least one parent matching every non-null child component; all-null\nchildren are exempt. Compatible parent witnesses are guarded through\ncommit, including concurrent deletion of alternative witnesses.\n"
    },
    "ForeignKeyTiming": {
      "type": "string",
      "enum": [
        "immediate",
        "deferred"
      ],
      "description": "Enforcement timing for atomic mutations and transaction sessions. Deferred\nrequires deferrable=true and validates the final transaction state.\nNO ACTION permits a valid final-state parent replacement; RESTRICT\nstill rejects referenced parent removal. Existing multi-request\ntransaction sessions retain deferred checks until commit; immediate\nchecks apply to each staged statement. SET CONSTRAINTS is not provided.\n"
    },
    "FullTextArtifactIndexSource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact"
      ],
      "description": "Textual artifact stream consumed by a full-text index, with an optional source-local projection.",
      "properties": {
        "artifact": {
          "type": "string",
          "minLength": 1,
          "description": "Stable name of a chunk or textual asset artifact stream. Artifact names must be unique within the index."
        },
        "field": {
          "type": "string",
          "minLength": 1,
          "description": "Optional field selected from this artifact's records. When omitted, the index-level field is inherited; when both are omitted, Antfly indexes the default text projection."
        }
      }
    },
    "Fuzziness": {
      "description": "The fuzziness of the query. Can be an integer or \"auto\".",
      "anyOf": [
        {
          "type": "integer",
          "format": "int32",
          "minimum": 0,
          "maximum": 2
        },
        {
          "type": "string",
          "enum": [
            "auto"
          ]
        }
      ]
    },
    "FuzzyQuery": {
      "type": "object",
      "properties": {
        "term": {
          "type": "string"
        },
        "prefix_length": {
          "type": "integer",
          "format": "int32",
          "minimum": 0,
          "maximum": 255
        },
        "fuzziness": {
          "$ref": "#/$defs/Fuzziness"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "term"
      ]
    },
    "GeneratorConfig": {
      "description": "A unified configuration for a generative AI provider.\n",
      "allOf": [
        {
          "oneOf": [
            {
              "$ref": "#/$defs/CloudflareGeneratorConfig"
            },
            {
              "$ref": "#/$defs/GoogleGeneratorConfig"
            },
            {
              "$ref": "#/$defs/VertexGeneratorConfig"
            },
            {
              "$ref": "#/$defs/BedrockGeneratorConfig"
            },
            {
              "$ref": "#/$defs/AnthropicGeneratorConfig"
            },
            {
              "$ref": "#/$defs/OllamaGeneratorConfig"
            },
            {
              "$ref": "#/$defs/AntflyGeneratorConfig"
            },
            {
              "$ref": "#/$defs/ChatGPTGeneratorConfig"
            },
            {
              "$ref": "#/$defs/OpenAIGeneratorConfig"
            },
            {
              "$ref": "#/$defs/OpenRouterGeneratorConfig"
            },
            {
              "$ref": "#/$defs/AppleGeneratorConfig"
            }
          ]
        },
        {
          "properties": {
            "max_image_input_tokens": {
              "x-go-type-skip-optional-pointer": false,
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "description": "Conservative input-token ceiling per image. Required for image calls when tokens_per_minute is configured; choose a bound valid for the model and image policy."
            },
            "rate_limit": {
              "x-go-type-skip-optional-pointer": false,
              "$ref": "#/$defs/RateLimitConfig"
            },
            "provider": {
              "$ref": "#/$defs/GeneratorProvider"
            }
          },
          "required": [
            "provider"
          ]
        }
      ]
    },
    "GeneratorProvider": {
      "type": "string",
      "enum": [
        "cloudflare",
        "gemini",
        "vertex",
        "bedrock",
        "anthropic",
        "ollama",
        "openai",
        "chatgpt",
        "openrouter",
        "antfly",
        "apple"
      ],
      "description": "Generator providers implemented by Antfly's generation runtime."
    },
    "GeoBoundingBoxQuery": {
      "type": "object",
      "description": "Geographic bounding box filter. The public query shape uses scalar latitude and longitude bounds to match structured filter_query.geo_bbox. Longitude ranges may cross the antimeridian by specifying a western/min longitude that is greater than the eastern/max longitude; for example, min_lon 179.5 and max_lon -179.5 matches points near +/-180 degrees longitude. Latitude bounds must be ordered with min_lat <= max_lat.\n",
      "properties": {
        "field": {
          "type": "string",
          "description": "Field or path containing geo_point values."
        },
        "min_lat": {
          "type": "number",
          "format": "double",
          "minimum": -90,
          "maximum": 90,
          "description": "Southern latitude bound."
        },
        "min_lon": {
          "type": "number",
          "format": "double",
          "minimum": -180,
          "maximum": 180,
          "description": "Western longitude bound. If greater than max_lon, the box crosses the antimeridian."
        },
        "max_lat": {
          "type": "number",
          "format": "double",
          "minimum": -90,
          "maximum": 90,
          "description": "Northern latitude bound. Must be greater than or equal to min_lat."
        },
        "max_lon": {
          "type": "number",
          "format": "double",
          "minimum": -180,
          "maximum": 180,
          "description": "Eastern longitude bound. May be less than min_lon for antimeridian-wrapped boxes."
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "field",
        "min_lat",
        "min_lon",
        "max_lat",
        "max_lon"
      ]
    },
    "GeoBoundingPolygonQuery": {
      "type": "object",
      "properties": {
        "polygon_points": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GeoPoint"
          }
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "polygon_points"
      ]
    },
    "GeoDistanceQuery": {
      "type": "object",
      "properties": {
        "location": {
          "type": "array",
          "items": {
            "type": "number",
            "format": "double"
          },
          "minItems": 2,
          "maxItems": 2,
          "description": "[lon, lat]"
        },
        "distance": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "location",
        "distance"
      ]
    },
    "GeoPoint": {
      "type": "object",
      "properties": {
        "lon": {
          "type": "number",
          "format": "double"
        },
        "lat": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "GeoShape": {
      "type": "object",
      "description": "A GeoJSON shape object. This is a simplified representation.",
      "properties": {
        "type": {
          "type": "string"
        },
        "coordinates": {
          "type": "array",
          "items": {}
        }
      },
      "required": [
        "type",
        "coordinates"
      ]
    },
    "GeoShapeGeometry": {
      "type": "object",
      "properties": {
        "shape": {
          "$ref": "#/$defs/GeoShape"
        },
        "relation": {
          "type": "string",
          "enum": [
            "intersects",
            "contains",
            "within"
          ]
        }
      },
      "required": [
        "shape",
        "relation"
      ]
    },
    "GeoShapeQuery": {
      "type": "object",
      "properties": {
        "geometry": {
          "$ref": "#/$defs/GeoShapeGeometry"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "geometry"
      ]
    },
    "GoogleGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Google generative AI provider (Gemini).\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "gemini"
          ]
        },
        "project_id": {
          "type": "string",
          "description": "The Google Cloud project ID."
        },
        "location": {
          "type": "string",
          "description": "The Google Cloud location (e.g., 'us-central1')."
        },
        "model": {
          "type": "string",
          "description": "The name of the generative model to use.",
          "default": "gemini-2.5-flash"
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The Google API key."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Google API endpoint."
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "GraphAlgebraicPlanningConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Optional algebraic planning features for graph traversal.",
      "properties": {
        "bounded_traversal": {
          "$ref": "#/$defs/GraphBoundedTraversalConfig"
        }
      }
    },
    "GraphArtifactContextConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Document fields made available to graph mapping templates through `_doc.value`.",
      "properties": {
        "doc_fields": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "GraphArtifactEdgeMappingConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Maps each artifact item to a relationship identity, type, weight, and public metadata.",
      "properties": {
        "edge_id": {
          "$ref": "#/$defs/GraphTemplateValue",
          "description": "Stable application relationship ID. Required with nodes.source. Replays update the same identity; distinct IDs preserve parallel relationships."
        },
        "type": {
          "$ref": "#/$defs/GraphTemplateValue"
        },
        "weight": {
          "$ref": "#/$defs/GraphTemplateValue"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": true,
          "description": "JSON metadata template copied onto each materialized edge. Sensitive keys are omitted from create responses."
        }
      }
    },
    "GraphArtifactNodeMappingConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Maps each artifact item to graph node identifiers.",
      "properties": {
        "model": {
          "type": "string",
          "enum": [
            "document",
            "external"
          ],
          "default": "document"
        },
        "source": {
          "$ref": "#/$defs/GraphTemplateValue",
          "description": "Logical source endpoint. When set, edge.edge_id is required; the artifact document remains the durable owner."
        },
        "target": {
          "$ref": "#/$defs/GraphTemplateValue"
        }
      }
    },
    "GraphArtifactProducerSourceConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "value"
      ],
      "description": "Document input used by an artifact producer. Field sources read one document field; template sources render a Handlebars template.",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "field",
            "template"
          ]
        },
        "value": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "GraphBoundedTraversalConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "law"
      ],
      "description": "Algebraic law used to combine bounded graph traversal provenance.",
      "properties": {
        "law": {
          "type": "string",
          "enum": [
            "provenance_semiring"
          ]
        }
      }
    },
    "GraphEdgeType": {
      "type": "string",
      "minLength": 1,
      "maxLength": 65536,
      "x-antfly-max-utf8-bytes": 65536,
      "description": "Durable graph edge type. Values must be valid UTF-8 and encode to at most 64 KiB; `maxLength` is the standard-schema code-point ceiling and `x-antfly-max-utf8-bytes` carries the exact wire-byte limit."
    },
    "GraphMetricConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Published metric configuration. If kind is omitted, the metric name must be a supported kind.",
      "properties": {
        "enabled": {
          "type": "boolean",
          "default": true
        },
        "kind": {
          "type": "string",
          "enum": [
            "pagerank",
            "degree",
            "eigenvector",
            "hits_authority",
            "hits_hub"
          ]
        },
        "refresh": {
          "type": "string",
          "enum": [
            "background",
            "manual"
          ],
          "default": "background",
          "description": "Serverless accepts background only."
        },
        "damping": {
          "type": "number",
          "format": "double",
          "default": 0.85,
          "exclusiveMinimum": 0,
          "exclusiveMaximum": 1
        },
        "tolerance": {
          "type": "number",
          "format": "double",
          "default": 1e-06,
          "exclusiveMinimum": 0
        },
        "max_iterations": {
          "type": "integer",
          "format": "int32",
          "minimum": 1,
          "maximum": 1000,
          "default": 50
        },
        "edge_filter": {
          "$ref": "#/$defs/GraphMetricEdgeFilter"
        }
      }
    },
    "GraphMetricEdgeFilter": {
      "type": "object",
      "additionalProperties": false,
      "description": "Omitting this object selects all edge types. A types list selects only those types; mode and types cannot both be supplied.",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "all"
          ]
        },
        "types": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/GraphEdgeType"
          }
        }
      }
    },
    "GraphResolverAdjudicationAcceptance": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "choice",
        "min_probability"
      ],
      "properties": {
        "choice": {
          "type": "string",
          "minLength": 1,
          "description": "A choice identifier in the configured question. Accept and reject must differ."
        },
        "min_probability": {
          "type": "number",
          "minimum": 0.5,
          "maximum": 1,
          "description": "Require this typed probability and a strict majority. Raw cosine is not a probability."
        }
      }
    },
    "GraphResolverAdjudicationConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "decider",
        "template",
        "question",
        "accept"
      ],
      "description": "Adjudicate the best deterministic REVIEW candidate with a typed decision. MATCH and NO_MATCH bypass the model. Evidence is authoritative resolution data, retained independently of work caches and reused on recovery. Changes trigger versioned re-resolution. This resolves mentions, not global key merges.",
      "properties": {
        "decider": {
          "$ref": "#/$defs/DeciderConfig",
          "description": "Frozen typed or generated decider configuration. Generated verdict-only thresholds must be zero or one."
        },
        "template": {
          "type": "string",
          "minLength": 1,
          "maxLength": 65536,
          "description": "Bounded interpolation of m.text, m.surface_form, m.canonical_text, m.label, m.description, c.canonical_name, c.label and c.description. Missing descriptions render empty text, allowing name-only decisions."
        },
        "question": {
          "$ref": "#/$defs/ChoiceDecisionQuestion"
        },
        "accept": {
          "$ref": "#/$defs/GraphResolverAdjudicationAcceptance"
        },
        "reject": {
          "$ref": "#/$defs/GraphResolverAdjudicationAcceptance",
          "description": "Optional confident negative choice. Without it, non-acceptance stays REVIEW."
        },
        "on_failure": {
          "type": "string",
          "enum": [
            "review",
            "mint"
          ],
          "default": "review",
          "description": "Failure or budget fallback. REVIEW remains unpromoted; mint explicitly permits a new identity."
        },
        "description_inputs": {
          "type": "object",
          "additionalProperties": false,
          "description": "Optional asset bindings. Resolution reads available data without waiting for promotion or producers.",
          "properties": {
            "mention_artifact": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "description": "Source-document asset containing a JSON object mapping local mention ids to description strings. Publication re-drives asset-scoped resolution."
            },
            "candidate_artifact": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "description": "Candidate-document text asset, such as a generated summary. Changes affect future decisions; explicitly re-resolve to revisit committed evidence."
            }
          }
        },
        "budget_ms": {
          "type": "integer",
          "minimum": 1,
          "maximum": 300000,
          "default": 10000,
          "description": "Total model-time budget per source artifact. Each call also obeys timeout_ms."
        },
        "max_pairs": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "default": 32
        },
        "max_input_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1048576,
          "default": 16384
        },
        "timeout_ms": {
          "type": "integer",
          "minimum": 1,
          "maximum": 300000,
          "default": 10000
        }
      }
    },
    "GraphResolverConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "table",
        "source_artifact",
        "resolution_artifact",
        "key_template"
      ],
      "description": "Versioned entity resolver attached to an artifact-backed graph index.",
      "properties": {
        "name": {
          "type": "string"
        },
        "table": {
          "type": "string"
        },
        "source_artifact": {
          "type": "string"
        },
        "source_artifact_kind": {
          "type": "string",
          "enum": [
            "asset",
            "chunk",
            "any"
          ],
          "default": "asset"
        },
        "resolution_artifact": {
          "type": "string"
        },
        "key_template": {
          "type": "string"
        },
        "promote": {
          "type": "boolean",
          "default": true,
          "x-go-type-skip-optional-pointer": false,
          "description": "Materialize canonical entity documents. False resolves graph keys without promotion."
        },
        "aliases": {
          "type": "array",
          "description": "Explicit redirects between fully rendered keys in this resolver's table; no entity documents required. Changes trigger corpus re-resolution.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "key",
              "target"
            ],
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1
              },
              "target": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        },
        "labels": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Mention labels this resolver consumes; empty consumes every label (catch-all). Labeled resolvers sharing a source artifact must claim disjoint label sets, and every catch-all on that artifact skips the labels claimed by labeled siblings, so extraction labels stay open-vocabulary while each mention routes to exactly one labeled resolver (label-routed tables, e.g. event mentions to an events table)."
        },
        "type_must_match": {
          "type": "boolean",
          "default": true
        },
        "scorer": {
          "$ref": "#/$defs/GraphResolverScorerConfig",
          "description": "Typed matcher scorer. Cannot be combined with scorer_json."
        },
        "adjudicate": {
          "$ref": "#/$defs/GraphResolverAdjudicationConfig"
        },
        "suppress": {
          "$ref": "#/$defs/GraphResolverSuppressionConfig"
        },
        "scorer_json": {
          "type": "string",
          "deprecated": true,
          "x-deprecated-reason": "Use the scorer field."
        },
        "candidate_search": {
          "type": "string",
          "enum": [
            "",
            "exact_key",
            "prefix",
            "ann"
          ]
        },
        "candidate_ann_index": {
          "type": "string"
        },
        "candidate_limit": {
          "type": "integer",
          "format": "uint",
          "minimum": 0
        },
        "name_embedding": {
          "type": "string"
        },
        "name_embedding_dims": {
          "type": "integer",
          "format": "uint",
          "minimum": 0
        },
        "fusion_combine": {
          "type": "string",
          "enum": [
            "",
            "noisy_or",
            "max",
            "mean"
          ]
        },
        "fusion_trust": {
          "type": "number",
          "format": "double",
          "minimum": 0,
          "maximum": 1
        },
        "fusion_prior": {
          "type": "number",
          "format": "double",
          "minimum": 0,
          "maximum": 1
        },
        "fusion_prior_weight": {
          "type": "number",
          "format": "double",
          "minimum": 0
        },
        "min_confidence": {
          "x-go-type-skip-optional-pointer": false,
          "type": "number",
          "format": "double",
          "minimum": 0,
          "maximum": 1,
          "description": "Mention admission floor: mentions whose extractor-asserted confidence is below this are never resolved — no canonical entity key, no mention edge, and relation endpoints referencing them are withheld. The cheap post-extraction junk filter for score-carrying extractors; omission defaults to 0 for trained extractors. Resolvers consuming verdict-only generated extraction must set this field explicitly, including when the chosen floor is zero."
        },
        "config_generation": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0
        }
      }
    },
    "GraphResolverScorerComparison": {
      "type": "object",
      "required": [
        "name",
        "left",
        "right",
        "levels"
      ],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "left": {
          "type": "string"
        },
        "right": {
          "type": "string"
        },
        "levels": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GraphResolverScorerLevel"
          }
        }
      }
    },
    "GraphResolverScorerConfig": {
      "type": "object",
      "required": [
        "comparisons"
      ],
      "additionalProperties": false,
      "properties": {
        "comparisons": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GraphResolverScorerComparison"
          }
        },
        "combine": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "bias": {
              "type": "number",
              "format": "double"
            }
          }
        },
        "decision": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "match": {
              "type": "number",
              "format": "double"
            },
            "review": {
              "type": "number",
              "format": "double"
            }
          }
        }
      }
    },
    "GraphResolverScorerLevel": {
      "type": "object",
      "required": [
        "weight"
      ],
      "additionalProperties": false,
      "properties": {
        "when": {
          "type": "string",
          "description": "Matcher condition, such as 'exact' or 'jaro_winkler >= 0.9'."
        },
        "else": {
          "type": "boolean",
          "description": "Catch-all level when no previous condition matched."
        },
        "weight": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "GraphResolverSuppressionConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Suppress mentions before candidate search, embedding, adjudication and promotion. Suppressed mentions remain explainable in resolution artifacts and contribute no canonical graph edges. Changes use the normal resolver generation and bounded backfill lifecycle. Redirects to suppressed keys are rejected. Runtime suppressions are additive and outlive index versions.",
      "properties": {
        "keys": {
          "type": "array",
          "maxItems": 100000,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16384
          },
          "description": "Exact rendered canonical keys in this resolver namespace."
        },
        "texts": {
          "type": "array",
          "maxItems": 100000,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16384
          },
          "description": "Mention texts normalized with the resolver Unicode slug rules."
        },
        "min_text_chars": {
          "type": "integer",
          "format": "uint32",
          "minimum": 0,
          "default": 0,
          "description": "Minimum Unicode scalar count after trimming surrounding ASCII whitespace."
        }
      }
    },
    "GraphTemplateValue": {
      "description": "A literal string or finite numeric value, or a Handlebars template evaluated for each materialized graph item.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number",
          "format": "double"
        }
      ]
    },
    "GroupedArtifactSource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "group_by",
        "order_by",
        "field"
      ],
      "properties": {
        "group_by": {
          "type": "string",
          "minLength": 1
        },
        "order_by": {
          "type": "string",
          "minLength": 1,
          "description": "Field containing an integer ordinal. Ties use the document key."
        },
        "segment_by": {
          "type": "string",
          "minLength": 1
        },
        "field": {
          "type": "string",
          "minLength": 1
        },
        "filter": {
          "type": "object",
          "additionalProperties": true,
          "description": "Canonical row filter evaluated on the source projection."
        },
        "max_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4194304,
          "default": 32768,
          "description": "UTF-8 text bytes per unit, including joining newlines. An oversized single member fails explicitly."
        },
        "max_members": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4096,
          "default": 1024,
          "description": "Maximum members per unit; larger partitions emit multiple units."
        },
        "window_ordinals": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4096,
          "default": 128,
          "description": "Fixed ordinal cells bound repartitioning and incremental work for long groups."
        }
      }
    },
    "IPRangeQuery": {
      "type": "object",
      "properties": {
        "cidr": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "cidr"
      ]
    },
    "IndexExecutionConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Namespaced execution policy for managed index shorthand. Only namespaces with runtime effects are accepted.",
      "properties": {
        "chunking": {
          "$ref": "#/$defs/ExecutionPolicy",
          "description": "Chunk producer batching for shorthand-created chunk enrichments."
        },
        "embedding": {
          "$ref": "#/$defs/ExecutionPolicy",
          "description": "Embedding producer batching for shorthand-created embedding enrichments."
        }
      }
    },
    "IndexPublicationPolicy": {
      "type": "string",
      "enum": [
        "progressive",
        "atomic"
      ],
      "default": "progressive",
      "description": "Publication behavior for a managed embeddings index. `progressive` makes a safely checkpointed active generation queryable before initial source coverage is complete. `atomic` keeps a new generation unavailable until complete validation and activation."
    },
    "LakeCatalogConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type"
      ],
      "description": "Catalog authority is independent of S3/GCS storage and deployment. managed uses a conditional durable head under the table root. rest uses a named HTTP connection; raw secrets are forbidden. Omit to retain explicit metadata URI/version-hint discovery.",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "managed",
            "rest"
          ]
        },
        "connection": {
          "type": "string",
          "description": "Required for rest. Named external_io/http connection with lake_catalog_read and, for commits, lake_catalog_write capabilities."
        },
        "uri": {
          "type": "string",
          "description": "Required for rest; catalog base URI whose origin must be allowed by the named connection."
        },
        "namespace": {
          "type": "array",
          "maxItems": 32,
          "items": {
            "type": "string"
          },
          "description": "Required nonempty namespace components for rest."
        },
        "name": {
          "type": "string",
          "description": "Required table name for rest, distinct from Antfly's logical table name."
        },
        "warehouse": {
          "type": "string",
          "description": "Optional REST config warehouse selector. Other fields must be omitted for managed."
        }
      }
    },
    "MatchAllQuery": {
      "type": "object",
      "properties": {
        "match_all": {
          "type": "object"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "match_all"
      ]
    },
    "MatchNoneQuery": {
      "type": "object",
      "properties": {
        "match_none": {
          "type": "object"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "match_none"
      ]
    },
    "MatchPhraseQuery": {
      "type": "object",
      "description": "Match a phrase using the field's analyzer. On a `substring` companion,\none or two words match contained text across token separators. Three\nor more words are rejected because the suffix index cannot verify\ntheir word boundaries; lookups over 32 bytes are also rejected.\nNonzero or automatic fuzziness is rejected on substring fields; use a standalone fuzzy query instead.\n",
      "properties": {
        "match_phrase": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "analyzer": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        },
        "fuzziness": {
          "$ref": "#/$defs/Fuzziness"
        }
      },
      "required": [
        "match_phrase"
      ]
    },
    "MatchQuery": {
      "type": "object",
      "description": "Analyze the text with the field's analyzer and match any of the\nresulting terms. On a `substring` companion field (`fieldName._substring`)\nthe text is lowercased and matched as a contained substring instead:\n`{\"match\": \"g3we\", \"field\": \"sku._substring\"}` finds `RAG3-WEAVER`.\nSubstring lookups require at least two bytes and reject a token or\nadjacent token pair longer than 32 bytes.\n",
      "properties": {
        "match": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "analyzer": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "match"
      ]
    },
    "MatchesQuery": {
      "type": "object",
      "additionalProperties": false,
      "description": "Unanchored native Unicode regular expression search on the original logical field value. Anchors refer to each complete value; indexed-term regexp semantics are unchanged.\nNo normalization is applied. Case-sensitive by default; case_sensitive=false\nuses Unicode simple case folding, not locale-specific or multi-character folding.\nMissing, null, and non-string values do not match. Arrays use any-element\nsemantics; a match never spans array elements. Indexes select conservative\ncandidates and original values are verified before counting and pagination.\n",
      "required": [
        "matches",
        "field"
      ],
      "properties": {
        "matches": {
          "type": "string"
        },
        "field": {
          "type": "string",
          "minLength": 1,
          "description": "Logical source field path, not a companion index name."
        },
        "case_sensitive": {
          "type": "boolean",
          "default": true,
          "x-go-type-skip-optional-pointer": false
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "MediaChunkPolicy": {
      "type": "object",
      "description": "Semantic chunk policy. Execution batch size and queue depth are deliberately separate.",
      "properties": {
        "max_text_bytes": {
          "type": "integer",
          "minimum": 4,
          "maximum": 16777216,
          "default": 1048576,
          "description": "Explicit byte ceiling per text chunk, independently of the target tokenizer budget."
        },
        "target_tokens": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000000,
          "default": 500
        },
        "overlap_tokens": {
          "x-go-type-skip-optional-pointer": false,
          "type": "integer",
          "minimum": 0,
          "default": 50
        },
        "window_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "default": 32000000000
        },
        "overlap_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "default": 0
        },
        "step_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "default": 1000000000
        },
        "video_hold": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1,
          "default": 1,
          "x-go-type-skip-optional-pointer": false,
          "description": "Select the displayed picture at each video cadence target, including VFR holds. Zero retains at-or-after timestamp sampling."
        },
        "max_frames": {
          "type": "integer",
          "minimum": 1,
          "maximum": 32,
          "default": 32
        },
        "tile_width": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "tile_height": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "tile_overlap": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "audio_speaker_turns": {
          "type": "boolean",
          "default": false,
          "description": "Split audio chunks at detected speaker transitions, additionally respecting the boundary model limits. Requires a diarization-enabled boundary target, zero overlap_ns and zero audio_pause_ns. The boundary diarization recipe participates in plan identity. Analysis runs even with execute=false because these boundaries depend on audio inference."
        },
        "audio_pause_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "default": 0,
          "description": "Optional minimum silence duration for choosing an earlier boundary; no samples are discarded."
        },
        "audio_pause_search_ns": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "default": 5000000000
        },
        "audio_silence_milli": {
          "x-go-type-skip-optional-pointer": false,
          "type": "integer",
          "minimum": 0,
          "maximum": 1000,
          "default": 10,
          "description": "Absolute normalized PCM amplitude threshold in thousandths."
        }
      }
    },
    "MultiMatchBody": {
      "type": "object",
      "properties": {
        "query": {
          "type": "string"
        },
        "fields": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1
        },
        "type": {
          "type": "string",
          "enum": [
            "bool_prefix"
          ]
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "query",
        "fields",
        "type"
      ]
    },
    "MultiMatchQuery": {
      "type": "object",
      "properties": {
        "multi_match": {
          "$ref": "#/$defs/MultiMatchBody"
        }
      },
      "required": [
        "multi_match"
      ]
    },
    "MultiPhraseQuery": {
      "type": "object",
      "properties": {
        "terms": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        },
        "fuzziness": {
          "$ref": "#/$defs/Fuzziness"
        }
      },
      "required": [
        "terms"
      ]
    },
    "NumericRangeQuery": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "min": {
          "type": [
            "number",
            "null"
          ],
          "format": "double",
          "x-go-type-skip-optional-pointer": false
        },
        "max": {
          "type": [
            "number",
            "null"
          ],
          "format": "double",
          "x-go-type-skip-optional-pointer": false
        },
        "inclusive_min": {
          "type": [
            "boolean",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "inclusive_max": {
          "type": [
            "boolean",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "OllamaGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the Ollama generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "ollama"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the Ollama model to use."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the Ollama API endpoint."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        },
        "timeout": {
          "type": "integer",
          "description": "HTTP response timeout in seconds for Ollama API calls.",
          "minimum": 1
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "OpenAIGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the OpenAI generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "openai"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the OpenAI model to use.",
          "default": "gpt-4.1"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the OpenAI API endpoint."
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The OpenAI API key."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate."
        },
        "max_completion_tokens": {
          "type": "integer",
          "minimum": 1,
          "description": "OpenAI completion budget, including visible output and reasoning tokens.\nUse for reasoning models instead of max_tokens; the two are mutually exclusive.\n"
        },
        "reasoning_effort": {
          "$ref": "#/$defs/OpenAIReasoningEffort",
          "description": "Optional reasoning effort. Supported values depend on the selected OpenAI model."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter.",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "frequency_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token frequency (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        },
        "presence_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token presence (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "OpenAIReasoningEffort": {
      "type": "string",
      "enum": [
        "none",
        "minimal",
        "low",
        "medium",
        "high",
        "xhigh",
        "max"
      ],
      "description": "OpenAI reasoning effort; model support varies. Omit to use the model default."
    },
    "OpenRouterGeneratorConfig": {
      "type": "object",
      "description": "Configuration for the OpenRouter generative AI provider.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "openrouter"
          ]
        },
        "model": {
          "type": "string",
          "description": "The OpenRouter model identifier to use."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the OpenRouter API endpoint.",
          "default": "https://openrouter.ai/api/v1"
        },
        "api_key": {
          "type": "string",
          "writeOnly": true,
          "description": "The OpenRouter API key."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate in the response."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "frequency_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token frequency (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        },
        "presence_penalty": {
          "type": "number",
          "format": "float",
          "description": "Penalty for token presence (-2.0 to 2.0).",
          "minimum": -2.0,
          "maximum": 2.0
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "PhraseQuery": {
      "type": "object",
      "properties": {
        "terms": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        },
        "fuzziness": {
          "$ref": "#/$defs/Fuzziness"
        }
      },
      "required": [
        "terms"
      ]
    },
    "PrefixQuery": {
      "type": "object",
      "description": "Match terms that start with the given bytes. On a `substring`\ncompanion field the prefix is lowercased and matched as a contained\nsubstring, exactly like `match` on that field.\n",
      "properties": {
        "case_insensitive": {
          "type": "boolean",
          "default": false,
          "description": "Fold ASCII letter case when matching indexed terms, without stemming the pattern."
        },
        "prefix": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "prefix"
      ]
    },
    "PriorArtifactContext": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact",
        "render"
      ],
      "properties": {
        "artifact": {
          "type": "string",
          "minLength": 1,
          "description": "Artifact providing earlier items, including this producer's own artifact."
        },
        "render": {
          "type": "string",
          "minLength": 1,
          "description": "Template rendered for each prior item, newest first."
        },
        "max_items": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256,
          "default": 40
        },
        "max_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1048576,
          "default": 16384
        },
        "horizon_segments": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128,
          "default": 8,
          "description": "Earlier segments available for context and the maximum later segments invalidated at each affected position of an original source change. A move invalidates the old and new neighborhoods independently; recomputed outputs never extend either interval."
        }
      }
    },
    "Query": {
      "oneOf": [
        {
          "$ref": "#/$defs/EqualsQuery"
        },
        {
          "$ref": "#/$defs/ContainsQuery"
        },
        {
          "$ref": "#/$defs/MatchesQuery"
        },
        {
          "$ref": "#/$defs/AutocompleteQuery"
        },
        {
          "$ref": "#/$defs/TermQuery"
        },
        {
          "$ref": "#/$defs/MatchQuery"
        },
        {
          "$ref": "#/$defs/MultiMatchQuery"
        },
        {
          "$ref": "#/$defs/MatchPhraseQuery"
        },
        {
          "$ref": "#/$defs/PhraseQuery"
        },
        {
          "$ref": "#/$defs/MultiPhraseQuery"
        },
        {
          "$ref": "#/$defs/FuzzyQuery"
        },
        {
          "$ref": "#/$defs/PrefixQuery"
        },
        {
          "$ref": "#/$defs/RegexpQuery"
        },
        {
          "$ref": "#/$defs/WildcardQuery"
        },
        {
          "$ref": "#/$defs/QueryStringQuery"
        },
        {
          "$ref": "#/$defs/NumericRangeQuery"
        },
        {
          "$ref": "#/$defs/TermRangeQuery"
        },
        {
          "$ref": "#/$defs/DateRangeStringQuery"
        },
        {
          "$ref": "#/$defs/BoolQuery"
        },
        {
          "$ref": "#/$defs/BooleanQuery"
        },
        {
          "$ref": "#/$defs/ConjunctionQuery"
        },
        {
          "$ref": "#/$defs/DisjunctionQuery"
        },
        {
          "$ref": "#/$defs/MatchAllQuery"
        },
        {
          "$ref": "#/$defs/MatchNoneQuery"
        },
        {
          "$ref": "#/$defs/DocIdQuery"
        },
        {
          "$ref": "#/$defs/BoolFieldQuery"
        },
        {
          "$ref": "#/$defs/IPRangeQuery"
        },
        {
          "$ref": "#/$defs/GeoBoundingBoxQuery"
        },
        {
          "$ref": "#/$defs/GeoDistanceQuery"
        },
        {
          "$ref": "#/$defs/GeoBoundingPolygonQuery"
        },
        {
          "$ref": "#/$defs/GeoShapeQuery"
        }
      ]
    },
    "QueryStringQuery": {
      "type": "object",
      "properties": {
        "query": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "query"
      ]
    },
    "RateLimitConfig": {
      "type": "object",
      "x-go-type-skip-optional-pointer": false,
      "additionalProperties": false,
      "description": "Outbound provider limits shared within one Antfly process by effective\nendpoint, operation, model, credential source, project and region/location.\nConflicting policies for an active scope are rejected. These limits do\nnot coordinate across replicas or infer the provider's account quota.\n",
      "properties": {
        "pacing": {
          "$ref": "#/$defs/RequestPacing",
          "description": "Request pacing mode. Defaults to token_bucket. Legacy flat embedder RPM with burst=1 uses completion pacing."
        },
        "requests_per_minute": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "maximum": 4294967295
        },
        "burst": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "maximum": 4294967295,
          "default": 1
        },
        "tokens_per_minute": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "description": "Conservative text budget: each HTTP attempt reserves its serialized\nUTF-8 body byte count plus the configured generation output cap.\nReservations are not refunded. A request larger than this budget\nis rejected. This is not provider billing token accounting; media\nrequests are not supported with this limit.\n"
        },
        "max_concurrency": {
          "type": "integer",
          "format": "int64",
          "minimum": 1,
          "maximum": 4294967295,
          "description": "Maximum in-flight HTTP attempts, held through response completion."
        }
      }
    },
    "RawQuery": {
      "oneOf": [
        {
          "$ref": "#/$defs/Query"
        }
      ],
      "x-go-type": "json.RawMessage",
      "x-zig-type": "raw_json",
      "description": "An Antfly query expression retained as syntactically validated JSON and compiled by the query engine."
    },
    "RegexpQuery": {
      "type": "object",
      "description": "Match post-analysis indexed terms. Patterns are not stemmed; use match for analyzed natural-language input.",
      "properties": {
        "case_insensitive": {
          "type": "boolean",
          "default": false,
          "description": "Fold ASCII letter case when matching indexed terms, without stemming the pattern."
        },
        "regexp": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "regexp"
      ]
    },
    "RelationalCheckConstraint": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name"
      ],
      "description": "A typed CHECK. Supply either expression or column and op (with optional\nvalue and collation), never both forms. Expressions must return boolean\nand use the shared bounded immutable scalar expression vocabulary.\nNew writes are checked from schema publication;\nexisting rows are validated separately. SQL UNKNOWN satisfies CHECK.\nComparison values must match the column type. Integer values may also\nuse exact decimal strings to avoid client-side floating-point rounding.\n",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "column": {
          "type": "string",
          "minLength": 1
        },
        "op": {
          "$ref": "#/$defs/RelationalComparisonOp"
        },
        "value": {
          "description": "Scalar comparison operand. Omission represents NULL. Null tests require a NULL operand."
        },
        "collation": {
          "type": "string",
          "description": "String comparison collation; uses the same rules as ordered indexes."
        },
        "expression": {
          "$ref": "#/$defs/RelationalScalarExpression"
        }
      }
    },
    "RelationalColumnExpression": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "column",
        "expression"
      ],
      "properties": {
        "column": {
          "type": "string",
          "minLength": 1
        },
        "expression": {
          "$ref": "#/$defs/RelationalScalarExpression"
        }
      }
    },
    "RelationalComparisonOp": {
      "type": "string",
      "enum": [
        "is_null",
        "is_not_null",
        "eq",
        "ne",
        "gt",
        "gte",
        "lt",
        "lte",
        "is_distinct",
        "is_not_distinct"
      ]
    },
    "RelationalExpressionOp": {
      "type": "string",
      "enum": [
        "literal",
        "column",
        "add",
        "subtract",
        "multiply",
        "divide",
        "negate",
        "concat",
        "coalesce",
        "lower_ascii",
        "upper_ascii",
        "eq",
        "ne",
        "gt",
        "gte",
        "lt",
        "lte",
        "is_null",
        "is_not_null",
        "is_distinct",
        "is_not_distinct",
        "and",
        "or",
        "not",
        "cast",
        "case_when",
        "modulo",
        "in_list",
        "not_in_list",
        "array"
      ]
    },
    "RelationalExpressionType": {
      "type": "string",
      "enum": [
        "string",
        "blob",
        "boolean",
        "datetime",
        "integer",
        "number",
        "numeric",
        "sql_array"
      ]
    },
    "RelationalForeignKeyConstraint": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "child_columns",
        "parent_table",
        "parent_columns"
      ],
      "description": "Composite foreign key. Child and parent columns correspond by position\nand must have the same physical comparison types. The parent columns\nmust identify a unique key. Existing-row validation is independent of\nnew-write enforcement and is never client-writable.\nEnforcement and referential actions share the bounded distributed\ntransaction path, including TTL expiry. Partial matching uses ordered\nsupport indexes on the parent; activation waits until these are ready.\nSET NULL requires every child column to accept explicit NULL.\n",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "child_columns": {
          "type": "array",
          "minItems": 1,
          "maxItems": 32,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "parent_table": {
          "type": "string",
          "minLength": 1,
          "description": "Literal parent table name in the child table's database and namespace.\nResolved to an immutable table identity when the constraint is declared;\nrenaming a parent preserves the reference. Public schemas show its current name.\n"
        },
        "parent_columns": {
          "type": "array",
          "minItems": 1,
          "maxItems": 32,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "on_delete": {
          "$ref": "#/$defs/ForeignKeyAction"
        },
        "on_update": {
          "$ref": "#/$defs/ForeignKeyAction"
        },
        "timing": {
          "$ref": "#/$defs/ForeignKeyTiming"
        },
        "match": {
          "$ref": "#/$defs/ForeignKeyMatch"
        },
        "deferrable": {
          "type": "boolean"
        }
      }
    },
    "RelationalIndexConfig": {
      "type": "object",
      "required": [
        "keys"
      ],
      "description": "Schema-bound composite ordered index on a relational table. Keys use stable typed comparison semantics and independent direction, null placement, and string collation. Existing rows build asynchronously; indexed queries require complete owner coverage. The table schema is the single durable authority for these definitions.\n",
      "properties": {
        "keys": {
          "type": "array",
          "minItems": 1,
          "maxItems": 32,
          "items": {
            "$ref": "#/$defs/RelationalIndexKey"
          }
        },
        "include_columns": {
          "type": "array",
          "maxItems": 256,
          "uniqueItems": true,
          "description": "Non-key columns stored for index-only projection; distinct from keys.",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "where": {
          "type": "array",
          "maxItems": 256,
          "description": "Optional conjunction selecting index members. Queries must explicitly include all typed conjuncts.",
          "items": {
            "$ref": "#/$defs/RelationalIndexPredicate"
          }
        }
      }
    },
    "RelationalIndexDefinition": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "keys"
      ],
      "description": "Declarative table-owned ordered index. Keys are compared lexicographically\nin the declared order, with independent direction, null placement, and\nstring collation. Creation builds existing rows asynchronously; queries\nmust wait for range-local coverage. Unique constraints and expression\nkeys are not implied by this object. Optional WHERE conjuncts select\nonly matching rows. INCLUDE columns\nstore typed values alongside keys for index-only projected reads.\n",
      "properties": {
        "description": {
          "type": "string",
          "description": "Optional human-readable description, also exposed by the shared indexes API."
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "keys": {
          "type": "array",
          "minItems": 1,
          "maxItems": 32,
          "items": {
            "$ref": "#/$defs/RelationalIndexKey"
          }
        },
        "include_columns": {
          "type": "array",
          "maxItems": 256,
          "uniqueItems": true,
          "description": "Non-key columns stored in the index; must be distinct from key columns.",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "where": {
          "type": "array",
          "maxItems": 256,
          "description": "Conjunction of typed predicates. Indexed queries must explicitly contain every conjunct with equivalent typed comparison semantics.",
          "items": {
            "$ref": "#/$defs/RelationalIndexPredicate"
          }
        }
      }
    },
    "RelationalIndexKey": {
      "type": "object",
      "additionalProperties": false,
      "description": "Ordered component of a relational ordered-tuple index key. Supply\neither a declared column or a deterministic typed scalar expression\nwith its result_type. Composite keys may mix both forms. Bounds use\nthe expression result type, not its input columns.\n",
      "properties": {
        "column": {
          "type": "string",
          "minLength": 1,
          "description": "Declared relational column used by this key component."
        },
        "expression": {
          "$ref": "#/$defs/RelationalScalarExpression"
        },
        "result_type": {
          "$ref": "#/$defs/RelationalExpressionType"
        },
        "collation": {
          "type": "string",
          "minLength": 1,
          "description": "String-key collation. Omission selects binary ordering. Supported\nbinary aliases are C, POSIX, and binary. The aliases ci,\ncase_insensitive, and antfly.case_insensitive select ASCII-only\ncase folding, not locale-aware or Unicode case folding.\n"
        },
        "direction": {
          "$ref": "#/$defs/RelationalIndexKeyDirection"
        },
        "nulls": {
          "$ref": "#/$defs/RelationalIndexKeyNulls"
        }
      }
    },
    "RelationalIndexKeyDirection": {
      "type": "string",
      "enum": [
        "asc",
        "desc"
      ],
      "description": "Direction of one ordered index key component. Omission selects asc."
    },
    "RelationalIndexKeyNulls": {
      "type": "string",
      "enum": [
        "default",
        "first",
        "last"
      ],
      "description": "Null placement for one ordered index key component. The default is\nlast for ascending keys and first for descending keys. Omission selects default.\n"
    },
    "RelationalIndexPredicate": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "column",
        "op"
      ],
      "description": "A typed partial-index conjunct. Only TRUE is indexed; FALSE and SQL UNKNOWN are excluded.",
      "properties": {
        "column": {
          "type": "string",
          "minLength": 1
        },
        "op": {
          "$ref": "#/$defs/RelationalComparisonOp"
        },
        "value": {
          "description": "Typed scalar operand; integer columns also accept exact decimal strings. Omission means NULL."
        },
        "collation": {
          "type": "string",
          "description": "String comparison collation with the same semantics as ordered keys."
        }
      }
    },
    "RelationalScalarExpression": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "op"
      ],
      "description": "Immutable typed scalar expression, limited to 128 nodes and 16 levels.\nA literal requires type; omitted value means typed null. A column\nrequires column; other\noperations require args. Unknown or irrelevant fields are rejected.\nArithmetic operands have the same integer or number type. Integer\ndivision truncates toward zero. Overflow and division by zero reject\nthe write. Arithmetic and string operations propagate null. ASCII case\noperations leave non-ASCII bytes unchanged. No volatile functions are\naccepted. Allocated results are bounded to 1 MiB each. Allocations\nand byte-comparison operand work share a 4 MiB evaluation budget per\nrow and expression set. An integer literal may use a decimal string\nfor exact int64 transport; blob uses base64 and datetime uses the\nnormal relational datetime representation.\nComparisons require operands of compatible types (integer and number may mix) and return boolean or\nSQL UNKNOWN (null); is_distinct and is_not_distinct always return a\nboolean. Unary is_null and is_not_null test presence/null. AND and OR\nevaluate left to right with SQL three-valued short-circuit semantics;\nNOT preserves UNKNOWN. CHECK accepts TRUE and UNKNOWN, rejecting FALSE.\nNumeric literals and arithmetic operations may specify sql_type to\nretain PostgreSQL builtin overflow and float4 rounding semantics.\nWithout it, integer and number operations retain int64 and float64\nsemantics. Numeric cast requires type and sql_type, takes one numeric\nargument, and performs a checked conversion when evaluated (not when\nthe schema is compiled). Floating-to-integer casts round ties to even.\nThe numeric expression type uses exact PostgreSQL NUMERIC values and\nmay specify sql_type numeric. Its literals accept decimal strings or\nexact JSON numeric lexemes, including string-valued special values.\nExact NUMERIC programs require reader capability version 21 even when\ntheir result is boolean or integer. Float/integer assignment casts keep\ntheir declared PostgreSQL rounding and overflow semantics.\nA cast to numeric may specify numeric_modifier for PostgreSQL precision\nand signed-scale coercion. Overflow is checked when the selected cast\nexecutes; unselected lazy branches do not fail. Modifier-bearing programs\nrequire reader capability version 23 even with integer/boolean output.\nThe sql_array expression type requires sql_type on literals, including\ntyped NULL, to declare the element builtin. Non-null literals use the\nordinal SQL array envelope (dimensions with length/lower_bound, values,\nand sql_nulls), retaining shape and lower bounds. Array columns derive\ntheir exact element identity from the immutable schema. Comparisons,\nIN, COALESCE and CASE require matching array element identities; no\nelement type is inferred from values. Array-dependent programs require\nreader capability version 24 even with scalar output. Assignment to a\nNUMERIC array column applies its precision/signed-scale modifier to\neach element. Array casts require type sql_array and an explicit matching\nsql_type; identity casts borrow the immutable input. Casts of numeric\narrays may additionally specify numeric_modifier, coercing each non-NULL\nelement with PostgreSQL precision and signed-scale semantics while\npreserving dimensions, lower bounds and NULL slots. Coercion is lazy\nand shares invocation admission with the surrounding expression.\nArray-valued ordered index keys and element-changing array casts are\nnot supported by this expression contract.\nThe array constructor requires sql_type and zero to 32 arguments.\nConstructor programs additionally require reader capability version 25,\nincluding constructors hidden inside scalar/boolean expressions.\nScalar arguments must have the declared element domain, with explicit\nwidth-preserving numeric casts where needed. SQL NULL arguments become\nNULL elements. Array arguments must all have matching element types,\ndimensions and lower bounds; one leading dimension with lower bound 1\nis added. All empty/NULL subarrays produce an empty array; mixing an\nempty/NULL subarray with a nonempty one is a dimension mismatch. Child\nexpressions execute once, with shared work/cancellation and byte limits.\ncase_when takes alternating boolean conditions and result expressions,\nfollowed by a mandatory fallback result (3 to 31 arguments, at most\n15 branches). Conditions are evaluated in order; only the selected\nresult is evaluated, and a NULL condition is not TRUE. All result\nexpressions must have the same physical type. Numeric SQL lowering\nrecords builtin result-domain promotions as explicit casts. This\noperation requires schema capability version 18.\nmodulo takes two same-domain integer or NUMERIC operands and returns the signed\nremainder (minInt modulo -1 is zero); a zero divisor rejects the write.\nin_list and not_in_list take one probe followed by 1 to 127 same-domain\ncandidates. The probe is evaluated once; NULL probes return UNKNOWN.\nA matching candidate wins over NULL candidates; otherwise a NULL\ncandidate makes the result UNKNOWN. These operations require schema\ncapability version 19.\n",
      "properties": {
        "op": {
          "$ref": "#/$defs/RelationalExpressionOp"
        },
        "type": {
          "$ref": "#/$defs/RelationalExpressionType"
        },
        "sql_type": {
          "$ref": "#/$defs/SQLBuiltinType",
          "description": "Numeric builtin result identity on numeric literals, arithmetic, negate, and cast (capability version 18), or required array element identity on sql_array literals including typed NULL (capability version 24)."
        },
        "numeric_modifier": {
          "$ref": "#/$defs/SQLNumericModifier",
          "description": "Optional precision/signed-scale coercion; accepted only on cast with type numeric and sql_type numeric. Requires reader capability version 23."
        },
        "value": {
          "description": "Typed literal value, including null."
        },
        "column": {
          "type": "string",
          "minLength": 1
        },
        "collation": {
          "type": "string",
          "description": "Optional binary or ASCII case-insensitive collation for string comparisons and in_list; aliases match ordered indexes."
        },
        "args": {
          "type": "array",
          "maxItems": 128,
          "items": {
            "$ref": "#/$defs/RelationalScalarExpression"
          }
        }
      }
    },
    "RelationalUniqueConstraint": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name"
      ],
      "description": "A named, ordered composite unique key. Validation status is maintained\nby the server. TTL expiry uses the distributed integrity coordinator.\nReferenced unique keys are nondeferrable.\n",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "origin": {
          "$ref": "#/$defs/RelationalUniqueConstraintOrigin"
        },
        "primary": {
          "type": "boolean",
          "description": "SQL primary-key identity. At most one per relational table; all key columns must be required and nonnullable."
        },
        "columns": {
          "type": "array",
          "minItems": 1,
          "maxItems": 32,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "keys": {
          "type": "array",
          "minItems": 1,
          "maxItems": 32,
          "description": "Typed native unique keys. Specify either columns or keys.",
          "items": {
            "$ref": "#/$defs/RelationalIndexKey"
          }
        },
        "where": {
          "type": "array",
          "maxItems": 256,
          "description": "Conjunction restricting uniqueness to matching rows.",
          "items": {
            "$ref": "#/$defs/RelationalIndexPredicate"
          }
        },
        "nulls_not_distinct": {
          "type": "boolean",
          "description": "When true, NULL components compare equal for uniqueness."
        },
        "deferrable": {
          "type": "boolean",
          "description": "Permit uniqueness checks at transaction commit. Never eligible as an ON CONFLICT arbiter or a referenced foreign key target."
        },
        "timing": {
          "$ref": "#/$defs/ForeignKeyTiming"
        }
      }
    },
    "RelationalUniqueConstraintOrigin": {
      "type": "string",
      "enum": [
        "constraint",
        "index"
      ],
      "default": "constraint",
      "description": "Durable ownership kind. Index-owned uniqueness participates in ON CONFLICT inference but is not a named SQL constraint. Human-readable index descriptions never determine ownership."
    },
    "ReplicationRoute": {
      "type": "object",
      "required": [
        "target_table"
      ],
      "properties": {
        "target_table": {
          "type": "string",
          "description": "Name of the Antfly table to write matching rows to. The table must\nalready exist.\n"
        },
        "where": {
          "$ref": "#/$defs/RawQuery",
          "description": "Antfly's native filter query (see `RawQuery`) evaluated against each CDC row. Only rows\nmatching this filter are written to `target_table`. If omitted,\nall rows match (equivalent to `match_all`).\n"
        },
        "key_template": {
          "type": "string",
          "description": "Override the source-level `key_template` for this route. If omitted,\nthe source-level template is used.\n"
        },
        "on_update": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReplicationTransformOp"
          },
          "description": "Transform operations for INSERT/UPDATE events on this route. If omitted,\nauto-generates `$set` for every column (passthrough mode).\n"
        },
        "on_delete": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReplicationTransformOp"
          },
          "description": "Transform operations for DELETE events on this route. If omitted,\nauto-derives from this route's `on_update` paths.\n"
        }
      }
    },
    "ReplicationSource": {
      "type": "object",
      "required": [
        "type",
        "dsn",
        "postgres_table"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of the replication source. Currently only \"postgres\" is supported.\n",
          "enum": [
            "postgres"
          ]
        },
        "dsn": {
          "type": "string",
          "description": "Data source name (connection string) for the PostgreSQL database.\nSupports `${secret:key_name}` references that resolve from the Antfly secret store\nor environment variables. Requires `wal_level=logical` on the source.\n"
        },
        "postgres_table": {
          "type": "string",
          "description": "Name of the table in the PostgreSQL database to replicate from.\n"
        },
        "key_template": {
          "type": "string",
          "default": "_id",
          "description": "Template for constructing the Antfly document key from PG columns.\nWhen omitted, Antfly first uses `_id`, then falls back to `id` if\nthe row has no `_id` column.\nA plain string (e.g., \"id\") uses that column's value directly.\nUse `{{column}}` syntax for composite keys: `{{tenant_id}}:{{user_id}}`.\n"
        },
        "slot_name": {
          "type": "string",
          "description": "PostgreSQL replication slot name. If omitted, auto-derived from\nthe Antfly table and PG table names. Specify this when using\npre-created slots (e.g., on Supabase or Neon).\n"
        },
        "publication_name": {
          "type": "string",
          "description": "PostgreSQL publication name. If omitted, auto-derived and created\nautomatically. Specify this when using pre-created publications.\n"
        },
        "on_update": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReplicationTransformOp"
          },
          "description": "Transform operations applied on INSERT/UPDATE events. Values can\nreference PG columns via `{{column}}` syntax. If omitted, auto-generates\n`$set` for every column (passthrough mode).\n"
        },
        "on_delete": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReplicationTransformOp"
          },
          "description": "Transform operations applied on DELETE events. If omitted, auto-derives\n`$unset` ops from `on_update`'s `$set` paths (safe for multi-source).\nUse `$delete_document` op to delete the entire Antfly document.\n"
        },
        "publication_filter": {
          "$ref": "#/$defs/RawQuery",
          "description": "Antfly's native filter query (see `RawQuery`) that gets translated to SQL and\napplied as a WHERE clause on the PostgreSQL publication. This filters rows at the\nsource before they are sent over the replication stream, reducing\nnetwork and processing overhead.\n\nRequires PostgreSQL 15 or newer and is applied only when Antfly\ncreates the publication. Changing this value does not alter an\nexisting publication; update or recreate that publication directly.\n\nOnly a subset of filter types are supported (term, match, range,\nconjuncts, disjuncts, must_not). The filter is translated to SQL\nwith inlined literal values.\n\nExample: `{\"term\": \"active\", \"field\": \"status\"}` becomes\n`WHERE (\"status\" = 'active')` on the publication.\n"
        },
        "routes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReplicationRoute"
          },
          "description": "Conditional routes for fan-out replication. Each route evaluates its\n`where` filter against every CDC row and, on match, writes to the\nspecified `target_table`. Multiple routes can match the same row.\n\nWhen routes are present, the top-level `on_update`/`on_delete` are\nignored — each route defines its own transforms.\n"
        },
        "require_exact_cutover": {
          "type": "boolean",
          "description": "When true, indicates this source was reseeded with exact cutover mode\nand must replay from a consistent snapshot before streaming.\n"
        },
        "status": {
          "$ref": "#/$defs/ReplicationSourceStatus"
        },
        "action_hint": {
          "$ref": "#/$defs/ReplicationSourceActionHint"
        }
      }
    },
    "ReplicationSourceActionHint": {
      "type": "object",
      "readOnly": true,
      "description": "Action hint for this replication source when remediation is recommended.\nPresent only in GET table detail responses.\n",
      "properties": {
        "action": {
          "type": "string",
          "description": "Recommended action (e.g., \"reseed_exact_cutover\")."
        },
        "reason": {
          "type": "string",
          "description": "Human-readable reason for the recommendation."
        },
        "reseed_exact_cutover_path": {
          "type": "string",
          "description": "API path to trigger a reseed exact cutover, if applicable."
        }
      }
    },
    "ReplicationSourceStatus": {
      "type": "object",
      "readOnly": true,
      "description": "Runtime status of this replication source. Present only in GET table\ndetail responses, not in create/update requests.\n",
      "properties": {
        "source_kind": {
          "type": "string"
        },
        "external_table": {
          "type": "string"
        },
        "cutover_mode": {
          "type": "string"
        },
        "slot_name": {
          "type": "string"
        },
        "publication_name": {
          "type": "string"
        },
        "phase": {
          "type": "string"
        },
        "checkpoint": {
          "type": "string"
        },
        "snapshot_offset": {
          "type": "integer"
        },
        "prepared_checkpoint": {
          "type": "string"
        },
        "stream_checkpoint": {
          "type": "string"
        },
        "last_error": {
          "type": "string"
        },
        "failure_class": {
          "type": "string"
        },
        "lag_records": {
          "type": "integer"
        },
        "lag_millis": {
          "type": "integer"
        },
        "consecutive_failures": {
          "type": "integer"
        },
        "last_source_commit_at_ms": {
          "type": "integer"
        },
        "last_success_at_ms": {
          "type": "integer"
        },
        "last_change_applied_at_ms": {
          "type": "integer"
        },
        "updated_at_ms": {
          "type": "integer"
        }
      }
    },
    "ReplicationTransformOp": {
      "type": "object",
      "required": [
        "op"
      ],
      "properties": {
        "op": {
          "type": "string",
          "description": "Transform operation. Supported ops: `$set`, `$setOnInsert`, `$unset`, `$inc`, `$push`, `$pull`, `$addToSet`, `$min`, `$max`.\nReplication-specific: `$merge` (flatten JSONB into top-level fields),\n`$delete_document` (delete entire Antfly doc, `on_delete` only).\n"
        },
        "path": {
          "type": "string",
          "description": "Antfly document field path. Required for `$set`, `$unset`, etc."
        },
        "value": {
          "description": "Value for the operation. Can be a literal (string, number, boolean)\nor a `{{column}}` reference to a PG column value. Use `{{col.key}}` to\nnavigate into decoded JSONB columns.\n"
        }
      }
    },
    "RequestPacing": {
      "type": "string",
      "enum": [
        "token_bucket",
        "completion"
      ],
      "description": "token_bucket limits admission rate while allowing overlapping attempts.\ncompletion serializes attempts and waits one RPM interval after each\nattempt finishes, including streamed writes and transport failures.\nThis prevents delayed connection setup from compressing successful\nrequest spacing, at the cost of response latency plus one interval per\nrequest. Requires requests_per_minute and burst=1. Neither mode can\nguarantee zero upstream 429s or coordinate other processes.\n"
    },
    "SQLArrayColumnSchema": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "type",
        "x-antfly-sql-type"
      ],
      "description": "JSON Schema property declaration for one typed SQL-array column in a\nrelational table. Use it as a root property of DocumentSchema.schema.\nThe element identity is mandatory; a JSON Schema `array` remains a JSON\ncolumn and is never inferred to be a SQL array. Column values use the\nlossless SQLArrayValue envelope: dimensions with lower bounds, flat\nrow-major values and explicit SQL NULL flags. Integer elements are\ndecimal strings, even when small. JSONB null and SQL NULL are distinct.\nFloat elements acquire their declared width before validation and\nstorage. Outer null represents a SQL NULL array when nullable is true.\nAdditional JSON Schema constraints apply to this envelope, not to\nPostgreSQL array subscripts. SQL array index keys and SQL DDL activation\nare not implied by accepting this storage schema.\n",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "sql_array"
          ]
        },
        "x-antfly-sql-type": {
          "$ref": "#/$defs/SQLArrayElementType"
        },
        "x-antfly-sql-numeric-modifier": {
          "$ref": "#/$defs/SQLNumericModifier",
          "x-go-type-skip-optional-pointer": false,
          "description": "Accepted only with numeric element identity. Applies assignment coercion to each non-NULL element while preserving dimensions and lower bounds. Requires reader capability version 23."
        },
        "nullable": {
          "type": "boolean",
          "default": false
        },
        "description": {
          "type": "string"
        }
      }
    },
    "SQLArrayElementType": {
      "type": "string",
      "description": "Bound SQL scalar or array-element identity, including numeric widths and exact NUMERIC. Never inferred from JSON value shape.",
      "enum": [
        "text",
        "int16",
        "int32",
        "int64",
        "float32",
        "float64",
        "boolean",
        "uuid",
        "jsonb",
        "numeric"
      ]
    },
    "SQLBuiltinType": {
      "type": "string",
      "description": "Exact PostgreSQL builtin identity for a relational root scalar column.\nSQL array columns use SQLArrayElementType for their element identity.\nSet the JSON Schema property's `x-antfly-sql-type` annotation to one of\nthese values. The underlying property type must match. SQL array storage\nis not implied by this annotation. Existing unannotated schemas retain\ntheir original domains.\nThe numeric identity uses an underlying number property and exact\nPostgreSQL NUMERIC semantics, never binary float. Submit finite values\nas JSON numeric lexemes or decimal strings; special values use strings\nNaN, Infinity and -Infinity. Const/enum finite numeric members must be\nJSON numbers, not strings. Bounds and multipleOf are exact decimals.\nPublic scalar NUMERIC schemas require reader capability version 22.\nTo constrain a NUMERIC scalar or SQL-array column, set the root\nproperty's `x-antfly-sql-numeric-modifier` annotation to an object with\nprecision (1..1000) and signed scale (-1000..1000). The annotation\nrequires numeric identity and reader capability version 23. Assignment\nrounds before constraints, indexes and generated dependents; overflow\nrejects the write. Restore verifies stored values without rounding.\n",
      "enum": [
        "text",
        "int16",
        "int32",
        "int64",
        "float32",
        "float64",
        "boolean",
        "uuid",
        "jsonb",
        "numeric"
      ]
    },
    "SQLNumericModifier": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "precision",
        "scale"
      ],
      "description": "PostgreSQL NUMERIC precision and signed scale. For arrays this describes every element, not dimensions. Absent means unconstrained NUMERIC.",
      "properties": {
        "precision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000
        },
        "scale": {
          "type": "integer",
          "minimum": -1000,
          "maximum": 1000
        }
      }
    },
    "ShardConfig": {
      "type": "object",
      "required": [
        "byte_range"
      ],
      "properties": {
        "byte_range": {
          "$ref": "#/$defs/ByteRange"
        }
      }
    },
    "TableMigration": {
      "x-go-type-skip-optional-pointer": false,
      "type": "object",
      "description": "Describes an in-progress schema migration. The table serves reads from read_schema while rebuilding full-text indexes for the new schema.",
      "required": [
        "state",
        "read_schema"
      ],
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "rebuilding"
          ]
        },
        "read_schema": {
          "$ref": "#/$defs/TableSchema"
        }
      }
    },
    "TableSchema": {
      "type": "object",
      "description": "Schema definition for a table with multiple document types",
      "properties": {
        "version": {
          "type": "integer",
          "format": "uint32",
          "readOnly": true,
          "description": "Backend-managed schema generation used for migrations. Omit it from create and update requests."
        },
        "storage_mode": {
          "$ref": "#/$defs/TableStorageMode"
        },
        "base_source": {
          "$ref": "#/$defs/ExternalLakeTableSource",
          "description": "External tables require relational storage mode. Ordinary row writes are read-only; an explicit iceberg_writer catalog binding permits Iceberg file commits. Omit for native tables."
        },
        "column_defaults": {
          "type": "array",
          "maxItems": 256,
          "items": {
            "$ref": "#/$defs/RelationalColumnExpression"
          },
          "description": "Immutable typed expressions applied only to absent columns on new\nwrites, never explicit null. Defaults cannot reference columns.\nA column cannot have both a default and a generated expression.\nOmission or [] declares none. Relational tables only.\n"
        },
        "generated_columns": {
          "type": "array",
          "maxItems": 256,
          "items": {
            "$ref": "#/$defs/RelationalColumnExpression"
          },
          "description": "Stored immutable generated columns, evaluated in dependency order\non writes before validation and indexing. Cycles are rejected.\nGenerated columns are output-only; submitted values are replaced\nby the computed value. Omission or [] declares none. Defaults\nand generated declarations together are limited to 256 columns,\n4096 expression nodes, and 4 MiB of literal data. Evaluation has\na shared 4 MiB allocation budget across all column expressions.\nRestore verifies stored results instead of silently recomputing\nthem. Changing, adding, or removing generated semantics through\nan existing table's schema update requires explicit rewrite=true\non the PUT or PATCH schema route. This returns a durable restore\njob and replaces the complete authorized dependency cohort only\nafter distributed transformation and validation. Ordinary schema\nupdates reject these changes, even when a table appears empty.\nDeclaration reordering and default-only changes remain allowed.\nRelational tables only.\n"
        },
        "checks": {
          "type": "array",
          "maxItems": 256,
          "items": {
            "$ref": "#/$defs/RelationalCheckConstraint"
          },
          "description": "Named scalar CHECK constraints for a relational schema. This is\npart of the complete schema: omission or [] declares no checks.\nNew writes enforce every check. Existing-row validation status is\nmaintained separately and is never accepted from the client.\n"
        },
        "unique_constraints": {
          "type": "array",
          "maxItems": 256,
          "items": {
            "$ref": "#/$defs/RelationalUniqueConstraint"
          },
          "description": "Complete set of composite unique declarations. Omission or [] declares none."
        },
        "foreign_keys": {
          "type": "array",
          "maxItems": 256,
          "items": {
            "$ref": "#/$defs/RelationalForeignKeyConstraint"
          },
          "description": "Complete set of outgoing composite foreign keys. Omission or [] declares none."
        },
        "relational_indexes": {
          "type": "array",
          "x-go-type-skip-optional-pointer": false,
          "maxItems": 4096,
          "items": {
            "$ref": "#/$defs/RelationalIndexDefinition"
          },
          "description": "Desired ordered indexes for a relational table. Names must be unique.\nAn explicit array replaces the declarations; an empty array drops\nthem. Omission preserves existing declarations during schema updates.\nIndex definitions commit atomically with the schema; build progress\nand readiness are local to each owning shard, not client-writable.\n"
        },
        "default_type": {
          "type": "string",
          "description": "Default type to use from the document_schemas."
        },
        "enforce_types": {
          "type": "boolean",
          "description": "Whether to enforce that documents must match one of the provided document types.\nIf false, documents not matching any type will be accepted but not indexed.\n"
        },
        "document_schemas": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/DocumentSchema"
          },
          "description": "A map of type names to their document json schemas."
        },
        "ttl": {
          "allOf": [
            {
              "$ref": "#/$defs/TtlConfig"
            }
          ],
          "description": "Automatic document expiration. Set this object to enable TTL and\nset it to null to disable an existing TTL policy.\n"
        },
        "ttl_field": {
          "type": "string",
          "deprecated": true,
          "description": "Deprecated compatibility alias for `ttl.field`. Cannot be combined with `ttl`.\n"
        },
        "ttl_duration": {
          "type": "string",
          "deprecated": true,
          "description": "Deprecated compatibility alias for `ttl.duration`. Cannot be combined with `ttl`.\n"
        },
        "dynamic_templates": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DynamicTemplate"
          },
          "description": "Rules for mapping dynamically detected fields. When a document contains fields\nthat don't have explicit mappings and dynamic mapping is enabled, templates are\nevaluated in order to determine how those fields should be indexed.\n"
        }
      }
    },
    "TableStorageMode": {
      "type": "string",
      "enum": [
        "document",
        "relational"
      ],
      "description": "Storage representation for the table. Omission selects \"document\".\n\"relational\" stores schema-bound typed rows and requires exactly one\nclosed document schema with declared properties. It implies\nenforce_types; explicitly setting enforce_types to false is invalid.\nExisting JSON document write and read APIs remain available. This\nsetting alone does not declare primary keys or unique constraints.\n"
    },
    "TableStorageSettings": {
      "type": "object",
      "additionalProperties": false,
      "description": "Immutable source embedding ownership. Omit storage when creating a table to select vector_store for a local single-shard standalone table without HA or replication, and primary_lsm for other deployments. Existing tables retain their recorded ownership; changing the creation default does not migrate data. Snapshot/backup and split operations currently reject vector_store tables; explicitly select primary_lsm when these operations are required.",
      "properties": {
        "engine": {
          "type": "string",
          "enum": [
            "local",
            "object"
          ],
          "default": "local",
          "description": "Durable table engine, independent of deployment. local uses the hosting process's local or Lite backend and normal shard placement. object uses external lake data with durable sidecars, or an Antfly-owned object WAL and published generations. Object tables do not allocate data Raft groups; omit num_shards and replication_sources. Metadata remains authoritative for table lifetime. Configure the shared destination through storage.artifacts. Writable object document tables initially require immutable schema and index definitions; changes require a new table and explicit migration."
        },
        "dense_embeddings": {
          "type": "string",
          "enum": [
            "primary_lsm",
            "vector_store"
          ],
          "default": "primary_lsm",
          "description": "Explicit ownership choice. vector_store requires a fresh local single-shard standalone table without HA or replication. An explicit empty storage object keeps primary_lsm; omit the storage object to use the deployment default."
        }
      }
    },
    "TemplateFieldMapping": {
      "type": "object",
      "additionalProperties": false,
      "description": "Field mapping used by a dynamic template. Dynamic templates match one physical field at a time and therefore do not accept multifields; use a DocumentFieldMapping in a document property's `x-antfly-field` annotation when named subfields are required.",
      "properties": {
        "type": {
          "$ref": "#/$defs/FieldMappingType"
        },
        "analyzer": {
          "type": "string",
          "description": "Analyzer name (e.g., \"standard\", \"keyword\", \"en\", \"html_analyzer\").\nUsed for text fields to control tokenization and normalization.\n"
        },
        "index": {
          "type": "boolean",
          "x-go-type-skip-optional-pointer": false,
          "description": "Whether to index the field. Omit to use the server default of true."
        },
        "store": {
          "type": "boolean",
          "default": false,
          "description": "Whether to store the field value (default false)"
        },
        "include_in_all": {
          "type": "boolean",
          "default": false,
          "description": "Whether to include in the _all field for cross-field search"
        },
        "sortable": {
          "type": "boolean",
          "default": false,
          "description": "Whether this exact scalar field can be used in order_by. Supported\nsortable mapping types are keyword, numeric/number/integer,\nboolean/bool, datetime/date/timestamp, and link. Analyzed text,\nsearch_as_you_type, geo, embedding, blob, html, object, and array\nfields are not directly sortable; use an exact scalar subfield such\nas title.keyword for sorted string pagination. When true, Antfly\nderives the internal typed doc-value structures required for exact\nsorting; users should not configure doc_values directly.\n"
        },
        "missing_null_policy": {
          "type": "string",
          "enum": [
            "missing_rejected",
            "nulls_ordered"
          ],
          "default": "missing_rejected",
          "description": "Missing/null sort policy for this mapped field. The default missing_rejected\nrejects missing or null native sort values. Opt in to nulls_ordered\nto sort missing/null values first ascending and last descending,\nwith JSON null in replayable sort cursor tuples. Native sorting\nrequires a complete producer proof for nullable physical layouts.\n"
        }
      }
    },
    "TermQuery": {
      "type": "object",
      "description": "Match an indexed post-analysis term exactly. Use match for analyzed natural-language input.",
      "properties": {
        "case_insensitive": {
          "type": "boolean",
          "default": false,
          "description": "Fold ASCII letter case when matching indexed terms, without stemming the pattern."
        },
        "term": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "term"
      ]
    },
    "TermRangeQuery": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "min": {
          "type": [
            "string",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "max": {
          "type": [
            "string",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "inclusive_min": {
          "type": [
            "boolean",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "inclusive_max": {
          "type": [
            "boolean",
            "null"
          ],
          "x-go-type-skip-optional-pointer": false
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      }
    },
    "TextAnalysisComponent": {
      "type": "object",
      "required": [
        "type"
      ],
      "description": "One named analysis component: its type and type-specific configuration.",
      "properties": {
        "type": {
          "type": "string"
        },
        "config": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "TextAnalysisConfig": {
      "type": "object",
      "description": "Custom text analysis for a full-text index. Component maps are keyed\nby the name that analyzers and `field_analyzers` reference. Built-in\nanalyzers (`standard`, `simple`, `keyword`, `html`, `search_as_you_type`,\n`substring`, and the language analyzers such as `german`) are always\navailable without declaring them.\n\nExample: split camelCase identifiers and match them as substrings.\n\n```json\n{\n  \"analysis_config\": {\n    \"field_analyzers\": {\"symbol\": \"code\"},\n    \"token_filters\": {\n      \"tails\": {\"type\": \"suffix\", \"config\": {\"min\": 3, \"max\": 24}}\n    },\n    \"analyzers\": {\n      \"code\": {\n        \"type\": \"custom\",\n        \"config\": {\n          \"tokenizer\": \"whitespace\",\n          \"token_filters\": [\"camel_case\", \"unique\", \"tails\"]\n        }\n      }\n    }\n  }\n}\n```\n",
      "properties": {
        "field_analyzers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Map of indexed field name to analyzer name. Overrides the analyzer derived from the table schema for that field."
        },
        "char_filters": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named character filters. Types: `html_strip` (alias `html`), `ascii_fold`, `zero_width_non_joiner`."
        },
        "tokenizers": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named tokenizers. Types: `unicode` (alias `unicode_words`), `whitespace`, `keyword`, `character`, `ngram` (`config.min`, `config.max`), `edge_ngram` (`config.min`, `config.max`, `config.side` of `front` or `back`)."
        },
        "token_filters": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named token filters. Types: `lowercase` (alias `to_lower`), `stop_words` (alias `stop`; optional `config.language`), `stemmer` (optional `config.language`), `ngram` and `edge_ngram` (`config.min`, `config.max`), `shingle` (`config.min`, `config.max`, `config.separator` of `space` or `none`), `suffix` (`config.min`, `config.max`; emits every suffix of each token so prefix queries answer containment), `length` (`config.min`, `config.max`), `truncate` (`config.length`), `camel_case`, `unique`, `reverse`, `elision`, `apostrophe`. Languages: english, german, french, spanish, italian, portuguese, dutch, swedish, norwegian, danish, finnish."
        },
        "analyzers": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named analyzers of type `custom`. `config.tokenizer` names a built-in or declared tokenizer; `config.char_filters` and `config.token_filters` list built-in or declared component names in application order. Configuration-free filters (`lowercase`, `stop_words`, `stemmer`, `camel_case`, `unique`, `reverse`, `elision`, `apostrophe`, `suffix`) can be listed by name without declaring them."
        },
        "default_datetime_parser": {
          "type": "string",
          "description": "Name of the date-time parser applied to datetime fields without a field-specific parser."
        },
        "field_date_time_parsers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Map of field name to date-time parser name."
        },
        "date_time_parsers": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/TextAnalysisComponent"
          },
          "description": "Named date-time parsers. Type `sanitizedgo` accepts `config.layouts`, a list of Go reference-time layouts tried in order."
        }
      }
    },
    "TextChunkOptions": {
      "type": "object",
      "description": "Options specific to text chunking.",
      "properties": {
        "target_tokens": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000,
          "description": "Target number of tokens per chunk."
        },
        "overlap_tokens": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000,
          "description": "Number of tokens to overlap between consecutive chunks. Helps maintain context across chunk boundaries. Only used by fixed-size chunkers."
        },
        "separator": {
          "type": "string",
          "description": "Separator string for splitting (e.g., '\\n\\n' for paragraphs). Only used by fixed-size chunkers."
        }
      }
    },
    "TtlConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "duration"
      ],
      "description": "Automatic document-expiration policy for a table.",
      "properties": {
        "duration": {
          "type": "string",
          "description": "Expiration duration using Antfly's integer-component duration format.\nSupported units are `ns`, `us`, `ms`, `s`, `m`, `h`, and `d`;\nexamples include `90m`, `1h30m`, and `7d`.\n"
        },
        "field": {
          "type": "string",
          "default": "_timestamp",
          "minLength": 1,
          "description": "Timestamp field used as the expiration reference."
        }
      }
    },
    "VertexGeneratorConfig": {
      "type": "object",
      "description": "Configuration for Google Cloud Vertex AI generative models.\n",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "vertex"
          ]
        },
        "model": {
          "type": "string",
          "description": "The name of the Vertex AI model to use.",
          "default": "gemini-2.5-flash"
        },
        "project_id": {
          "type": "string",
          "description": "Google Cloud project ID."
        },
        "location": {
          "type": "string",
          "description": "Google Cloud region for Vertex AI API.",
          "default": "us-central1"
        },
        "credentials_path": {
          "type": "string",
          "writeOnly": true,
          "description": "Path to service account JSON key file."
        },
        "temperature": {
          "type": "number",
          "format": "float",
          "description": "Controls randomness in generation (0.0-2.0).",
          "minimum": 0.0,
          "maximum": 2.0
        },
        "max_tokens": {
          "type": "integer",
          "description": "Maximum number of tokens to generate in the response."
        },
        "top_p": {
          "type": "number",
          "format": "float",
          "description": "Nucleus sampling parameter (0.0-1.0).",
          "minimum": 0.0,
          "maximum": 1.0
        },
        "top_k": {
          "type": "integer",
          "description": "Top-k sampling parameter."
        }
      },
      "required": [
        "provider",
        "model"
      ]
    },
    "WildcardQuery": {
      "type": "object",
      "description": "Match post-analysis indexed terms. Patterns are not stemmed; use match for analyzed natural-language input.",
      "properties": {
        "case_insensitive": {
          "type": "boolean",
          "default": false,
          "description": "Fold ASCII letter case when matching indexed terms, without stemming the pattern."
        },
        "wildcard": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "boost": {
          "$ref": "#/$defs/Boost"
        }
      },
      "required": [
        "wildcard"
      ]
    }
  }
}