They took the first shot before he was even in place.

For weeks now, Boris Johnson has refused to rule out sidelining parliament so he can force through no-deal. We don't know why. He might just be trying to look tough for the crazed wing of the Conservative party, or he could really be intending to go through with it.

It doesn't matter. It is a democratic nadir, a low point hardly anyone would have ever thought possible before the referendum: a man standing to be British prime minister holding open the possibility of cancelling parliamentary democracy.

But today, before he has even entered No.10, parliament took a stand. It did so through the usual tangle of procedures and backroom dealings which have typified the Brexit process.

Last week, Tory moderates tried to put down amendments forcing the government to publish reports on the status of Northern Ireland during the autumn, with Commons debates attached. These would have given them a basis upon which to launch a rearguard defence against no-deal. Most were rejected, but one squeaked through by a single vote.

It shuttled back to the Lords, who then bolstered it back up and returned it to the Commons. Today, moderate Tories amended it again. They added a rider that the House would return to debate these reports even if parliament was "prorogued or adjourned". This was a chance to pre-emptively overrule any attempt by a new prime minister to sideline MPs. No matter what Boris Johnson did to parliament, MPs could come back to Westminster and hold him to acount.

It was expected to be tight, especially after the knife-edge results last week. But in the end, it sailed through: 315 votes to 274.

The Tory moderates in Cabinet, who had warned they would fight attempts at prorogation, held the line. Special credit goes to Margot James, culture minister, who quit and voted for the amendment. Six others in Cabinet abstained: Karen Bradley, Greg Clark, David Gauke, Philip Hammond, Caroline Noakes and Rory Stewart.

In a normal government, they'd be fired right now. But what's the point? Theresa May is off next week anyway. The only reason to do it would be spite.

The amendment will now be enshrined in the bill, which is very likely to pass.

We need to be clear what this means. It does not stop no-deal. It does not even stop Johnson proroguing parliament. He can still do that. But if he does, MPs will be able to return and sit for a debate. And in that scenario, against a prime minister trying to cancel British parliamentary democracy to force through no-deal, we can be confident that they would act to stop it.

They know how to do this. They passed legislation last time - the Cooper amendment - forcing the prime minister to request an extension to Article 50. So they have the mechanism. And they would most certainly have the will. While this move doesn't make prorogation impossible, it makes it largely ineffective in trying to achieve no-deal.

It's an important moment for several reasons. Firstly and most importantly, it blocks off the attempt to cancel parliament. Secondly, it shows the institution is ready to stand up for itself in the battles to come with the executive. And there is a third part, which hasn't been properly recognised yet but could prove crucial to the entire Brexit process. The amendment provides usable vehicles for MPs to prevent no-deal.

The Lords amendment, which was bolstered by the anti-prorogation amendment in the Commons, demanded that a minister put down each Northern Ireland report and then allow "a motion in neutral terms" on it.

Back in the day, those neutral motions couldn't be amended, so they were effectively meaningless. MPs need to be able to amend them so they can issue a command to the government.

There was an awful lot of toing-and-froing over that in the last bout of fighting over May's deal. But then MPs won. They voted to temporarily suspend the Commons rules - called standing orders - preventing amendments on neutral motions. And then they were able to take charge and force the government to do their bidding.

That set-up is now in place in the days leading up to the October 31st deadline. There are now vehicles for MPs to potentially stop no-deal.

This is theoretical. They'd still need to win a vote suspending the standing orders again, for a start. But it has been done before and can be done again. The slow chiselling away of the government advantage has begun. Johnson's ability force through no-deal is significantly diminished.

He hasn't even made it to No.10 yet and already his hasty, foolish promises are starting to fall apart around him. British constitutional democracy is fighting back.

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.