If anyone had any doubts that Brexit posed a threat to the powers of the Scottish parliament, they need only have listened to the Tory MP Bernard Jenkin addressing the devolution conference organised last week by the Brexit think tank, UK in a Changing Europe. Not only did he say that Scotland and Wales had been “allowed to vote in our EU referendum” - gee thanks for that - he airily dismissed as “fantasy” the idea that the Scottish Parliament could lose powers and influence as a result of the EU Withdrawal Bill. Jenkin, who chairs the powerful Commons Constitutional Affairs Committee, insisted that the Scottish parliament never really had powers over matters like agriculture, and only ever implemented policies imposed by Brussels. Now that the UK was taking over from Brussels, “nationalists” had no right to insist that the powers should gravitate to Holyrood or Cardiff. Thus spoke the authentic voice of post-imperial Brexit nationalism.

It must have come as something of a shock to MSPs in Holyrood to learn that they didn’t really have those 111 plus EU-derived responsibilities, which even Whitehall identified as falling under Holyrood’s remit. These include animal welfare, food standards, food labelling, pesticides, genetically modified crops, agricultural support, fisheries, etc - all of which the UK government intends to keep at Westminster pro tem. Of course, these powers were exercised within policy frameworks set at a European level, but that didn't mean they weren't part of Holyrood's jurisdiction – a reality that the Scottish government is attempting to nail down by passing the Legal Continuity Bill. This basically freezes the status quo and incorporates EU laws into Scots law. That emergency legislation received the overwhelming backing of the Scottish parliament last week, despite the reservations of the Presiding Office, Ken Macintosh.

Now, Jenkin did accept the inconvenient truth that, under the Scotland Act, 1998, matters not specifically reserved to Westminster are 'automatically' powers of the Scottish parliament. As the House of Lords EU committee reported last year, powers repatriated from Brussels become Holyrood's “by default” - (only now are we are realising just how radical the late Donald Dewar's drafting of the 1998 Scotland Act really was) -but the Tory MP brushed this constitutional nicety aside because, well, Brexit has changed the rules. The Scottish parliament was subordinate to Brussels in the past, and now it is subordinate to Westminster, and that's that. So, now we know.

Number 10's approach is less confrontational than Jenkin's, who is a hard line Brexiteer, but it has made clear that it will impose its will over powers that it regards as essential to the creation of the UK internal market. On Friday, The UK Cabinet Secretary, David Lidington, insisted that at least 24 would be held at Westminster until such time as there is a level playing field across the entire UK. Different rules on things like food standards or genetically modified crops might impede the UK government's ability to strike trade deals with non EU countries, while divergences on standards of animal welfare or food hygiene might increase the costs of trading within the UK. Brexit requires a unitary British state.

Now, the Scottish Brexit minister, Mike Russell, has accepted that there should be these agreed frameworks across the whole UK, but says Scotland should give its “consent” to any changes in its powers. It must be by agreement and not by imposition. The UK government is sticking here, and doesn't want to give what might be a Scottish veto on changes, say, to agricultural support payments, worth around half a billion pounds. Such is the current deadlock. The UK government believes voters don’t really care much about the division of powers and will accept that Westminster should prevail at least in the meantime. Devolution is a complex issue, to be sure. Unlike independence, which is pretty straightforward, the debates about Schedule 5 of the Scotland Act, and its relationship to Clause 11 of the EU Withdrawal Bill, are highly technical.

Indeed, when you look closely at the powers of the Scottish parliament, they can appear to come away in your hands. Holyrood is a quasi-federal parliament which exercises sovereignty, but only to the extent that Westminster allows it. That was Donald Dewar's solution to the conundrum of how to allocate limited sovereignty to the Scottish parliament in a unitary state. This quasi-ness was supposed to have been addressed after the independence referendum, when the revised Scotland Act supposedly “entrenched” the Sewel Convention such that, as a matter of law, Westminster could not legislate in devolved areas without consent. But Sewel became somewhat un-entranched again last year during the Supreme Court's deliberations on the Miller case on parliament's right to vote on Article 50. The Law Lords ruled that Sewel is still merely a “convention”, not a law, and that Westminster can impose consent if it really needs to do so. Looked at through this constitutional hall of mirrors, it sometimes seems as if Holyrood never had any sovereign powers at all - that they were merely on loan from Westminster.

That indeed, is what many Scottish nationalists have always believed. Power devolved is power retained, as SNP MPs used to say before Alex Salmond persuaded them to support the campaign for a Scottish parliament in the 1990s. Many in the SNP still regard devolution as, at best, a diversion from the true path of independence, and at worst a devious plot by the English to confuse the natives by giving them what Billy Connolly called a “pretendy parliament”. In joining with the Labour First Minister of Wales in trying to defend the constitutional status of Holyrood, Nicola Sturgeon risked being accused of hitching the independence movement to a chimera.

But I believe she deserves credit for standing up for devolution. It's good politics too. There's no doubt that if Clause 11 of the EU Withdrawal Bill had passed in its original form, Holyrood would have been very much reduced as a parliament. It was indeed a “naked power grab” by a UK government rattled by Brexit and determined to clear away any devolutionary obstacles to Britain's departure from the EU. By allying with a Labour political leader, the Welsh First Minister Carwyn Jones, Sturgeon may have supped with the SNP's arch enemies, but it was worth it. She has made a very clear statement that when it comes to Scotland's interests, the SNP is not just a sectarian organisation, obsessed with independence-and-nothing-less. She has acted in concert with all the non-Tory opposition parties in the Scottish parliament to try to keep intact Donald Dewar's legacy.

It is significant that the opposition parties are no longer reciting their mantra that Nicola Sturgeon should stop obsessing about indyref2 and “get on with the day job”. That's exactly what she has done in the run-up to the final confrontation with Theresa May this week. If she loses, and Holyrood's limited sovereignty is eventually extinguished by Brexit, she'll be able to say that at least she tried. And if Scottish voters conclude that independence is now the only way to ensure that Scotland's interests can be protected in the new, highly centralised, post-Brexit UK, she won't argue with them.