McClatchy says that one inmate, Mohammed Akhtiar, was known as pro-American to everybody but the American soldiers who battered him. Some of his militant fellow inmates spit on him, beat him and called him “infidel,” all because of his anti-Taliban record.

These abuses happened partly because, for several years after 9/11, many of our national institutions didn’t do their jobs. The Democratic Party rolled over rather than serving as loyal opposition. We in the press were often lap dogs rather than watchdogs, and we let the public down.

Yet there were heroes, including civil liberties groups and lawyers for detainees. Some judges bucked the mood, and a few conservatives inside the administration spoke out forcefully. The Times’s Eric Lichtblau writes in his terrific new book, “Bush’s Law,” that the Immigration and Naturalization Service commissioner, James Ziglar, pushed back against plans for door-to-door sweeps of Arab-American neighborhoods.

The book recounts that in one meeting, Mr. Ziglar bluntly declared, “We do have this thing called the Constitution,” adding that such sweeps would be illegal and “I’m not going to be part of it.”

Among those I admire most are the military lawyers who risked their careers, defied the Pentagon and antagonized their drinking buddies  all for the sake of Muslim terror suspects in circumstances where the evidence was often ambiguous. At a time when we as a nation took the expedient path, these military officers took the honorable one, and they deserve medals for their courage.

The Truth Commission investigating these issues ideally would be a non-partisan group heavily weighted with respected military and security officials, including generals, admirals and top intelligence figures. Such backgrounds would give their findings credibility across the political spectrum  and I don’t think they would pull punches. The military and intelligence officials I know are as appalled by our abuses as any other group, in part because they realize that if our people waterboard, then our people will also be waterboarded.

Both Barack Obama and John McCain should commit to impaneling a Truth Commission early in the next administration. This commission would issue a report to help us absorb the lessons of our failings, the better to avoid them during the next crisis.

As for what to do with Guantánamo itself, the best suggestion comes from an obscure medical journal, PLoS Neglected Tropical Diseases. It suggests that the prison camp would be an ideal research facility for tropical diseases that afflict so many of the world’s people. An excellent suggestion: the U.S. should close the prison and turn it into a research base to fight the diseases of global poverty, and maybe then we could eventually say the word “Guantánamo” without pangs of shame.