It has been an unlikely Washington feud, pitting a determined Sen. Dianne Feinstein, the implacable chairman of the Senate intelligence committee, long regarded as a supporter of the CIA, against the agency’s equally stubborn director, John Brennan.

The culmination of the battle is near, with the committee scheduled to vote Thursday on releasing a summary of its 6,300-page report on CIA interrogation practices. The report examines in damning detail one of the darkest chapters in modern U.S. history, in which the agency harshly interrogated al-Qaeda suspects to obtain information.

Feinstein (D-Calif.) wanted a report so tough that it would “ensure that an un-American, brutal program of detention and interrogation will never again be considered or permitted,” as she put it. Feinstein’s campaign has advanced that goal, and for this the country should be grateful. But the investigation process has also badly frayed the trust between Congress and the CIA because of blinkered actions by both Feinstein and Brennan.

The Senate report includes gruesome new details about interrogation practices in the first year after Sept. 11, 2001, before the CIA’s program was formally established with the misplaced approval of President George W. Bush’s Justice Department. These details — recounting filthy conditions and vicious interrogation techniques — will shock the conscience in the same way that the Abu Ghraib and waterboarding revelations did.

This is the necessary, curative part of the report. Brennan said in a letter to CIA employees last month that, while the agency has “taken corrective measures to prevent such mistakes from happening again,” he also wants to make sure “any historical account . . . is balanced and accurate.” It’s over the issue of what constitutes balance regarding the inflammatory issue of torture that Brennan and Feinstein have tangled.

The heart of the dispute isn’t whether torture is immoral — nobody would argue that question today — but whether it was ever effective. Feinstein’s investigators gathered 20 cases where CIA documents most frequently cited information gained from interrogation; the investigators scoured intelligence reports and argued that in each case the information could have been obtained without brutal methods.

The CIA critiqued the 20 cases, pointing out what it claimed were serious errors. The Senate staffers re-crafted the document, fixing mistakes but maintaining the claim that the same intelligence could have been gleaned without torture. The CIA rewrote its rebuttal, continuing its dissent that, even with perfect hindsight, the record was ambiguous.

Perhaps the clearest public CIA statement was a May 2011 letter from then-Director Leon Panetta to Sen. John McCain (R-Ariz.) about whether “enhanced interrogation techniques” had provided leads that identified Osama bin Laden’s hiding place. “Whether those techniques were the ‘only timely and effective way’ to obtain such information is a matter of debate and cannot be established definitively,” he wrote.

This ambiguity wasn’t acceptable to Feinstein. When the movie “Zero Dark Thirty” appeared in December 2012 (the month her committee finished the report) and suggested that harsh interrogation had generated leads that led to bin Laden’s hideout, she co-authored a letter that blasted the movie for even considering the possibility. “The use of torture should be banished from serious public discourse,” the letter argued, in what sounded almost like an attempt to censor debate.

After Brennan became CIA director in 2013, the battle lines hardened further. Like Feinstein, he was obdurate on what he considered matters of principle. President Obama had privately cautioned Brennan in May that he didn’t want him to defend the interrogation program. But when the director learned this January that Senate investigators had obtained, copied and removed from a CIA facility a sensitive, off-limits document known as the “Panetta review,” he went ballistic. The initial mistake here was probably the CIA’s, for inadvertently putting the document — an unofficial draft by mid-level CIA staffers — in a computer system where Senate investigators could grab it. But the war was on.

The CIA’s Office of Security rashly searched the Senate staff’s computers at a CIA facility — triggering an investigation by the agency’s inspector general. Whereupon the CIA general counsel imprudently sent a “crimes report” to the Justice Department, requesting an investigation of how the Senate staffers had obtained the Panetta document.

It was a royal mess and the opposite of how oversight is supposed to work. Brennan shouldn’t have waged this fight: The CIA never really wins when it battles Congress. But Feinstein should recognize that the reason to oppose torture is because it’s immoral — not because a prosecutorial, 6,300-page Senate report claims that it never works.

Read more from David Ignatius’s archive, follow him on Twitter or subscribe to his updates on Facebook.