Just when it looked like we might be headed for World War III, it seems we found a way for Iran to save face and for Donald Trump to turn his inconsistency into a declaration of victory.

“No Americans were harmed in last night's attack,” Trump said Wednesday morning. “We suffered no casualties. All of our soldiers are safe and only minimal damage was sustained... Our great American forces are prepared for anything. Iran appears to be standing down.”

Indeed, it appears that Iran has backed down, while still getting to say that they avenged the killing of Qassem Soleimani. For now, at least, fears of Armageddon are subsiding. Still, for a tense couple of days there, it felt as if we were on the brink of war. That’s because we were. Consider what might have happened if Iran had killed some Americans last night--even if by accident.

How did we get here, and did we really need to tempt fate to this degree?

In fact, it was Donald Trump’s incoherent foreign policy--one that wildly oscillates between isolationist dove and aggressive war hawk--that invited this brush with war.

During my lifetime, conservatives--of which I am still, philosophically and temperamentally, one--have advocated a peace through strength ethos that suggests that (a) bad actors recognize only power, and (b) evil regimes perceive any failure to respond to aggression as a sign of weakness.

Now, based on those conservative assumptions, consider how the timeline played out:

In June, Iran attacked two oil tankers in the Strait of Hormuz. Mike Pompeo responded by calling it a “blatant assault,” and Trump called Iran a “nation of terror.”

Then, Iran shot down a U.S. drone, which led Trump to consider launching a military strike, before backing down at the last minute. “We were cocked & loaded to retaliate last night on three different sights [sic] when I asked, how many will die,” he tweeted.

Here, the problem wasn’t so much that Trump decided against killing dozens of Iranians in response to a downed robot (one could argue he made the prudent decision), but that he publicizing his hemming and hawing.

Next, came attacks on Saudi oil fields. You might remember it because Trump tweeted that the U.S. was “locked and loaded” before promising to wait for Saudi Arabia to inform us “under what terms we would proceed.”

Finally, after rocket attacks carried out by Iran or proxies of Iran killed a U.S. contractor, the U.S. launched air strikes in Iraq and Syria. In response, Iranian-backed militias (or as some in the media like to call them, “protesters”) attacked a U.S. embassy.

“ All’s well that ends well, I suppose. But what about the next time? ”

Trump responded by killing Soleimani.

This, of course, is a simplified and truncated timeline. We never know what sorts of covert activities both sides might be engaging in. Still, the trend was pretty clear: Prior to killing Soleimani, time and again, Iran’s unprovoked attacks were greeted with comparatively weak responses: sanctions, highly calibrated military moves, and Trumpian bluster.

If you assume (as most conservatives do) that Iran respects only power, this was evidence of a president who blinks--a sign of a paper-tiger president who threatens “fire and fury” on Twitter, only to retreat from the battlefield, lest America be drawn into “forever wars.”

You could forgive Iran for thinking the Trump Doctrine amounted to speaking loudly and carrying a small stick.

One man’s deterrence is another man’s escalation, and by failing to respond to smaller transgressions, Trump raised the stakes.

For now, at least, it appears Trump’s bet paid off. All’s well that ends well, I suppose. But what about the next time?