But the OP does raise an interesting question, how do food/agriculture restrictions apply at pre-clearance locations versus when you physically go through customs on US soil?
Since one can buy and eat food after pre-clearance and before boarding the flight, how exactly do they police what you take onboard the aircraft? Are there signs/announcements informing you of restrictions before boarding?
I've flown YUL and YYZ to the US, and remember buying food items before departure and taking them on board, but it's been 5+ years, don't know if anything's changed recently.
In the OP's case, what happens if they had simply purchased an apple after preclearance?