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 even triggers if you have no cards in your library.
05-10-2018
wotc
You put only one +1/+1 counter on Dimir Spybug each time you surveil, no matter how many cards you looked at when you surveilled.
Random a card of Magic: The Gathering (MTG), but you can also roll the D20 dice, random a Planeswalker, have fun with the random rules and more.