Gitea returns an empty created_at for generic package files, so sorting by it left every build equally old and the "keep one previous for rollback" rule retained whichever the listing happened to return first — the OLDEST build, with the newest deleted. Rank by the version in the filename instead, numeric segment by segment so 1.4.34 outranks 1.4.9, and fall back to created_at only when a name carries no version. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>