The old legitimizing thugs theory was at the breaking point. It simply had too many flaws to continue, so this should be a refined version. Even if I'm wrong about how to address it, I don't think I'm wrong in saying what the problem is. I might need to refine it again, too. We'll see.
My idea is to publicly recognize the Taliban as the ruling authority of Afghanistan, and then hold them publicly responsible for every death that happens until they surrender to us. It's only a political strategy, not a tactical one, but it's politics that has been ruining this war for us, not tactics.
This doesn't mean we punish them for the deaths. It's simply a restructuring of our own war doctrine. It's unrealistic to give ourselves responsibility for civilian deaths, when we have hardly any control over it. We're not the ones who ought to surrender if the civilian death toll gets too high. The Taliban is. It's their people, and their responsibility to protect them, not ours. We need to start asserting that.
If they don't either surrender, or defeat us, in the next few years, then every civilian death that happens must be seen as being their fault. A responsible leader would surrender if the suffering of their people became too great. Sometimes the only way to discredit someone is to give them the chance to prove themselves. So, yes, we should negotiate with them, by which I mean we should offer them terms of surrender. (Probably those terms would be "unconditional surrender", where all we agree to do is stop harassing the people that they are supposed to be in charge of.)
I think our political mistake has been trying to set up a government in a place that still has a government. Taking Kabul didn't mean the Taliban was no longer Afghanistan's government. Until the Taliban publicly surrenders, or a significant portion of the people publicly refuse to follow them, or aid them, the political fact of the matter is that they are in charge. Pretending otherwise, or labeling them "terrorists" doesn't change that fact. What it does is make it impossible to change it.
Going back to WWII, the real point of victory with Japan was when the Emperor surrendered. If we merely took Tokyo, I don't think that would have counted as victory. It was probably the emperor's knowledge that he was seen as primarily responsible if we went on Nuking Japanese cities, that motivated him, not fear of death. (Because it was seen as being his responsibility to stop us, not our responsibility to stop.) If it were fear only for his own life, he probably would have refused, and as long as the emperor remains credible in the minds of the Japanese people, he can be replaced as many times as we kill him.
Somehow, our fear of "total war" engagements has prevented us from being able to put enemy leaders in the same position as the Emperor was in.