The native queryLogs and cleanupLogs ran synchronously on the main
thread. On an agent holding 1,684,935 log files every sync query froze
the process for 12-52 seconds, so its socket stopped accepting and the
platform's readiness probe timed out. Both now run on the libuv thread
pool through napi AsyncTask; the same query holds the event loop for at
most 1 ms.
Queries counted the rows of every file in scope for exact totals. The
new totals: false option picks the newest files by name and opens only
as many as the limit needs, which took a 100-entry query on that store
from 14 seconds to 3.2 seconds. The default is unchanged.
Also clears the repository's code-discipline violations: formatting,
removed comments, and a split of scan_single_partition.