On June 1 the legal authority enabling the National Security Agency's bulk telephone metadata collection program expires. The expiration date of Section 215 of the USA Patriot Act comes two years after NSA whistleblower Edward Snowden revealed the spying to the Guardian.

Ahead of the deadline, three key bills have emerged. They can best be described as the good, the bad, and the ugly.

One proposal scuttles the bulk metadata program altogether. Another bill tinkers with the snooping. Yet another allows it to continue unabated though 2020.

The good

There's a House measure called the Surveillance State Repeal Act that does what its name says. It ends the authority for the bulk telephone metadata collection spying. That means the nation's telcos won't have to fork over to the National Security Agency the phone numbers of both parties in a call, calling card numbers, the length and time of the calls, and the international mobile subscriber identity (ISMI) number for mobile callers. The NSA keeps a running database of that information, and says it runs queries solely to combat terrorism.

Several former national security whistleblowers called Monday for the measure's passage. One of them was Thomas Drake, a former NSA executive once prosecuted under the Espionage Act. Drake, who eventually pleaded guilty to a misdemeanor charge of exceeding his authorized access of government computers, said he was "throwing my weight behind" the legislation proposed by Reps. Mark Pocan (D-Wis.) and Thomas Massie (R-KY).

The bill sits in the House Subcommittee on Crime, Terrorism, Homeland Security, and Investigations.

The bad

Credo Mobile, Demand Progress, and others immediately blasted the latest version of the USA Freedom Act of 2015, which was proposed Tuesday in the House and Senate. They decried it as a "diversion."

Instead of the NSA collecting and housing the metadata from every phone call made to and from the United States, the USA Freedom Act's passage would mean that the same data would remain with phone companies.The act requires the NSA to seek approval from the Foreign Intelligence Surveillance Court before demanding that the telecoms hand over metadata based on an NSA search query.

"As a telecom that can be compelled to participate in unconstitutional government surveillance, we can tell you that the latest version of the USA Freedom Act is just a diversion to take the heat off our out-of-control surveillance state," said Becky Bond, Credo's vice president.

Under the proposal, the Fourth Amendment standard of "probable-cause" is not a necessary element to demand data from the telcos. The government promises that it only searches the data it now collects if it has a "reasonable, articulable suspicion" against a terrorism target.

The legislation would allow the revised phone snooping to continue through 2019 and was indeed a compromise.

Sen. Patrick Leahy, a Democrat from Vermont who helped broker the package, said it was a "product of intense and careful negotiations between the House and Senate."

"The USA Freedom Act is a path forward that has the support of the administration, privacy groups, the technology industry and, most importantly, the American people," he said.

The Center for Democracy & Technology is supporting the bill, saying it was a "significant first step in broader government surveillance reform." What's more, the group said the "bill would also provide greater transparency and accountability regarding surveillance orders and the activities of the secretive Foreign Intelligence Surveillance Court."

Mozilla weighed in, too. Noting the realpolitik of the situation, Mozilla said the bill "represents a significant step" in the privacy battle, yet "there is more to do."

The House Judiciary Committee is expected to consider the measure on Thursday.

The ugly

This bill, (PDF) which is unnamed, leaves the metadata snooping program unscathed through the end of 2020. The measure was proposed by Senate Majority Leader Mitch McConnell of Kentucky and Senate Intelligence Committee Chairman Richard Burr (R-NC). It keeps intact the Patriot Act's "business records" language allowing the authorities to acquire, without a probable cause warrant, "business records" on people held by most any institution, including banks and telephone companies.

McConnell and Burr have declined comment.

No hearing date has been set.