{"record":{"id":"d5fff4aea23248ed","repo":"astrid-runtime/astrid","slug":"no-corpus-selected-omit-no-synthetic-or-pass-a","errorCode":null,"errorMessage":"no corpus selected; omit --no-synthetic or pass a corpus or version-chain option","messagePattern":"no corpus selected; omit --no-synthetic or pass a corpus or version-chain option","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-chunker-evidence/src/main.rs","lineNumber":117,"sourceCode":"    if options.include_synthetic {\n        corpora.push(Corpus::synthetic_adversarial());\n        corpora.push(Corpus::synthetic_version_chain());\n    }\n    for (name, path) in &options.corpus_specs {\n        corpora.push(Corpus::from_path(name.clone(), path)?);\n    }\n    for (name, path) in &options.version_chain_specs {\n        corpora.push(Corpus::version_chain_from_path(name.clone(), path)?);\n    }\n    for (name, repository, relative_path) in &options.git_history_specs {\n        corpora.push(Corpus::version_chain_from_git(\n            name.clone(),\n            repository,\n            relative_path,\n        )?);\n    }\n    if corpora.is_empty() {\n        bail!(\"no corpus selected; omit --no-synthetic or pass a corpus or version-chain option\");\n    }\n    ensure_unique_corpus_labels(&corpora)?;\n    Ok(corpora)\n}\n\nfn ensure_unique_corpus_labels(corpora: &[Corpus]) -> Result<()> {\n    let mut labels = HashSet::with_capacity(corpora.len());\n    for corpus in corpora {\n        if !labels.insert(corpus.name()) {\n            bail!(\"duplicate corpus label {:?}\", corpus.name());\n        }\n    }\n    Ok(())\n}\n\nfn write_report(output: Option<&PathBuf>, report: &EvidenceReport) -> Result<()> {\n    let mut encoded = serde_json::to_string(report)?;\n    encoded.push('\\n');","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-chunker-evidence/src/main.rs#L99-L135","documentation":"`load_corpora` bails when no corpus was configured (no corpus directories and no git-history version chains) yet `--no-synthetic` suppressed the default synthetic corpus, leaving `corpora` empty. The benchmark needs at least one corpus to produce evidence.","triggerScenarios":"Running the binary with `--no-synthetic` but without any `--corpus`/`--git-history` option, so `corpora.is_empty()` after collection.","commonSituations":"CI configs that add `--no-synthetic` while forgetting to add corpus flags, scripting where corpus paths were filtered out before reaching the CLI, or misunderstanding that synthetic data is the default input.","solutions":["Remove `--no-synthetic` so the built-in synthetic corpus is used","Pass at least one `--corpus DIR` or `--git-history NAME=REPO::PATH` option together with `--no-synthetic`","Check earlier filtering in your pipeline isn't dropping all corpus arguments before exec"],"exampleFix":"// before\nbin --no-synthetic\n// after\nbin --no-synthetic --corpus ./bench/corpus\n// or simply\nbin","handlingStrategy":"validation","validationCode":"fn selected_any_corpora(args: &[String]) -> bool {\n    let has_corpus = args.iter().any(|a| a.starts_with(\"--corpus\") || a.starts_with(\"--git-history\"));\n    let no_synthetic = args.iter().any(|a| a == \"--no-synthetic\");\n    has_corpus || !no_synthetic\n}\nassert!(selected_any_corpora(&std::env::args().skip(1).collect::<Vec<_>>()));","typeGuard":null,"tryCatchPattern":"match run_cli(args) {\n    Err(e) if e.to_string().contains(\"no corpus selected\") => {\n        eprintln!(\"no corpora configured; falling back to synthetic corpus\");\n        run_cli(&args_without(&args, \"--no-synthetic\"))\n    }\n    other => other,\n}","preventionTips":["Pair `--no-synthetic` with at least one `--corpus` or `--git-history` flag","Default to the synthetic corpus unless a corpus is explicitly configured","Validate CI job arguments in a preflight script"],"tags":["rust","cli","configuration","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}