An ability that triggers “whenever you surveil” triggers after you’re done surveilling, even if you have fewer cards in your library than the number of cards you’re instructed to surveil. It triggers even if you have no cards in your library.