I'll take a stab at this. I've been thinking about this for a long time. I'm trying to rough it in.
I believe: #1) problems of the affair and problems of the BS/marriage are separate and should be treated separately, #2) a person is value programmed at an early age and is only re-programmed after experiencing a rare MAJOR, MAJOR life traumatic event, and #3) incorrect value programing that occurred at adolescence or after a rare life event lead to a person choosing to have an affair with the exception being improper brain chemistry thus leading the person to choose the affair for shallower reasons, in which case medical assistance is required with the below guidance.
In my opinion,
EVERY event leading to the affair is a cause/effect. EVERY event is first an effect from a previous event, and then pivots to be the cause of the next event. The task of successful recovery is identifying which "cause/effect" events are problems that should be fixed for both the affair and the marriage, independently. There can be more than one problem for each.
To solve the problems:
Delete the noise. Rule out ALL causes and effects that occurred during the affair and all causes and effects that occurred as a result of your spouse. Focus only on yourself and only on pre-affair causes/effects. This goes for both the WS and BS for self evaluation. Avoid confusing your analysis with behaviors of the other and radical behaviors during the affair. Its not necessary.
Next, for the WS for the affair problem, look only at yourself and only at pre-affair events, and further delete noise by ruling out all causes and affects by others, and all causes and affects occurring during adolescence. Look only at your OWN BELIEFS and FEARS, without consideration of outside effects, that may have led you to choose to having the affair as a solution to your problem, -and that led you to believe choosing the affair was justified for solving your problem. Here lies the biggest problem and it is 100% owned by you. Don't loose focus on this. Don't give up on it. Have the courage to find it. Fix it. Questions you can ask: Why did you believe you were not loved, not worthy, were bad, came from bad? Why did you need more affection, false affection, more sex, non-intimate sex, why were you were not happy? Why did you not speak up for yourself, why did you avoid conflict? Why did you not allow yourself to be vulnerable, to love others and to be loved? Why did you not respect yourself, respect others, and why did you lie on such grand scale, and dishonor yourself so? Why were you so desperate, so drastically in survival mode, what triggered you to believe this was ok or not care so that it was wrong?
Furthermore, for the WS, review adolescence and any FOO issues and traumatic life experiences to help with understanding your incorrect value programming that have caused your incorrect beliefs and fears. Know that your value programming was wrong, your beliefs were wrong, and that you were using poor coping skills. Know that you were carrying forward a negative trend that has been negatively effecting your life and everyone else's around you. On a positive note, also know that carrying this trend was not your fault. It was all you knew. IT was value programming handed to you or all that you could come up with on your own at an early age. However, also know NOW is your time, NOW its your job, to realize this is a problem, to correct this, -to correct the incorrect beliefs (causes/effects) and incorrect fear and coping skills (causes/effects). Fixing this not only will prevent you from having an affair, it will allow you to live fuller and more peace life regardless of your spouse or marriage status. If for nobody else, fix this for yourself, be a hero for yourself, and be proud of fixing it.
If you are in a fog, know this, that this fantasy you are living, this infatuation, this limerence, thrill, excitement, "luv", -it wears off just like it did with your current spouse. It's a drug that wears off leaving you with a hangover that involves actually needing to "love" your AP to sustain a healthy relationship, or move to another, as must your AP. Just look at the odds. There is a reason for the high failure rate. And while evaluating this from a practical standpoint, also evaluate the people that helped shape your value programming. Were they emotionally successful at that time? How was their environment? There is a reason for their high failure rate, and their lack of emotional success, true happiness, and peace. Also, think about your legacy and compare it to theirs. Are you terrified of dying? Are they afraid of dying? You will not fear death having a positive legacy. After assessing this stuff from a practical standpoint, can you see a consistency that just might be wrong?, -such as beliefs, fears, and coping mechanisms? -resulting in radical behaviors? Maybe this is their problem. Maybe you are their legacy? You still have a choice to end it. Please think about this.
Understanding not all BSs are saints: When evaluating your spouse for problems, don't view their problems as a cause for your affair. It was your choice to have an affair, and only yours. It was wrong, period. Rather, look at your spouse's problems as a secondary problem to yours, something that amplified YOUR problem. Once you fix your problem, fixing your spouse's problem is expected to improve your marriage and your spouse, not you. Also, be careful not to give your spouse's problem too much weight as you might be perceiving it incorrectly because you are still learning, or your spouse not yet accept it because he/she is still learning. It was not your spouse's responsibility to prevent you from having an affair. In the end, you can know that, on one extreme, you can leave your spouse if your spouse chooses not to fix their own problem. You can feel confident and justified in leaving after you fix your own problem. Or on the other extreme hand, your spouse's problem might disappear after fixing your own problem. It will take time to work this, and time will tell.
Because it takes time to learn and grow and figure this out, you may need radical short term corrective actions in place to please your spouse and allow your spouse to trust. Through time you will both learn and grow to understand which of these actions are unhealthy to support a long haul, and you will comfortably eliminate them AFTER and AS you identify and fix your own problems.
In conclusion, if your wife is saying the reason for your affair is your own problem, and it runs deep, and you need to find it and fix it, and not point fingers at her, I agree. But I also agree she eventually needs to evaluate her self, if not to identify problems, then at properly adjust to her MAJOR, MAJOR traumatic event (see #2 above and potential unhealthy RA). Of course, this is only if you BOTH are willing, and have the strength, proper guidance, and courage to perform the required emotional work.
Good luck. Take care. I see it as a good sign that your are posting.