Let's face the Afghanistan War problem/project at a more abstract level. This helps the clarity of thought.

I say:

The problem is the extremist view on warfare and national security.


Evidence:
I cannot remember a single war in history where governments believed that an alliance was still to be committed to a fight AFTER the aggressor was pushed out of power (para)militarily. Wars usually end when the aggressor lost power.

This time it's even more extreme: The alliance only really committed itself AFTER that government had lost power. How dumb is that?

Even MORE extreme: Said government wasn't even the aggressor. The aggressor was a state-independent and transnational group of criminals, none of whom resided in the country in question, were born there, raised there or belonged to one of its ethnic groups. The ones who commited the crime died in the process.


2,200 years ago, Cato repeated after every Senate speech (and he lived very long, was Senator for many decades) that he believed that Carthage muzst be destroyed. Carthage posed no real threat any more, but he wanted it destroyed.
Such extremism was not atypical in ancient Rome: As long as it could, the Republic and early Empire were not able to accept the survival of a threat. They were quite childish and naive, obviously. The consequence was war after war, expansion after expansion - until the empire had not only passed its optimal size, but even grown further to a size that was so much suboptimal that the benefits of a small empire were consumed to the degree of fragility of the huge empire.


This same inability to stand the survival of even a small threat, this extremist view that sheds centuries of warfare that usually had a lot of restraint - this inability probably stems from 1943 when the Allies demanded unconditional surrender. This counter-productive extremism means that easy ways out of troubles are blocked by extremism.

The whole extreme treatment of the AQ/AFG affair was totally counterproductive, even if we ignore all the expenses, WIA and KIA.
By the time of the invasion AQ was still denying responsibility for 9/11, right?
With that denial (a condition for Taliban's hospitality) there would have been no global jihad fashion and thus much less if any follow-on attacks.
If AQ had on the other hand accepted responsibility while in AFG, this would have helped denying them this safe haven.

In other words; smarter diplomacy and national leadership could have
# either solved the AQ/AFG issue 100%
or
# avoided the global jihad fashion

Instead, resources were thrown at the problem and governments acted like 4 year olds.


Now could we at least getb rid of the latter and shed the extremist view on warfare?