system
A chat on subreddit /r/wallstreetbets
human
Both parties need to go locked shop and demand some minimum sort of loyalty to the party before you can campaign at certain levels. That and implement card carrying dues. Random chumps on the street shouldn't be voting in the primary. It should be party members only.

gpt
The Democrats basically had such a system and look what it did to them last election.