How much am I allowed to edit my ESL friend's Master's Thesis? I am lucky enough to be on a good schedule with my own edit: Thesis  and have a little extra time. Earlier in the year, I offered to edit one of my classmate's/close friend's dissertation in Computer Science. I made sure to leave enough time to do this in the writing process and they gave me a copy to edit a week before the deadline. 

The time frame is fine, but the issue is I am unsure of how much help I am allowed to offer. They are an ESL (English as a Second Language) student, and I don't believe they have had much formal English training. Our University makes clear that they accommodate ESL students, as it is a large portion of the student base. The dissertation guidelines note they don't come down hard on syntax and grammar, but that the paper does need to make sense in written English, and that the examiners can't grade a paper they can't understand.

I'm looking at the paper now, and it's pretty rough. I'm not going crazy over the syntax and am helping with that some. However, I'm finding I'm having to make a lot of corrections and completely restructuring sentences and paragraphs in order to make the sentences make sense. 

My question is how much should I be fixing? How much would I be allowed to fix? I am mostly worried about plagiarism, as it would be obvious that my friend's paper has been dramatically changed. My friend's supervisor has seen some drafts of his writing, and it would be obvious if the writing was suddenly much clearer. Getting a paper edited is not against the rules, but I have to make so many dramatic edits I'm worried it may risk plagiarism. 

When there's a bad argument, I don't rewrite it, but just write a sentence or blurb below it to guide my friend to making a better one. Like, "do you have evidence for this?" or, "this is not relevant here, move to...". 

Thanks for the advice!
It sounds like you're doing all the right things regarding helping without actually writing for your friend. I would explain to your friend, and ask them to meet with their adviser, either with or without you, to discuss how much/what type of help is appropriate. With the adviser included in the process, and some boundaries identified, it will be clear that plagiarism is not taking place. That being said, this is a huge time committment on your part. It might help you and your friend for them to work with a writing coach. Your school probably has a writing center or ESL center that can help with this.