Code Calibration as a Decision Problem