The strategy behind Ukraine’s rapid military gains in recent days began to take shape months ago during a series of intense conversations between Ukrainian and U.S. officials about the way forward in the war against Russia, according to American officials. The counteroffensive — revised this summer from its original form after urgent discussions between senior U.S. and Ukrainian officials — has succeeded beyond most predictions. Ukrainian forces have devastated Russian command and control, and appear poised to capitalize on their advances in the northeast of the country and in another campaign in the south.