The document trove reveals that Boston police officers and BRIC analysts spent hundreds or thousands of hours — and countless tax dollars — collecting and compiling huge quantities of information about people, including Walsh, simply because they spoke at Occupy Boston or related events during the fall and early winter of 2011.

According to documents obtained by the Partnership for Civil Justice Funds and released to The New York Times last Friday, Boston law enforcement officials assigned to the so-called “anti-terrorism” fusion center kept tabs on the political activities of then-state-legislator Walsh and dozens of other law-abiding people.

What does Boston Mayor Marty Walsh have in common with peace activists, environmentalists and the ACLU? All showed up in files created by the Boston Police Department’s “Boston Regional Intelligence Center” (BRIC) database.

This information about individual speakers and groups was stored in BRIC, one of the two so-called “fusion centers” in Massachusetts that the Department of Homeland Security set up to catch terrorists.

Mayor Walsh isn’t a terrorist, you say? Neither is Bill McKibben, the famous environmental spokesman. Nor are long-time ACLU of Massachusetts Public Education Director Nancy Murray, MIT professor Noam Chomsky or rap mogul Russell Simmons. But all showed up in the BRIC database because they dared to speak at events affiliated with Occupy Boston.

In 2012, the ACLU of Massachusetts and the National Lawyers Guild published a report criticizing the Boston Police Department for the same kind of red-squad political monitoring. That report, entitled “Policing Dissent,” also relied on internal BRIC documents obtained through a public records lawsuit. The expose revealed how the BPD wasted public resources tracking the legal political activities of scores of individuals and various antiwar organizations, including Veterans for Peace and Codepink.

Our clients, war veterans and social workers among them, were labeled things like “EXTREMIST” simply for protesting the U.S. wars in Iraq and Afghanistan.

In response to that expose, an attorney for the BPD said that the records on peace groups were retained in the BRIC due to a “computer glitch” and would be deleted. Now it seems like political surveillance is a feature of BRIC, not a bug.

It didn’t have to be this way. At least one fusion center, in Delaware, declined to keep records of the Occupy movement, citing the First Amendment and the center’s focus on actual crimes, instead of speech. The Boston Police Department appears to have taken the opposite approach.

The BRIC records contain precise details about who was at Dewey Square, when and for what purpose. Nothing was too small for BRIC analysts to note in the records, which were daily distributed as “homeland security bulletins” to an unknown numbers of private security corporations and law enforcement organizations at untold locations state- or even nation-wide.

Why were purported anti-terrorism analysts keeping these records on law-abiding people? What possible public safety purposes were served by this political surveillance?

At the top of many of the documents is a disclaimer asserting that the information contained therein is “provided for awareness due to the potential for these events to result in increased crowds or traffic conditions.”

That sounds reasonable. Except it’s not true.

In fact, a huge quantity of the information in the documents has nothing to do with crowds or traffic. Boston police officers documented yoga classes, religious ceremonies, musical concerts and educational lectures. The fusion center employees even kept track of how many people were planning to attend events that took place on private campuses outside the city limits — notably at Harvard and Tufts Universities.