Confused,
You have repeatedly not followed through on clearly telling your wife the marriage was over. You could have enforced a boundary while she was in rehab and had her head to sober living.
Instead on her first night home from rehab you tried to sabotage her sobriety with a review of her last week and a video.
Now you've admitted to an affair.
You desperately need help regarding your codependency. Your behavior with your wife is exceedingly passive aggressive.