Preface: I am new to engineering after thirteen years in academia, and I've noticed the standards for professional and polite are very different between the two situations, so I'm not sure academic standards apply here.
I signed a contract to work on a project which has now gone on more than twice as long as it was contracted to last. A variety of things could be the culprit, so the specific reasons don't matter here except for to say that in my well-documented opinion, the project is not able to be finished. The general issues include serious communication problems that I am unable to resolve; constant revision of goals and requirements; requirements that are not able to be completed as written; the refusal to comply with and/or use the tools, standards, and/or methods in the underlying architecture chosen for the project, causing me to need to constantly customize, override, and/or rewrite fundamental classes and/or methods; mass deletion of my work without explanation and occasionally without notification of any kind; my own inexperience; and what I am going to sum up as a conflict of personalities.
I assume I have to stay because I signed a contract, but I do not believe the contract will ever be finished, nor have my requests for prioritized lists of tasks and/or feedback on how to get the project finished been answered.
The rest of my pay for the contract is being held until the project manager is satisfied with my work, which appears highly unlikely to occur, and the tone and commentary in the feedback I've been given on my work and/or requests for clarification is demoralizing. I'm not sure the tone and comments are entirely intentional, but the effect is unpleasant enough without intent.
Under those conditions, what can I do to politely, professionally handle the situation?
My preferred goal here would be to leave, but I don't believe that's an option, so I would be interested in advice on how to behave as professionally as possible given the situation and, if at all possible, finish the project so that I am not abandoning it. I have and am extensively documenting interactions, changes, revisions to the goals, and/or all communication.
My request for a prioritized list finally got added today, after I wrote the question.
The contract is in the US.
A concise summary of this learning experience, as per reading the comments:
1. Next time, I'll do a whole lot more detailed negotiation up front.
2. Scope changes will require renegotiation.
3. I'm insisting on explicit clauses for conditions under which I can terminate work.