The duplicate-title repair that runs before creating idx_sessions_title_unique
kept the highest-rowid row and NULLed every other title, including names the
user typed (and pre-provenance NULL-source rows, which _title_rank treats as
user). A newer session with a lower rowid also lost its title.
Per duplicate title, keep the row with the highest _title_rank, newest
started_at first; clear lower-ranked auto (llm/derived) titles and rename
user-owned duplicates via the existing lineage numbering ("Title #2"), logging
each change. The index is then always created. get_next_title_in_lineage now
delegates to a connection-level helper so the schema init can reuse it.
Fixes#126764.