Principled AI Coding