In a Democratic wave year, in a state where unemployment has finally fallen under 5 percent after one of the nation’s most brutal recessions, Rhode Island Gov. Gina Raimondo sure sounds like she should be a shoo-in for a second term.

But she isn’t. In fact, Raimondo isn’t even guaranteed to get through her Democratic primary election on Wednesday. Though she has the backing of popular national Democrats including Joe Biden, she’s facing a challenge from former Rhode Island Secretary of State Matt Brown, backed by Bernie Sanders-inspired groups like Justice Democrats.

The progressive insurgency sweeping the nation is cresting in Rhode Island as well — a state with a peculiar brand of politics and a history of strong lefty showings in Democratic primaries. But unlike other places, where progressive victories have conveniently aligned with the party’s championing of women and candidates of color, the Rhode Island battle features a more throwback battle between a progressive white male candidate who seeks to unseat the state’s first woman governor.

“The toughest thing [Raimondo’s] gonna have to do is survive the primary,” Maureen Moakley, a political science professor at the University of Rhode Island, told me. “By running in the middle, she’s invited challengers.”

Raimondo appears to be divisive: 44 percent approval and 46 percent disapproval, according to the latest Morning Consult polling. We don’t really have any polling on the primary, but the progressive grassroots, based primarily in Providence, has a notable history of prevailing in Democratic primaries in Rhode Island. Moakley pointed to the party’s repeated nominations for Myrth York in the 1990s and early 2000s, who was well-liked by the grassroots but fell short in three straight elections against a Republican.

“We had 12 years of Republican governors, which appeared to be something of an anomaly,” Moakley said. “What it really was about was the Democratic Party. [Raimondo] is facing that kind of challenge.”

Gina Raimondo vs. Matt Brown in the Dem governor’s primary, explained

Raimondo sees herself as plenty progressive. She cites three times she raised the state’s minimum wage and outlines her plans for universal education, while warning against “this lazy narrative about progressive, not progressive.”

Perhaps the biggest thing hanging over her head in the primary is pension reform.

In her first term, Raimondo finished implementing a plan to eliminate cost-of-living increases and move workers into retirement plans that resemble 401(k)s. Raimondo made the case that the state pension system would go bankrupt without the overhaul.

Her shepherding of the pension plan invited a challenge from the left in a year when the socialist-curious wing of the Democratic Party is particularly energized. Brown, who is taking up the progressive flag in Wednesday’s primary, is criticizing Raimondo’s administration in the strongest terms.

“Gov. Raimondo is probably the most extreme corporatist Democrat in the country,” Brown told me by phone. “Is the Democratic Party going to be the party of corporations and Wall Street — or is it going to be a party like it’s supposed to be, which is a party that works for the people?”

Raimondo, a former state treasurer who was elected Rhode Island’s first woman governor in 2014, inherited an economic mess. Governing magazine’s Dan Vock summarized the past 10 years of the state’s economy like this:

Rhode Island was one of the worst-hit states in the country during the 2007-2009 downturn, and it certainly fared worse than its New England neighbors. More manufacturing jobs disappeared. Housing prices collapsed. Governments laid off workers. Central Falls, a small city near Providence, filed for bankruptcy in 2011. And because Rhode Island’s economy sank further than those of other states, it also took longer to recover. By 2013, nearly 181,000 of Rhode Island’s roughly 1 million residents were receiving food stamps. Between 2014 and 2015, Rhode Island went nine months with the highest unemployment rate in the country.

Raimondo’s top priorities have been the state economy and reforming the state government. She has helped craft tax incentives for businesses to come to Rhode Island, expanded a small-business loans program, and toured the state touting new projects and new jobs. The unemployment rate was still above 8 percent in early 2014, as Raimondo launched her bid for governor. Now, near the end of her first term, it’s 4.3 percent.

“More than 10,000 Rhode Islanders are finally getting ahead and working because of our approach,” Raimondo told me in a phone interview. “So whether it’s Matt Brown or anyone else pledging to undo our economic development programs, that means Rhode Islanders are going to get hurt and a lot of people are going to lose their jobs.”

Brown has also criticized Raimondo for the disastrous launch of a new website that was supposed to help people sign up for government assistance but ended up “an epic failure,” according to Rhode Island Monthly, and resulted in a gap in some food and health benefits for lower-income residents.

“Many of those Rhode Islanders who went without health care and food assistance were single mothers,” he told me. “What one does in one life, one’s record and the policies one has for women, is critically important.”

Raimondo, while describing the website as “a project I inherited” because planning had begun before she was elected, concedes that “we launched the system too soon. I have acknowledged that as a big mistake. We’ve since turned the corner.”

Brown supports single-payer health care and wants to reverse Raimondo’s pension overhaul, but some in-state experts think his campaign promises are unrealistic. Raimondo’s pension reform was praised when it was first approved for averting a crisis while not raising taxes. Nearby Vermont failed horribly when it attempted to set up a state-level single-payer system. Brown told me one of the first things he’d do as governor is set up a commission to study the proposal.

“What I see across the state is that almost everyone agrees the system we have isn’t working for them,” Brown told me. “People know that we need to change those things, and they know Gov. Raimondo is part of that system and taking it to the extreme.”

A peek ahead to the November general election in Rhode Island

The Republicans have their own primary on Wednesday: Cranston Mayor Allan Fung, who was the nominee in 2014 and narrowly lost to Raimondo, is the presumed frontrunner in his race against state Rep. Patricia Morgan and former state Sen. Giovanni Feroce. His platform is term limits for state lawmakers, tax cuts, and work requirements for welfare benefits.

The wild card is independent candidate Joseph Trillo, who is positioning himself as the Trumpiest candidate in a state where Donald Trump easily prevailed in the 2016 GOP primary. Any three-way split vote would presumably benefit the Democrats.

“There is a lot of support for Trump here, so of course that’s gonna split the Republican vote,” Moakley said.

However, the early polling suggests that the November general election isn’t a foregone conclusion, no matter who wins in the Democratic primary. A Fleming and Associates poll from late July found Raimondo at 39 percent and Fung at 37 percent, with Trillo taking 6 percent of the vote. The same survey showed Brown, if he were the Democratic nominee, trailing Fung by 15 points, 21 percent to 36 percent, with 30 percent of voters undecided.

Election forecasters do think that the Rhode Island governor’s race tilts toward the Democrats (Cook rates it Likely Democrat, while the University of Virginia’s Crystal Ball says the election merely leans toward Democrats).

But Rhode Island has had a rough 21st century, which has fostered a lot of discontent and distrust among the electorate and lent itself to unpredictable outcomes. Raimondo, a Rhodes scholar with a Yale law degree, more or less governed as the leader she promised to be. Wednesday’s primary will test whether that platform still sells.

“I’m not as focused on the labels and the narrative,” Raimondo said. “What I know is people are working. When I was running, we had the highest unemployment rate in America, and today, if you want a job, you can get a job.”