"You want to file a what, now?"

The deputy clerk looked up at me from behind her glass window in the county courthouse with an expression that showed both skepticism and confusion.

"A Petition for a Writ of Mandamus," I said.

"I don't think we can do those," she said. "Hold on. Let me get a supervisor."

Her confusion was understandable. The General District Court for Chesterfield County, Virginia, mostly handles cases involving traffic fines, evictions, and debt collection. They do not, I suspect, handle a lot of magazine interns trying to file pro se lawsuits against the local police department. And yet there I was.

The two hours it took me to convince the clerks that I was not crazy and that what I was trying to do was actually legal was my first indication that this might be more complicated than I had hoped. On the upside, they were pleased enough that I was not a sovereign citizen that they waived my filing fees.

The path that had led me to the Chesterfield County courthouse had begun about a week earlier, when I spotted a post on the law blog Above the Law about police in Virginia refusing to turn over body camera footage of a traffic stop in which officers of the Chesterfield County Police Department (CCPD) held a black college student at gunpoint. The story was a depressingly familiar one.

The student had been pulled over in early February by officers who said he hadn't stopped before turning right on red. Then, claiming to smell marijuana, they ordered him to step out of the car and asked if he had anything illegal. He replied that he had a knife clipped inside his pocket—perfectly legal in Virginia.

Immediately, the officer on the passenger's side of the vehicle aimed his gun at the driver. Both cops started shouting at him not to reach for the knife. After he'd been handcuffed, they searched the car, with his consent. Finding no weed, they let him go.

The kid's mother turned out to be Yesha Callahan, deputy managing editor at The Root. Understandably upset, she did what any sharp reporter would do and filed a request under the Virginia Freedom of Information Act (VFOIA) for the officers' body cam video. She also lodged a complaint with the police department.

When CCPD denied her request, claiming that the video was a FOIA-exempt "criminal investigative file," she wrote about it. That caught the attention of the Richmond Times-Dispatch, which started asking questions about the stop. After the first article in the Times-Dispatch, CCPD said that the paper's reporter and Callahan could come view the video in person at their headquarters but they couldn't have a copy.

Callahan, who lives in D.C., didn't make the trip, but a Times-Dispatch columnist, Michael Paul Williams, did, and described the video in his column. Williams also interviewed Jefrey Katz, the Chesterfield County police, and asked why he was being so hush-hush about the video.

Katz claimed he was worried about people trying to doctor the video. But he also said, in what I suspect was a moment of unintentional candor, that they hadn't wanted to release the video to Callahan because they believed that she had "an anti–law enforcement agenda."

That's where I come in. I sent off my own request to CCPD, thinking I'd get the same "criminal investigative files" response and I could write a quick piece chuckling about how they'd probably also rejected my request because they think Reason has an anti-police agenda.

They did reject my request, but didn't cite the exemption I expected. Instead I was told that CCPD considered the video to be a record "of an administrative investigation," specifically, the internal affairs investigation triggered by Yesha Callahan's complaint.

That gave me an idea. This wasn't a record of an administrative investigation; it was a record of a traffic stop that might or might not be relevant to administrative investigation. That isn't the same thing at all.

For the sake of due diligence , I tried to convince CCPD of that. They told me to go away.

Some states (and the federal government) have administrative processes to appeal Freedom of Information denials without going to court. Virginia doesn't. Instead, you have to sue for a court order to release the records.

Well, I figured, why not give it a try? You're allowed to bring these cases in Virginia's General District Courts, which have simpler procedures and also are "courts not of record," meaning their decisions aren't binding legal precedents. So if I lost (a distinct possibility, since I have no formal legal training and didn't have a lawyer), it wouldn't make life harder for other reporters in the future.

I found an example of a VFOIA lawsuit (arcanely styled a "Petition for a Writ of Mandamus") online, and I used it as a template to draft my own. It had to be filed in person, so road-tripping down to the courthouse I went.

The bewildered clerks were not the last of my problems. Pretty quickly, I hit two snags. First, the county took my case a little more seriously than I had thought they would. They put the second-in-command of the County Attorney's Office, a government lawyer with decades of experience, on the case.

Within a few days, he a filed Motion to Strike, arguing that my case thrown out because I'd sued the wrong entity— the police department instead of the county government. CCPD, apparently, was "a non-existent legal entity" that could not be sued. So the first hearing, which was supposed to be about whether the video had to be released, was instead about who the right defendant was.

The good news was that I managed to avoid having my case thrown out altogether. Instead, the hearing was delayed for a month while the clerk's office served the papers on the same county attorney's office that had just got done arguing that it hadn't been properly served.

The second difficulty I encountered was that Virginia's Freedom of Information law sucks. Essentially, it consists of a general mandate that documents and records generated by Virginia government agencies be produced on request, followed by exemptions for, basically, anything someone interested in government accountability would ever ask for.

It's especially bad with regard to police records. One of the exemptions is for "criminal investigative files," a term the act defines as "any documents and information, including complaints, court orders, memoranda, notes, diagrams, maps, photographs, correspondence, reports, witness statements, and evidence relating to a criminal investigation or prosecution." The Supreme Court of Virginia made things worse by holding that this exemption lasts forever, even after the investigation in question is closed.

Once we got past the procedural issue of who I should be suing, the county filed an answer to my fixed petition arguing that the video was exempt both because the fact that it showed the cops searching the car for weed made it a record of a criminal investigation and because of the previously cited internal affairs investigation.

The next hearing was the real show. The county lawyer and I spent about an hour and a half arguing about whether the two exemptions they were invoking should apply. Jeffrey Katz, the chief of police who had made the original "anti–law enforcement agenda" remark, turned up to watch the show. In terms of organizational seniority, I, the intern, was feeling a little outgunned.

Basically, I tried to argue that the consent search of the car was too minimal an effort to count as a "criminal investigation." I pointed out that the case in which the Supreme Court of Virginia had addressed the "criminal investigative files" exemption dealt with a suspicious death investigation that lasted for days and involved detectives, crime scene technicians, and an evidence log.

The county, on the other hand, argued that the exception applies any time officers are acting based on "reasonable suspicion," the low standard that applies to things like stop and frisk. I countered that such an interpretation would exempt video of nearly everything that police officers do and would thus defeat VFOIA's stated purpose of promoting transparency. Instead, I argued, the judge should look to the "totality of the circumstances" to determine whether an investigation has occurred, including the strength of the evidence, the level of police resources involved, and the complexity of the fact-finding techniques employed.

The issue about administrative investigations, which had initially piqued my interest in the case, ultimately ended up not mattering very much, because it only applies during the course of an administrative investigation, and so the issue is "trumped" by the criminal investigative files exemption, which lasts forever.

The judge asked both of us probing legal questions that suggested he was really paying attention. But in the end, I lost. In his opinion, the judge said he couldn't draw lines between which searches count as criminal investigations and which don't. As long as the police are acting on reasonable suspicion, he said, that's good enough.

That's not an outrageous ruling, all in all. But it's not quite correct, either. As the judge notes, "an investigation is a concerted effort—that is, more than a casual or haphazard effort—to ascertain facts about a given subject." In the context of daily life, sure, searching a car counts as more than a casual or haphazard effort. In the context of modern American law enforcement, though, casual and haphazard is exactly what these kinds of searches are.

"Pretext" traffic stops like this one—in which police pull over drivers with the true intention of searching for drugs—are one of the most commonplace forms of American policing. They're fishing expeditions, but thanks to the Supreme Court, they're entirely legal. In most states, an officer's unverifiable assertion that he smells marijuana is enough to create the "probable cause" sufficient to conduct a search even without the driver's consent.

To recognize that, and base a legal opinion on it, is probably further than you can fairly expect a judge who sits beneath three tiers of possible appellate scrutiny to go. There are layers and layers of bad law at work here.

So as far as police transparency in Virginia, this judge isn't the problem. VFOIA is, with an assist from the Supreme Court of Virginia. Saying that the public may access police records unless they relate in any way to criminal investigations is like saying you love all Ben & Jerry's products except the ones containing dairy. It's self-negating.

The judge in my case understood this, I think. "The Court believes that the language at issue here was codified in a pre–Ferguson, Missouri world," he wrote. "Judicial self-restraint, in addition to statutory analysis, counsels that the decision whether to exempt body-worn video from VFOIA should be made by the [state legislature], not the courts." I can respect that.

If you're a Virginian who cares about accountability, though, you should be pissed at your state and local governments for spending your money on body cams and then spending more of it to fight with a reporter to avoid letting you see what they film.