fn sanitize_state_key(raw: &str) -> String
Filesystem-safe form of an arbitrary key for use as a filename component.