When the loan is sold, the owner/servicer will retain the "original" set of documents. As the seller, you should review any recourse agreement you have with the investor and be able to review your complete file for at least that period of time (my recommendation).
I believe Fannie requires a three year retention of your QC files so any reviewed as a part of that must be retained and reproducible for at least that period of time.
My last comments are that anything in litigation should be held until that is settled and to review state guidance as well. In that these are e-files, retention is not as expensive as it once was so longer is a rule of thumb when in doubt, but don't archive and plan to hold them forever. That only increases any liability and records searches if there is a problem. I heard of one bank that had a Reg B issue. The examiner wanted the 25 months of retention reviewed for a fair lending issue. One of the bank staff commented they had years more records than that and the examiner asked that the bank review all it had. So longer is not always better.