The MAX(id) replacement touched four queries that each carry their own copy of
the same CTE: SearchRepositories, GetRepoCards, GetUserRepoCards and
GetStarredRepoCards. Only the third had a test. Fixing one and missing another
would leave the UI disagreeing with itself about which manifest is current,
depending on which page you were looking at.
All four now assert that recency follows created_at rather than insert order,
and that a tie between manifests pushed in the same second resolves the same way
on every surface. Verified by regressing the CTEs back to rowid ordering: each
of the four fails independently.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>