She tested positive for Meldonium that is correct however WADA did not do any study how long it takes to take the drug out of the system. As it turns out it takes longer then 1 month so they changed the rules extending the time-frame as well as setting a minimum content of the drug in the system. According to the test Efimova was well within that threshold.
Further there are no studies that indicate that Meldonium is a performance booster it was banned by WADA according to its own statements because of wide use not because there are any indications that it enhances performance. So basically based on the popularity. But regardless of the background rule is rule but she complies with the rule as it is stated.
There were no 11th hour negotiations. Olympic Commitee set out clear guidelines for accepting Russian athletes which is in itself discriminatory and should have been applied to all participants instead. But anyway one of the rules was that that athletes with a history of doping sanctions could not attend, based on this FINA disqualified Efimova because in 2014 she had failed a doping test for which she has served disqualifications until February 2015, not because of anything that have happened in March 2016. So it is based on this that FINA did not allow her to participate. Efimova went to court http://www.tas-cas.org/en/index.html which ruled in her favor indicating that quite rightly that it is not possible to punish a person for a crime for which the punishment has already been served. Therefore Olympic Committee and FINA was forced to retract its requirement and accept the participation of Efimova or ignore the rolling and face eventual monetary fines. The rule was retracted not just for Efimova but for all athletes.
Personally I like clear cut decisions and don't mind athletes caught on doping being disqualified for life but i disagree that it should only be applied to Russian athletes and many teams have athletes that have previously served disqualification for doping. The argument from the other side being that today there is enormous opportunity for athletes to inadvertently ingest some banned substance and a life ban would not be fair, not being a specialist i am not certain how valid the latter argument is.
I am amazed that under all that psychological pressure she went out and was able to perform as well as she did.