For Philadelphia managing director Mike DiBerardinis, a parks and rec man at heart, the event at the Heitzman Playground last summer was supposed to be hopeful. The tattered Harrowgate rec center, just blocks from the heart of the city’s overdose crisis in Kensington, would be getting a badly needed makeover.

It was one of the first projects green-lit as part of the city’s $500 million Rebuild effort, the mayor’s ambitious overhaul of the city’s crumbling public spaces. But as the celebration kicked off, DiBerardinis and the crowd realized they would have to shout through the ceremony — because heavy equipment was clearing the elevated train tracks above the center, where dozens of people in addiction had been living. Conrail worried a train would run someone over.

For DiBerardinis, the din — and the optimism beneath it — was a perfect microcosm of his nearly half-century of activism and public service in Philadelphia.

A big step forward drowned by a city’s deepest inequities.

It’s the kind of contradiction that he’s navigated from his first days as a Kensington street activist at the tail end of the Civil Rights Movement to his job as the city’s number two honcho — a career that offered a front seat to the real story of Philadelphia, which is one of two cities. One moving forward with a posh downtown, new cultural cachet, and ambitious reforms, and one still riven with profound unfairness.

DiBerardinis, long known as “Mike D,” is retiring from that front seat on Tuesday. He’s turning 70; his wife, Joan Reilly, recently retired as chief operating officer of the Mural Arts Program, and there are the five grandkids, plus a professorship at Penn’s Fels Institute of Government and his son Justin’s potential at-large City Council bid. As his city career ends, it’s one worth examining.

The son of a millworker who grew up in working-class Downingtown, he was “radicalized,” as he puts it, at 20, as a college student at St. Joseph’s University, where the Jesuit values —– service for others, critical questioning, the good in everybody — hit home. After graduation, he did what Philadelphians do: He went to the place where he could be of most help. That was Kensington. At the time, the neighborhood was still clinging to the last gasps of its industrial past. He remembers the block he lived on, the corner stores, the pharmacies. The house where he lived, just a few blocks from ground zero of the opioid crisis, is gone now. He drives by often. “It’s a mess,” he said.

DiBerardinis took a job transforming a vacant building into a community center. He threw himself into housing advocacy, even taking to hurling toilets onto the lawn of the Housing Authority to highlight the lack of repairs in public housing, and the glut of, yes, broken toilets. When St. Christopher’s Hospital threatened to leave Kensington in 1983, he led a march of 1,000 children to protest — walking the same route that the legendary activist Mother Jones took in 1903, leading child laborers on a protest — at the same time 75,000 textile workers were striking in the neighborhood.

“My point,” he says, “is that recovery is long and arduous.”

That applies to his long career in city politics, too, working under three of the last four mayors, among other things running the Parks and Recreation department and the state Department of Conservation and Natural Resources for Gov. Ed Rendell.

“I saw a kid from the neighborhoods,” remembered Rendell, who hired him in 1991 after DiBerardinis lost a tough-fought Council bid. Rendell credits DiBerardinis with helping save endangered city pools from shuttering — a victory that led to the iconic, if vaguely unsettling, photo of a shirtless Rendell jumping into the water. “He wasn’t Ivy League, he knew Philadelphia, he knew the neighborhoods, and he emphasized with the challenges the neighborhoods face … The taxpayers got their money’s worth with Mike D.”

The activist turned bureaucrat who spent a half-century trying to make a city a little less unfair is retiring at a time when he feels the stakes couldn’t be higher. A time when the federal government has turned its back on cities and the people struggling in them.

But this, for Mike D., is not a cause for despair. Because he feels that cities can carry the torch in these dark times — and that the city’s progressive efforts like Rebuild, the soda tax, expanded early literacy and workforce development programs are proof. The response to the opioid crisis, which, as it does with everything, threatened to overwhelm that Rebuild celebration last summer, can be proof, too. As long as it finally redresses the suffering of the Kensington neighborhood where Mike DiBerardinis first cut his teeth.

“It’s still a tale of two cities,” he said. “But now you can feel the possibilities.”