A characteristic length scale causes anomalous size effects and boundary programmability in mechanical metamaterials