Not sure I understand your post but let me clarify.
With art, you often need to produce a looooooot of preliminary and intermediate work to achieve the final product. This isn't wasted work, as the grandparent poster seems to think.
It's similar (admittedly, not identical) in many regards with code. Each line of code stands a high chance of being revised or deleted as we iterate and get our code to a working state and then continue to improve it in the future. Those intermediate steps aren't wasted; they're how we get to where we're going.
We agree, essentially. At the risk of really labouring the point though;
It'd be most efficient for time/cost reasons if we only ship to production code which is actually used in that build.
However, intermediate steps, or additional debug/test/migration/whatever code is required to get to the final state. You probably don't want to ship debug stuff into production.
Therefore, of the total quantity of code written, somewhat less than 100% is useful in production.
Therefore, you don't want to ship 100% of all code written to production.
> "how can we make it so that 100.0% of the code I type is shipped in the final product?"
This isn't necessarily desirable; but phrased slightly differently perhaps reflects more about production efficiency:
"how can we make it so that 100% of the production code is the only code I typed?"
Well, I don't disagree with what you typed there but I think we're off in the weeds a bit.
"how can we make it so that 100% of the production
code is the only code I typed?"
We certainly want to eliminate as many unnecessary steps as possible.
But much of that intermediate work iteration is inseparable from the discovery and refinement process.
To answer your question literally, "how can we make it so that 100% of the production code is the only code I typed?" would only be possible if you moved all of that discovery and iteration and refinement out of the coding loop or whatever.