Back in 2003, at the start of America’s disastrous invasion of Iraq, then Major General David Petraeus, commanding the US 101st Airborne Division driving toward Baghdad, famously asked my Washington Post colleague Rick Atkinson: “Tell me how this ends.”

That phrase – both a question and a plaintive plea – came to capsulate the entire unplanned and ill-fated Iraq misadventure, from which the US is still struggling to extricate itself. But the question is equally applicable today, as America once again seems bent on blindly stumbling into a new conflict with inadequate preparation, unclear goals and with no clear exit strategy – a possible trade war with China.

I say “possible” because, despite all the huffing and puffing, common sense could still prevail and the US and China could pull back from the brink. But that would require a remarkable public climbdown by US President Donald Trump, who has so far shown himself adverse to introspection, incapable of admitting error, and quick to claim credit even from the most ignominious defeats.

Remember the promise to “repeal and replace” Obamacare, the national health insurance programme? It didn’t happen. But didn’t stop Trump from proclaiming, “We have essentially repealed Obamacare.”

Trump’s travel ban on immigrants from majority-Muslim countries? Repeatedly watered down, repeatedly struck down in federal courts, and waiting for a final ruling by the US Supreme Court. The trillion-dollar infrastructure rebuilding plan? Dead in the water. Repealing the Obama-era protections for young immigrants brought to the US as children? Blocked in the courts.

And that “big, beautiful wall” along the border with Mexico? Congress would not approve the money, and of course Mexico refused to pay for it.

The trade war, in fact, should be seen in the broader context of those other Trump failures and defeats. Congress controls the purse strings, and can block him from spending any money to build his border wall or rebuild infrastructure. The courts can put on hold his plans to deport young immigrant “dreamers” or block Muslim migrants. But there is one area where an American president has broad freedom to act unilaterally without interference from Congress or the courts, and that is with trade policy.

To figure out how to get out of a trade war with China, it is best to start by figuring out how it started.

Trump’s base was considered so loyal, and he so impervious to criticism, that he once declared he could shoot someone in the middle of Fifth Avenue and “not lose any votes”. But after a year in the White House, and a string of setbacks in Congress and the courts, there were signs that the Don’s Teflon was starting to fray.

He was being blasted by conservative talk radio pundits for signing a massive US$1.3 trillion spending bill laden with Democratic priorities like funding for environmental protection and foreign aid that will also drive the US national debt to record levels.

Beijing must change its ways or US trade war looks inevitable

Meanwhile, his erstwhile rightwing supporters were chastising him for accepting a spending bill that did not include money to build his border wall, a central campaign promise that animated his boisterous rallies with chants of “Build that wall!”

The inability to find funding for the wall has tarnished Trump’s brand as the master deal maker who could get things done. For the core of Trump’s blue-collar base, concerned about the perception of a flood of illegal immigrants literally changing the complexion of the country, the wall became the most potent physical manifestation of Trump’s “America First” policy.

But Trump has proven, if anything, that he is a master of deflection. And if his base was riled up about inaction on the border wall, what better way to divert attention than by threatening to launch a trade war? If there is one thing those blue-collar workers in steel country get excited about more than illegal immigrants, it is unfair trade practices from China.

Someone tell Trump the trade war is over. China won

China’s leaders for decades have used unfair trade policies to build their economy, with only occasional and scant criticism from US leaders, usually around election time. It kept its currency undervalued when it helped push exports. It forces American companies to share coveted technology, and blocks out entire sectors of its economy, such as financial services, from foreign competition. Some of the biggest American tech companies, such as Facebook and Google, are banned.

Some have suggested that the real endgame for Trump’s tariff threat is to force an opening of China’s economy, and for President Xi Jinping to fulfil the pledge to turn China into a full market economy.

The road map to the opening of China’s economy was laid out in a report, called China 2030, by the World Bank and China’s Development Research Centre.

Even as the rhetoric heats up, Trump’s economic team is said to still be in talks with China’s top trade officials, looking for ways to avert a showdown. The trouble is, it is difficult now to see the off-ramp. China under Xi has changed dramatically since that 2012 report recommended breaking up state-owned enterprises and opening the financial and service sectors to foreign competition. In his marathon speech to the Communist Party congress last October, an emboldened Xi talked about making state-owned enterprises stronger, not breaking them up. He barely mentioned the word “markets”.

Others have reported that White House trade representatives are pushing China to lower existing duties on American automobiles and buy a few more US-made semiconductors – minor concessions that, at this point, might not be enough to mollify Trump’s core supporters who are already sick of being sold half-measures and pyrrhic victories.

Trump himself, in various Twitter rants, has made eliminating the trade deficit with China his main mark of a victory. That deficit hit a record US$375 billion last year. But most economists view the deficit as a result of the structural imbalance between the two countries – well-off American consumers simply want to buy more products made in China. Will China offer enough minor concessions for Trump to declare victory and withdraw? Will this first escalate beyond the rhetoric into a real full-blown trade war that drags down the global economy? Does Trump even have an endgame, or is he, as in so many other cases, merely improvising?

Someone, please, tell me how this ends.

Keith B. Richburg, a former Washington Post correspondent, is director of the University of Hong Kong’s Journalism and Media Studies Centre