| name | contain |
| description | Reach a safe state before diagnosing. Halt the affected job, revert to last known good, or stop the loop โ containment, never a fix. Records what was contained and what was deliberately left alone. Use immediately after `prove-the-failure`, or any time a failure is actively recurring and the bleeding must stop first. |
contain
Containment is not repair. The goal is to stop the failure recurring while you still understand nothing about its cause. A fix applied here is a guess applied at the worst possible moment.
Resist the pull to fix. You have a red loop and no diagnosis. Anything that looks like a repair right now is a coincidence waiting to be mistaken for understanding.
Phase 1 โ Choose the smallest sufficient action
In ascending order of blast radius. Take the first that reaches safety.
- Do nothing โ the failure is not recurring and nothing is degrading. Record this as the containment decision. It is a real choice and often the right one.
- Stop the loop โ disable the schedule, pause the cron, unqueue the job.
- Halt the affected job โ cancel the in-flight run only.
- Revert to last known good โ roll back the deployment or the commit that introduced it.
- Isolate the surface โ take the affected route, feature flag, or integration out of the path.
Prefer reversible containment over thorough containment. Disabling a schedule is trivially undone. A revert is not.
Phase 2 โ Record the boundary
Write both halves. The second half is the one people skip and the one that matters later.
- Contained: what you stopped, how, and how to undo it
- Deliberately left alone: what you could have stopped and chose not to, with the reason
The "left alone" list is what a reviewer checks when the failure recurs somewhere adjacent. Without it, the next responder cannot tell the difference between a considered decision and an oversight.
Completion
Stop conditions
Containment that spends money or mutates production stops for a human. Reverting a production deploy, disabling a live integration, and rolling back a database are all gated โ propose them, do not perform them. Disabling a schedule in a repo, cancelling a CI run, and stopping a local loop are inside the fence.
If the only sufficient containment is a gated action, stop and report: the symptom, the red loop, the proposed containment, and its undo. A human decides. Do not downgrade to a weaker containment just to stay inside the fence โ say plainly that the safe action is gated.
Next
diagnose โ root cause, against the loop.