SNAP: A Self-Consistent Agreement Principle with Application to Robust Computation