Planning for the final assault on Raqqa, the capital of the Islamic State’s caliphate, had been grinding on for more than seven months. There had been dozens of meetings of President Barack Obama’s top national security team, scores of draft battle plans and hundreds of hours of anguished, late-night debates.