Robots and sensors can spot mastitis before symptoms appear, but keeping cows healthy still comes down to careful management.