I recommend breaking the project into three parts, developing a separate agreement for each to be executed at the time the work on that phase is to commence.
Without knowing more about the book you are putting together, I suggest the three parts be separated, as below, with a payment arrangement on each part being 1/2 upfront (in theory, should at least cover all your cost*), 1/2 upon delivery.
A primary consideration should be whether you will engage in the work of the content editor. At least in my experience, there is no such thing as "middle ground" in an editor's world. You either have the final say, or you don't. If you don't, then think twice before you take on the project.
*The notion is that as you move from phase to phase, you are never "underwater" on the whole project. If the costs are high in any one part, you can also require he/she be billed separately for some part of the cost.
P.S. Will he/she be selling the end product?