The sensation has become so rare, it took a moment to realise what it was. But following Wednesday’s ruling by Scotland’s highest civil court that Boris Johnson’s suspension of parliament was unlawful, the feeling was unmistakable. It was optimism. Admittedly, it was optimism in its weakest form: not the confident certainty that all would turn out for the best, but rather a fragile flicker of hope that things might not be so bad after all.

Coupled with MPs’ success in both outlawing a no-deal crash-out from the European Union on 31 October and forcing the release of the Yellowhammer papers outlining the government’s own assessment of the calamity such a Brexit would inflict on the country, a hopeful thought took root. Maybe, just maybe, the British constitution was working as the textbooks say it should. Here was an independent judiciary and independent legislature doing their jobs: acting as a restraint on an overmighty executive.

For once, we could draw a happy contrast between ourselves and others. For a sobering lesson from the convulsions of the post-2016 era is that constitutions, written or unwritten, are only as strong as the people charged with enforcing them. The Republicans in the US Congress have failed that test, refusing to do their duty by restraining a president bent on trampling on the constitution. In the last fortnight, Britain’s politicians – or enough of them – have shown their US counterparts how it’s done.

Labour deserves credit for resisting the temptation to give Johnson the early election date he wanted, but the striking act of political courage was committed by the 21 Tory rebels who were prepared to sacrifice their careers, and break decades-long bonds of allegiance, to stop their party leader driving the country off a cliff. Surely their bravery justifies what one of those rebel leaders, Dominic Grieve, calls a “quiet optimism” – proof that while our constitution is currently being tested to its very limits, so far it is, despite everything, coming through.

I wish I could say that. But we need to gird ourselves for a possible reversal of the Scottish decision in the UK supreme court on Tuesday. If, as plenty of legal scholars fear, those judges rule that Johnson’s prorogation, or suspension, of parliament was cynical, unjustified and dishonest but not ultimately illegal, parliament will remain shut.

That would be more than just another setback in a journey that has been full of them. For, as Prof Meg Russell of UCL’s Constitution Unit puts it: “The political constitution cannot operate properly if parliament is not sitting.” Under our system, parliamentary sovereignty is the whole shooting match: it is the constitution. “If you shut parliament, it’s very hard to say your constitution is working.”

Look at those recent rebel achievements, on both Yellowhammer and the Brexit extension. They required great ingenuity, organisation and cross-party cooperation, as well as a Speaker with a strong bias in favour of parliament against government. But above all they required parliament to be in session. If the doors of the Commons are shut, all those levers are gone. It’s not just that Grieve and friends can no longer perform legislative acrobatics in the chamber. The whole apparatus of scrutiny will have been dismantled. No departmental questions that might expose gaps in no-deal preparations; no select committees to hear evidence; no urgent questions, a tool that Speaker Bercow allowed to be used to powerful effect. Above all, MPs will have been deprived of their most critical weapon: if parliament is not sitting, it cannot table a vote of no confidence in the government. Recall that Johnson has lost six out of seven votes he has faced in the House of Commons; his majority is down to minus 43.

It seems likely that, were it tested, Johnson would not enjoy the confidence of MPs. And yet, while parliament is suspended it has no way of expressing that verdict. Fear not, comes the reply. Parliament will be back on 14 October and can assert itself then. But if the supreme court rules the suspension is legal, what’s to stop Johnson doing it again, shutting parliament for another two weeks to take him past the no-deal deadline? He could then cheerfully defy the law by refusing to apply for an EU extension, for who would enforce it? The courts cannot remove him from office. Grieve has no army. The only mechanism, a no-confidence vote, cannot be exercised if parliament is closed.

Facebook Twitter Pinterest ‘Why do Cummings and Johnson think they can get away with it? Perhaps they saw last month’s poll, showing that two-thirds of young voters approve of “strongman” leaders prepared to defy parliament.’ Photograph: Daniel Leal-Olivas/AFP/Getty Images

Of course, none of these questions should arise – and for many decades they did not. Our system relied on what the constitutional historian Peter Hennessy called “the good chap model of government”. MPs and ministers respected the unwritten rules, observing taboos and following precedent, fearing that they would be shamed if they did not. But we are now in the era of shamelessness, when that sanction no longer applies. On the contrary, Johnson’s chief adviser, Dominic Cummings, like Donald Trump, reckons a willingness to defy norms wins the devotion of your base, marking you out as a brave tribune of the people, unafraid to tear down the establishment and its niceties.

What can be done? John Bercow is surely right to suggest that, once this Brexit crisis has passed, a written constitution will be essential, one that would spell out the limits on executive might – stripping the prime minister of, for example, the power to suspend parliament. More immediately, if Johnson does disobey the law, the onus will shift to his cabinet colleagues, the likes of the lord chancellor, Robert Buckland and others, to follow the lead of the Tory 21 and resist. They might be the last line of defence of the rule of law - short of the monarch being forced into the extraordinary situation of having to decide whether to remove the prime minister.

Hero or villain? Bercow’s notoriety is a consequence of parliament’s crisis – not its cause | James Butler Read more

Because this has gone far beyond Brexit now. At stake are the fundamentals of our democratic system: whether our elected parliament is sovereign, whether our rulers are bound by the law. Why do Cummings and Johnson think they can get away with it? Perhaps they saw last month’s poll, showing that two-thirds of young voters approve of “strongman” leaders prepared to defy parliament, while a quarter believe democracy is a bad way to run the country. Or perhaps they reflect on how they won the 2016 referendum. That victory was won not during a few weeks of summer campaigning, but after three decades in which the very idea of Europe had been attacked relentlessly.

When you consider how MPs, Westminster, even politics itself, have been mocked and derided for so much longer, perhaps the Downing Street duo believe they can win again. Except this time their target is our democracy itself.

• Jonathan Freedland is a Guardian columnist