Texas Senator Ted Cruz, in July. PHOTOGRAPH BY ERIC THAYER / THE NEW YORK TIMES / REDUX

Ted Cruz, it appears, has had a dismal time since the Republican National Convention, where his decision not to endorse Donald Trump drew vigorous boos. Cruz’s national favorability rating among Republicans has plummeted from fifty-nine per cent to forty-three per cent. Several Texas Republicans, including perhaps former Governor Rick Perry, are said to be weighing primary challenges when Cruz seeks reëlection to the Senate, in 2018. Cruz has devoted several weeks to travelling around his home state, apparently trying to mend fences and persuade the locals that he hadn’t forgotten them during his long race for the White House. Is Cruz doomed, locally as well as nationally?

Far from it. Cruz is merely taking the next step toward the Presidency in a manner that he previewed when I profiled him for the magazine, in 2014. Cruz may be wrong about Republican and Presidential politics, but he’s consistent, and his rejection of Trump, when every other putative successor as Republican nominee has endorsed him, fits into his master plan. In simple terms, Cruz thinks that conservative Republicans win Presidential elections: Ronald Reagan, in 1980 and 1984; George H. W. Bush, in 1988; George W. Bush, in 2000 and 2004. He thinks moderate Republicans lose: George H. W. Bush, who had agreed to raise taxes, in 1992; Bob Dole, in 1996; John McCain, in 2008; and Mitt Romney, in 2012. Cruz intends—someday—to be that conservative Republican nominee.

Cruz built his 2016 campaign on the principle that he had to be the most conservative candidate in the race. He embraced social issues (opposing abortion and proposing a constitutional amendment to ban same-sex marriage) in a way that Trump never did. Although Trump made opposition to illegal immigration the cornerstone of his candidacy, Cruz had the same hard-line approach to evicting people from the United States. On climate change, taxation, Obamacare, and every other issue, Cruz positioned himself at the far right of the Party. Of course, Cruz’s efforts fell short, and he did not become the nominee.

But, despite his defeat, Cruz positioned himself perfectly to reassert his core argument in 2020. Assuming that Trump loses this year, Cruz can argue that Trump failed because he did not fully embrace conservative dogma. While Trump has taken conservative positions during the campaign, he has held a variety of less hard-line views over the years, including on such bedrock issues as abortion. And Trump has, in any event, largely steered away from social issues during his campaign. In recent days, Trump even appears to be trying to moderate his views on illegal immigration, which had been the heart of his conservative appeal.

The greater Hillary Clinton’s margin of victory turns out to be, the stronger Cruz’s claim will be. Without a political base of his own, a defeated Trump will be a deserted Trump; he will not be making a second run for President in his mid-seventies. Trump will be a scorned and discredited figure. Marco Rubio, Cruz’s once and future rival in the Presidential race, has given a grudging but real endorsement of Trump’s candidacy. (Rubio, of course, first has to survive a contested Senate race in Florida this year to have any political future at all.) But Cruz will be able to portray his refusal to endorse Trump as an act of conservative principle, while saying that Rubio and others gave in to political expediency. True, Rubio and others will be able to boast of their loyalty to the Republican Party while portraying Cruz’s intransigence as selfishness. But the effectiveness of that argument will depend on the affection that remains for Trump as a nominee. In the aftermath of a Trump defeat, particularly a lopsided one, the value of boasting about a Trump endorsement may be small indeed.

Cruz has built his career on repudiation of moderation—and on confrontation with his fellow-Republicans. On balance, it has worked out well for him. As a first-term senator, he nearly shut down the federal government single-handedly in a failed bid to end Obamacare. This kind of absolutism alienated his Senate colleagues, including Republicans, but it propelled him to a strong second-place finish in the Republican Presidential primaries—an extraordinary achievement for a politician who has won exactly one election in his life. For a party picking up the pieces after a catastrophic Presidential election (if that’s what it turns out to be), there will be great appeal in a politician, like Cruz, who can say, “I told you so.”