I didn't stop sleeping with my H until he left me. I had my reasons, and I did some heavy duty compartmentalizing, but it was terrible for me. I don't think I got a good nights sleep for eight months. That exhaustion snowballed into how I treated him when we were awake and made things a lot worse.
The night after he left I slept like the dead. All but a handful of nights since then have been just as restful. If I had it to do over I would have booted him out then and there.
I'm not necessarily advocating a separation. But it sounds like a very healthy and helpful boundary for you would be to ask her to move into the guest room, if you have one, while she's involved in the affair. A transparency plan would be necessary for you to let her back into the marital bed.
Of course I defer to any vets who have an opinion. But you can't be detached in your sleep. Sleep is for rebuilding the strength to do that.
Me42, H40 D12, S8, S7 A revealed: 7/13 Sep 4/14; Agreed to D 1/15