You can just look at the diff when you do a pull request, no prayer needed, and if you want it to be “surgical” in that way, your prompt (and agents.md) can be specific.
You can also unit test the function to better assure behavior didn’t change.
Many diff tools, such as delta (https://github.com/dandavison/delta) and the ones built into VS Code and IDEs by JetBrains, can configured to highlight changes within each line (by word) and ignore changes to whitespace. Those features save me a lot of time when I review diffs that include indentation changes or variable renames.
You can also unit test the function to better assure behavior didn’t change.