{"record":{"id":"f464f87ad691484a","repo":"AprilNEA/OpenLogi","slug":"id-must-be-a-nonempty-synthetic-identifier","errorCode":null,"errorMessage":"--id must be a nonempty synthetic identifier","messagePattern":"--id must be a nonempty synthetic identifier","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/record_profile.rs","lineNumber":163,"sourceCode":"    let snapshot = tokio::time::timeout(\n        SNAPSHOT_TIMEOUT,\n        connection.client.snapshot(context::current()),\n    )\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,","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/record_profile.rs#L145-L181","documentation":"`validate_metadata` checks that the `--id` passed to `openlogi fixture record-profile` is a nonempty synthetic identifier before any capture runs. Synthetic fixture data must never embed real hardware identity, so an empty (or whitespace-only) id is rejected up front. This is a CLI argument guard, raised before the agent connection is used for capture.","triggerScenarios":"Running `openlogi fixture record-profile` with `--id \"\"` or `--id \"   \"` (trim-to-empty), or omitting a meaningful id value.","commonSituations":"Scripting the command with a shell variable that resolves to empty (unset env var, failed substitution); copy-pasting a template command without filling in the placeholder id.","solutions":["Pass a nonempty synthetic id, e.g. `--id syn-mx-master-3s`","Check the shell variable feeding --id is actually set: `${SYN_ID:?SYN_ID must be set}`","Use a slug-style identifier (lowercase, hyphens) consistent with existing fixture ids"],"exampleFix":"// before\nopenlogi fixture record-profile --id \"$SYN_ID\" --name \"Profile\"   # SYN_ID empty\n// after\nopenlogi fixture record-profile --id \"syn-lift-vertical\" --name \"Profile\"","handlingStrategy":"validation","validationCode":"#!/bin/sh\n: \"${SYN_ID:?--id source variable must be set}\"\n[ -n \"$(echo \"$SYN_ID\" | tr -d '[:space:]')\" ] || { echo \"id 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(\"--id must be a nonempty synthetic identifier\") {\n        eprintln!(\"Pass a nonempty synthetic --id, e.g. --id syn-my-device\");\n    }\n}","preventionTips":["Always pass explicit, nonempty --id values in scripts; never interpolate unset variables","Use ${VAR:?msg} shell guards for parameterized fixture recordings","Adopt a slug convention (syn-*) and stick to it"],"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"}