In a fair world, Elissa Ennis would be prosecuted for filing a false police report and face punishment by imprisonment, or at least a fine. Because as she admitted herself, under oath: She’s a liar who tried to extort Reuben Foster after he dared to break up with her; in her eloquent words, she wanted to “f*** up his career.”

In a just world, Foster’s reputation would be magically restored, and he’d never have to hear ugly chants from fans mocking him for deeds he didn’t commit, or wonder why folks are whispering when he walks into a room. Because that, unfortunately, is bound to be the fallout for some time, even if he lives a quiet, admirable life off the football field.

As much as I want to crucify Ennis in print for the damage she’s done — to Foster, definitely, but also to other, true victims of domestic violence — the knots in my gut I’ve had since Thursday, when she sat in a Santa Clara dock and walked back everything, are partly my own doing. Because I leapt to certain conclusions after Ennis’ accusations led to Foster being charged with some heinous crimes, and boy was I wrong.

Seriously, shamefully wrong.

While I didn’t push publicly for the 49ers to suspend their talented linebacker, I mocked the “sycophants” for slut-shaming a woman I assumed was being truthful — the details of the injuries she claimed Foster inflicted seemed nearly impossible to invent — and wondered why team executives and fellow players remained strangely silent, when they should have been loudly condemning a man accused of beating a woman.

Now we know what they must have known. Foster, according to his accuser, was being extorted by a raging pathological liar who wanted to take his money, his livelihood and his dignity.

Where once Ennis claimed to police that he struck her eight to 10 times with a closed fist (resulting in a perforated eardrum, an injury that surely couldn’t be manufactured, right?), her testimony at Thursday’s preliminary hearing implicated her as the abuser. She went bonkers after he tried to end their relationship the morning of Feb. 11, and attacked him with a clothes hanger. She admitted he kept running away from her, even locking her out of their Los Gatos home, but she broke through the back door to confront him.

That horrendous claim she made of Foster throwing her bulldog across the room — a sickening visual that added to the picture of an out-of-control hulking psychopath? It never happened! The dog showed no signs of abuse, according to a police officer’s testimony. Why would Ennis accuse Foster of animal abuse?

“Because I was pissed and I wanted to end him,” she replied from the witness stand.

“No, sir. Not once,” she said, when prosecutor Kevin Smith asked if Foster ever hit her.

And here I do believe her, because even though victims of domestic violence sometimes recant if they’ve been paid off, or if they don’t want their abusers to go to jail, or if they’re simply afraid, Ennis, through her extensive testimony, proved her selfish desire was to “trash his career.” She admitted to stealing money and two Rolex watches from Foster, but swore he never offered her a cent to retract her allegations.

As revenge plots go, Ennis’ was both diabolical and fantastical. Her injuries, including the ruptured eardrum? Turns out she sustained them during a fight with another woman following a road rage incident in San Francisco on the night of Feb. 10. Prosecutors knew about this, even saw a videotape of the fight, but oddly chose to ignore it and proceed with felony domestic violence charges against Foster, for which he faced up to 10 years in prison.

It’s not clear if the DA’s office was aware Ennis had also falsely accused a former boyfriend of domestic violence in Louisiana in 2011, after he, too, tried to break up with her. This is the same case where she was arrested and charged with two counts of aggravated assault in Baton Rouge, though they were dismissed in September of 2013.

Foster has his own trail of misdeeds — and we sure have noted them — but in the interest of equality and fairness, Ennis’ history with the criminal justice system is just as relevant. Journalists might not have known where to begin the deep dive, but this sure is something prosecutors must have discovered.

Her devious scheme, now that she’s tied all the diabolical pieces together for public consumption, seems ludicrously obvious. Two days after Foster was arrested, Ennis recanted her story to police, and then again in a public statement through her attorney last month. Despite that, I, for one, was more inclined to believe Smith, the prosecutor, when he declared the DA’s office planned to move forward with the case even if the accuser chose not to testify.

I like to think Smith meant well when he used the high visibility of Foster to advocate on behalf of other victims, saying after Foster’s April 12 arraignment, “There are resources for (victims), and we do not care who the perpetrator is, their status in the community, or anything of that nature. We are here to get you justice, and to get you help.”

There is, of course, a real victim here, and it’s the man who, as a child, was in his mother’s arms when his own father shot her in the back multiple times. Foster, just 18 months old, was injured from the gunfire; his mother Inita Berry Paige, survived, while Danny Foster escaped from jail and went on the lam for 16 years before being captured in 2013, just as Reuben was about to begin playing football at Alabama.

The physical and emotional pain he and his mother endured at the hands of Reuben’s father is unimaginable. With that in mind, I had hoped he or one of his lawyers would say, in his defense, “As a victim of domestic violence, Reuben understands the trauma it creates. And because of his own experience, he would never be violent toward a woman.”

They never did, but they did maintain his innocence and let the court proceeding play out, even while apparently knowing their client was being exhorted and victimized, again, by extremely damaging false accusations that led to many of us — mob rule, at times — jumping to conclusions without having all the facts.

“Honestly I never thought it would get this far. I wanted to sue him on my own. I didn’t think y’all would capitalize off it,” Ennis admitted, and that last sentence ought to cause knots in the stomachs of any journalist who helped hoist the pitchforks.

Due process and the adage “innocent until proven guilty” in this country applies to the court of law, not the court of public opinion. I was inclined to believe the Santa Clara district attorney, especially since that office has in the past been especially cautious about bringing charges without strong evidence. I also listened to the many victims I know, most of whom were hesitant to ever go public with accusations against powerful, wealthy men. I’m also acutely aware of the demonizing of black men in our court system and in the media.

From this side of the laptop, I promise painful lessons have been learned, and temperance while the system is allowed to function will be observed.

The next step comes Wednesday, when the Santa Clara County judge, after taking nearly a week to review all the evidence, including Ennis’ dramatic testimony, will make a ruling on the three felony charges Foster faces related to domestic abuse and gun possession. No matter what the judge decides, the repercussions from Ennis’ false accusations have already left an ugly stain.

“Yes, it hurts and this will be placed with Duke Lacrosse. And victims will constantly hear about these two cases when excuses are made for abusive behavior,” Katherine Redmond, a survivor of abuse and advocate who trains athletes in violence prevention, wrote in an email that referenced the 2006 false rape accusation against Duke athletes.

Like many of us who now see the full picture, she has sympathy for Foster, the victim, writing: “People who have been abused tend to gravitate towards other abusers if they are not healed. Because that is what they know. They don’t mean to and don’t want to, but abusers find them and they cannot see clearly because of past abuse.”

Here’s one more thing we learned Thursday, in between Ennis’ veil of tears and pleas of sorrow: The 49ers showed some kind of hellish restraint. Because she nodded yes when Joshua Bentley, Foster’s attorney, asked Ennis, “Is it true that you told Foster in texts after the arrest that, ‘your career is over, you’re going after him, you’re going after the Niners, and you’re going after his coaches?’”

Her plan was to take them all down, through public humiliation — all because Foster, after hearing of the road rage incident that led to a physical fight with another woman, was done with her. Back in April, 49ers general manager John Lynch was castigated for being prudent and saying only, “If these charges are proven true, if Reuben did hit this young lady, he won’t be a part of this organization going forward.”

Lynch, in retrospect, seems downright wise, and the sort of boss we all would want.

I’ve spent the last few days talking to current and former domestic violence prosecutors and counselors. None wanted to be quoted, because this sordid episode is still so messy, but all believe it will be near impossible to refute Ennis’ admission that her claims, all of them, were lies. It will, they agreed, be extremely difficult for the DA to proceed with the domestic violence charges against Foster, provided there’s not another jaw-dropping twist that rebuts her testimony.

So what becomes of this woman who has admitted twice to making up charges that could ruin a man’s career and scar him for life? She said she plans to check herself into a mental health clinic, admitting she had threatened to kill herself several times in text messages sent to Foster over the past three months. She said this was her attempt to re-establish contact with him. She said she “needs help.” Violins did not play.

For months it was easy to portray her sympathetically, this petite, delicate woman who eschewed publicity. I wondered why some of the 49ers such as Richard Sherman and Jaquiski Tartt, along with their wives and girlfriends, weren’t rallying by her side. Turns out they weren’t just strong teammates and friends; they were admirably holding their tongues when they probably knew so much more.

The prosecutors I spoke with said it’s unlikely the DA’s office will pursue a case against her of filing a false police report, in part because it could have an inhibitory and chilling effect on potential victims from coming forward. Foster could still possibly sue for malicious prosecution and seek financial damages.

Mostly we’re left with this: Where does he go to get his reputation back? Because victims come in all sizes and shapes, and this one just happens to play linebacker for the 49ers.

(Top photo: AP/Marcio Jose Sanchez)