perf(mail): re-apply incremental UID-scan (Phase 2) — safe w/ externals fix
Wiedereinspielung von mo's inkrementellem Scan (war nach dem imapflow-Bundle-
Incident zurückgerollt). Jetzt safe, weil der nitro externals-Fix (d64f31d)
imapflow robust extern hält — lokal verifiziert: Build clean, imapflow in
node_modules (kein Chunk), kein util.inherits.
- scan-internal: inkrementeller UID-Scan (status uidNext/uidValidity, search
UID>lastUid, leere Ordner skip), UIDVALIDITY-Wächter, täglicher Quality-Full-
Sweep (last_full_sweep_at). Klassifikation/Delete/Consent 1:1.
- db/mail: patchFolderScanState (atomic JSONB-merge) + markFullSweepDone;
toter getAllActiveMailUserIds entfernt.
Schema + Migration (folder_scan_state, last_full_sweep_at) sind bereits live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>