At the heart of Corbynism is an ethical vision of a society founded on different values to those of neoliberal capitalism. The movement has sustained itself over the last three tumultuous years ultimately because of this powerful claim. It’s what has held Jeremy’s support together through thick and thin and, in 2017, it is what powered the movement that helped deliver the biggest increase in Labour’s vote share since 1945. But Brexit has pushed the left dangerously close to losing sight of these values.

The danger appears because there are two Brexits. One is the formal process of leaving the EU. This obsesses our political and media class and drives endless, tedious reportage fixating on technical details and political squabbles, which is exactly what so many hate about mainstream political reporting. If cynicism about politicians and politics remains sky-high, context-free insider reporting of Westminster bickering has helped fuel it.

The other Brexit receives less attention, but grasping it is essential for understanding what we are going through. Brexit was never simply about leaving the European Union – that much is obvious. Brexit is ultimately a constitutional debate about what kind of country we are, or could be. It is profoundly sad that our political institutions are largely incapable of allowing that debate to occur properly.

This other Brexit has appeared intermittently. Labour’s response to it was to insist, from the morning of the referendum, that the Leave vote cannot be separated from how deeply alienated people feel from our political system, the result of almost a decade of austerity, under-investment and neglect for large parts of the country. By promising to transform our economy for the benefit of the many, Labour offered new grounds for hope.

There is nothing resembling hope on the Conservative side. Xenophobia has been Theresa May’s leitmotif. From her time as home secretary, instigating hostile environment and net migration targets, overseeing the Windrush scandal and introducing the appalling “go home” vans, to stripping EU citizen’s rights while Prime Minister, she has doggedly persisted in targeting, victimising and abusing migrants to this country. She has no other memorable achievements to her name.

The apogee of May’s career has been to win EU support for a train-wreck Brexit deal that sacrifices much and delivers almost nothing beyond a commitment to ending free movement. With continued observance of state aid and competition law wired into this deal, staying in the EU is unambiguously better than the stinking racist mess May is offering. If (and perhaps when) a second referendum happens, the position the left takes in it should be judged on this basis.

But Labour’s alternative vision has to be grounded in its principles. There should have never been any serious doubt that Labour would oppose the Immigration Bill. More than this, Corbynism will start to look like shallow, business-as-usual politics if it cannot conduct a principled argument in defence of migration and free movement.

The economic arguments in favour of migration – from its impact on growth to the absence of impact on wages and employment – are clear, robust, empirically-grounded, and politically almost useless. Trying to tackle Nigel Farage or Tommy Robinson by waving academic research around is like bringing a spreadsheet to a knife fight. It’s not that people don’t want evidence and research – they do. And they want clear policies that they can see will be workable. But both have to arrive in a context where what really matters is the story we tell about the kind of people we are and the kind of country we want to build.

This political argument is where the left has to win this fight. We defend free movement on the grounds of the solid principle at stake – that we defend the rights of the 3.7 million EU citizens here in Britain, and the 1.3 million UK citizens in the EU – and the defence of that principle should be an important part of Labour’s story.

This is class politics: the majority of EU migrants in Britain are working class. The working class today isn’t only the older, white workers that Brexit reporting has magnified. It’s multinational, multi-ethnic – and together makes up a clear majority of the population.

Undermining existing rights to free movement undermines the rights of the whole working class: forcing migrants into illegal work or depriving them of protections makes it harder, not easier, to maintain rights for everyone else. And as polling shows, public attitudes on migration are softening markedly. Class politics, growing electoral advantage and – above all – a clear and principled vision of an open, democratic, egalitarian Britain should all point Labour towards a solid defence of existing rights to free movement.

James Meadway is former economic advisor to shadow chancellor John McDonnell, and is currently writing a book on Corbynomics