You must very focus on what you are doing and make every effort to deliver but you don't look around, and you may not want to initiate connections with others.
The big boss liked your deliveries. In this situation, many people would have done a lot more to further impress the big boss, which may make a big difference. If the big boss acknowledged your capabilities of driving up a program, your supervisor might have to think twice before making the decision of promoting your co-worker. Even he named that guy, the big boss may not have approved the nomination.
Your boss must have decided to leave a long time ago. He seemed to build his own business network by outsourcing a portion of your work to a third party and promoting someone he deemed more useful to his career/business than you.
How to make yourself useful as to others' career or business is a difficult and subtle task. But believe or not, it is more rewarding than pouring your energies, time and efforts in delivering a project.
When the new boss comes, team up with him to kick out the guy your current supervisor promoted!