Mayor Bill de Blasio and NYPD Commissioner William Bratton have finally turned a pipe dream into reality: They've retooled city policy on low-level marijuana busts into something that's reasonable, pragmatic and just.

Starting next week, people with 25 grams of weed or less may be handed a summons instead of facing arrest and an interminable wait in a holding cell.

That's huge. The new protocol means no arrest, no handcuffs, no detention, and no criminal record to explain to prospective employers for the rest of your life.

It puts the offense on the level of a traffic infraction -- which is where it belongs -- and brings a degree of racial justice to a situation that has been flagrantly unfair.

Surveys show that young white adults use marijuana at greater rates than blacks or Latinos. But in the Bloomberg administration, 87 percent of the city's marijuana arrests were of blacks and Hispanics -- many of whom were just swept up in NYPD stop-and-frisk operations.

That's one reason stop-and-frisk generated such public anger. Cops looking for illegal guns wound up nabbing people for small amounts of pot. Then-Mayor Michael Bloomberg asked the state to decriminalize possession of small amounts in 2012 -- but the legislature said no.

So now de Blasio and Bratton have crafted Plan B. They didn't decriminalize weed across the board. Lighting it, selling it and possessing it are still against the law. But their plan should deftly defuse the outrage that's festered over inequities in the way state drug laws are enforced.

Unfortunately, not everyone is a fan. Ed Mullins, head of the NYPD sergeants union, calls the plan the beginning of a "breakdown of a civilized society" and at odds with the "broken-windows" policy Bratton champions.

But Mullins is wrong. Broken-windows -- the idea that careful attention to small crimes leads to fewer large crimes -- demands a strong community buy-in.

Bloomberg lost that buy-in with stop-and-frisk.

By easing up on unfair marijuana enforcement, Bratton can win back this crucial mandate. This isn't a breakdown in civilized society. It's common sense.