{"record":{"id":"932ca22fdfd65007","repo":"zed-industries/zed","slug":"invalid-split-point-kind-value-expected-fim","errorCode":null,"errorMessage":"invalid split point kind '{value}' (expected fim, same-file-near, same-file-far, or cross-file)","messagePattern":"invalid split point kind '(.+?)' \\(expected fim, same-file-near, same-file-far, or cross-file\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/split_commit.rs","lineNumber":149,"sourceCode":"        match self {\n            SplitPointKind::Fim => write!(f, \"fim\"),\n            SplitPointKind::SameFileNear => write!(f, \"same-file-near\"),\n            SplitPointKind::SameFileFar => write!(f, \"same-file-far\"),\n            SplitPointKind::CrossFile => write!(f, \"cross-file\"),\n        }\n    }\n}\n\nimpl std::str::FromStr for SplitPointKind {\n    type Err = anyhow::Error;\n\n    fn from_str(value: &str) -> Result<Self> {\n        match value {\n            \"fim\" => Ok(Self::Fim),\n            \"same-file-near\" => Ok(Self::SameFileNear),\n            \"same-file-far\" => Ok(Self::SameFileFar),\n            \"cross-file\" => Ok(Self::CrossFile),\n            _ => anyhow::bail!(\n                \"invalid split point kind '{value}' (expected fim, same-file-near, same-file-far, or cross-file)\"\n            ),\n        }\n    }\n}\n\n#[derive(Debug, Clone, PartialEq)]\npub enum SplitPoint {\n    /// Fraction of total edits (0.0 to 1.0)\n    Fraction(f64),\n    /// Absolute index\n    Index(usize),\n    /// Random split point matching the requested kind.\n    Kind(SplitPointKind),\n    /// Explicit split point that must match the requested kind.\n    KindWithSplit {\n        kind: SplitPointKind,\n        split_point: SplitPointValue,","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/split_commit.rs#L131-L167","documentation":"Thrown by the FromStr implementation for SplitPointKind when parsing the kind keyword of the `--split-point`/`-s` argument to `ep split-commit`. Only four kind spellings are accepted — `fim`, `same-file-near`, `same-file-far`, `cross-file` — in exact kebab-case. Note the same flag also accepts fractions (0.0-1.0) and integer indexes, which are parsed before the kind keyword is attempted.","triggerScenarios":"Passing `--split-point same_file_near` (underscores), `--split-point SameFileNear` (wrong case), or any other misspelling that is neither a number, fraction, nor one of the four kebab-case kinds.","commonSituations":"Copying Rust enum variant names instead of the CLI spellings; underscore/hyphen confusion; typos in automation scripts.","solutions":["Use one of the exact values: fim, same-file-near, same-file-far, cross-file","Check `ep split-commit --help` for the accepted syntax (fraction, index, or kind keyword)","If you meant a specific position, pass a fraction like 0.5 or an integer index instead of a kind name"],"exampleFix":"# before\nep split-commit -s same_file_near input.jsonl\n\n# after\nep split-commit -s same-file-near input.jsonl","handlingStrategy":"validation","validationCode":"fn is_valid_split_point_kind(value: &str) -> bool {\n    matches!(value, \"fim\" | \"same-file-near\" | \"same-file-far\" | \"cross-file\")\n}","typeGuard":"fn is_valid_split_point_kind(value: &str) -> bool {\n    matches!(value, \"fim\" | \"same-file-near\" | \"same-file-far\" | \"cross-file\")\n}","tryCatchPattern":"When driving the CLI from code, validate the argument first and fail with the accepted-value list before spawning the process.","preventionTips":["Validate kind keywords against the accepted set before invoking split-commit","Prefer clap ValueEnum derivation for enum-like flags so help text and parsing stay in sync","Use the exact kebab-case spellings from --help in scripts"],"tags":["cli","argument-parsing","enum","edit-prediction","rust"],"backgroundTag":"invalid-cli-argument","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}