{"record":{"id":"25ce0334f3df5ec1","repo":"zed-industries/zed","slug":"no-predictions-available-run-predict-first","errorCode":null,"errorMessage":"no predictions available (run predict first)","messagePattern":"no predictions available \\(run predict first\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/repair.rs","lineNumber":298,"sourceCode":"    args: &RepairArgs,\n    example_progress: &ExampleProgress,\n) -> Result<()> {\n    if has_successful_repair(example) {\n        return Ok(());\n    }\n\n    if !needs_repair(example, args.confidence_threshold) {\n        return Ok(());\n    }\n\n    run_parse_output(example).context(\"Failed to execute run_parse_output\")?;\n\n    if example.prompt_inputs.is_none() {\n        anyhow::bail!(\"prompt_inputs missing (run context retrieval first)\");\n    }\n\n    if example.predictions.is_empty() {\n        anyhow::bail!(\"no predictions available (run predict first)\");\n    }\n\n    let teacher_prompt = example\n        .prompt\n        .as_ref()\n        .context(\"prompt missing (run format_prompt first)\")?;\n\n    let teacher_response = &example.predictions[0].actual_output;\n    if teacher_response.is_empty() {\n        anyhow::bail!(\"teacher response is empty (run predict first)\");\n    }\n\n    let step_progress = example_progress.start(Step::Repair);\n\n    let model = model_for_backend(args.backend);\n    let repair_message = build_repair_message(example).context(\"Failed to build repair message\")?;\n\n    step_progress.set_substatus(\"generating\");","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/repair.rs#L280-L316","documentation":"Bailed by the repair step when `example.predictions` is empty. Repair sends the first prediction's `actual_output` to the model as the teacher response to correct, so at least one prediction must exist. The guard fires when repair runs before the predict step, or when predict stored no predictions for the example.","triggerScenarios":"Invoking `ep repair` on examples whose `predictions` array is empty: predict never ran, was skipped for that example (e.g. provider errors), or the run was resumed from a file written before predict.","commonSituations":"Stage reordering in scripts; predict step skipping failed requests and leaving the array empty; stale intermediate files.","solutions":["Run the predict step for the examples before repair","Check the example JSONL to confirm predictions were persisted (non-empty `predictions` array)","If predict is failing for these examples, fix the provider error it reports first"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if example.predictions.is_empty() {\n    // run predict for this example before repair\n    anyhow::bail!(\"cannot run repair: no predictions, run predict first\");\n}","typeGuard":null,"tryCatchPattern":"Catch per example, classify as 'missing prerequisite', and route the example back to the predict stage instead of failing the run.","preventionTips":["Assert a non-empty predictions array before building the repair prompt","Make predict failures loud so examples without predictions are visible immediately","Validate intermediate JSONL between pipeline stages"],"tags":["pipeline-ordering","edit-prediction","cli","rust"],"backgroundTag":"missing-prerequisite-state","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}