← Table of Contents · Page 112 of 868

STATE AND CONTROL FLOW

Part 5 of 9

ROLLBACK Rollback means undoing steps to return to a known-good point. Known-good means a moment when we are confident the state and the world were correct. Rollback is like the undo button in a text editor, or like restoring your phone from last night's backup after an app update broke something. Rollback is easiest for things the harness fully controls, such as files in a project folder tracked by version control. Version control is software that records every change to a set of files so you can step backward through history; a popular example is Git. If an agent makes three bad edits, the harness can revert the files to the commit made before those edits and all three vanish in one action. Rollback is harder for outside effects like emails, payments, or database writes in other companies' systems. For such actions engineers use other tools. One is a compensating action, a new action that cancels the earlier one's effect, such as issuing a refund for a mistaken charge. Another is a dry run, where the agent first shows what it would do without doing it. Another is to place risky actions behind a human approval so they are less likely to need rollback at all. So a full picture of rollback says what it restores and what it loses. It restores the harness state and the controlled files. It cannot restore actions that left the building, so those must be prevented, approved, or compensated.
Advertisement
Read Aloud:
0:00 / 0:00