You're right. The mRNA vaccines aren't fragments. With your source code analogy, the same analogy applies for covid itself. It sends a code to your body to produce a protein that varies slightly depending on the strain.
Governments will eventually allow covid to run and we'll all be exposed to it. If you're skeptical about the messenger vaccines, I hope you go with a non reproducing fragment or whole virus vaccine like AZ or Novavax when it arrives, because it's a lot safer than the live virus.