const MIGRATION_VERSION: u32 = 2;Expand description
Migration-logic version. Bump whenever the scan changes (new roots, schema
handling, etc.) so existing users re-run the migration ONCE: the marker
stores this number; a marker older than this re-runs. The pre-v2 marker
held the literal text migrated, which parses as version 0 → re-runs,
recovering everyone whose first pass was incomplete.
v2 — schema-resilient column handling (missing columns no longer skip a
whole DB), scans dev/ branches too, and a recoverable versioned marker.
See docs/analysis/ANALYSIS_CROSS_CHANNEL_AGENT_RETENTION_2026_06_13.md.