THESE are historic times at Holyrood. Indeed, we may be in the middle of one of the most significant weeks at parliament since devolution. The unprecedented abounds.

Two days ago, MSPs abolished the SNP’s response to a series of sectarian disturbances and threats in football. No other party backed the Offensive Behaviour at Football Act in 2011, and many fans detested it. But while the SNP had a majority, it was safe on the statute book.

After that majority went in 2016, Labour MSP James Kelly initiated the Act’s repeal. His efforts ended in a 62-60 vote, with all other parties aligned against the SNP. It was the first time a Holyrood Act had been repealed without a replacement, and the first time a Scottish government had seen part of its record forcibly deleted. It was a big psychological moment for the parliament, but especially for SNP ministers and MSPs. That disgusted look on their faces was the whiff of political mortality pricking their nostrils. More repeals will surely follow.

But the next few days could see something far more important. After a three-week rush, the SNP’s Brexit Continuity Bill is due to go to its final vote on Wednesday.

If it happens - and it is only due to happen if the UK and Scottish Governments cannot agree on the distribution of devolved powers after Brexit - then we will be entering uncharted constitutional waters.

Despite both sides saying they want a deal - and I believe them, given the potential bùrach around the corner - the omens are not good.

Last week, Ms Sturgeon emerged from a Downing Street meeting with Theresa May to confirm there was still no deal on amending the EU Withdrawal Bill (EUWB) at Westminster, though the differences were “not insurmountable”.

This phrase was taken as a hint at a breakthrough, but in fact the stalemate continued. It was only because of the other item on the agenda - the nerve agent attack in Salisbury - that there was no unseemly finger-pointing.

“No, I don’t think much did change,” admitted the FM’s spokesman the next day. He also revealed there are no face-to-face meetings between the main players scheduled before Wednesday’s vote.

If MSPs pass the Continuity Bill things could get very hairy indeed.

The UK government could have a huge change of heart and amend the EUWB to the satisfaction of Ms Sturgeon and her Welsh counterpart Carwyn Jones. In theory, they could do this as late as May in the Lords.

Far more likely is that the UK law officers would use a four-week window after the vote to refer the Bill to the UK Supreme Court, and ask for it to be struck down.

This would be an unprecedented step for one government to take against the other. The basic line of attack would be that the Bill is ultra vires and therefore a dud.

This is the view already expressed by Holyrood’s presiding officer. In another unprecedented moment, Ken Macintosh last month said he believed the Continuity Bill was not legislatively competent, but the SNP Government, supported by the Lord Advocate, pressed ahead regardless.

MSPs are still able to pass a Bill the Presiding Officer thinks is mince because his opinion is advisory, not a veto. The Court has the final say.

Basically, the argument is about legal effect and legal validity.

The Continuity Bill is a fallback to transfer devolved EU law into Scots law if there is no deal on the EUWB. But the 1998 Scotland Act says Holyrood cannot deal in EU law, as that would be a breach of the UK’s relationship with the EU, and so incompatible with EU law.

The SNP Government and Lord Advocate argue the Bill gets round this by ensuring provisions which would be incompatible with EU law today won’t take effect until after Brexit, when EU law won’t apply.

Meanwhile Mr Macintosh says the key point is not when the Bill’s provisions take legal effect, but whether they are legally valid right now. For him, the Bill runs ahead of Holyrood’s existing powers.

“In my view, postponing the exercise of powers until a future date may change the legal effect of a Bill, but does not resolve the question of its legal validity,” as he said.

If the Bill was passed and the Supreme Court agreed it went beyond Holyrood’s legislative competence, it would be deemed “not law” and cease to exist.

But that would still leave the UK government having to press ahead with the EUWB without Holyrood’s legislative consent, an ugly first for devolution and a gift for the SNP.

If, on the other hand, the Court ruled the Bill was competent, Westminster could shrug it off and impose the EUWB on Holyrood.

This is an even uglier political option, but if the UK government had come this far, it may be in no mood to compromise. Relations between the two sides would hardly have been improved by an acrimonious court case.

As a fig-leaf, UK ministers could point to the Sewel Convention, which says Westminster will not “normally” legislate in devolved areas without Holyrood’s consent, but, hey, Brexit isn’t normal.

Just to complicate matters, if the Bill received Royal Assent it could be challenged in court by anyone with the money and inclination.

Small wonder most academics saw the Bill as a feint, a gambit to pressure the UK government into making concessions on the EUWB, rather than a good idea in itself. It is such a constitutional stink bomb that surely the UK government would blink before it was passed?

Yet we are now just days from that gambit becoming a reality. Where devolution might veer off in the aftermath is impossible to say.