For example; the US Constitution is a relatively clean OS. First law/loop should check for whether any particular issue of consideration is explicitly delegated to the United States Government (10th amendment), if not, then it is exited to states. The problem here is that the OS has been so corrupted by the vested interests that they’ve tried using the federal OS for everything under the sun and it’s corrupting and clearly breaking by making it do things it not only was never intended to, but the makers of the best OS in human history explicitly warned never to do any of the things that have been done and the documentation very clearly explains why not to do them because it will destroy the whole system that everything relies on that everyone takes for granted.
With regards specifically to that US system; not being an American, I am not infested with the exceptionalism of the flag-saluters, and from the outside looking in the US constitution (especially with the Bill of Rights) looks like it was inevitably going to spawn the vast, sprawling shitshow that is the US code today. The fundamental difference being the positive construction of freedoms, which thereby ensured any right not strictly guaranteed is (irrespective of rightly or wrongly) perceived as fair game by just about every other entity jostling for position, who then spend inordinate amounts of energy whittling away at them.
All humans, other than a few ascetic hermits, have vested interests, so it's essential that any system of laws assumes this rather than trying to push an avalanche back uphill whilst complaining about all the snow.
But I suppose you aren’t actually talking about that, but are referring to hard forks to roll back smart contract hacks. If so, it’s only happened once. In 2016. (And never gonna happen again)