Run your scripts with Wolverine and when they crash, GPT-4 edits them and explains what went wrong. Even if you have many bugs it will repeatedly rerun until it's fixed.
It didnt pick up the bug in the else of the calculate function, presumably it is only running along the path that the script is running based on the inputs.
If they are so obvious, why didn't you just do it yourself the first time? Instead of yeeting large portions of your codebase at a 3rd-party web service?