{"record":{"id":"54346d73a2d2c980","repo":"AprilNEA/OpenLogi","slug":"selected-profile-route-has-no-identity-bearing-device-model","errorCode":null,"errorMessage":"selected profile route has no identity-bearing device model","messagePattern":"selected profile route has no identity-bearing device model","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/contribute.rs","lineNumber":374,"sourceCode":"    Ok(plan)\n}\n\nfn selected_model<'a>(\n    profile: &'a DeviceProfile,\n    route: &DeviceRoute,\n    slot: u8,\n) -> Result<&'a DeviceModelInfo> {\n    profile\n        .inventories\n        .iter()\n        .find(|inventory| {\n            inventory.paired.iter().any(|device| {\n                DeviceRoute::device_route_for(inventory, device.slot).as_ref() == Some(route)\n            })\n        })\n        .and_then(|inventory| inventory.paired.iter().find(|device| device.slot == slot))\n        .and_then(|device| device.model_info.as_ref())\n        .ok_or_else(|| anyhow!(\"selected profile route has no identity-bearing device model\"))\n}\n\nfn add_model_identities(plan: &mut HidCassetteIdentityPlan, model: &DeviceModelInfo) -> Result<()> {\n    if model.unit_id == [0; 4] && model.serial_number.is_none() {\n        bail!(\n            \"the selected device has no stable synthetic identity for cassette relationships; \\\n             rerun with --profile-only\"\n        );\n    }\n    if model.unit_id != [0; 4] {\n        plan.insert(SanitizedIdentityKind::DeviceUnitId, model.unit_id.to_vec())?;\n    }\n    if let Some(serial) = model.serial_number.as_deref() {\n        plan.insert(\n            SanitizedIdentityKind::DeviceSerialNumber,\n            serial.as_bytes().to_vec(),\n        )?;\n    }","sourceCodeStart":356,"sourceCodeEnd":392,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/contribute.rs#L356-L392","documentation":"`selected_model` resolves the `DeviceModelInfo` for the profile route the user selected during fixture contribution. It walks the agent inventory looking for a paired device whose route matches the selected profile route, then extracts its identity-bearing model info. If no paired device matches (or the match has no `model_info`), it throws because a cassette relationship needs a real device identity behind the chosen route.","triggerScenarios":"Calling the fixture-contribute flow with a profile route that no currently paired device in the inventory carries — e.g. the profile was recorded against a device that has since been unpaired, moved to a different slot/receiver, or the inventory came back without that device paired.","commonSituations":"Running `openlogi fixture contribute` after unplugging the receiver, re-pairing the device (new slot), reusing a cassette recorded on another machine, or a stale agent snapshot where the target device is listed as offline/not paired.","solutions":["Reconnect/pair the device so the selected route exists in the paired inventory, then retry","Re-run target selection so a route that actually exists in the current inventory is chosen (don't pass a hardcoded route)","Verify with `openlogi list` that the target device is paired and has model info before contributing","Regenerate the cassette/profile against the current device instead of reusing a stale one"],"exampleFix":"// before\nopenlogi fixture contribute --route 'bolt:<old-uid>:3'\n// after\nopenlogi list   # confirm the device's current route/slot\nopenlogi fixture contribute --route '<current route from openlogi list>'","handlingStrategy":"validation","validationCode":"// before contributing, confirm the route resolves to a paired device with model info\nlet matches: Vec<_> = inventory.paired.iter()\n    .filter(|d| DeviceRoute::device_route_for(inventory, d.slot).as_ref() == Some(&route))\n    .collect();\nif matches.len() != 1 || matches[0].model_info.is_none() {\n    eprintln!(\"route {route:?} has no single paired identity-bearing device; re-select target\");\n}","typeGuard":null,"tryCatchPattern":"match selected_model(inventory, &route) {\n    Ok(model) => proceed(model),\n    Err(e) => eprintln!(\"{e:#}; run `openlogi list` and re-select the device\"),\n}","preventionTips":["Run `openlogi list` and confirm the device is paired before contributing","Never hardcode routes across sessions — slots and receiver UIDs change on re-pair","Refresh the inventory snapshot immediately before selection","Re-record rather than reusing cassettes from a different machine/receiver"],"tags":["cli","fixture","device-identity","inventory"],"backgroundTag":"entity-not-found","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"}