As President-elect Obama begins to form his administration his wisest counsellors will be pointing out the need for a major policy rethink in Afghanistan. For months senior military figures in both Britain and America have been speaking publicly of their own failure to win a military victory against the Taliban and the need for negotiation.
They join a long list of military commanders over the past two centuries who have learned the hard lessons of fighting in the Hindu Kush and the hot southern plains. The Afghans do not take kindly to farangis who occupy their land and this issue will unite them as much as ethnicity, language, religion and geography divide them.
The generals may have known all along that the chances of defeating the insurgency were very small, but after seven years of fighting they can no longer be in any doubt. This summer the insurgency was more active and effective than ever before.
Two hundred and fifty soldiers have died in Afghanistan this year so far, including 151 Americans. In the whole of last year there were 232 casualties. More than 1,000 have died since the US-led invasion in 2001, of whom 634 were Americans (all figs from icasualties.com). Many thousands more have been seriously injured.
Estimates of civilian casualties are harder to come by, but most estimates suggest somewhere around 7,000 people have been killed directly as a result of the conflict, with anything from 9,000 to 27,000 having been killed indirectly by the humanitarian crisis that has gripped parts of the country.
And while US and other forces have had some success in direct firefights, we have also begun to see accounts of battles in which the Taliban is willing to commit several hundred fighters at a time, occasionally over-running fixed positions before quickly withdrawing. On several occasions groups of soldiers have only been saved by the use of massive airpower.
But that is increasingly controversial. The last few months have been particularly noteworthy for the number of airstrikes which have led to civilian deaths, clearly as a result of poor targetting or misinformation. In the August bombing of the village of Azizabad in western Afghanistan, in which many civilians died, it later emerged that information that led to the airstrike came from Afghan tribal opponents of the village that was hit.
One of the most striking differences between the present conflict and the many campaigns conducted by the British Army during the days of the Raj is the comparative lack of knowledge of the tribal and social structure of Afghanistan by the military.
The first Pashto grammar in English was written by Henry Walter Bellew (1834-92), a surgeon in the Bengal Army, who served with the Corps of Guides in Mardan in the 1860s. His General Report on the Yusufzais (1864) and Inquiry into the Ethnography of Afghanistan (1891) remain important historical works. Many other British officers learned either Dari or Pashto and were familiar with the pashtunwali code of conduct.
Today there is little evidence that the military understands the importance of tribal politics in trying to understanding Afghanistan. How many military officers know that there are Shia enclaves in the Federally Administered Tribal Areas of Pakistan, for example?
One consequence is that all Pashtuns have been demonised, as military strategists find it impossible to differentiate between Taliban and Pashtun, often using the two terms interchangeably. The reality is that the insurgency is almost as fractured as the US-led coalition it is fighting. In parts of the south it is drug lords who predominate, in others the Taliban of Mullah Omar or the Hezbe Islami of the warlord Gulbuddin Hekmatyar.
Understanding these local differences is vital.
As Obama consults his generals he would do well to consider the possibility that the Islamic world itself may have an important role to play in terms of resolving the present conflict. One could go further and reasonably argue that the chances of a negotiated settlement are minimal without the participation of moslems. For some time it has been rumoured that negotiations have been taking place with elements of the old Taliban leadership that has become disenchanged with Mullah Omar and his close association with al-Qaeda. President Karzai himself has admitted as much and not so long ago he threw British advisers out of the country for conducting such talks without his permission.
These may look like local talks, but the reality is that it will require power brokers based in Cairo and Jeddah to make these discussions turn into a real agreement.
For those living in Kabul, there is still a sense that they are living in a capital city, even though safety cannot now be guaranteed in most of the country. In the last week we have been told of three kidnappings - a Canadian and a Dutch journalist - both of whom were seized very close to the capital - and a 61 year-old American engineer who was held for two months before being rescued by US special forces. Two weeks ago a Frenchman was kidnapped off the streets of Kabul and before that UK citizen Gayle Williams was gunned down in the street, allegedly for spreading Christianity. The town of Sarobi, where ten French paratroopers were killed six weeks ago by a large force of Hekmatyar's men is only a half-hour drive from the capital.
It may be that the impending arrival of winter will slow the momentum towards national disintegration, but unless someone in Washington wakes up to the realities and convinces the President that missiles fired from drones and a surge in troop numbers will not solve this war, then the spring will bring another hard lesson for Operation Enduring Freedom.