Crisis? What crisis? With its buoyant economy, increasing industrial output, renewed export boom and its record low unemployment, Germany looks to be getting along fine without the little matter of a government. This week, official data in Berlin showed the workshop of Europe’s economy returning to something like full speed. Output has registered its best monthly rise since 2009, while Germany’s trade surplus has widened the way it did in the days before the eurozone crisis. Now even the nearly four-month post-election absence of a government in Berlin is being dealt with, after Angela Merkel and the social democrats reached agreement on Friday morning on a programme for a new coalition government.

All this renewed stability is good news for Germany, and thus for the European Union, and thus also, in a Brexit context, perhaps for Britain too. After the rise of the rightwing AfD in September’s election, it was essential that Germany’s established parties should find a way to work together to renew their social market model for new times. But it would be prudent not to break open the Sekt too soon. Mrs Merkel’s CDU-CSU conservative bloc has certainly struck a coalition deal with Martin Schulz’s centre-left SPD. But it is far from certain that the deal will hold.

The 28-page agreement is the result of five days of talks culminating in a 24-hour all-nighter, fuelled by currywurst, before the deal was proclaimed on Friday morning. It contains lots of policy detail on every front: pension guarantees, equalisation of employer and employee healthcare contributions, more spending on schools, tax breaks for lower earners, more police jobs, and an annual cap of 180-200,000 refugees allowed into Germany. There is also a pledge to embrace Emmanuel Macron’s eurozone reform ideas, putting Germany back at the heart of the EU after a period in which the French president has had the field largely to himself.

But there are mountains to climb before Mrs Merkel can begin her fourth term in the chancellery. The most immediate problem is that Mr Schulz must get his party to support the deal. This will not be straightforward. Both before and after September’s poor SPD election performance, the party mood was against taking part in another grand coalition with Mrs Merkel. Within the party’s youth wing, that is still the case. Mr Schulz ruled such a deal out after the SPD had lost a fifth of its support in the election. But the failure of Mrs Merkel to form a four-party government with the liberal FDP and the environmental Greens left a renewed grand coalition as the only viable alternative.

Everything now hangs on two tests within the SPD. The first, on January 21, is an extraordinary party conference in Bonn to consider the joint programme. The second, if Mr Schulz wins in Bonn, is a referendum among the SPD’s 450,000 members. Much will depend on whether the document agreed this week is felt by rank-and-file SPD members to contain enough of its own demands to overcome the widespread feeling last year that the party would be better off in opposition than to be the junior party in a Merkel-led coalition for the third time. The absence from the programme of a big signature SPD pledge, at a time when industrial militancy over wages is growing in Germany, will test Mr Schulz’s authority.

If the SPD balks, Mrs Merkel will be left with a choice between minority rule and new elections. Even if it doesn’t, the chancellor is likely to be even more cautious than before about politically difficult change. It would be reckless to write off early 21st-century Europe’s most important politician too soon. But the post-Merkel era is beginning to loom.