TL;DR: "A client contracts us to build the engine for Warcraft I, does client have right to stop us using the same engine for let's say.... Skyrim?" (No contracts have been signed YET)
Actual details:
Our client is in the retail industry. They came to us and we made a beta program for them (free) to show that we can save them $.
We are now in the contract negotiation phase. We understand that the clients only wants to ensure that they will be able to continue their business if our business defaults, and they want our source code. Ok. Sure. Our coders won't be happy, maybe we can make sure to not give away the source code until the contract is OVER. And have a default/bankruptcy safe guard.
However, they also want us to promise that we won't sell the program to any of their competitors. Sure, but what if we wanted to repackage the code and sell to say... a medical company?
First, I plan to define competitors. Then, I plan to define exactly what the program scope is.
So the question is this, legally (in Ontario, Canada), how can we draft a contract that will make both parties happy? Do they really have any grounds to sue us if we take our program, make an essentially new program based on the platform of the old one, and sell to who ever?