The job was routine. A background process had been creating orphaned records, meaning entries left behind with nothing attached to them. We fixed the process and cleaned up the ones that had already piled up. Standard practice for a change like that is to write a paired plan for undoing it, in case anything needs to be reversed later. We wrote one. Then we tried to double-check that plan before ever running it for real.
The check that wasn’t checking
We wanted to confirm the undo plan was written correctly without actually running it, so we turned on a feature built for exactly that: look over the steps, don’t execute them. We ran it against the live system and treated it as completely harmless.
It wasn’t. That feature suppresses execution for one particular kind of step. Everything else runs exactly as if the check had never been turned on, and most of an undo plan is made of that “everything else.” So the “safety check” ran the plan for real. The cleanup we had just finished reverted to its messy state, as if none of it had happened.
Why it didn’t become an incident
We were already running verification checks as part of the same pass, and they came back wrong immediately. There was no gap between the mistake and the moment we saw it. We restored everything that had been undone, redid the cleanup, and checked the end state against what it was supposed to look like. It matched.
While putting it back together, we found a second problem sitting in the undo plan that had not fired yet, because nothing had needed the real undo before. One step assumed nothing new had been added since the original change ran, and that assumption was already wrong the same day. We fixed that too, before it could matter.
What the name promised
We did not skip a safety step. We added one specifically to avoid running something risky before we were sure it was right. What we got wrong was trusting what the feature’s name implied instead of checking what it covers. “Won’t execute anything” sounds like a blanket promise. It is a promise about one specific case and silent about everything else, including the exact kind of step our plan was mostly made of. We never confirmed it covered the two plain drop statements (commands that delete things outright) sitting in that plan.
Against a system real people depend on, that is where the risk hid. It was not in the step we added on purpose. It was in the one line of that step we never tested before we trusted it.
Before anyone runs a “dry run” or “preview” mode against a live system, find out what exactly it suppresses, and test it somewhere that isn’t live first. And keep verification checks running alongside any change to a live system, since they are what caught this one right away.
AI Skills
Use this lesson with the AI assistant you already use
A feature built to check a plan without running it was switched on before a real system change, and treated as a harmless dry run. It suppressed one kind of step and let a different, more common kind run for real.
Paste the prompt, share only the context needed to answer it, and treat the result as a draft for your review. Do not include confidential information or let an AI assistant make changes without your approval.
Optional: for a visual report and saved memory, run /dxdev first.
Don’t have it? Get it at dxdev.com/skills/dxdev. The prompt works without it.
dxdev LESSON · paste into your AI coding agent
LESSON: A mode named "safe" is only safe for the exact steps it actually covers
SOURCE: dxdev.com/blog/the-safety-check-i-trusted-wasnt-one
WHAT HAPPENED: Before running an undo plan against a live system, a mode built to check the plan's correctness without executing it was switched on, on the assumption it was a harmless no-op. It suppressed execution for one specific kind of step and ran every other kind of step exactly as normal, and most of the undo plan was made of the second kind. Real changes happened for real. The mistake was caught within the same check, because verification queries were already running as part of the same pass and came back wrong immediately. Everything affected was restored and re-verified to match the intended result, and a second, unrelated defect the plan had been hiding was found and fixed in the same pass.
THE RULE: "Won't run anything" and "safe to run against a live system" are not the same claim unless the exact scope of what a mode suppresses has been checked against every step actually in front of it. A feature's name describes what it was built for, not the boundary of everything it covers.
CHECK MY CODE, then report PASS or FAIL with file:line for each:
1. Any script using a "dry run," "check only," or "preview" mode against a live system, where the exact scope of what that mode suppresses hasn't been verified against every step in the script.
2. Any undo or rollback plan that assumes conditions haven't changed since the original action ran, without accounting for anything added in the meantime.
3. Any live-system safety step whose confidence rests on a single unverified assumption about what a feature actually does, rather than a real test against a non-live copy first.
THEN PRINT: a table (check, PASS/FAIL, evidence, fix) + a verdict (applies / partially / OUT_OF_SCOPE / no) + the single most important next action.