{"record":{"id":"eaf8a186a3afb576","repo":"AprilNEA/OpenLogi","slug":"id-must-be-a-nonempty-synthetic-path-component","errorCode":null,"errorMessage":"--id must be a nonempty synthetic path component","messagePattern":"--id must be a nonempty synthetic path component","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/contribute.rs","lineNumber":447,"sourceCode":"                && left_product == right_product\n                && left_page == right_page\n                && left_usage == right_usage\n        }\n        _ => false,\n    };\n    if matches {\n        Ok(())\n    } else {\n        bail!(\n            \"the selected direct-capture target does not match the profile transport and slot; \\\n             reconnect the same device and use the same --device selector\"\n        )\n    }\n}\n\nfn validate_args(args: &ContributeArgs) -> Result<()> {\n    if args.id.trim().is_empty() || matches!(args.id.as_str(), \".\" | \"..\") {\n        bail!(\"--id must be a nonempty synthetic path component\");\n    }\n    if Path::new(&args.id).file_name() != Some(OsStr::new(&args.id))\n        || args.id.contains('/')\n        || args.id.contains('\\\\')\n    {\n        bail!(\"--id must be one synthetic path component without separators\");\n    }\n    if args.name.trim().is_empty() {\n        bail!(\"--name must be a nonempty synthetic device name\");\n    }\n    if args.output.file_name() != Some(OsStr::new(&args.id)) {\n        bail!(\"--output directory name must exactly equal --id\");\n    }\n    Ok(())\n}\n\nfn validate_state(args: &ContributeArgs, state: &ContributionState) -> Result<()> {\n    if state.version != STATE_VERSION {","sourceCodeStart":429,"sourceCodeEnd":465,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/contribute.rs#L429-L465","documentation":"The `openlogi fixture contribute` command refuses an `--id` that is empty or only whitespace, or the special path components \".\" or \"..\". The id is used as a synthetic fixture directory name and profile id, so it must be a real, nonempty path component. The check runs up front in `validate_args` before any files are touched.","triggerScenarios":"Run `openlogi fixture contribute` with `--id \"\"`, `--id \" \"`, `--id .`, or `--id ..` (or a value that trims to empty). Any of these bails immediately from validate_args.","commonSituations":"Shell variable interpolation producing an empty string (`--id \"$ID\"` with unset ID), scripts passing placeholders, or someone literally trying `--id .` to write into the current directory.","solutions":["Pass a nonempty, descriptive id, e.g. `--id my-mouse-fixture`.","If the id comes from a variable, verify it is set and non-blank before invoking the command: `[ -n \"${ID//[[:space:]]/}\" ] || exit 1`.","Never use \".\" or \"..\"; choose a distinct component name for the fixture output directory."],"exampleFix":"// before\nopenlogi fixture contribute --id \"$ID\" --name \"Mouse\" --output ./out\n// after\nID=\"${ID:?--id must be set to a nonempty synthetic path component}\"\nopenlogi fixture contribute --id \"$ID\" --name \"Mouse\" --output \"./out/$ID\"","handlingStrategy":"validation","validationCode":"if [ -z \"${ID//[[:space:]]/}\" ] || [ \"$ID\" = \".\" ] || [ \"$ID\" = \"..\" ]; then echo \"--id must be a nonempty path component\" >&2; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass a literal, nonempty id; avoid unset shell variables with ${ID:?msg}.","Never use \".\" or \"..\" as ids.","Validate ids once in the wrapper script before any contribute invocation."],"tags":["cli","validation","argument"],"backgroundTag":"invalid-cli-argument","analyzedSha":"e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8","analyzedAt":"2026-09-13T03:07:16.451Z","contentChangedAt":"2026-09-13T03:07:16.451Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}