I don't know of any "official" doctrine of how much we knew of and agreed to of our trials in this life. As you point out, there is always free agency to consider. However, I do believe that our Father in Heaven knows ALL things. And he does allow horrific things to happen. I mean because they do happen all around us! I believe God is all powerful and that He COULD -- it is in His power to stop evil from happening and save any life or any child from harm. But He ALLOWS people to make horrific choices, and he ALLOWS natural disasters to take place, and he allows accidents to occur.
So if we (and I) believe this -- that he ALLOWS these things -- the real question here should be WHY?? HOW can He - a loving Father -- allow these things to happen? That is the question I would answer for you - the WHY.
In the Book of Mormon there is a story of a prophet named Alma and his friend and companion Amulek. These two go into a wicked city and begin to preach the gospel. They find much opposition and after they preach they are thrown in prison. However some were converted in during their preaching. The people were so wicked that they gathered all the men, women and children who believed the words of Alma and Amulek. Then they brought Alma and Amulek out of prison and made them watch while they cast all the believers - men women and children - into a fire to kill them. I would call this pretty horrific.
So while they are watching, "when Amulek saw the pains of the women and children who were consuming in the fire, he also was pined; and he said unto Alma: How can we witness this awful scene? Therefore let us stretch forth our hands, and exercise the power of God which is in us, and save them from the flames." This verse indicates that God has the power to save them from this.
Let's continue in verse 11 of Alma chapter 14 "But Alma said unto him; The Spirit constraineth me that I must not stretch forth mine hand; for behold the Lord receiveth them up unto himself, in glory; and he doeth suffer that they may do this thing, or that the people may do this thing unto the, according to the hardness of their hearts, that the judgements which he shall exercise upon them in his wrath may be just; and the blood of the innocent shall stand as a witness against them, yea and cry mightily against them at the last day."
From this verse we see that as a perfectly JUST God, our Heavenly Father must allow people to act according to their own free agency so that their judgements will be JUST at the last day. He Knows before they do the evil act that they will do it because He knows each of us perfectly. But He cannot punish us for something we didn't do. So by allowing the evil doer to do evil, God is just in giving them the punishment they deserve.
That sounds great but what about the victim right? Especially when they aren't immediately received in the arms of their Heavenly Father but rather have to LIVE with the horror of the crime. Well, that is where the atonement and the grace of the Savior come into play. We believe that Jesus Christ was perfect and without sin, yet he was the ultimate "victim." He suffered the pains, agonies, and hurt of every one of us for everything we have ever done wrong and every thing that has ever been done or just been allowed to happen to us. In doing so, He is able to take our broken hearts and make of them a heart more like His own.
I am not saying this is an easy road. I am not saying I fully understand how this works. But I can stand as a witness before you that Christ's atonement can heal up broken hearts and make them better than they were before. I am a living example of that. I am a richer, more empathetic, more Christlike person for having suffered the tragic loss of my daughter.
Would I have chosen this road? Not as a mortal. But before this life? Not knowing what real pain felt like and knowing that the outcome would be to be more like my Savior? I don't know. Maybe? The whole goal here is to become like Him right? That is the reason I am here in this life is to become more like Christ so who knows.
I am so sorry about the abuse of your child. Really, I can't think of many worse things. I pray that this horrific trial will turn to become in some ways a blessing to you and your child as you seek the Lord's healing. And please know that because of Christ's sacrifice and knowing just how hard it is to be the victim, He can extend his mercy and grace to make up for the wrongs done to us in that great last day.