fn max_ts(conn: &Connection, sql: &str, agent_id: &str) -> Result<i64, Error>
MAX(col) over a per-agent table; 0 when the table is missing (pre-v2) or there are no rows. Other errors propagate (→ DB skipped).
MAX(col)
0