Illustrative case: an agent renames a config key and rewrites 14 fixtures. CI passes, but an unrehearsed revert later conflicts with a migration. The proposal is to grade whether a patch can be reverted before merge.
Steps
Use a disposable worktree and your CI runner's equivalent operations; no runnable commands are supplied. From a clean base-commit checkout, record collected tests, passes, skips and failures. Ensure stale last-failed cache cannot skew the baseline. Apply the patch, record the forward report, then rehearse reverse apply on the same tree. Compare the reverted tree with base, excluding generated paths declared beforehand. Compare test collection and pass/skip/failure sets. If reverse apply conflicts, record a merge-order decision. Fewer tests after reversal warrant checking fixture coupling and test discovery.
A timeout does not roll back a remote effect; it applies to the local awaitable. Python's asyncio.wait_for documentation notes it requests cancellation, then waits for cancellation to complete, so elapsed time can exceed the timeout. Kubernetes Deployment documentation adds that rollback restores the Pod template, not unrelated database changes.
Test
Use a negative control. Take a passing patch in a disposable worktree. After forward apply, remove one test file outside the patch's hunks, then run the reverse rehearsal. Expected: the reverted tree differs from base and the gate reports baseline drift. If it reports pass, its no-diff or report comparison is too weak. Second control: modify the same hunk, then attempt reverse apply; expect a conflict.
Limits
Classify irreversible steps before relying on a revert. If a patch drops data or publishes a schema version, do not assume reverse apply restores the prior state; require a forward-fix owner and written plan. The NIST AI RMF playbook is voluntary and prescribes no order or mandatory set; it offers actions indexed by Core outcomes. The AI RMF Core covers Govern 2.1 (responsibility and communication) and Manage 4.1 (monitoring, incident response, recovery, change management).
This article was created with AI assistance.
Top comments (0)