Weeding out smart non-programmers is quite easy. Obvious by their resume and their non-coding interviews. I bet in an unlikely scenario that you fail to detect that, you probably have a pretty good hire who'll learn in a heartbeat.
What you really want to weed out, at least at top-tier companies who can afford to be more selective, is people who have a resume, but are not that great at fundamentals. Most loud complaints seem to be of this nature: guy had N years of experience at previous company/is author of popular software, but couldn't get through basic linked list/recursion/BFS--as if this is not an acceptable bare minimum expectation of a professional in the field.
Often people are too polite to say it out loud, but realistically, that is exactly when it is working as intended.
It's not. In 99,99% of programming jobs you will never have to implement a linked list. And yet, interviewers pretend it's important to be able to write it on the blackboard.
Not the point. If you have way more applicants than roles and you are paying well, given the choice between a programmer who cannot implement a linked list [really?] and one who can, you would hire the one who has that ability, even if all they do all day is to stare at Claude Code.