Goal-directed diagnosis of expectation failures