Hoy he comido pasta.

English Translation

Today I had pasta for lunch.

I had pasta FOR LUNCH.(?) I don’t see the FOR LUNCH in this sentence.

Hmm, yeah, probably it’s not the best idea to assume it, but, because lunch is simply “la comida”, when nothing else is added, I’d say it’s kind of the default.
So, while for clarity reasons, it’s probably better to specify it (like “Al mediodia he comido pasta”), I think it’s not wrong, per se, to translate “Hoy he comido pasta” as “Today I had pasta for lunch”.
The think is that comer (Wiktionary, definition 2 ) can be:

  • eating in general
  • eating lunch
    and you’d decide based on context. For example, you’d say, “hoy he comido pasta y he cenado pescado” (today i ate pasta for lunch and fish for dinner)