forked from dsutanto/bytetrack-counter-cpp
File sources now keep STATE_FILE on graceful shutdown (EOF or SIGTERM): the final batch snapshot is written instead of deleted, so the dashboard's /api/current-batch still shows the recount result after the process exits. On startup, STATE_FILE is cleared unless a live instance is detected via a /proc cmdline scan (rtsp/http source in argv or config). Live sources keep the old resume-at-start / delete-on-finish behavior. SPEC: V19, T21, B2. AGENTS: STATE_FILE lifecycle section.