One of the things that Brexit has done has been to create, amongst supporters of the European Union, an almost fanatical mythology about its strength and its iron will. “There will not be a re-opening of the withdrawal agreement” was the refrain for months, nay years, leading up to this morning’s breakthrough. “There will be no bilateral negotiations”, the experts said, until the Taoiseach trundled over to Liverpool to hammer the whole thing out one on one with Boris Johnson. “Northern Ireland will remain in the Customs Union”, they all insisted, right up until the moment they agreed to let it leave that Customs Union, this morning.

Reflexive Euroscepticism tempts one to mock all of this, and there will be an element of British Brexiteer triumphalism along the lines of “Boris stood up to them and they gave way in the end”.

And there is, in fact, an element of truth to that. Johnson said that he was prepared to leave without a deal. Whether that threat was likely to materialise on October 31st, or, more likely after the Benn Act, in the aftermath of a UK election that returned him to power, no deal suddenly became a real risk that the EU had to mitigate. Theresa May, very clearly, and very openly, was never prepared to risk leaving with no deal. The fact that Johnson was very clearly changed the calculations.

But this is not an unalloyed win for Johnson, even if the deal is passed. Credit too must go to the European Union, which has once again shown the flexibility and willingness to totally abandon its own principles that is, in truth, its greatest strength. The EU, at its heart, is a coldly pragmatic organisation. The Brexit deal it appears to have agreed will, make no mistake, stick in the craws of many federalists who will worry about the risk that the UK will actually do pretty well outside the EU, and become an example to others who consider leaving. Not now, but in ten or fifteen years, is it impossible to imagine debates in Poland, or Hungary, or Italy where the Eurosceptics say “look at Britain, it left, and it is doing pretty well”? By then, the pain of the negotiations will have been forgotten, so this deal is not without risk.

But on the other side, the EU has secured important wins. If this deal passes, it is very hard to imagine a scenario where a border on the island of Ireland is restored. The Europeans have demonstrated to smaller states who might be considering accession that membership, for all its costs, does indeed strengthen their hands in negotiations with powerful neighbours. There are some who will hate this fact, but when those who are most pro-European say that Ireland is stronger on the international stage inside the EU, these negotiations have proved them right.

The truth is that the question of whether Brexit is truly a good idea or a bad idea will not, and cannot, be answered immediately. What can be said is that the negotiations were (and who knows, may yet continue to be) exceedingly painful and de-stabilising for the UK. Whether this by itself is too high a price to pay for an uncertain reward is a matter of opinion, but in truth Brexit will only be properly assessed decades from now.

What is clear, though, is that the ideas that motivated Brexit are not illegitimate. Brexit was never truly about a big red bus with a lie on it or promises of an easy negotiation. The campaign may have featured those things, but the reason that there was a campaign in the first place was that a significant number of Britons simply felt that the loss of power to Brussels was too high a price to pay for uncertain and intangible gains. The right to set one’s own policy, to elect one’s own leaders, and to control one’s own economy – these are ideas that have motivated nationalist movements throughout history, not least our own war of independence less than a century ago.

As the EU continues to integrate, the UK will not be the last country to have movements demanding the return of their own sovereignty. We are told in Ireland that we live in the most pro-EU country in Europe, but let us see how that changes if our young men and women are told that they must serve in an armed force to defend Estonia from Russian tanks. Many who claim they would die for Ireland will suddenly find that they are less willing to die for Brussels.

But at the end of the day, by reaching a deal that delivers wins for each side, both Boris Johnson and the European Union have proved their harshest critics wrong. Now the EU must learn the lessons from this episode, and Britain must prove that it made the correct choice. Neither will be easy.