Speaking of shipping code, I always envision my systems as if I'm designing Ships of Theseus. Design it in a way that things are nice and modular and you can take any one piece and replace it, especially if you're on the high seas. Most large ships these days have their own machine shops. They're constantly Theseusifying themselves without having to go to port and shut down operations.
The hard part, of course, being that you need competent engineers who know just how modular is the right amount and how to achieve that. This can fail horribly when you go leftpad on the modularity. But I believe it's the only way to build something that lasts.