It was a little after 10am on Thursday when Theresa May’s premiership hung in the balance. David Davis, the Brexit secretary, had just left No 10, having made clear to the prime minister that he was prepared to resign unless she changed her proposed customs arrangement with Brussels.

To some in Downing Street, it was a classic example of “DD being DD”, a piece of vainglorious grandstanding, quickly settled with some fudged language that allowed Davis to claim victory without altering the direction of negotiations towards a softer Brexit. But the full story of last week’s events reveals that May came perilously close to defenestration. Even as a temporary peace was declared, Brexiteer resentments were weaponised in a manner that could see the prime minister