The National Security Agency’s bulk collection of Americans’ phone records is bound for review by the U.S. Court of Appeals for the D.C. Circuit — just as the court is set to undergo significant change.

U.S. District Judge Richard Leon ruled last week that the government’s surveillance efforts “almost certainly” violated the Fourth Amendment. Leon was caustic in his criticism of the phone data collection — James Madison “would be aghast,” the judge wrote — and skeptical of the argument that protection of the national security justifies the program.