{"record":{"id":"14d4fae1bfa85160","repo":"AprilNEA/OpenLogi","slug":"output-directory-name-must-exactly-equal-id","errorCode":null,"errorMessage":"--output directory name must exactly equal --id","messagePattern":"--output directory name must exactly equal --id","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/contribute.rs","lineNumber":459,"sourceCode":"        )\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 {\n        bail!(\"unsupported contribution state version {}\", state.version);\n    }\n    if state.fixture_id != args.id\n        || state.profile_id != format!(\"{}-profile\", args.id)\n        || state.profile_name != args.name\n    {\n        bail!(\"--id and --name must match the in-progress contribution\");\n    }\n    Ok(())\n}\n\nfn read_json<T: serde::de::DeserializeOwned>(path: &Path, asset: &str) -> Result<T> {","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/contribute.rs#L441-L477","documentation":"The `--output` path's final directory component must be exactly equal to the `--id` value. Synthetic fixture directories are identified by their directory name, so mismatched output dir vs id would create an inconsistent fixture. Caught up front in `validate_args`.","triggerScenarios":"e.g. `--id mx-master --output ./out/mx-master-3` or `--output ./out/other-name` — any case where `Path::new(output).file_name() != id`.","commonSituations":"Reusing a previous output directory name while changing the id, or copying a command line and editing only one of the two flags.","solutions":["Rename the output directory's last component to match `--id` exactly (including case).","Or change `--id` to equal the existing output directory name if that name is already correct.","Create the target dir with the id as its name: `mkdir -p out/$(id)` and pass `--output out/<id>`."],"exampleFix":"// before\nopenlogi fixture contribute --id mx-master --name \"MX Master\" --output out/mx-master-3\n// after\nopenlogi fixture contribute --id mx-master --name \"MX Master\" --output out/mx-master","handlingStrategy":"validation","validationCode":"[ \"$(basename \"$OUT\")\" = \"$ID\" ] || { echo \"--output dir name must equal --id\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive the output dir from the id in scripts: OUT=\"fixtures/$ID\".","Never edit --id and --output independently in copied commands.","Match case exactly — the comparison is byte-equal."],"tags":["cli","validation","mismatch"],"backgroundTag":"invalid-argument-value","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"}