The problem my AI assistant created when trying to fix another problem
I had asked Cursor last week to solve a problem related to the date in a booking form. It solved the problem. It also, in a subtle way, modified how time zones were stored. I realized it only after three days when a booking was made one day earlier. The diff was forty lines long, and I just skimmed through it because the fix seemed fine and the app was working.
I am not blaming the tool. Small requests led to large changes, and I took it as such without even looking closely. Since then, I have developed two new habits: ask for the minimal change and read every line related to data format changes, no matter how boring the rest of the diff is.
The second habit has found more issues than any test I have ever written. The places where a confident but incorrect change can cause the most trouble are storage, date, money and auth.
What is your policy when it comes to reviewing changes made by AI? Do you review everything, just the riskier bits, or do you run a test? And has an attempted fix ever caused problems in another part of the codebase?
Replies
Your list of four, storage, date, money and auth, matches mine, and I would add one habit next to the minimal change rule: write the reason for a deliberate oddity where the agent will read it. My daily limit counter, for example, uses a UTC calendar day on purpose, so the window resets at one fixed moment for everyone instead of following whatever the device claims its time zone is. Without a comment saying so, that is exactly the kind of thing an agent "fixes" while touching something nearby, because local time looks more correct. Same for a counter kept on the user document rather than counted off the songs: it is there because a user can delete songs and a count of survivors would hand back a slot with every deletion. Each of those has a two line comment with the why, and through all the agent edits since, neither has been "corrected". A rule I keep for comments in general is that they exist only when the why is not obvious, which makes the few that exist read like warnings, and the agent treats them that way. The second half of my policy is the one you found: a diff that touches how something is stored gets read line by line, however small the task that produced it.