JUST a weekend has passed since Theresa May breakfasted in Brussels on euphoria, and already the talk is of her Brexit deal unravelling. The talk all comes, it is true, from members of the Cabinet she is supposed to be leading, who cannot let a single chance go by of backbiting among themselves.

Here I’m not going to waste any more space on this sorry crew, but draw out some of the implications for Scotland of the deal struck before the sun rose on Friday.

Scotland was like Northern Ireland in voting Remain at the referendum of June 23, 2016, though I don’t suppose the majority over there contained many Democratic Unionists. In any case, it is the section on Northern Ireland in the Joint Report of the Brexit negotiators that most concerns us. While it never mentions Scotland, it does foreshadow a rearrangement of relations among the four (or five) nations that jostle together on the British Isles – or on These Islands, as they insist on saying in Dublin.

As a result the Irish Question will reappear, yet again in fresh guise. There’s an old schoolboy saw: “Gladstone spent his declining years trying to guess the answer to the Irish Question. Unfortunately, whenever he was getting warm, the Irish secretly changed the Question…”

William Gladstone was a great Prime Minister, who made the first moves towards what he called Home Rule all round, that is to say, a UK devolved into its four parts, which might over time have become a formal federation on the model of Canada or Australia. The stupid Tories said No and thwarted him, opening the way to a 20th century stained by bloodshed in Ireland.

But his vision was admired by some people who otherwise deplored his radical outlook on life. In 1930, King George V remarked to a Scotsman, Ramsay MacDonald, his Labour Prime Minister: “What fools we were not to have accepted Gladstone’s Home Rule Bill.”

In the 21st century tactics have changed and nowadays, for the sake of a quiet life, every question posed in Ireland tends to get Yes for an answer. The accord between Theresa May and Jean-Claude Juncker shows as much.

The UK says Yes to an open border between Northern Ireland and the Republic but gives no detail whatever on how this is going to be achieved. The Democratic Unionists say Yes to leaving the European single market along with the rest of the UK yet have not a clue what, if anything, is to replace it. Nor does the UK have a clue, and if the UK hasn’t a clue I dare say the rest of the EU hasn’t either.

It is not as if the Joint Report remains silent on such matters. The report says, at the crucial para 49, that the “intention is to achieve these objectives through the overall EU-UK relationship. Should this not be possible, the UK will propose specific solutions to address the unique circumstances of the island of Ireland. In the absence of agreed solutions, the UK will maintain full alignment with those rules of the Internal Market and the Customs Union which, now or in the future, support North-South co-operation, the all-island economy and the protection of the 1998 Agreement”.

I’d say that was a self-contradictory text, and no doubt deliberately so because otherwise nobody would have signed it.

But what strikes me is this. The legal basis of the Joint Report is not any of the European treaties – Accession, Maastricht, Amsterdam or Lisbon – nor is it any Act of the UK Parliament. Its legal basis is the Good Friday Agreement of 1998, a deal between the UK and the Republic of Ireland that at the time lacked any status in European law. “In the absence of agreed solutions”, which is what we have, the requisites of the Agreement override everything else.

What is the source of the Agreement’s authority? It was ratified by referendum both north and south of the Irish border, while the UK in effect defined it as an international treaty so that it needed no legislation but came into force by royal prerogative. The only consequent action taken at Westminster was to repeal the Government of Ireland Act 1920, which had partitioned the island but asserted British sovereignty over both parts (you see what I mean when I say the Irish question keeps changing).

While the Good Friday Agreement is the only legal basis to which the Joint Report makes reference, that Agreement does not, and was never intended to, bind the EU or its member states. What is more, it has hardly anything to say about the economic matters at the core of the Brexit problem. It defines the areas where Northern Ireland and the Republic are to have common policies as: free trade and special programmes approved in Brussels (which were there anyway by virtue of EU membership), management of waterways, food safety, promotion of Irish and Ulster Scots languages, navigation lights on the frontier waterways of the River Foyle and Carlingford Loch. And that’s it.

Now this merest skeleton of a trading treaty is to be expanded to cover 400,000 freight movements that cross the Irish border every year, over 1000 a day. Nearly half of them carry cargoes ultimately destined for Great Britain, since the rural Republic retains its historical role of supplying its produce to the industrial society across the water.

Just to state the problem gives an inkling of its daunting dimensions. May and Juncker agreed to kick it down the road, but does either of them seriously believe it is going to be solved by the Brexit date of March 2019? It looks more like a 10-year job, at least, meanwhile with “full alignment” (presumably to the single market and customs union) all the way through, or conceivably beyond, the final solution. In other words, we have an effective soft Brexit, certainly in the short term, and quite possibly in the long term.

The main reason I have gone at some length into all this is to see where it leaves Scotland, and in particular the express desire of Nicola Sturgeon and her Government for us to remain within the single market and the customs union. I agree with the First Minister that the Joint Report makes it inconceivable there will ever be a hard border between Scotland and England, even after Scotland becomes an independent nation.

The idea that the sole hard border in the British Isles should be there, between Carlisle and Berwick, where we have had freedom of movement since 1603, is just grotesque. For one thing, it would also require a hard border at Cairnryan, the terminus of the sea route from Larne, through which one tenth of Ireland’s exports come. Ian Paisley junior is the local MP, and I suspect the Democratic Unionists might have something to say about that brilliant idea too. And now they know how to make a UK Government crumple.

In my view the fluidity, the lack of definition, in the Joint Report will ripple over into real economic life in the northern parts of These Islands to the point where any border, or at least any barrier, becomes in practice impossible.

Scotland might not be in a strong position to deal with this because we are not a state and no other state, apart from the UK, has an interest in our status: the Irish Taoiseach will never be on the phone to fellow leaders to press our interests along with his own island’s.

And to foresee some sort of soft Brexit also overlooks formidable problems: freedom of movement, jurisdiction of the European Court of Justice. All the same, it is closer to what the Scottish Government actually wants than any of the other outcomes that seemed more likely till last Friday.

The test that follows will be for the government to identify the country’s best economic interests and to unite us behind them, which is the only way they can be safeguarded. Getting this week’s budget right would be a good start.