Theresa May has one final task — and we can reveal today that the Cabinet Secretary Sir Mark Sedwill has told her it could be perhaps the most important of her premiership. Who does she recommend that the Queen appoints as her successor in Downing Street?

That is the responsibility that under our unwritten constitution falls on all outgoing prime ministers.

The answer, Sir Mark has reminded Mrs May, must be the person who can command a majority in the House of Commons.

Normally it’s just a formality, because that answer is obvious. It’s either the Leader of the Opposition, whose party has won an election, or it’s a candidate who has just triumphed in an internal leadership contest. But not always.

In 2010, the country had to wait for five days after the general election while David Cameron assembled a coalition that commanded a majority.

It was only then that Gordon Brown could recommend him to the Queen as his successor.

You might assume that Mrs May’s choice is an easy one: wait to see whether Boris Johnson or Jeremy Hunt are elected on July 23 to replace her as leader of the Conservative Party, and then propose that the sovereign chooses them as the person to replace her as premier the next day.

But how can Mrs May be sure that either Mr Johnson or Mr Hunt has a majority in the House of Commons? Remember, the leadership election doesn’t change the fact that this is a hung Parliament.

The Conservative Party by itself does not have a majority of MPs. So as a minimum the Conservative leader needs a so-called “confidence and supply” arrangement with the DUP, the small Northern Irish party.

It gave that backing to Mrs May in 2017 after she lost her majority, in return for a hefty cheque. But it was only for a two-year period, and that two years is up.

We can make the reasonable assumption that the DUP will eventually do a deal with the new Tory leader. But the haggling could take a while — and cost a lot. That was controversial in 2017, and will be doubly so today.

No confidence

But even with DUP support, will that be enough? Remember, four Tory MPs have resigned the whip in recent months to sit on the Opposition benches — Anna Soubry, Sarah Wollaston, Heidi Allen and Nick Boles.

Now a by-election in Brecon and Radnorshire looms after the Tory MP there was “recalled” on Friday after expenses fraud — and it’s highly likely the Conservatives will lose it.

The Government whips calculate that would leave a majority of just three. It leaves them very vulnerable to scandal in the future, now that recalls are working — and to the Grim Reaper.

But now ask: what happens if there are Tory MPs who resign the whip rather than serve under Mr Johnson, or indeed Mr Hunt this July? No one has yet said they will definitely do so.

But today, the defence minister Tobias Ellwood has stated that “a dozen or so” Conservative MPs would not support their new leader in a vote of “no confidence” if he insisted on taking Britain out of the EU without a deal.

Even if Mr Ellwood is just speaking for himself that brings the majority to almost zero — and we know, even if a dozen seems high, that some fellow MPs, like Dominic Grieve, will be alongside him.

Yet that no-deal option is being explicitly kept on the table by both leadership candidates. It was the commitment that arguably saw them both through to the final round, and it wins thunderous rounds of applause from Tory members at the hustings.

There are a small number of Brexiteer Labour MPs who also want to keep the no-deal option open — but would the likes of Dennis Skinner ever vote to support a Tory government in a motion of no confidence?

If they did, they would earn the everlasting condemnation of their movement.

What all this shows is that the new leader of the Conservative Party is unlikely to have a majority for his central policy come the autumn, and may not have a majority this July full stop.

If the latter is the case, then Mrs May will have to recommend that the Queen asks Jeremy Corbyn whether he can assemble a majority instead. If not, it’s election time.

No wonder Britain’s top civil servant has put the current Prime Minister on notice that her biggest decision may be still to come.