Documentation Index
Fetch the complete documentation index at: https://docs.enact.cloud/llms.txt
Use this file to discover all available pages before exploring further.
What is Rollback?
Sayagent_pr_workflow ran — it created agent/fix-149, opened a PR, and merged it straight to main by mistake. You need to undo all three steps. One call:
How It Works
rollback() does four things in order:
- Loads the receipt by
run_id— readsreceipts/a1b2c3d4-....json - Verifies the signature — if the receipt was tampered with, rollback refuses to run
- Walks
actions_takenin reverse — last action first, so nothing is orphaned - Calls the undo action for each step and writes a new rollback receipt
Why Reverse Order?
merge_pr happened last — you have to undo it first before closing the PR makes sense. Reverse order preserves the dependency chain.
The Rollback Receipt
How merge_pr Rollback Works
revert_commit is git revert -m 1 <sha> under the hood — it adds a new commit to main that restores its pre-merge state. Safe on protected branches; no force-push needed. The merge SHA is captured automatically in the receipt when merge_pr runs.
What If an Action Can’t Be Undone?
Some actions have no safe inverse. If rollback hits one, it stops, records which action couldn’t be reversed, and tells you exactly what to fix manually. It never silently skips.| Action | Rollback? | Why not |
|---|---|---|
github.push_commit | ❌ | Un-pushing requires a destructive force-push, blocked on protected branches |
postgres.DROP TABLE | ❌ | Blocked by block_ddl policy — even with rows, you’d lose indexes, constraints, sequences |
postgres.TRUNCATE | ❌ | Same — blocked by policy. Prevention beats fake recovery. |
slack.delete_message | ❌ | Slack doesn’t allow un-deleting messages |