Text this: A principled approach to state failure