When John F. Kelly replaced Reince Priebus as White House chief of staff, one question he faced was the choice of managing down or managing up: bringing discipline to a chaotic and feuding staff operation or trying to tame an uncontrollable boss. This past week it became evident he’s done neither successfully.

Kelly made his bet early. There was little he could do to change President Trump. This president, more than others in the past, operates outside of traditional boundaries. His impulses are rarely in check, and often he acts on his worst instincts. He makes life difficult for those who serve him. What’s a chief of staff, even a retired four-star Marine general, to do about that?

Kelly decided to manage down, to focus where he thought his talents could best be utilized. He earned plaudits for reducing the staff infighting and bringing some semblance of order to a White House where an open door to the Oval Office symbolized a table of organization with no clear lines of authority.

Instead of a White House seen from the outside as a real-life “Game of Thrones,” with characters in primary colors clashing behind a cascade of leaks and anonymous quotes, the White House under Kelly’s guidance projected a far less flamboyant personality. That was in part because of new processes he put in place and in part because of the departure of some senior officials who delighted in all the palace intrigue.

If the fundamental behavior of the president did not change, allies of the administration comforted themselves into believing that a somewhat calmer White House was a more competent White House. However, the changeover in Kelly’s regime appears to have instead substituted one set of problems for another, as this past week demonstrated.

The past few days have been terrible for the White House. Staff secretary Rob Porter, regarded as one of the most skilled insider operators in the White House, was forced to depart after two ex-wives went public with accusations of domestic abuse. In leaving the government, Porter forcefully denied the accusations, labeling them as “simply false.”

On Friday, a second White House official, speechwriter David Sorensen, resigned as The Washington Post was preparing to publish a report about domestic abuse accusations leveled by his former wife. Sorensen also strongly denied the allegations.

Sorensen’s ex-wife told The Post’s Elise Viebeck that she had shared her account with the FBI during a background investigation for her former husband, just as Porter’s exes had done with him.

In Porter’s case, the accusations of abuse were long known to some senior White House officials, who chose not to act on them until public scrutiny forced their hand. Kelly’s reputation has taken another hit, and White House officials once again are under siege and plunged into a new period of turmoil and recriminations.

Trump’s White House will probably never be smooth-running, as it ultimately reflects the character and personality of the president. But the past few days have dealt another blow to public confidence in those who serve at the highest levels at the White House and probably to the morale of those who serve there in other capacities.

Porter acted as more than staff secretary. He was in many ways Kelly’s right hand, a staffer with no public profile but, by accounts from those who worked with him, someone who was highly skilled at his job. His role was to manage the flow of paper to the president, a responsibility that belies its bureaucratic description. He was in constant contact with Trump, briefing him — and no doubt educating him — about the kinds of policies and proposals that are constantly in motion in any administration and that were in many cases unfamiliar to a chief executive with no prior governmental experience.

Porter was good at his job, and he was allowed to continue despite the allegations of abuse that had surfaced during the FBI background checks and were relayed to White House officials. When the first reports about the accusations surfaced on Tuesday night in the Daily Mail and the Intercept, Kelly issued a statement in Porter’s defense, effusively praising his character.

Kelly’s initial defense of Porter, echoed by others at the time, was complicated by the fact that the staff secretary was dating Hope Hicks, the White House communications director, who reportedly had a hand in shaping the first reactions.

As public outcry intensified, Kelly backed away from his robust endorsement.

He told senior staffers Friday that he had moved swiftly to remove Porter when he learned that the allegations were credible, according to The Post’s Philip Rucker and Josh Dawsey. It was an explanation that contradicted previous accounts from Trump administration officials.

Meanwhile on Friday, the president undercut efforts to distance the White House from Porter when he praised his former staffer. “We wish him well,” he told reporters, later adding, “He also, as you probably know, says he is innocent, and I think you have to remember that.”

In the case of Porter, Kelly appears to have put his emphasis on competence and a smoothly running White House ahead of good judgment about how to deal with something as serious as domestic abuse. It was not the first time Kelly has said or done things that lacked either good judgment or political sensitivity.

Kelly served admirably in the military, and those accomplishments will always be part of his biography. But the differences between the military and the civilian role of running the White House have caused him problems. As chief of staff, he has shown various blind spots that have led him into other controversies, from falsely attacking a female member of Congress to suggesting the Civil War was caused by a failure to compromise.

On Tuesday, he noted that the president’s immigration proposal, which offered a path to citizenship for 1.8 million “dreamers,” the young undocumented immigrants brought to the country as children, far exceeded the 690,000 who had signed up for the protections under the Obama administration’s Deferred Action for Childhood Arrivals program.

“The difference between 690 and 1.8 million,” he told reporters, “were the people that some would say were too afraid to sign up, others would say were too lazy to get off their a--es, but they didn’t sign up.”

Kelly’s failure to recognize the severity of the accusations against Porter, or to demand more information sooner, is not the first example of his effort to ignore or screen out information that interfered with his approach to running the White House.

He told reporters on a day Trump had tweeted that North Korea’s Kim Jong Un was “short and fat” that he tries to pay no attention to the president’s Twitter feed. “Someone, I read the other day, said we all just react to the tweets,” Kelly said, according to the Los Angeles Times. “We don’t. I don’t. I don’t allow the staff to. We know what we’re doing.”

Kelly made that comment in the fall. It was an expression of confidence and self-confidence that has again been called into question under an especially harsh spotlight. Given what has been revealed about the internal operations at the White House and the turmoil that it has set off, would he make that same claim today?