Find the completion-evidence bugs in this generated checkpoint recorder.
JavaScript
function finishStep(step, result, plan) {
plan.completed.push(step.id);
step.status = "passed";
if (result.stdout.includes("PASS")) {
return true;
}
return result.exitCode === 0;
}