Yes, humans can learn which parts of the spec are true and which aren’t. LLMs can too, but only through their context window (or long term through retraining)
You think you don't have a context window? Try coming back to your own uncommented code after half a year.
In-context learning is more than "copying" though. It's generalization.