How do I automate complex stateful systems?
You can automate most things now. The complex, stateful ones still defeat you, and that is where the real difficulty lives. Simple automation is repeatable because nothing changes underneath it. Stateful systems carry memory and consequence, so the same command can do different things depending on what came before. That is genuinely harder, and it is right to respect it. The way through is not more cleverness but more caution. With state, you must know exactly where the system is before you change it, and you must be able to undo what you do. Build in checks that confirm the current state before acting, and design each step so it can run twice without harm. Slowness here is wisdom, not weakness. Take one stateful process you dread automating and, before writing anything, map every state it can be in and what should happen from each. That map is the hard part. Once you can see all the states clearly, the automation becomes careful, small steps instead of one risky leap.