This star survived a close call with a black hole. Eventually, it will become a planet