An agent's mistakes are priced by what it costs to take them back. Four effect classes, five ways to manufacture reversibility, the record an undo needs, and why compensation is not rollback.
Ship it reversible: designing the undo layer an agent's irreversible actions need