Article II, Section 1, Clause 2: Each State shall appoint, in such Manner as the Legislature thereof may direct, a Number of Electors, equal to the whole Number of Senators and Representatives to which the State may be entitled in the Congress: but no Senator or Representative, or Person holding an Office of Trust or Profit under the United States, shall be appointed an Elector.
12th Amendment: The Electors shall meet in their respective states, and vote by ballot for President and Vice-President, one of whom, at least, shall not be an inhabitant of the same state with themselves; ..."
So how can the primary system not be rigged?
Primaries, which are run by state governments, need not be related to political parties at all. The two parties have used laws to favor themselves.
The only practical alternative to private associations like political parties is a jungle primary with the top two finishers facing off, unless plurality decides the winner. A plurality winner system wouldn’t last long. Again, I’m speaking of a situation without political parties.