Roll back if verification fails
Tell the agent that if its change doesn't pass the checks, it should undo it and return to the last working state, rather than piling on more fixes.
Define the failure condition up front: if tests, the build, or other checks fail after a change, revert to the known-good checkpoint and report, instead of layering guesswork fixes. This prevents a cascade of patches on top of a broken change.
A climbing team agreeing before they start: if the weather turns, we go back to base camp. The decision is made while everyone is calm, not halfway up the mountain.
When a change fails, agents tend to try fix after fix. Each attempt adds more changes, and soon the code is further from working than when it started. A rule set in advance keeps things recoverable.
Verification failed: 2 chart tests broke after the upgrade. As instructed, I rolled back to the checkpoint, and everything passes again. Here are the failures.
Upgrade the chart library, then run the tests and the build. If verification fails, roll back to the last commit and report what broke instead of trying more fixes.
Thinking a rollback means failure. It's a safe return to a known-good state, so you can decide what to do next with a clear head.