{
  "schemaVersion": "auto-oncall-slow-query-handoff-fields-v1",
  "selectionContract": {
    "semanticDraftOwner": "Scenario Diagnostic Agent",
    "providerFieldTranslationOwner": "Evidence Agent",
    "instruction": "Treat the Scenario Diagnostic Agent evidence request as a semantic draft. During initial planning and same-round query repair, translate equivalent TiDB terms to the exact supported fields below, keep paired fields together, and replace unsupported optional projections with the closest field group that answers the same question. Do not send provider field syntax back to the Scenario Diagnostic Agent."
  },
  "scenarioFieldGroups": {
    "single-query-or-cluster-query-latency-or-query-execution": {
      "latencyAndWait": ["cop_time", "process_time", "wait_time", "backoff_time", "backoff_types", "write_sql_response_total"],
      "scanAndLocalization": ["request_count", "process_keys", "total_keys", "cop_proc_max", "cop_proc_addr", "cop_wait_max", "cop_wait_addr"],
      "optimizerAndAccess": ["stats", "index_names", "parse_time", "compile_time", "rewrite_time", "preproc_subqueries_time", "optimize_time", "wait_ts"],
      "resourceAlternative": ["memory_max", "disk_max", "ru", "time_queued_by_rc", "resource_group"]
    },
    "workload-hotspot-supporting-slow-query": {
      "contribution": ["query_time", "request_count", "process_keys", "total_keys", "ru"],
      "entityAndQueue": ["cop_proc_max", "cop_proc_addr", "cop_wait_max", "cop_wait_addr", "time_queued_by_rc", "resource_group"]
    },
    "write-path-contention": {
      "transactionShape": ["write_keys", "write_size", "txn_retry"],
      "writeStages": ["write_sql_response_total", "exec_retry_time", "local_latch_wait_time", "resolve_lock_time", "lock_keys_time", "backoff_time", "backoff_types"],
      "scanAlternative": ["request_count", "process_keys", "total_keys"]
    },
    "memory-oom": {
      "resource": ["memory_max", "disk_max"],
      "scanAndQueueAlternative": ["request_count", "process_keys", "total_keys", "time_queued_by_rc", "resource_group"]
    }
  },
  "fields": [
    "digest",
    "connection_id",
    "timestamp",
    "query",
    "instance",
    "db",
    "success",
    "query_time",
    "parse_time",
    "compile_time",
    "rewrite_time",
    "preproc_subqueries_time",
    "optimize_time",
    "wait_ts",
    "cop_time",
    "lock_keys_time",
    "write_sql_response_total",
    "exec_retry_time",
    "memory_max",
    "disk_max",
    "index_names",
    "process_time",
    "wait_time",
    "backoff_time",
    "backoff_types",
    "local_latch_wait_time",
    "resolve_lock_time",
    "cop_proc_avg",
    "cop_proc_p90",
    "cop_proc_max",
    "cop_wait_avg",
    "cop_wait_p90",
    "cop_wait_max",
    "request_count",
    "process_keys",
    "total_keys",
    "rocksdb_delete_skipped_count",
    "rocksdb_key_skipped_count",
    "rocksdb_block_cache_hit_count",
    "rocksdb_block_read_count",
    "rocksdb_block_read_byte",
    "write_keys",
    "write_size",
    "txn_retry",
    "ru",
    "time_queued_by_rc",
    "resource_group",
    "execution_interval_status",
    "time_semantics",
    "start_time",
    "finish_time",
    "overlaps_incident_window",
    "incident_overlap_seconds",
    "stats",
    "warnings",
    "cop_proc_addr",
    "cop_wait_addr"
  ]
}
