{
  "$comment": "AttendanceHub Sync V2. Device list is DYNAMIC by default: devices.source=laravel resolves count/IP/port/comm key from GET /api/v1/devices (the same source the old web service used). The static 'device' below is only the fallback when the API is unreachable. idOverrides keeps an existing local SQLite identity stable for a known IP.",
  "device": {
    "deviceId": "phase1-test-01",
    "displayName": "Phase 1 designated test device",
    "ip": "172.24.30.9",
    "port": 4370,
    "machineNumber": 1,
    "commKey": 0
  },
  "devices": {
    "source": "laravel",
    "baseAddress": "",
    "listPath": "/api/v1/devices",
    "apiToken": "",
    "refreshSeconds": 60,
    "fallbackToStatic": true,
    "machineNumber": 1,
    "idOverrides": {
      "172.24.30.9": "phase1-test-01"
    }
  },
  "sdk": {
    "commTimeoutSeconds": 5,
    "expectedSdkVersion": "6.3.1.45"
  },
  "session": {
    "operationTimeoutMs": 30000,
    "connectTimeoutMs": 15000
  },
  "realtime": {
    "eventMask": 1,
    "channelCapacity": 256
  },
  "read": {
    "mode": "Auto",
    "lookbackMinutes": 1440,
    "maxRecordsPerRead": 1000000,
    "failureRetryLimit": 3,
    "failureRetryBackoffMs": 15000,
    "tryTimeWindow": true,
    "windowedIntervalMs": 15000,
    "fullReconcileMinutes": 30,
    "overlapMinutes": 10
  },
  "supervisor": {
    "$comment": "readIntervalMs is the read cadence used while the windowed API is still being VALIDATED (window=Unknown) and when windowed reads are off entirely. It must stay SHORT: a long value delays validation, so the device can never reach window=Valid and stays on full reads. The heavy case is handled separately: once a device is PROVEN to have no usable window (window=Invalid, e.g. 172.30.70.5 whose firmware rejects ReadTimeGLogData) its cadence becomes read.fullReconcileMinutes - it used to be this 60s value, which made that device issue a full multi-10k ReadGeneralLogData every minute (measured 82 full reads / 95 min). When the window IS valid the effective cadence is min(windowedIntervalMs, readIntervalMs) = 15s. Health checks keep their own cadence (healthIntervalMs) and are never gated by this.",
    "reconnectDelayMs": 5000,
    "healthIntervalMs": 15000,
    "readIntervalMs": 60000,
    "maxReconnectDelayMs": 60000,
    "pingFailThreshold": 2,
    "readRecreateThreshold": 6,
    "liveStaleMinutes": 15
  },
  "persistence": {
    "dedupeLogEnabled": false
  },
  "upload": {
    "enabled": false,
    "baseAddress": "http://localhost/AttendanceHub/public",
    "batchPath": "/api/v1/sync/punches",
    "apiToken": "8ad88bf216991a5d5447c2c84ff008fa2fa9c5dc31048e3e5c16ad198381e6b4",
    "deviceId": "172.24.30.9",
    "timeoutSeconds": 30,
    "batchSize": 200,
    "maxConcurrency": 1,
    "pollingIntervalMs": 15000
  },
  "heartbeat": {
    "$comment": "Reports device liveness to POST /api/v1/sync/heartbeat, which updates devices.last_seen_at and connection_status. Without it the panel and the monitoring service show every device OFFLINE forever even while acquisition and delivery are perfectly healthy — that picture is what makes an operator suspect the wrong subsystem. intervalSeconds must stay BELOW the backend's 120s online window (Device::isOnline reads last_seen_at within 120s), otherwise the beats are accepted and logged and the devices still look offline. Requires upload.enabled=true: it shares the upload endpoint and token.",
    "enabled": false,
    "intervalSeconds": 60
  }
}
