This week, possibly as soon as Tuesday, the Senate will vote on the House-approved USA Freedom Act, which would end the National Security Agency’s bulk collection of Americans' phone records. To some, its expected passage is a victory for the alliance between libertarian-oriented Republicans and civil liberties-oriented Democrats that sprang to life in 2013 after the leaks of former NSA contractor Edward Snowden. And to be fair, if it weren't for strange bedfellows like libertarian-minded Senator Rand Paul of Kentucky and Oregon's liberal Senator Ron Wyden, the Senate might be voting simply to reauthorize Patriot Act provisions.

But more than anything, what brought us here—that is, a modification to the collection program that leaves records in telephone companies' hands, and after two years of see-sawing debate—is the general Republican disarray on national security. The party is shifting on the issue; it's just not sure where it's going.

That confusion manifested itself when Senate Majority Leader Mitch McConnell, who was a sharp tactician as minority leader and wants to keep the NSA program intact, misplayed his hand by assuming none of his colleagues would let the Patriot Act provisions expire. Paul, the fellow Kentuckian whom McConnell has endorsed for president, did just that, forcing the majority leader and some of his caucus’s hawks to advance a bill they don’t actually support. Others refused, which is why the 17 "no" votes on Sunday included hawks like Tom Cotton and Joni Ernst as well as Paul. In the House, the 88 members who voted against the Freedom Act included a mix of liberal Democrats and libertarian Republicans who don't believe it goes far enough, among them some of the most prominent opponents of bulk collection, like Republicans Justin Amash and Thomas Massie.

When Snowden went to the media with evidence of the secret NSA program in 2013, Paul's libertarian cohort and liberal Democrats led the early charge. That summer, Amash and a fellow Michigander, Democrat John Conyers, came just a handful of votes away from convincing the House to adopt an amendment that would’ve ended bulk collection. The 217-205 vote on the Amash-Conyers amendment scared GOP hawks and Democratic Obama administration allies who had defended the program, forcing them to accept some limitations.

But some of those GOP hawks switched positions entirely. Mere weeks after Snowden’s leaks to the media, I asked James Inhofe where he stood. “I actually supported it originally. I felt a little more comfortable supporting it with Bush as president than the current president,” the Oklahoma senator said, citing, in essence, party allegiance. “Is that shocking?”

Representative Jim Sensenbrenner, who sponsored the original Patriot Act that the executive branch used as the legal justification for the bulk collection program, became one of the program’s harshest critics, going so far as to serve as lead sponsor of the Freedom Act. For Sensenbrenner, it was about what he said was the unexpected abuse of the Patriot Act, which expanded surveillance beyond what he intended. Other Republicans who fielded angry calls after their vote against the Amash-Conyers amendment reversed their position as a result.

All the momentum for—at minimum—a legislative watering down of the bulk collection program seemingly came to a halt at the end of 2014 when the Republican Senate united to block debate on the Freedom Act. It looked like the neoconservative wing of the party might be ascendant again, bolstered by Iraq's spiraling out of control and Republicans' winning back the Senate in the fall elections.

Since then, though, the picture has become murkier in a couple ways: One, a pair of GOP presidential candidates fumbled Iraq questions, sparking a backlash from the right, scattering other candidates, and signaling a party still shaky on one of its former strengths: national security. And two, we learned definitively that any political shift that neocons might celebrate in the Senate didn’t necessarily extend to the House, where 338 lawmakers backed the Freedom Act.

That’s where McConnell’s miscalculation came into play. McConnell wanted to simply reauthorize expiring Patriot Act provisions as the June 1 deadline approached, but failing that, he wanted to pass some short-term extensions toward that ultimate goal. And in an odd bit of brinkmanship to drag everyone in his direction, he stalled to try to force a choice between either the short-term extension or nothing, despite considerable evidence that the House didn’t want a short-term extension.

But before it could get that far, Paul began his own stalling—first with his "fake filibuster," and most recently by using procedural maneuvers to delay Sunday's vote until Tuesday (and fundraising off of it). Backed into a corner of his own making, McConnell was forced to settle for the Freedom Act he never liked, although he’s making one last stab at weakening it with some amendments Tuesday before it heads to a final vote. And while just a couple weeks ago there still weren’t enough votes from Senate hawks and various skeptics to pass the bill, a 77-17 vote to advance it this past weekend suggests that some believe it's better than the alternative.

It’s an uneasy resolution for many Republicans, hawks and libertarian reformists alike. If nothing else, then, this whole mess shows that there's something Republicans can agree on when it comes to security and privacy: that Rand Paul is a pain in the ass.