Yeah, server_facts would be a much better choice. At that point, the ENC has decided and that value is the environment that compilation is actually using.
Anything Facter reports is a guess about what compilation might use, and relying on that is just taunting Murphy's Law.