My startup is compensating the engineers with restricted shares in the corporation. When we go for funding, we will want the highest valuation we can convince the investors of. One important valuation attribute is the corporation's legal ownership of the intellectual property produced by the engineers who build the system. That intellectual property is not just patents, but the source code, web site design, system architecture, operating processes and many other points. Basically, the intellectual property is what ever the engineers create in the process of building the startup.

The restricted shares are granted under contractor agreements. Performing to those agreements qualifies the restrictions on the shares to be lifted, in effect vesting the the shares.

In order for the corporation to demonstrate that it has legal ownership of everything the engineers have created, the contractor agreement they sign is very explicit and verbose [1] about their informed decision to turn over ownership of that IP to the company, and that the ownership they are being given in the company is compensation for the intellectual property they produce. The language specifically carves out -relevance- to the startup: "... that are related to the business (present or future) of the Company or its affiliates...".

None of them have any qualm about this, and fully understand the purpose and value of turning over their creative fruits to the company.

I'd expect that this principle has to persist regardless of the size of the company. The key to making it work is that the employee/inventor willfully signs up to the legal restrictions the company places on them as payment for their work and compensation for their creativity. I can easily imagine that corporate attorneys who work to protect their employer's interests would push the lines of what constitutes the scope of the company's claim over their work. I'd guess that for every term that seems intrusive or abusive, there is a precedent case somewhere that corporations can point to as justification for it.

In the case of my startup, the language is specific that the invention is made in the course of building the company, not from other unrelated activities.

[1] INVENTIONS.
(a) Disclosure. I will promptly disclose In writing to the Company all discoveries, developments, designs, ideas, improvements, inventions, formulas, processes, techniques, know-how, and data (whether or not patentable or registerable under copyright or similar statutes) made, conceived, reduced to practice, or learned by me (either alone or jointly with others) during the term of the Independent Contractor Agreement between the Company and me and within 12 months thereafter (unless any such disclosure Is prohibited by the terms of a commercially reasonable non-disclosure agreement signed by me that Is meant to protect the trade secrets and confidentiality of an employer subsequently employing me), that are related to the business (present or future) of the Company or its affiliates, or which result from tasks assigned to me by the Company, or from the use of facilities or equipment owned, leased, or otherwise used by the Company or Its affiliates (all of the foregoing are referred to in this Agreement as "Inventions").
(b) Assignment of Inventions. I acknowledge and agree that all Inventions belong to and shall be the sole property of the Company, subject to the provisions of this Agreement. I hereby assign to the Company all rights, title, and interest I may have or may acquire in and to all inventions. Both during and after the term of the Independent Contractor Agreement between the Company and me, and from time to time, I agree, promptly upon the request of the Company, to sign and deliver to the Company such other documents as the Company considers desirable to evidence the assignment to the Company of all rights I may have, if any, in any Inventions and the Company's ownership of such Inventions.