the pg_get_functiondef check tells you what's live right now. if you want to stop guessing after a crash next time, make the agent's change leave a receipt that commits together with it. ddl is transactional in postgres, so: ```sql begin; create or replace function public.my_rpc(p uuid) ...; insert into agent_changes (op_key, object_name, applied_at) values ('my_rpc-v7', 'public.my_rpc', now()); commit; ``` with op_key unique. after a crash you look up the op_key: row there means the function change landed, no row means nothing did. no half state and no diffing against local files. it also gives you a rough timeline of what the agent changed, as long as it goes through that path. if your project lets you create event triggers, one on ddl_command_end that logs pg_get_functiondef into a table would catch the execute_sql bypasses too, since it fires no matter which tool sent the sql. (the receipt in the same transaction is the same trick we use in ledgerguard for agent data writes, not ddl: https://github.com/Val1-IT/Arvanta-Ledgerguard)