When Donald Dewar opened the Scottish Parliament in 1999, waxing lyrical about “the speak of the Mearns and the din of the Clyde shipyards”, there was one thing he forgot to mention: the European Union.

The 1998 Scotland Act, which he shaped so brilliantly, presupposed permanent UK membership of the EU. It was written into the very fabric of the act that laws passed on matters like environment, agriculture, energy, human rights, had to be in harmony with laws emanating from Brussels.

At the time, few thought this would ever pose a problem. The idea that the UK might ever leave the EU seemed ridiculous Why would a privileged country like the UK leave the wealthiest free trading organisation on the planet? Well, it has, and it did. Brexit has undermined the foundations of devolution.

Read more: Former employee speaks out over Joanna Cherry MP bullying allegations

This became clear in 2017 when the UK Government legislated to seize devolved responsibilities being repatriated from Brussels. Under the Sewel Convention, the UK Parliament is supposed to seek the agreement of Holyrood when it legislates on matters which are devolved.

That went doon the Brexit stank when the UK Supreme Court ruled that on anything important, Westminster can dictate laws without consent from the Scottish Parliament.

Perhaps it was always an illusion that the Scottish Parliament was a sovereign body with entrenched powers similar to a federal parliament. The 1998 Scotland Act was always ambiguous on the nature and location of sovereign power. However, Brexit has left Holyrood in a constitutional limbo.

It seems clear that the Parliament’s wings have been clipped, but how far and for how long, no one knows.

Labour has recently revived the idea of a formal federal constitution for Holyrood. This is a project that has been knocking about the fringes of Scottish politics for decades.

But few believe that Jeremy Corbyn has will, or will ever have the political authority, to fashion a new constitution out of the ashes of Brexit. Enlightened Conservatives like the MSP Murdo Fraser have suggested turning the House of Lords into a senate, elected on a regional basis.

This is a sensible idea – the unelected Lords is a democratic anachronism. However, England has never shown any enthusiasm for federalism, and Lords reform has proved beyond the capacities of successive governments.

Read more: A new politics of the populist right is about to be born out of the ashes of Brexit

Many Scottish nationalists believe the events of the last three years have vindicated their historic suspicion of devolution. That it was always a diversion from independence, a means of containing Scottish autonomy rather than expressing it.

Power devolved is power retained, as Enoch Powell put it. What kind of parliament allows others to dictate its powers? Scots voted to Remain, have been dragged out of Europe, and Holyrood has been unable to prevent Scots losing their EU citizenship.

However, it’s too early to write off the institution. The standout from The Herald’s week-long assessment of devolution at 20 is that the Scottish Parliament is now the focus of public life here.

This was something only the most committed home rule enthusiasts could have hoped for back in the days of the Scottish Constitutional Convention in the late 1980s.

Holyrood has had precisely the impact on Scottish political life that Donald Dewar promised. From free personal care to the abolition of tuition fees; from the smoking ban to progressive taxation; from scrapping Section 2A to world-leading environmental standards, the Scottish Parliament has delivered.

There have been a few honest mistakes, like the Offensive Behaviour Act and Named Persons legislation. And there is much still to do, on land reform, industrial policy, educational attainment and inequality.

Holyrood’s heyday was probably the minority government led by Alex Salmond after 2007, which showed that a legislature can work by placing the national interest above narrow party divisions.

The next decade or so will be one of great upheaval for Holyrood. No-one knows how the Brexit burach is going to end, but it doesn’t look good. However, history is not going to into reverse. The Scottish Parliament is not going to go away, or fall into disuse like Stormont.

It may be that Brexit has accelerated Scotland’s progress towards independence, though it seems unlikely there will be a repeat referendum in the immediate future. Scotland couldn’t cope with another divisive referendum in the midst of Brexit uncertainty.

Read more: Newspaper backs Scottish Greens in European election race

When the dust settles. Holyrood will demand the return of the powers temporarily seized by Westminster and seek further economic responsibilities. There will almost certainly be another Scotland Act to resolve the contradictions left by Brexit.

The Scottish Parliament is already behaving like a national parliament and this will force further constitutional change. Holyrood may evolve into independence rather as Canada and Australia did after the Statute of Westminster in 1931.

What is inconceivable, as the Scottish Parliament reaches 20, is that Scotland will give up on home rule. One you have experienced self-government, you just want more of it.