/** * Filter incoming batch results to only those whose participantId * is not already in the set of existing result participantIds. */ export function filterNewResults( incoming: { participantId: string; placement: number }[], existingParticipantIds: Set ): { participantId: string; placement: number }[] { return incoming.filter((r) => !existingParticipantIds.has(r.participantId)); }