{"record":{"id":"c9cf5ae7e6ba30fa","repo":"AprilNEA/OpenLogi","slug":"name-must-be-a-nonempty-synthetic-profile-name","errorCode":null,"errorMessage":"--name must be a nonempty synthetic profile name","messagePattern":"--name must be a nonempty synthetic profile name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/record_profile.rs","lineNumber":166,"sourceCode":"    )\n    .await\n    .map_err(|_| anyhow!(\"the running Agent timed out while providing its device snapshot\"))?\n    .map_err(|_| anyhow!(\"the running Agent disconnected while providing its device snapshot\"))?;\n\n    let captured = capture_profile(&connection.client, snapshot, selector, id, name).await?;\n    captured\n        .profile\n        .validate()\n        .context(\"captured semantic profile failed version-1 validation; no profile was written\")?;\n    Ok(captured)\n}\n\nfn validate_metadata(args: &RecordProfileArgs) -> Result<()> {\n    if args.id.trim().is_empty() {\n        bail!(\"--id must be a nonempty synthetic identifier\");\n    }\n    if args.name.trim().is_empty() {\n        bail!(\"--name must be a nonempty synthetic profile name\");\n    }\n    Ok(())\n}\n\nasync fn capture_profile(\n    client: &AgentClient,\n    snapshot: AgentSnapshot,\n    selector: Option<&str>,\n    id: String,\n    name: String,\n) -> Result<CapturedProfile> {\n    // Runtime status, camera, foreground-app, and pairing facts are dropped at\n    // this boundary and can never enter the serializable profile value.\n    let AgentSnapshot {\n        inventory,\n        standalone,\n        ..\n    } = snapshot;","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/record_profile.rs#L148-L184","documentation":"`validate_metadata` rejects an empty (or whitespace-only) `--name` for `openlogi fixture record-profile`. The recorded semantic profile needs a human-readable synthetic display name, and an empty one would produce an unusable fixture entry. The check runs before capture, so nothing is written when it fires.","triggerScenarios":"Running `openlogi fixture record-profile` with `--name \"\"` or only whitespace, often because the value came from an empty shell variable or an unfilled template.","commonSituations":"CI scripts parameterizing the profile name with an unset variable; hand-editing a wrapper script and deleting the default name; non-ASCII quoting mistakes leaving the flag value empty.","solutions":["Pass a nonempty quoted name, e.g. `--name \"Vertical Mouse Profile\"`","Quote the value so shell word-splitting doesn't drop it: --name \"$PROFILE_NAME\" with the variable set","Verify the variable: : \"${PROFILE_NAME:?PROFILE_NAME must be set}\""],"exampleFix":"// before\nopenlogi fixture record-profile --id syn-lift --name \"\"\n// after\nopenlogi fixture record-profile --id syn-lift --name \"Lift Vertical Mouse\"","handlingStrategy":"validation","validationCode":"#!/bin/sh\n: \"${SYN_NAME:?--name source variable must be set}\"\n[ -n \"$(echo \"$SYN_NAME\" | tr -d '[:space:]')\" ] || { echo \"name is empty\"; exit 2; }\nopenlogi fixture record-profile --id \"$SYN_ID\" --name \"$SYN_NAME\"","typeGuard":null,"tryCatchPattern":"if let Err(e) = cmd.output() {\n    if String::from_utf8_lossy(&e.stderr).contains(\"--name must be a nonempty synthetic profile name\") {\n        eprintln!(\"Pass a quoted nonempty --name, e.g. --name \\\"Lift Vertical Mouse\\\"\");\n    }\n}","preventionTips":["Quote flag values so word-splitting cannot empty them","Validate template variables before composing the command line","Keep default names in wrapper scripts and require overrides explicitly"],"tags":["cli","validation","fixture"],"backgroundTag":"empty-required-field","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"}