How do you design a reward function for a code-generation agent to prevent reward hacking while encouraging modular code?