{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/antfly/json-schema/antfly-index-status-schema.json",
  "title": "IndexStatus",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/antfly-index-management-api-openapi.yml#/components/schemas/IndexStatus",
  "type": "object",
  "required": [
    "config",
    "status",
    "shard_status"
  ],
  "properties": {
    "shard_status": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/IndexStats"
      }
    },
    "config": {
      "$ref": "#/$defs/CreatedIndex"
    },
    "status": {
      "$ref": "#/$defs/IndexStats"
    }
  },
  "$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"
          }
        }
      }
    },
    "AlgebraicIndexStats": {
      "type": "object",
      "description": "Compact public statistics for an algebraic sidecar index. Detailed runtime, adaptive, and materialization records remain internal diagnostics.",
      "required": [
        "index_type"
      ],
      "properties": {
        "index_type": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "enum": [
            "algebraic"
          ],
          "description": "Discriminator for the index stats variant."
        },
        "readiness": {
          "$ref": "#/$defs/IndexReadinessStatus",
          "deprecated": true,
          "description": "Deprecated compatibility projection. Use milestones and revision fields."
        },
        "incarnation": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Opaque identity of the desired index incarnation. Clients may compare it for equality but must not interpret its contents."
        },
        "target_revision": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "published_revision": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "milestones": {
          "$ref": "#/$defs/IndexMilestones"
        },
        "error": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Error message if stats could not be retrieved"
        },
        "total_indexed": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of documents reflected in the algebraic sidecar"
        },
        "disk_usage": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Size of the index in bytes"
        },
        "rebuilding": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "Whether the sidecar is currently rebuilding"
        },
        "repair": {
          "$ref": "#/$defs/IndexRepairStatus"
        },
        "backfill_active": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "Whether the sidecar is actively rebuilding, replaying, or catching up."
        },
        "backfill_progress": {
          "x-go-type-skip-optional-pointer": true,
          "type": "number",
          "format": "double",
          "description": "Backfill progress as a ratio from 0.0 to 1.0"
        },
        "backfill_items_processed": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of documents processed during current backfill"
        },
        "backfill_state": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Operational readiness state such as ready, running, retrying, degraded, or failed."
        },
        "doc_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of documents visible to the sidecar."
        },
        "term_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "replay_applied_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "replay_target_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "replay_catch_up_required": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "runtime_present": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "runtime_fresh": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "runtime_source": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "runtime_freshness": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "catch_up_active": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "catch_up_phase": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "catch_up_applied_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "catch_up_target_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "async_indexing": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true
        },
        "healthy": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "parse_error_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "schema_version": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "capability_lifecycle_status": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Schema-derived algebraic capability lifecycle, for example current, stale, or rebuild_required."
        },
        "planner_selected": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "planner_fallback_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "planner_last_decision": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "enum": [
            "selected",
            "fallback"
          ]
        },
        "planner_last_fallback_reason": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "planner_last_estimated_scan_rows": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Latest algebraic planner scan-row estimate for the last selected or fallback decision."
        },
        "planner_last_estimated_result_buckets": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Latest algebraic planner result-bucket estimate for the last selected or fallback decision."
        },
        "planner_lifecycle_ready": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "planner_lifecycle_blocking_reason": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "adaptive_progress_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "recommendation_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of currently recommended algebraic shapes."
        },
        "adaptive_backfilling_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "adaptive_ready_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "adaptive_stale_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "adaptive_cleanup_recommended_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "last_error_reason": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "active_progress_lifecycle": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "active_progress_rows_processed": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "active_progress_target_rows": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "projection_checkpoint_status": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Durable projection checkpoint status: clean, rebuilding, degraded, or repair_required."
        },
        "projection_checkpoint_applied_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Highest derived-log sequence covered by the durable projection checkpoint."
        },
        "projection_checkpoint_generation": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Projection generation associated with the durable checkpoint."
        },
        "projection_checkpoint_config_fingerprint": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "pattern": "^[0-9a-f]{16}$",
          "description": "Projection configuration identity associated with the durable checkpoint."
        },
        "checkpoint_replay_tail_sequence_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of derived-log sequences after the durable checkpoint that still need replay."
        },
        "repair_scan_issue_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Repair issues found by explicit repair-scan accounting for this projection."
        },
        "edge_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "node_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "repair_degraded": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "repair_issue_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "repair_summary_ready": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "repair_issue_count_estimated": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "expected_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "reported_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "fresh_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "stale_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "missing_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "unknown_remote_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "source_artifact": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true,
          "description": "Source artifact stream used to materialize graph edges."
        },
        "resolver_replay": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true,
          "description": "Graph resolver replay diagnostics."
        },
        "resolution": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true,
          "description": "Artifact resolution replay diagnostics."
        },
        "promotion": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true,
          "description": "Artifact promotion replay diagnostics."
        }
      }
    },
    "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"
      ]
    },
    "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)."
        }
      }
    },
    "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"
      ]
    },
    "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"
      ]
    },
    "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."
    },
    "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"
              ]
            }
          }
        }
      ]
    },
    "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."
    },
    "DenseNativeStoragePhase": {
      "type": "string",
      "enum": [
        "legacy",
        "native_building",
        "native_validating",
        "native_authoritative"
      ],
      "description": "Conservative distributed rollout phase for native WAL-backed dense-index storage. native_authoritative is reported only when every expected shard has supplied current authority evidence."
    },
    "DenseVectorPublicationStatus": {
      "type": "object",
      "additionalProperties": false,
      "description": "Exact dense-vector publication cardinality for the observed index incarnation.",
      "required": [
        "target_vectors",
        "searchable_vectors",
        "complete"
      ],
      "properties": {
        "target_vectors": {
          "type": "integer",
          "format": "uint64",
          "description": "Exact durable vector target for the current dense-index incarnation."
        },
        "searchable_vectors": {
          "type": "integer",
          "format": "uint64",
          "description": "Physical vectors currently visible to queries."
        },
        "complete": {
          "type": "boolean",
          "description": "Whether searchable_vectors exactly equals target_vectors."
        }
      }
    },
    "DerivedCoverageObservationIncompleteReason": {
      "type": "string",
      "enum": [
        "runtime_unavailable",
        "target_observation",
        "missing_group",
        "unknown_group",
        "remote_unknown_group",
        "stale_group",
        "summary_unavailable",
        "config_mismatch",
        "counter_mismatch"
      ],
      "description": "A structured reason why the coverage projection cannot be treated as globally complete."
    },
    "DerivedCoveragePolicy": {
      "type": "string",
      "enum": [
        "strict",
        "partial",
        "best_effort"
      ],
      "default": "strict",
      "description": "How generation-scoped source outcomes determine derived-index completeness."
    },
    "DerivedCoverageStatus": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "policy",
        "observation_complete",
        "observation_incomplete_reasons",
        "config_fingerprint",
        "summary_ready",
        "config_mismatch_group_count",
        "source_total",
        "produced",
        "skipped",
        "terminal_failed",
        "covered",
        "settled",
        "uncovered",
        "pending",
        "complete",
        "healthy",
        "degraded"
      ],
      "properties": {
        "policy": {
          "$ref": "#/$defs/DerivedCoverageStatusPolicy"
        },
        "observation_complete": {
          "type": "boolean",
          "description": "Whether every expected shard contributed a fresh, configuration-compatible observation with valid outcome cardinality."
        },
        "observation_incomplete_reasons": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DerivedCoverageObservationIncompleteReason"
          },
          "description": "Empty when observation_complete is true; otherwise identifies every known reason the projection is incomplete."
        },
        "config_fingerprint": {
          "type": "string",
          "pattern": "^[0-9a-f]{16}$",
          "description": "Versioned semantic configuration fingerprint encoded as fixed-width hexadecimal. Non-semantic execution tuning does not affect it."
        },
        "summary_ready": {
          "type": "boolean",
          "description": "Whether all observed shard-local coverage summaries were read atomically and completely."
        },
        "config_mismatch_group_count": {
          "type": "integer",
          "format": "uint64",
          "description": "Freshly observed shard groups reporting a different semantic configuration fingerprint."
        },
        "source_total": {
          "type": "integer",
          "format": "uint64",
          "description": "Source documents observed across fresh shard reports. This is the exact table total only when observation_complete is true; otherwise it is a lower bound and all outcome counts are partial observations."
        },
        "produced": {
          "type": "integer",
          "format": "uint64",
          "description": "Source documents with a durable produced outcome for this index generation."
        },
        "skipped": {
          "type": "integer",
          "format": "uint64",
          "description": "Source documents intentionally producing no indexable output."
        },
        "terminal_failed": {
          "type": "integer",
          "format": "uint64",
          "description": "Source documents whose generation failed non-retryably."
        },
        "covered": {
          "type": "integer",
          "format": "uint64",
          "description": "Raw terminal source outcomes counted by the configured policy. This may exceed source_total only while observation_complete is false with counter_mismatch."
        },
        "settled": {
          "type": "integer",
          "format": "uint64",
          "description": "Source documents with any durable terminal outcome: produced, intentionally skipped, or terminally failed."
        },
        "uncovered": {
          "x-go-type-skip-optional-pointer": false,
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "description": "Source documents without an outcome accepted by the configured coverage policy. Null when observations are incomplete."
        },
        "pending": {
          "x-go-type-skip-optional-pointer": false,
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "description": "Source documents that have not reached any terminal outcome and may still be processing. Null when observations are incomplete."
        },
        "complete": {
          "type": "boolean",
          "description": "Whether observations are complete, replay has reached its target, and every observed source has an outcome accepted by the policy."
        },
        "healthy": {
          "type": "boolean",
          "description": "Whether coverage is complete without terminal failures."
        },
        "degraded": {
          "type": "boolean",
          "description": "Whether all sources are settled but coverage remains unhealthy under the configured policy, including terminal failures or policy-rejected skips."
        }
      }
    },
    "DerivedCoverageStatusPolicy": {
      "type": "string",
      "enum": [
        "strict",
        "partial",
        "best_effort",
        "external"
      ]
    },
    "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\"."
    },
    "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."
    },
    "EmbeddingIndexActivity": {
      "type": "object",
      "additionalProperties": false,
      "description": "Volatile index-incarnation activity. It explains motion but never participates in readiness.",
      "required": [
        "epoch",
        "phase",
        "chunks_created",
        "embedding_batches_completed",
        "embeddings_computed",
        "active_batch_size",
        "last_progress_at"
      ],
      "properties": {
        "epoch": {
          "type": "string",
          "description": "Opaque worker-and-index-incarnation identity. Rates are valid only between samples with the same epoch."
        },
        "phase": {
          "$ref": "#/$defs/EmbeddingIndexActivityPhase"
        },
        "chunks_created": {
          "type": "integer",
          "format": "uint64",
          "description": "Chunks created for this index during the activity epoch."
        },
        "embedding_batches_completed": {
          "type": "integer",
          "format": "uint64"
        },
        "embeddings_computed": {
          "type": "integer",
          "format": "uint64",
          "description": "Embedding vectors successfully computed for this index during the activity epoch."
        },
        "active_batch_size": {
          "type": "integer",
          "format": "uint64",
          "description": "Items currently submitted to an embedding provider for this index."
        },
        "last_progress_at": {
          "x-go-type-skip-optional-pointer": false,
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Completion time of the latest successful embedding batch, or null before the first batch."
        }
      }
    },
    "EmbeddingIndexActivityPhase": {
      "type": "string",
      "enum": [
        "preparing",
        "embedding",
        "publishing",
        "waiting_retry",
        "idle"
      ]
    },
    "EmbeddingSourceCoverageStatus": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "policy",
        "observation_complete",
        "observation_incomplete_reasons",
        "config_fingerprint",
        "total",
        "pending",
        "covered",
        "skipped",
        "failed",
        "complete",
        "healthy",
        "degraded"
      ],
      "properties": {
        "policy": {
          "$ref": "#/$defs/DerivedCoverageStatusPolicy"
        },
        "observation_complete": {
          "type": "boolean",
          "description": "Whether total and all outcome counts are exact across the expected shards."
        },
        "observation_incomplete_reasons": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DerivedCoverageObservationIncompleteReason"
          }
        },
        "config_fingerprint": {
          "type": "string",
          "pattern": "^[0-9a-f]{16}$",
          "description": "Semantic configuration fingerprint for the observed index incarnation."
        },
        "total": {
          "type": "integer",
          "format": "uint64",
          "description": "Source documents in scope. This is a lower bound when observation_complete is false."
        },
        "pending": {
          "x-go-type-skip-optional-pointer": false,
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "description": "Sources awaiting a terminal generation decision; null when the observation is incomplete."
        },
        "covered": {
          "type": "integer",
          "format": "uint64",
          "description": "Sources that durably produced material for this index incarnation."
        },
        "skipped": {
          "type": "integer",
          "format": "uint64",
          "description": "Sources intentionally producing no material after generation evaluated them."
        },
        "failed": {
          "type": "integer",
          "format": "uint64",
          "description": "Sources whose generation reached a non-retryable failure."
        },
        "complete": {
          "type": "boolean",
          "description": "Whether source outcomes satisfy the configured coverage policy. Replay and publication are reported independently by revisions and milestones."
        },
        "healthy": {
          "type": "boolean"
        },
        "degraded": {
          "type": "boolean"
        }
      }
    },
    "EmbeddingsIndexStats": {
      "type": "object",
      "description": "Statistics for an embeddings index (dense or sparse)",
      "required": [
        "index_type"
      ],
      "properties": {
        "index_type": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "enum": [
            "embeddings"
          ],
          "description": "Discriminator for the index stats variant."
        },
        "readiness": {
          "$ref": "#/$defs/IndexReadinessStatus",
          "deprecated": true,
          "description": "Deprecated compatibility projection. Use milestones and the explicit status dimensions."
        },
        "incarnation": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Opaque identity of the desired index incarnation. Clients may compare it for equality but must not interpret its contents."
        },
        "target_revision": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "published_revision": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "milestones": {
          "$ref": "#/$defs/IndexMilestones"
        },
        "source_coverage": {
          "$ref": "#/$defs/EmbeddingSourceCoverageStatus"
        },
        "searchable_vectors": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Physical vectors or sparse entries visible to queries; chunked indexes may exceed source coverage."
        },
        "publication": {
          "$ref": "#/$defs/DenseVectorPublicationStatus",
          "description": "Dense-only exact publication status; absent for sparse indexes and when the target proof is unavailable."
        },
        "activity": {
          "x-go-type-skip-optional-pointer": false,
          "allOf": [
            {
              "$ref": "#/$defs/EmbeddingIndexActivity"
            }
          ],
          "description": "Fresh owner-reported activity, or null when no heartbeat for this index incarnation is available."
        },
        "error": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Error message if stats could not be retrieved"
        },
        "total_indexed": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of vectors/documents in the index"
        },
        "disk_usage": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Size of the index in bytes"
        },
        "total_nodes": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Total number of nodes in the index (dense only)"
        },
        "total_terms": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of unique terms in the inverted index (sparse only)"
        },
        "rebuilding": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "Whether enrichment, publication, or replay work is still pending. Documents that do not contain the indexed field are terminal skipped outcomes and do not keep this true."
        },
        "repair": {
          "$ref": "#/$defs/IndexRepairStatus"
        },
        "wal_backlog": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of documents pending enrichment in the WAL"
        },
        "backfill_active": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "Whether the index is actively rebuilding, replaying, enriching, or catching up."
        },
        "backfill_progress": {
          "x-go-type-skip-optional-pointer": true,
          "type": "number",
          "format": "double",
          "description": "Fraction of source documents with a terminal materialization outcome, including produced embeddings and intentionally skipped documents. Reaches 1.0 when no source work is pending and replay is current."
        },
        "backfill_items_processed": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Total items processed during backfill"
        },
        "backfill_state": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Operational readiness state. Clients should use ready (or rebuilding=false) for query readiness; replay watermarks diagnose replay progress but do not replace this signal."
        },
        "doc_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of physical vectors or sparse entries visible to the index; chunked indexes may contain multiple entries per source document."
        },
        "coverage": {
          "$ref": "#/$defs/DerivedCoverageStatus",
          "description": "Generation-scoped source-document coverage, separate from physical index cardinality."
        },
        "query_visible_doc_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Documents currently visible to queries."
        },
        "published_doc_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "published_node_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "root_node": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "published_root_node": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "dense_replay_applied_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "dense_replay_target_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "dense_publish_pending": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "Whether dense/vector artifacts still need publication before queries see the latest data."
        },
        "dense_vector_projection_pending": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "Whether the shared native exact-vector projection is still being built or reconciled. Queries remain correct by falling back to primary embedding artifacts while this is true."
        },
        "dense_native_storage_phase": {
          "x-go-type-skip-optional-pointer": true,
          "$ref": "#/$defs/DenseNativeStoragePhase"
        },
        "replay_applied_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "replay_target_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "replay_catch_up_required": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "runtime_present": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "runtime_fresh": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "runtime_source": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "runtime_freshness": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "catch_up_active": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "catch_up_phase": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "catch_up_applied_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "catch_up_target_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "enrichment_runtime": {
          "$ref": "#/$defs/EnrichmentRuntimeStatus"
        },
        "hbc_cache": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true
        },
        "hbc_posting": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true
        },
        "async_indexing": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true
        },
        "projection_checkpoint_status": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Durable projection checkpoint status: clean, rebuilding, degraded, or repair_required."
        },
        "projection_checkpoint_applied_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Highest derived-log sequence covered by the durable projection checkpoint."
        },
        "projection_checkpoint_generation": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Projection generation associated with the durable checkpoint."
        },
        "projection_checkpoint_config_fingerprint": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "pattern": "^[0-9a-f]{16}$",
          "description": "Projection configuration identity associated with the durable checkpoint."
        },
        "checkpoint_replay_tail_sequence_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of derived-log sequences after the durable checkpoint that still need replay."
        },
        "repair_scan_issue_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Repair issues found by explicit repair-scan accounting for this projection."
        },
        "term_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "edge_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "node_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "repair_degraded": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "repair_issue_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "repair_summary_ready": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "repair_issue_count_estimated": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "expected_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "reported_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "fresh_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "stale_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "missing_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "unknown_remote_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "resolution": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true,
          "description": "Artifact resolution replay diagnostics."
        },
        "promotion": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true,
          "description": "Artifact promotion replay diagnostics."
        }
      }
    },
    "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."
        }
      }
    },
    "EnrichmentRuntimeStatus": {
      "type": "object",
      "additionalProperties": false,
      "description": "Runtime state for the durable embeddings enrichment worker.",
      "required": [
        "enabled",
        "target_sequence",
        "applied_sequence",
        "pending_sequence_count",
        "projection_checkpoint_status",
        "projection_checkpoint_applied_sequence",
        "projection_checkpoint_generation",
        "projection_checkpoint_config_fingerprint",
        "projection_checkpoint_identity_consistent",
        "checkpoint_replay_tail_sequence_count",
        "processed_requests",
        "error_count",
        "retryable_error_count",
        "fatal_error_count",
        "consecutive_retry_count",
        "next_retry_at_ms",
        "retrying",
        "worker_failed",
        "worker_started",
        "stalled",
        "stall_reason",
        "active_phase",
        "active_model",
        "active_backend",
        "active_deadline_ms",
        "last_progress_ms",
        "active_progress_completed",
        "active_progress_total",
        "inference_timeout_count",
        "inference_cancel_count",
        "skip_by_hash_count",
        "skipped_source_count",
        "codec_decode_failures",
        "embed_batches_started",
        "embed_batches_completed",
        "embed_items_started",
        "embed_items_completed",
        "active_embed_batch_items",
        "active_embed_batch_bytes",
        "active_embed_batch_max_bytes",
        "active_embed_batch_started_ms",
        "last_embed_batch_items",
        "last_embed_batch_bytes",
        "last_embed_batch_max_bytes",
        "last_embed_batch_completed_ms",
        "last_embed_batch_ns",
        "total_embed_ns"
      ],
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "target_sequence": {
          "type": "integer",
          "format": "uint64"
        },
        "applied_sequence": {
          "type": "integer",
          "format": "uint64"
        },
        "pending_sequence_count": {
          "type": "integer",
          "format": "uint64"
        },
        "projection_checkpoint_status": {
          "type": "string"
        },
        "projection_checkpoint_applied_sequence": {
          "type": "integer",
          "format": "uint64"
        },
        "projection_checkpoint_generation": {
          "type": "integer",
          "format": "uint64"
        },
        "projection_checkpoint_config_fingerprint": {
          "type": "string",
          "pattern": "^[0-9a-f]{16}$"
        },
        "projection_checkpoint_identity_consistent": {
          "type": "boolean",
          "description": "Whether every shard contributing to this status reports the same checkpoint generation and configuration identity."
        },
        "checkpoint_replay_tail_sequence_count": {
          "type": "integer",
          "format": "uint64"
        },
        "processed_requests": {
          "type": "integer",
          "format": "uint64"
        },
        "error_count": {
          "type": "integer",
          "format": "uint64"
        },
        "retryable_error_count": {
          "type": "integer",
          "format": "uint64"
        },
        "output_counts": {
          "$ref": "#/$defs/MediaOutputCoverageCounts"
        },
        "fatal_error_count": {
          "type": "integer",
          "format": "uint64",
          "description": "Durable count of enrichment requests parked with a non-retryable (terminal) disposition, plus fatal worker failures. A terminally failed request never returns to pending; per-document terminal state is reported by the owning index's coverage counters (terminal_failed), and per-document diagnostics by the artifact repair issue listing."
        },
        "consecutive_retry_count": {
          "type": "integer",
          "format": "uint32",
          "description": "Consecutive durable worker retries for the current failed request window."
        },
        "next_retry_at_ms": {
          "type": "integer",
          "format": "uint64",
          "description": "Unix epoch time in milliseconds when the current durable retry becomes eligible. Zero when not retrying."
        },
        "retrying": {
          "type": "boolean"
        },
        "worker_failed": {
          "type": "boolean"
        },
        "worker_started": {
          "type": "boolean",
          "description": "Whether the background enrichment worker is currently running."
        },
        "stalled": {
          "type": "boolean",
          "description": "Whether pending work has no worker or has exceeded its execution/progress deadline."
        },
        "stall_reason": {
          "type": "string",
          "enum": [
            "",
            "worker_missing",
            "model_loading",
            "embedding_overdue",
            "publishing_overdue"
          ]
        },
        "active_phase": {
          "type": "string",
          "enum": [
            "idle",
            "loading_model",
            "tokenizing",
            "executing",
            "serializing",
            "publishing"
          ]
        },
        "active_model": {
          "type": "string"
        },
        "active_backend": {
          "type": "string"
        },
        "active_deadline_ms": {
          "type": "integer",
          "format": "uint64",
          "description": "Display-only Unix deadline in milliseconds; timeout decisions use a monotonic clock."
        },
        "last_progress_ms": {
          "type": "integer",
          "format": "uint64"
        },
        "active_progress_completed": {
          "type": "integer",
          "format": "uint64"
        },
        "active_progress_total": {
          "type": "integer",
          "format": "uint64"
        },
        "inference_timeout_count": {
          "type": "integer",
          "format": "uint64"
        },
        "inference_cancel_count": {
          "type": "integer",
          "format": "uint64"
        },
        "skip_by_hash_count": {
          "type": "integer",
          "format": "uint64"
        },
        "skipped_source_count": {
          "type": "integer",
          "format": "uint64"
        },
        "codec_decode_failures": {
          "type": "integer",
          "format": "uint64"
        },
        "embed_batches_started": {
          "type": "integer",
          "format": "uint64"
        },
        "embed_batches_completed": {
          "type": "integer",
          "format": "uint64"
        },
        "embed_items_started": {
          "type": "integer",
          "format": "uint64"
        },
        "embed_items_completed": {
          "type": "integer",
          "format": "uint64"
        },
        "active_embed_batch_items": {
          "type": "integer",
          "format": "uint64"
        },
        "active_embed_batch_bytes": {
          "type": "integer",
          "format": "uint64"
        },
        "active_embed_batch_max_bytes": {
          "type": "integer",
          "format": "uint64"
        },
        "active_embed_batch_started_ms": {
          "type": "integer",
          "format": "uint64"
        },
        "last_embed_batch_items": {
          "type": "integer",
          "format": "uint64"
        },
        "last_embed_batch_bytes": {
          "type": "integer",
          "format": "uint64"
        },
        "last_embed_batch_max_bytes": {
          "type": "integer",
          "format": "uint64"
        },
        "last_embed_batch_completed_ms": {
          "type": "integer",
          "format": "uint64",
          "description": "Wall-clock completion time in Unix milliseconds for the most recently completed embedding batch."
        },
        "last_embed_batch_ns": {
          "type": "integer",
          "format": "uint64",
          "description": "Elapsed duration in nanoseconds for the most recently completed embedding batch."
        },
        "total_embed_ns": {
          "type": "integer",
          "format": "uint64"
        }
      }
    },
    "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."
        }
      }
    },
    "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."
        }
      }
    },
    "FullTextIndexStats": {
      "type": "object",
      "required": [
        "index_type"
      ],
      "properties": {
        "index_type": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "enum": [
            "full_text"
          ],
          "description": "Discriminator for the index stats variant."
        },
        "readiness": {
          "$ref": "#/$defs/IndexReadinessStatus",
          "deprecated": true,
          "description": "Deprecated compatibility projection. Use milestones and revision fields."
        },
        "incarnation": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Opaque identity of the desired index incarnation. Clients may compare it for equality but must not interpret its contents."
        },
        "target_revision": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "published_revision": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "milestones": {
          "$ref": "#/$defs/IndexMilestones"
        },
        "error": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Error message if stats could not be retrieved"
        },
        "total_indexed": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of documents in the index"
        },
        "disk_usage": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Size of the index in bytes"
        },
        "rebuilding": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "Whether the index is currently rebuilding"
        },
        "repair": {
          "$ref": "#/$defs/IndexRepairStatus"
        },
        "backfill_active": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "Whether the index is actively rebuilding, replaying, or catching up."
        },
        "backfill_progress": {
          "x-go-type-skip-optional-pointer": true,
          "type": "number",
          "format": "double",
          "description": "Full-text materialization completion as a fraction from 0.0 to 1.0. A ready index reports 1.0."
        },
        "backfill_items_processed": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of documents indexed during current rebuild"
        },
        "backfill_state": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Operational readiness state such as ready, running, retrying, degraded, or failed."
        },
        "doc_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of documents visible to the index."
        },
        "term_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of indexed terms when available."
        },
        "replay_applied_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Highest replay sequence applied to the index runtime."
        },
        "replay_target_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Replay sequence the index runtime must reach to be current."
        },
        "replay_catch_up_required": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "Whether replay must catch up before the index is fully current."
        },
        "runtime_present": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "runtime_fresh": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "runtime_source": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "runtime_freshness": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "catch_up_active": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "catch_up_phase": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "catch_up_applied_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "catch_up_target_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "text_merge": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true,
          "description": "Full-text merge runtime diagnostics."
        },
        "async_indexing": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true,
          "description": "Asynchronous indexer runtime diagnostics."
        },
        "projection_checkpoint_status": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Durable projection checkpoint status: clean, rebuilding, degraded, or repair_required."
        },
        "projection_checkpoint_applied_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Highest derived-log sequence covered by the durable projection checkpoint."
        },
        "projection_checkpoint_generation": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Projection generation associated with the durable checkpoint."
        },
        "projection_checkpoint_config_fingerprint": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "pattern": "^[0-9a-f]{16}$",
          "description": "Projection configuration identity associated with the durable checkpoint."
        },
        "checkpoint_replay_tail_sequence_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of derived-log sequences after the durable checkpoint that still need replay."
        },
        "repair_scan_issue_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Repair issues found by explicit repair-scan accounting for this projection."
        },
        "edge_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "node_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "repair_degraded": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "repair_issue_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "repair_summary_ready": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "repair_issue_count_estimated": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "expected_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "reported_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "fresh_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "stale_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "missing_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "unknown_remote_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "resolution": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true,
          "description": "Artifact resolution replay diagnostics."
        },
        "promotion": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true,
          "description": "Artifact promotion replay diagnostics."
        }
      }
    },
    "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."
    },
    "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."
    },
    "GraphIndexStats": {
      "type": "object",
      "description": "Statistics for graph index. While counts_pending is true, edge/node/document counts are physical upper bounds awaiting ownership cleanup, not exact logical counts.",
      "required": [
        "index_type"
      ],
      "properties": {
        "index_type": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "enum": [
            "graph"
          ],
          "description": "Discriminator for the index stats variant."
        },
        "readiness": {
          "$ref": "#/$defs/IndexReadinessStatus",
          "deprecated": true,
          "description": "Deprecated compatibility projection. Use milestones and revision fields."
        },
        "incarnation": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Opaque identity of the desired index incarnation. Clients may compare it for equality but must not interpret its contents."
        },
        "target_revision": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "published_revision": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "milestones": {
          "$ref": "#/$defs/IndexMilestones"
        },
        "error": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Error message if stats could not be retrieved"
        },
        "total_edges": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Total number of edges in the graph"
        },
        "counts_pending": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "True while ownership cleanup is pending on any observed shard. Counts are physical upper bounds until cleanup completes; serving adjacency already enforces ownership."
        },
        "edge_types": {
          "type": "object",
          "additionalProperties": {
            "type": "integer",
            "format": "uint64"
          },
          "description": "Count of edges per edge type"
        },
        "rebuilding": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "Whether the index is currently rebuilding"
        },
        "repair": {
          "$ref": "#/$defs/IndexRepairStatus"
        },
        "backfill_active": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean",
          "description": "Whether the index is actively rebuilding, materializing, or catching up."
        },
        "backfill_progress": {
          "x-go-type-skip-optional-pointer": true,
          "type": "number",
          "format": "double",
          "description": "Rebuild progress as a ratio from 0.0 to 1.0"
        },
        "backfill_items_processed": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of edges indexed during current rebuild"
        },
        "backfill_state": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Operational readiness state such as ready, running, retrying, degraded, or failed."
        },
        "doc_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of documents covered by the graph index."
        },
        "edge_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of graph edges currently indexed."
        },
        "node_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of graph nodes currently indexed."
        },
        "replay_applied_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "replay_target_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "replay_catch_up_required": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "runtime_present": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "runtime_fresh": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "runtime_source": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "runtime_freshness": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "catch_up_active": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "catch_up_phase": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string"
        },
        "catch_up_applied_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "catch_up_target_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "source_artifact": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true,
          "description": "Graph source artifact materialization status."
        },
        "resolver_replay": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true,
          "description": "Resolver replay diagnostics for graph materialization."
        },
        "async_indexing": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true
        },
        "projection_checkpoint_status": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "description": "Durable projection checkpoint status: clean, rebuilding, degraded, or repair_required."
        },
        "projection_checkpoint_applied_sequence": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Highest derived-log sequence covered by the durable projection checkpoint."
        },
        "projection_checkpoint_generation": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Projection generation associated with the durable checkpoint."
        },
        "projection_checkpoint_config_fingerprint": {
          "x-go-type-skip-optional-pointer": true,
          "type": "string",
          "pattern": "^[0-9a-f]{16}$",
          "description": "Projection configuration identity associated with the durable checkpoint."
        },
        "checkpoint_replay_tail_sequence_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Number of derived-log sequences after the durable checkpoint that still need replay."
        },
        "repair_scan_issue_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64",
          "description": "Repair issues found by explicit repair-scan accounting for this projection."
        },
        "term_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "repair_degraded": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "repair_issue_count": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "repair_summary_ready": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "repair_issue_count_estimated": {
          "x-go-type-skip-optional-pointer": true,
          "type": "boolean"
        },
        "expected_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "reported_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "fresh_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "stale_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "missing_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "unknown_remote_groups": {
          "x-go-type-skip-optional-pointer": true,
          "type": "integer",
          "format": "uint64"
        },
        "resolution": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true,
          "description": "Artifact resolution replay diagnostics."
        },
        "promotion": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "additionalProperties": true,
          "description": "Artifact promotion replay diagnostics."
        },
        "algebraic_graph": {
          "x-go-type-skip-optional-pointer": true,
          "type": "object",
          "description": "Algebraic graph execution health for bounded semiring traversal.",
          "properties": {
            "traversal": {
              "type": "object",
              "properties": {
                "attempted": {
                  "type": "integer",
                  "format": "uint64"
                },
                "proven": {
                  "type": "integer",
                  "format": "uint64"
                },
                "rejected": {
                  "type": "integer",
                  "format": "uint64"
                },
                "fallback": {
                  "type": "integer",
                  "format": "uint64"
                },
                "result_nodes": {
                  "type": "integer",
                  "format": "uint64"
                }
              }
            }
          }
        },
        "graph_metric_runtime": {
          "x-go-type-skip-optional-pointer": true,
          "$ref": "#/$defs/GraphMetricRuntimeStats"
        }
      }
    },
    "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"
          }
        }
      }
    },
    "GraphMetricRuntimeStats": {
      "type": "object",
      "description": "Summarized graph metric maintenance runtime state. Identity fields are stable hashes, not raw process or owner identifiers.",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "role": {
          "type": "string",
          "enum": [
            "combined",
            "coordinator",
            "worker",
            "worker_pool"
          ]
        },
        "runtime_id_hash": {
          "type": "integer",
          "format": "uint64"
        },
        "owner_id_hash": {
          "type": "integer",
          "format": "uint64"
        },
        "lease_key_hash": {
          "type": "integer",
          "format": "uint64"
        },
        "worker_id_hash": {
          "type": "integer",
          "format": "uint64"
        },
        "worker_count": {
          "type": "integer",
          "format": "uint64"
        },
        "lease_owned": {
          "type": "boolean"
        },
        "has_lease": {
          "type": "boolean"
        },
        "acquisition_count": {
          "type": "integer",
          "format": "uint64"
        },
        "takeover_count": {
          "type": "integer",
          "format": "uint64"
        },
        "lease_acquire_failures": {
          "type": "integer",
          "format": "uint64"
        },
        "lost_leases": {
          "type": "integer",
          "format": "uint64"
        },
        "last_acquired_ms": {
          "type": "integer",
          "format": "uint64"
        },
        "lease_expires_at_ms": {
          "type": "integer",
          "format": "uint64",
          "description": "Cached expiry of the currently held maintenance lease, or zero when no lease is held."
        },
        "lease_renew_after_ms": {
          "type": "integer",
          "format": "uint64",
          "description": "Earliest time the runtime will renew its maintenance lease, or zero when no lease is held."
        },
        "renewal_count": {
          "type": "integer",
          "format": "uint64",
          "description": "Number of durable maintenance lease renewals completed by this runtime."
        },
        "started": {
          "type": "boolean"
        },
        "shutdown": {
          "type": "boolean"
        },
        "notified": {
          "type": "boolean"
        },
        "ticks_started": {
          "type": "integer",
          "format": "uint64"
        },
        "ticks_completed": {
          "type": "integer",
          "format": "uint64"
        },
        "durable_progress_ticks": {
          "type": "integer",
          "format": "uint64"
        },
        "idle_ticks": {
          "type": "integer",
          "format": "uint64"
        },
        "error_ticks": {
          "type": "integer",
          "format": "uint64"
        },
        "last_error_name": {
          "type": "string"
        },
        "total_metrics_scanned": {
          "type": "integer",
          "format": "uint64"
        },
        "total_active_builds": {
          "type": "integer",
          "format": "uint64"
        },
        "total_builds_started": {
          "type": "integer",
          "format": "uint64"
        },
        "total_worker_steps": {
          "type": "integer",
          "format": "uint64"
        },
        "total_coordinator_steps": {
          "type": "integer",
          "format": "uint64"
        },
        "total_retired_input_records": {
          "description": "Consumed intermediate records retired at completed reduction barriers.",
          "type": "integer",
          "format": "uint64"
        },
        "total_pages_claimed": {
          "type": "integer",
          "format": "uint64"
        },
        "total_pages_completed": {
          "type": "integer",
          "format": "uint64"
        },
        "total_phases_advanced": {
          "type": "integer",
          "format": "uint64"
        },
        "total_published": {
          "type": "integer",
          "format": "uint64"
        },
        "total_failed_builds": {
          "type": "integer",
          "format": "uint64"
        },
        "last_metrics_scanned": {
          "type": "integer",
          "format": "uint64"
        },
        "last_active_builds": {
          "type": "integer",
          "format": "uint64"
        },
        "last_builds_started": {
          "type": "integer",
          "format": "uint64"
        },
        "last_worker_steps": {
          "type": "integer",
          "format": "uint64"
        },
        "last_coordinator_steps": {
          "type": "integer",
          "format": "uint64"
        },
        "last_retired_input_records": {
          "description": "Consumed intermediate records retired in the latest maintenance tick.",
          "type": "integer",
          "format": "uint64"
        },
        "last_pages_claimed": {
          "type": "integer",
          "format": "uint64"
        },
        "last_pages_completed": {
          "type": "integer",
          "format": "uint64"
        },
        "last_phases_advanced": {
          "type": "integer",
          "format": "uint64"
        },
        "last_published": {
          "type": "integer",
          "format": "uint64"
        },
        "last_failed_builds": {
          "type": "integer",
          "format": "uint64"
        },
        "last_budget_exhausted": {
          "type": "boolean"
        }
      }
    },
    "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."
        }
      }
    },
    "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."
        }
      }
    },
    "IndexMilestoneStatus": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "reached",
        "blockers"
      ],
      "properties": {
        "reached": {
          "type": "boolean",
          "description": "Whether this milestone is satisfied by the observed index incarnation."
        },
        "blockers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Milestone-specific, machine-readable blockers. Empty whenever reached is true."
        }
      }
    },
    "IndexMilestones": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "queryable",
        "complete"
      ],
      "properties": {
        "queryable": {
          "$ref": "#/$defs/IndexMilestoneStatus"
        },
        "complete": {
          "$ref": "#/$defs/IndexMilestoneStatus"
        }
      }
    },
    "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."
    },
    "IndexReadinessReason": {
      "type": "string",
      "enum": [
        "load_failure",
        "enrichment_failure",
        "runtime_unavailable",
        "target_observation",
        "shard_observation_incomplete",
        "incarnation_pending",
        "source_publication",
        "repair",
        "backfill",
        "coverage",
        "replay",
        "publication"
      ],
      "description": "Stable machine-readable reason why an index is pending, partial, or failed."
    },
    "IndexReadinessState": {
      "type": "string",
      "enum": [
        "pending",
        "queryable_partial",
        "ready",
        "failed"
      ],
      "description": "Lifecycle state for the desired index incarnation. A failed desired repair may coexist with queryable=true when a separately proven serving incarnation remains available; clients must use the explicit milestone booleans."
    },
    "IndexReadinessStatus": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "state",
        "queryable",
        "complete",
        "pending_reasons"
      ],
      "properties": {
        "state": {
          "$ref": "#/$defs/IndexReadinessState"
        },
        "queryable": {
          "type": "boolean",
          "description": "Whether the published generation can safely answer queries."
        },
        "complete": {
          "type": "boolean",
          "description": "Whether the desired incarnation has complete coverage and publication according to its configured policies."
        },
        "incarnation": {
          "type": "string",
          "description": "Opaque identity for the desired index incarnation. Clients may compare it for equality but must not interpret its contents."
        },
        "target_revision": {
          "type": "integer",
          "format": "uint64",
          "description": "Highest captured source/replay revision required by this readiness observation."
        },
        "published_revision": {
          "type": "integer",
          "format": "uint64",
          "description": "Highest revision published to the query-visible index represented by this observation."
        },
        "pending_reasons": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/IndexReadinessReason"
          },
          "description": "Stable, machine-readable blockers or failure reasons. Empty when state is ready."
        },
        "sources": {
          "type": "array",
          "description": "Operational readiness for each configured artifact stream. Present only for artifact-backed indexes, in configuration order.",
          "items": {
            "$ref": "#/$defs/IndexSourceReadinessStatus"
          }
        }
      }
    },
    "IndexRepairStatus": {
      "type": "object",
      "description": "Compact user-facing state for an automatic index repair. Detailed diagnostics are available from the admin API and metrics.",
      "required": [
        "state",
        "action_required",
        "blocks_queryable",
        "blocks_complete"
      ],
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "rebuilding",
            "waiting",
            "paused",
            "failed"
          ],
          "description": "Stable repair state. Internal state-machine phases are intentionally not exposed here."
        },
        "action_required": {
          "type": "boolean",
          "description": "Whether an operator must resume, retry, reconfigure, or drop the affected index."
        },
        "blocks_queryable": {
          "type": "boolean",
          "description": "Whether this repair currently prevents the proven serving incarnation from answering queries."
        },
        "blocks_complete": {
          "type": "boolean",
          "description": "Whether this repair prevents the desired incarnation from satisfying the complete milestone."
        },
        "reason": {
          "type": "string",
          "description": "Diagnostic reason automation stopped. Present only when action_required is true."
        }
      }
    },
    "IndexSourceReadinessReason": {
      "type": "string",
      "enum": [
        "index_failed",
        "enrichment_failure",
        "repair",
        "runtime_unavailable",
        "shard_observation_incomplete",
        "source_observation_incomplete",
        "publication"
      ],
      "description": "Stable machine-readable reason why an artifact source is pending or failed."
    },
    "IndexSourceReadinessStatus": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact",
        "state",
        "complete",
        "pending_reasons"
      ],
      "properties": {
        "artifact": {
          "type": "string",
          "description": "Configured artifact stream identity."
        },
        "state": {
          "type": "string",
          "enum": [
            "pending",
            "ready",
            "failed"
          ]
        },
        "complete": {
          "type": "boolean",
          "description": "Whether this source is fully observed and published on every expected shard."
        },
        "pending_reasons": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/IndexSourceReadinessReason"
          },
          "description": "Stable, machine-readable blockers or failure reasons for this source. Empty when state is ready."
        }
      }
    },
    "IndexStats": {
      "type": "object",
      "description": "Statistics for an index",
      "oneOf": [
        {
          "$ref": "#/$defs/FullTextIndexStats"
        },
        {
          "$ref": "#/$defs/EmbeddingsIndexStats"
        },
        {
          "$ref": "#/$defs/GraphIndexStats"
        },
        {
          "$ref": "#/$defs/AlgebraicIndexStats"
        },
        {
          "$ref": "#/$defs/RelationalIndexStats"
        }
      ]
    },
    "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."
        }
      }
    },
    "MediaOutputCoverageCounts": {
      "type": "object",
      "description": "Cumulative durably accepted output coverage by media-output kind. Per-output names, source clocks, and current-document status remain on the named output assets.",
      "properties": {
        "embedding": {
          "$ref": "#/$defs/MediaOutputCoverageValues"
        },
        "transcribe": {
          "$ref": "#/$defs/MediaOutputCoverageValues"
        },
        "classify": {
          "$ref": "#/$defs/MediaOutputCoverageValues"
        },
        "diarize": {
          "$ref": "#/$defs/MediaOutputCoverageValues"
        }
      }
    },
    "MediaOutputCoverageValues": {
      "type": "object",
      "properties": {
        "complete": {
          "type": "integer",
          "format": "uint64"
        },
        "failed": {
          "type": "integer",
          "format": "uint64"
        },
        "terminal": {
          "type": "integer",
          "format": "uint64"
        },
        "degraded": {
          "type": "integer",
          "format": "uint64"
        }
      }
    },
    "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"
      ]
    },
    "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."
        }
      }
    },
    "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."
        }
      }
    },
    "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"
      ]
    },
    "RelationalIndexBuildFailure": {
      "type": "string",
      "enum": [
        "incompatible_schema",
        "invalid_row",
        "key_too_large"
      ]
    },
    "RelationalIndexBuildState": {
      "type": "string",
      "enum": [
        "building",
        "ready",
        "failed"
      ]
    },
    "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"
          }
        }
      }
    },
    "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."
        }
      }
    },
    "RelationalIndexRangeStatus": {
      "type": "object",
      "required": [
        "group_id",
        "generation",
        "slot",
        "owner",
        "comparison",
        "progress_digest",
        "maintenance_epoch",
        "state",
        "rows_scanned"
      ],
      "properties": {
        "group_id": {
          "type": "string",
          "pattern": "^[0-9]+$"
        },
        "generation": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "Exact uint64 generation encoded as decimal, never a floating-point number."
        },
        "slot": {
          "type": "integer",
          "format": "uint32"
        },
        "owner": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Namespace and owned-range fingerprint."
        },
        "comparison": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Executable tuple comparison fingerprint."
        },
        "progress_digest": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Exact durable progress observation for generation-fenced maintenance."
        },
        "maintenance_epoch": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "Replicated desired maintenance ticket, separate from replica-local progress."
        },
        "last_maintenance_request": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Most recently accepted maintenance command proof for exact retry acknowledgement."
        },
        "state": {
          "$ref": "#/$defs/RelationalIndexBuildState"
        },
        "rows_scanned": {
          "type": "string",
          "pattern": "^[0-9]+$"
        },
        "failure": {
          "$ref": "#/$defs/RelationalIndexBuildFailure"
        }
      }
    },
    "RelationalIndexStats": {
      "type": "object",
      "required": [
        "index_type",
        "milestones",
        "relational_index"
      ],
      "properties": {
        "index_type": {
          "type": "string",
          "enum": [
            "relational"
          ]
        },
        "milestones": {
          "$ref": "#/$defs/IndexMilestones"
        },
        "relational_index": {
          "$ref": "#/$defs/RelationalIndexStatus"
        }
      }
    },
    "RelationalIndexStatus": {
      "type": "object",
      "required": [
        "table_id",
        "schema_version",
        "index_name",
        "state",
        "ranges"
      ],
      "properties": {
        "table_id": {
          "type": "string",
          "pattern": "^[0-9]+$"
        },
        "schema_version": {
          "type": "integer",
          "format": "uint32"
        },
        "index_name": {
          "type": "string"
        },
        "state": {
          "$ref": "#/$defs/RelationalIndexBuildState"
        },
        "ranges": {
          "type": "array",
          "maxItems": 4096,
          "items": {
            "$ref": "#/$defs/RelationalIndexRangeStatus"
          }
        }
      }
    },
    "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"
          }
        }
      }
    },
    "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"
    },
    "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
        }
      }
    },
    "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."
        }
      }
    },
    "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"
      ]
    }
  }
}