The old sync created a collection, imported batches without reading a
single import response, and swapped the alias regardless. A partial
import published a half-empty index, and two overlapping DAG runs could
prune each other's collections.
Publication now checks every import response and the final document
count before upserting the alias, and holds a session-scoped advisory
lock across the read and the publish so concurrent runs serialise.
Cleanup keeps the previous collection as a rollback pointer and is
best-effort: an uncertain alias response must never delete what might
still be live.
Also parses the Typesense URL properly instead of splitting on colons,
which mangled any host carrying a scheme and a default port.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>