(Posted by John, not Ezra.)
If you haven't read the NYT piece on Afghanistan today, you really owe it to yourself to. Rob Farley at Lawyers, Guns and Money has some thoughts on whether this retroactively de-legitimizes the invasion of Afghanistan in the first place.
I don't really know the answer to that question in my own head, but my suspicion that Afghanistan is going to end very badly for NATO makes me think it's time for us to leave. (The short version of my argument these days is that nobody has seriously considered enduring the costs that an actual success in Afghanistan would entail, so the forseeable future is bloody back-and-forths between us and the Taliban. Add martial and political incompetence to the mix, and, well...)
That said, I think there's two points I'd like to make in response to Rob's argument: one response to a specific point, and another more general argument.