November 18, 2017. In a bar on Northcote’s High Street, Greens supporters were in euphoric shock. In the byelection for the Victorian state seat of Northcote, most expected a close but losing contest. Election night was not expected to yield the result; the vote would be so tight they’d have to wait. But so emphatic was the Greens win – an 11.6 per cent swing, a near sweep of the booths – supporters were deliriously welcoming their candidate’s victory speech just a few hours after the polls closed. In Lidia Thorpe, they had elected the first Indigenous woman to the Victorian Parliament. That night, they would drink, hug, cry.

Labor had held the seat for a century, and they didn’t lose it through lack of effort. Hundreds of thousands of dollars were spent; the premier was dispatched with calibrated announcements. But the electoral encroachment of the Greens in inner Melbourne had been a decade coming, and many inside Labor thought losses inevitable. State and federal seats that had been long held with plump margins – seats that were once the base for party leaders – were gone or threatened. It raised hard questions within the party: should Labor re-conceive its constituency? How should it campaign in the future? In Victoria, did the party have to consider future Labor–Greens coalitions? Was that unlikely or anathema?

The day after the Northcote election, I received this answer from a Labor insider. Defeat was fresh, the analysis raw. “We have given Victoria one of the most progressive governments probably in the nation’s history,” the source wrote. “The premier is a progressive inner-city stereotype. We made a suite of progressive announcements tailored to Northcote residents. We even found a Labor issue – housing and renting – to intensely focus on, relevant to the electorate. We’ve tackled equality, drugs, euthanasia, sustainability – all in the past few months. And we made plenty of funding promises for the usuals – schools, community groups.

“On top of that, we spent a shitload of money and ran one of our biggest field campaigns ever. We couldn’t even get sympathy for the member – a warrior for progressive issues, and the first minister for the prevention of family violence, who died suddenly of cancer.

“We could not do more to appeal to Northcote voters, and their overwhelming rejection of us says we should not try to appeal to them. They have sent the message that they do not care how progressive Labor is. The Greens will ensure that progressives are the victims of their success because Labor will learn there’s nothing to be gained from being progressive. They demand we ignore or reject our conservative working-class base to pander to their desires and then they reject us at the ballot box for the authentic thing.”

In the 1990s, Labor was attracting close to 70 per cent of the primary vote in Batman. It was one of its safest seats. A jewel. But from 2007, Labor’s margin – already in modest decline – began nosediving.

Four months later, Labor faces a similar rejection. Through a rare coincidence, much of the same geographical area is now subject to another byelection, this time for the federal seat of Batman, vacant after Labor MP David Feeney failed to provide the papers he said would confirm his constitutional eligibility. He resigned – with some encouragement – before his case came before the High Court.

In the 1990s, Labor was attracting close to 70 per cent of the primary vote in Batman. It was one of its safest seats. A jewel. But from 2007, Labor’s margin – already in modest decline – began nosediving. After the 2016 federal election, when Labor retained the seat thanks only to Liberal preferences, the party’s margin had been shredded to just 1 per cent.

A measure of the difficulty of retaining the seat was Labor’s Right faction relinquishing their claim to it, and allowing the quick nomination of the Left’s Ged Kearney. Few I’ve spoken to in the party could think of a better nominee. A nurse and, for the past decade, president of the Australian Council of Trade Unions, Kearney is a genial and accomplished candidate who grew up in the area. Despite this, there seemed scant optimism for a victory.

I’m on my way to a Greens press conference at the Northcote Social Club, a pub on the main retail drag of High Street. Beneath a nearby “Stop” sign, an “Adani” sticker has been fixed. A block away, a politically unaffiliated poster reads, “Smash the rich”. Tram stops have been increasingly decorated with unofficial Greens posters alleging Labor’s moral indifference. On some measures, Batman is Australia’s most left-wing seat.

The Greens candidate is Alex Bhathal, a social worker who has lived in the area for 30 years. She is contesting the seat for a sixth time and, as with the recent state byelection, many of the issues are unusually lofty: economic inequality, climate change, offshore detention and, pointedly, the proposed Adani mine in Queensland’s Galilee Basin.

“People have a loyalty to progressive causes and a concern for others,” Bhathal tells me of Batman. “And that’s true of those in Bundoora [in the electorate’s north] and those down in Alphington. And concern for climate change is almost universal here.”

When Bhathal stands before the cameras in the front bar, she is joined by federal Greens leader Richard Di Natale, who is wearing a black “#StopAdani” T-shirt. The party’s opposition to the mine has been clear and vociferous, and some within Labor express frustration at how it has wedged them – or distracted them from the “core” Labor mission.

Until recently, federal Labor has been publicly agnostic on the mine. Earlier this month Bill Shorten signalled the likelihood of a federal Labor government’s opposition when he said he was “increasingly sceptical” of the project. But he has not been explicit, and likely can’t be until Labor’s coal policy is ratified at the party’s national conference later this year. Labor’s juggling act is obvious: Shorten was campaigning in Batman on his scepticism of the mine, then was compelled to fly to Queensland to assure the mining industry that that scepticism did not extend to scepticism about coal. The Greens have relished this seeming equivocation, and begun reflecting it in their campaign literature.

“The Greens’ sole focus are those voters,” a Labor source told me. “It’s a much smaller goal. It’s a select few seats won from a targeted demographic.”

But for all the discussion of Adani, the only questions asked at the press conference were about Barnaby Joyce. Di Natale seemed more than happy to field them – the compounding scandals supported the Greens’ thesis that the dominant political culture in Canberra was sick. “I spoke with an Italian pensioners’ community group recently,” Bhathal later told me. “And the biggest cheer went up when I said we needed to clean up politics. The vested interests I can see. With the Joyce situation, you have potentially the soliciting of gifts. There was the Gina Rinehart cheque, which he later gave back. It’s hugely concerning.”

After the first parliamentary sitting for the year, politicians returned to their electorates last week. I heard stories of voters crossing the street to speak with their local member about Barnaby Joyce. Some MPs were surprised by the size of community feeling. People were angry. It wasn’t the adultery, but the perceived misuse of public money – the job for his partner, the inordinate use of travel allowances, the request to have the Nationals pay him the salary he had lost through his own negligence. Suddenly, Barnaby wasn’t a plain-spoken bloke — but just another pollie on the make. In Batman, Di Natale volubly answered questions about Joyce, presumably because his party will benefit here from public fatigue with “politics as usual”.

A cliché of the Batman electorate is the “hipster-proof fence” – the arterial road, Bell Street, that runs east to west and roughly splits the electorate in two. The southern half is younger and wealthier and boasts the country’s highest concentration of artists. Typically, it yields a higher Greens vote than the north. “The whole issue of gentrification is an area that really needs needling,” Ged Kearney tells me. “It would be an excellent analysis piece – why are they voting Green, or why have they left Labor? Perhaps they’re more wealthy, perhaps they’re more secure. Certainly there’s this whole question of ethics and values, and for whatever reason – rightly or wrongly – that they feel Labor has deserted that space in some way. I would argue not. In this campaign I am appealing to a lot of people who did vote Greens but also voted Labor in the past, and for some reason they see me as someone they can vote for, whether that’s because of my history on progressive things or whether it’s because I’ve been a nurse and that brings certain amount of characteristics they’d like to see in a politician.

“There are some universal issues. I’ve visited half-a-dozen schools in the area that are in desperate need of funding. That’s a story across the whole electorate. The issue of community health funding, mental health funding, Medicare – that’s universal. Public transport is another one that’s universal across the electorate. But I can probably count on one hand the number of people north of Bell Street that have asked me about Adani. Whereas in the southern part, absolutely. There’s a high level of engagement with that issue.”

Against national averages, Batman is wealthy and its people more likely to be university educated, atheist and unmarried. They are, generally speaking, people who have benefited from a global economy and had their tastes and politics informed and enriched by cosmopolitanism.

Batman’s voters are also physically in flux. The electorate will accommodate about 10,000 new voters during an election cycle. Crudely, that has meant the flight of older Labor voters and the introduction of younger Greens ones. While the national Greens primary vote has stagnated – or drifted slightly backwards from its high-water mark of 11.8 per cent in 2010 – Greens voters have become increasingly concentrated in the inner suburbs of major cities. Especially Melbourne. While their primary vote has plateaued, their electoral potency has increased.

Much merriment – or angst, if you’re in the Labor Party – was caused by the seeming haplessness of David Feeney. During the 2016 campaign, it was revealed he lived outside the electorate and, while debating housing affordability, failed to declare a negatively geared investment property. But in a recent piece, the ABC’s election expert Antony Green counselled against attributing Batman’s declining margin solely to its previous member. Batman’s erosion was matched in neighbouring electorates, federal and state. It was part of a larger, decade-long trend.

That said, Green and a Labor source nominated the inner-Sydney seat of Grayndler as one of similar demographic composition to Batman, but one that had withstood Greens encroachment because of – in part, at least – the popularity of its member, Anthony Albanese.

Labor sources thought Kearney, who lives just outside the Batman electorate but has links to the area spanning many decades, could be a similarly popular and effective local member, but feared she would not be given the chance. Some rued the fact that, historically, a disproportionate number of inner-Melbourne seats were held by the party’s Right.

How does Labor appeal simultaneously to the inner city and the outer suburbs? Does it bother? While debate occurs within the party about resigning to the Greens wave, an obvious point was raised to me by a Labor source: if inner-city seats are relinquished, a commensurate number of seats must be claimed on the other end of the spectrum. In this new strategic world, a seat such as Queensland’s Dawson – currently held by Liberal National member George Christensen – would become a “threshold”. Demographically, Dawson is a world away from Batman. Another Labor source admitted: “If you’re going to lose these once unloseable seats – and you can target seats like Dawson, maybe seats like Dunkley – you’re trying to replace once safe seats with swing seats. That’s a dangerous position to be in.”

It is far from an existential crisis for the Labor Party, but there are few easy answers.