{"record":{"id":"403048ebbcc384e8","repo":"zed-industries/zed","slug":"has-invalid-example-extension-ext","errorCode":null,"errorMessage":"{} has invalid example extension `{ext}`","messagePattern":"(.+?) has invalid example extension `(.+?)`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/example.rs","lineNumber":278,"sourceCode":"                                    line_ix + 1\n                                )\n                            });\n                        if example.spec.name.is_empty() {\n                            example.spec.name = format!(\"{filename}-{line_ix}\")\n                        }\n                        example\n                    })\n                    .collect::<Vec<Example>>(),\n            ),\n            \"md\" => {\n                let mut example = parse_markdown_example(&content).unwrap();\n                if example.spec.name.is_empty() {\n                    example.spec.name = filename;\n                }\n                examples.push(example);\n            }\n            ext => {\n                panic!(\"{} has invalid example extension `{ext}`\", path.display())\n            }\n        }\n    }\n\n    examples\n}\n\npub fn sort_examples_by_repo_and_rev(examples: &mut [Example]) {\n    examples.sort_by(|a, b| {\n        a.spec\n            .repository_url\n            .cmp(&b.spec.repository_url)\n            .then(b.spec.revision.cmp(&a.spec.revision))\n    });\n}\n\npub fn group_examples_by_repo(examples: Vec<Example>) -> VecDeque<Vec<Example>> {\n    let mut examples_by_repo: HashMap<String, Vec<Example>> = HashMap::default();","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/example.rs#L260-L296","documentation":"The edit_prediction_cli example loader (parse_example_files) dispatches on each input file's extension and only accepts `json`, `jsonl`, and `md`. Any other extension falls into the catch-all arm and panics with the offending path, aborting the whole run. This is a strict input-format contract for evaluation example files.","triggerScenarios":"Pointing `--inputs` (or the example-parsing commands) at a directory or file whose extension is not json/jsonl/md, e.g. `examples.json.bak`, `notes.txt`, `.DS_Store`, editor swap files, or a directory containing stray non-example files.","commonSituations":"Example directories polluted by editor backups, OS metadata files, README notes, or a renamed export; someone adds a `.yaml` example file assuming the tool supports it.","solutions":["Remove or move files whose extension is not json, jsonl, or md out of the input directory","Rename the file to match its actual content: .json (single Example), .jsonl (one Example per line), or .md (markdown example)","If a new format is genuinely required, add a match arm in parse_example_files (crates/edit_prediction_cli/src/example.rs:239) that parses it"],"exampleFix":"# before\ninputs/my_example.yaml   <-- panic: invalid example extension `yaml`\n\n# after\nmv inputs/my_example.yaml inputs/my_example.json","handlingStrategy":"validation","validationCode":"let ok = inputs.iter().all(|p| {\n    matches!(\n        p.extension().and_then(|e| e.to_str()),\n        Some(\"json\") | Some(\"jsonl\") | Some(\"md\")\n    )\n});\nassert!(ok, \"input contains unsupported extensions\");","typeGuard":"fn is_supported_example_ext(ext: &str) -> bool {\n    matches!(ext, \"json\" | \"jsonl\" | \"md\")\n}","tryCatchPattern":null,"preventionTips":["Keep evaluation example directories to .json/.jsonl/.md files only; exclude backups and dotfiles","Validate the extension list in scripts before invoking the CLI","Run the CLI on an explicit file list rather than a whole directory when the directory may contain other files"],"tags":["edit-prediction-cli","file-extension","panic","input-validation"],"backgroundTag":"unsupported-file-extension","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}