The Upgrade Problem: What Happens When an AI Agent Evolves Onchain?