{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "field_replay.session_config.v1",
  "type": "object",
  "required": ["schema", "duration_sec", "window_ms", "local_agent", "peer_agent", "probe", "output"],
  "properties": {
    "schema": {"const": "field_replay.session_config.v1"},
    "session_name": {"type": "string"},
    "duration_sec": {"type": "integer", "minimum": 1},
    "window_ms": {"type": "integer", "minimum": 1},
    "local_agent": {
      "type": "object",
      "required": ["id", "name", "listen_ip", "listen_port"],
      "properties": {
        "id": {"type": "integer", "minimum": 1},
        "name": {"type": "string"},
        "listen_ip": {"type": "string"},
        "listen_port": {"type": "integer", "minimum": 1, "maximum": 65535}
      }
    },
    "peer_agent": {
      "type": "object",
      "required": ["id", "name", "host", "port"],
      "properties": {
        "id": {"type": "integer", "minimum": 1},
        "name": {"type": "string"},
        "host": {"type": "string"},
        "port": {"type": "integer", "minimum": 1, "maximum": 65535}
      }
    },
    "probe": {
      "type": "object",
      "required": ["transport", "echo_interval_ms", "stream_interval_ms", "timeout_ms", "payload_sizes_bytes"],
      "properties": {
        "transport": {"const": "udp"},
        "echo_interval_ms": {"type": "integer", "minimum": 1},
        "stream_interval_ms": {"type": "integer", "minimum": 1},
        "timeout_ms": {"type": "integer", "minimum": 1},
        "payload_sizes_bytes": {"type": "array", "minItems": 1, "items": {"type": "integer", "minimum": 0, "maximum": 65535}}
      }
    },
    "security": {"type": "object"},
    "output": {
      "type": "object",
      "required": ["raw_log_path", "summary_path"],
      "properties": {
        "raw_log_path": {"type": "string"},
        "summary_path": {"type": "string"}
      }
    }
  }
}
