C.W.K.
Stream
Lesson 01 of 04 · published

Decommission Is an Invariant, Not an Event

~10 min · decommission, invariant, stays-green, doctrine

Level 0Cold Flint
0 XP0/34 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete
"You didn't finish removing the old thing the day you deleted it. You finish removing it every day it stays gone."

Delete Is Not Decommission

Track 1 retired the old TextForge machinery. But a delete on one day is not the same as a decommission that holds. Deleting is an event; decommissioning is a state you have to keep true. The old tool had servers, ports, launch jobs, wrappers, and an environment — and any of those can come back without anyone intending it: a script that recreates an environment, a launch job re-added out of habit, a port that starts listening again after some unrelated change. The removal is only real for as long as it stays real.

Machinery Creeps Back

Old infrastructure has a gravity. It's referenced in scripts, remembered in muscle memory, and easy to resurrect because it used to work. That's exactly why 'we deleted it' is a weak guarantee: nobody has to decide to bring it back for it to return — an automated process or an absent-minded command can do it. Treating the legacy as gone because you removed it once is how a shadow runtime quietly reappears months later, doing work the remake was supposed to have ended.

The Guard That Stays Green

So the decommission is enforced as a check that must keep passing: no legacy process running, no legacy launch job registered, nothing listening on the old ports, no wrapper or environment recreated. It's the same idea as the very first decommission verification, but promoted to a standing invariant — something you can re-run and expect green, not a box you ticked once. A removal you verify on a schedule is a removal that stays removed.

DECOMMISSION GUARD (must stay green over time)
---------------------------------------------
no legacy process        pgrep -> empty
no legacy launch job     launchctl list -> empty
no old ports listening   lsof :OLD_PORTS -> empty
no wrapper / env         recreated? -> no

Green once is a delete. Green on a schedule is a decommission.
A removal is only real if it's continuously verified gone. Deleting something is a one-time action; keeping it deleted is an invariant. For anything that can be resurrected by automation, habit, or a stray command, the honest way to 'remove' it is to add a check that fails if it ever comes back, and to run that check over time. State you don't verify is state you're only hoping about — and old machinery does not stay gone on hope.
This is the flip side of 'no runtime fallback.' Track 1 said the legacy must never be a fallback, and archived it symlink-free so no code path could revive it. This lesson is the operational half: even with the code un-launchable, you still verify that no process, port, or job has crept back by some other route. Belt and suspenders — make revival impossible in code, and check that it hasn't happened anyway.

Code

The standing decommission guard — expected to stay empty forever·bash
#!/usr/bin/env bash
# Run this on a schedule. Any non-empty result means the legacy runtime
# crept back and the decommission invariant is broken.

fail=0
pgrep -f 'textforge'            && { echo 'legacy process alive';  fail=1; }
launchctl list | grep -i textforge && { echo 'legacy launch job';  fail=1; }
lsof -i :8510 -i :8520 2>/dev/null && { echo 'legacy port listening'; fail=1; }

[ "$fail" = 0 ] && echo 'decommission green: legacy stays dead'
exit "$fail"

# Green once is a delete. Green every time you run it is a decommission.

External links

Exercise

You decommissioned a tool six months ago by deleting its code. Today someone reports the old service is running again. Explain how that's possible even though 'you deleted it,' name three concrete vectors by which it could have returned, and describe the guard that would have caught it the day it came back instead of six months later.
Hint
Deleting the code doesn't remove every trace: an environment can be recreated by a setup script, a launch job re-added from memory or an old dotfile, a port re-bound by a resurrected process. It returned because 'deleted' was an event, not a verified state. The guard is a scheduled check that fails on any legacy process, launch job, or listening port — run over time, it turns 'we deleted it' into 'it is verified absent right now,' catching the creep on day one instead of month six.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.