triplet_sort: handle new-style compose identifiers
triplet_sort is no longer reliable on its own, as we are going
to intersperse nightlies with productions, so its assumption
that nightlies are always older than productions is invalid.
However, it can be used as a tie-breaker when two events have
the same creation_date, so we still want it to work as well as
possible.