Theresa May outside Downing Street ahead of the publication of her Brexit deal.

A guide to Theresa May’s Brexit deal

Theresa May's Brexit deal is like an outrage time machine. People are so upset by it that they're holding protests outside Downing Street before they've even read it.

But even if we haven't seen the deal yet, we can still outline the likely shape of it. The following piece is based on my own assumptions and those of some of the cleverest people following the Brexit debate, which in this case refers to Holger Hestermeyer, mid-career fellow at the British Academy, Sam Lowe, senior research fellow at the Centre for European Reform think tank, and Steve Peers, professor of EU, human rights and world trade law at the University of Essex.

But, to be clear, it could still all be wrong. Take it with a bucket-load of salt. Nevertheless, it should still give you a decent grounding to understand what's published later.

The main issue, of course, is the backstop. This is the guarantee that there will be no hard border between the Republic of Ireland and Northern Ireland.

If Britain decided to stay in the customs union and single market, this could be easily achieved, because we would have the same tariffs and regulations as the EU. There would be nothing to check.

But Theresa May doesn't want that. What she actually does want is not entirely clear. Her last plan – Chequers – was to sign up to a customs 'partnership' and single market membership, but only for goods. Why goods and not services? Because goods are the only things that are checked on borders. She basically agreed to as much as she needed to to satisfy the Northern Ireland problem, but no more.

The problem is that the EU refuses to separate single market membership for goods from membership for services. The clue's in the name. It's a single market. You can't just carve out the bits you like.

Chequers went down like a pile of cold sick with her party and led to a series of Cabinet resignations. So now she rarely mentions it and instead talks sporadically about a Canada-style free trade agreement, which would mean complete separation of tariffs and regulations.

The truth is, no-one really knows what the British position is, least of all the British government, so the backstop is there as an insurance policy, ensuring that no matter what happens there'll be no border on the island of Ireland.

But here's the kicker. If you don't put that border through the island, it needs to go in the sea, between Northern Ireland and Britain. And the DUP, which props up May's government, don't like that. So she proposed a backstop that covered the whole of the UK.

This raised two diabolical issues.

Problem number one was our old friend Article 50. This EU law allowed for two things: a legal withdrawal agreement covering the terms of divorce and a political framework for a future relationship.

May's plan for the whole of the UK to stay in the customs union and single market for goods was like trying to stuff the future relationship bit into the withdrawal bit. The EU looked at it and thought: Well if it looks like a future relationship, sounds like a future relationship and walks like a future relationship – then it's probably a future relationship. And that would go against Article 50, which only gave legal powers for the divorce.

The second problem was that the EU refused to separate goods and services in single market membership. And that's precisely what May's all-UK backstop would do.

But here's the thing about EU red lines: they are just as tenuous as ours. The Brexit talks are like an abattoir of red lines. In they come, having been fattened up by political promises on either side, then the conveyor belt starts and before they know it Michel Barnier and May emerge, aprons on, with butchers hooks in their hand.

In this case, the EU made two significant concessions. Firstly, it allowed the backstop to include membership of the customs union for the whole of the UK. That was a big concession. Secondly, it agreed to split goods and services – but only for Northern Ireland. It considered this a special case, so that the promise of no hard border could be kept. But it wouldn't do that for the rest of the UK.

So we now expect the backstop to have two elements. It covers the whole of the UK for customs union membership, but only Northern Ireland for single market membership.

A lot of very weird repercussions flow from this.

It's not actually clear that what the EU is doing is legal. Is that customs union proposal really a backstop, or is it the spine of a future relationship? Quotes from EU officials suggest it is now considered the baseline arrangement for a future trade deal. This seems to go against Article 50. At the very least, Barnier seems to be operating in a legal twilight zone.

More seriously, it also means that checks would still take place in the Irish Sea, because Northern Ireland has regulatory demands that the UK won't.

On industrial goods, checks aren't really a problem. Surveillance can take place away from the border, in warehouses. But that type of system is not available for agricultural products, and especially not for products of animal origin. This is because the rules around these products are there to stop diseases, so you can't allow them into your territory. They must be checked at the border.

There is already an inspection post for live animal exports at the Port of Larne. This would need to be expanded to check all products of animal origin. But it's not exactly clear what that entails and whether new infrastructure would be needed. Would they need new buildings, for instance, or just more vets and officials? What kind of testing equipment is required? All of these mundane details could suddenly become politically explosive.

Will the DUP accept this? Probably not. It goes against their demand that there are no new checks whatsoever between Northern Ireland and the rest of the UK.

To placate them, No.10 will promise to unilaterally decide to keep its own regulations exactly the same as the EU's. So even where we are not connected to the EU by law, we will be connected by political decision-making. But there are no guarantees of that in the future. The DUP will be concerned that a later government would decide to scrap that idea and drift away – the regulatory umbilical cord between Britain and Northern Ireland broken.

Then there's the customs union itself, which the whole of the UK will be a part of. This comes with it's own set of regulations – known as the 'level playing field'. They include state aid, which dictates the scenarios in which government can support industries, environmental and workers' rights rules, and tax.

They are there to stop the UK undercutting Europe. The customs union will allow UK goods to go all over the continent without paying tax. Now imagine that we can suddenly funnel loads of cash to the British car industry. Its products will become cheaper and we'll have secured an unfair advantage.

But how do you administer that? In the EU, governments have to take their state aid plans to the European Commission, which says whether they'll allow it or not. But there's no way Brexiters would tolerate that still being the case. Will it be an independent UK agency? We have the Competition Markets Authority, which could be levelled-up to deal with it. But it's not clear if Brussels would accept that.

There will also need to be some kind of dispute resolution body for disagreements that come up. Hold on tight, as it gets technical. But it's in these technicalities that the reality of the UK-EU relationship will play out.

Both sides will monitor the other and then raise complaints. There are plenty of ways to deal with this, but it's likely the deal will leave it to the joint committee – a collection of senior officials from both sides who meet regularly. If a dispute arises, they will be encouraged to sort it out politically, through discussions.

If they can't do that, there would be retaliatory trade actions – putting up a bit of tariff in one area to compensate for what happened in another. And then finally we'd need independent arbitrators to rule on whether the retaliation was proportionate. This is not likely to be a permanent court but a selection of mutually-agreed arbitrators working on an ad-hoc basis.

The fly in this ointment is the interpretation of EU law. The European Court of Justice, whose jurisdiction May promised to leave, is the ultimate arbiter of EU law. So any dispute resolution system would need to defer to it. And most disputes are likely to be about EU law in some way. That means the court will play a big role in British politics for years to come.

The other legal problem is how we get in and out of the backstop. Brexiters in the Cabinet wanted a unilateral escape clause but there's no way they'll get it. In all likelihood, it'll require consent from both parties, probably with a yearly review.

The thorniest issue in the customs union backstop proposal is how violently lopsided it is. For a start, Britain has lost all say over how the customs union operates, or the regulations which are embedded in it. And things only get worse from there.

We will now be stuck in a trade coma. When the EU signs a trade deal with another country, we will have to open up our market to their goods under whatever tariff arrangement they've come up with. But we won't get reciprocal access to their market unless we negotiate it ourselves – because the deal is only for EU members. And we'll have very little chance of doing that, because they'll already have what they want, which is full access to us. It's horrible.

The customs union backstop will also have plenty of other damaging effects. It doesn't come anywhere near replicating the economic arrangements the UK currently has. Services will take a massive hit, because it offers no provision for them. Agricultural products – especially animal based ones – will have have lots of extra bureaucratic requirements when they're exported. UK companies will no longer be able to self-certify products for the EU market.

The obvious solution to this hellscape is to extend the transition. If there is any chance of avoiding the backstop, that is it. When the deal is published, this is the first thing many people will be looking for.

What you want is vague wording. Ideally it would say that the UK and EU could open talks on extending the transition period and lay out the conditions for future discussion. That would return the Brexit debate to some sort of political normalcy, away from the constant arbitrary cliff-edges which have been imposed by Article 50 and a time-limited transition.

The trouble is that reason and good sense are not politically palatable at the moment. For the EU, cliff edges offer a mechanism to force the UK to make decisions. For Brexiters, vaguely-worded extension mechanisms make it look like they'll be in the EU's eco-system forever.

Basically, it looks pretty dreadful. It's hard to imagine anyone who would want this kind of deal. It is the result of a bludgeoning compromise. Like gravity, the realities of EU law, political promises and trade reality have flattened May's deal into this ghastly thing. But it will have one thing to recommend it: it is better than no-deal. And that is a point May will make over and over again.

Ian Dunt is editor of Politics.co.uk and the author of Brexit: What The Hell Happens Now?

The opinions in politics.co.uk's Comment and Analysis section are those of the author and are no reflection of the views of the website or its owners.