{"record":{"id":"0395c67eb50f8651","repo":"ruvnet/RuView","slug":"training-failed-e","errorCode":null,"errorMessage":"training failed: {e}","messagePattern":"training failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"v2/crates/wifi-densepose-cli/src/room.rs","lineNumber":260,"sourceCode":"    let raw = std::fs::read_to_string(&args.enrollment)\n        .map_err(|e| anyhow::anyhow!(\"cannot read {}: {e} — run `enroll` first\", args.enrollment))?;\n    let mut data: EnrollmentData =\n        serde_json::from_str(&raw).map_err(|e| anyhow::anyhow!(\"invalid enrollment: {e}\"))?;\n    if data.anchors.is_empty() {\n        bail!(\"no accepted anchors in {} — re-run enroll\", args.enrollment);\n    }\n\n    if let Some(path) = &args.geometry {\n        let graw = std::fs::read_to_string(path)\n            .map_err(|e| anyhow::anyhow!(\"cannot read geometry {path}: {e}\"))?;\n        let geometry: Vec<NodeGeometry> = serde_json::from_str(&graw).map_err(|e| {\n            anyhow::anyhow!(\"invalid geometry {path}: {e} (expected a JSON array of NodeGeometry records)\")\n        })?;\n        data.session.record_geometry(geometry, now_unix());\n    }\n\n    let mut bank = SpecialistBank::train(&data.room_id, &data.baseline_id, &data.anchors, now_unix())\n        .map_err(|e| anyhow::anyhow!(\"training failed: {e}\"))?;\n    match data.session.geometry() {\n        Some(g) if !g.is_empty() => {\n            bank = bank.with_geometry(g.to_vec());\n            eprintln!(\n                \"[train-room] geometry: {} node(s) snapshotted into the bank (ADR-152 §2.1.1)\",\n                bank.geometry.len()\n            );\n        }\n        _ => eprintln!(\n            \"[train-room] no transceiver geometry recorded — bank will not support geometry conditioning (ADR-152 §2.1.2)\"\n        ),\n    }\n    std::fs::write(&args.output, bank.to_json().map_err(|e| anyhow::anyhow!(\"{e}\"))?)\n        .map_err(|e| anyhow::anyhow!(\"cannot write {}: {e}\", args.output))?;\n\n    eprintln!(\n        \"[train-room] room='{}' trained {} specialists from {} anchors → {}\",\n        bank.room_id,","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/ruvnet/RuView/blob/4685618388a5e49fad5b3005806f3bdd6a7c25c3/v2/crates/wifi-densepose-cli/src/room.rs#L242-L278","documentation":"SpecialistBank::train returned Err while building the mixture-of-specialists bank from enrollment anchors. In the library (wifi-densepose-calibration/src/bank.rs:58) the only error is CalibrationError::InsufficientSamples for an empty anchors slice — a case train-room already rejects earlier with its own 'no accepted anchors' bail — so this wrap is a defensive guard against future train() failure modes.","triggerScenarios":"Unreachable via the current train-room path (the empty-anchor case is pre-checked); would resurface if SpecialistBank::train gains new validation minimums or if the CLI pre-check is removed.","commonSituations":"Seen after modifying bank.rs thresholds while reusing old enrollment files; version skew between the CLI and the calibration crate.","solutions":["Read the {e} payload: InsufficientSamples names the kind and the have/need counts","Re-run enroll to capture more accepted anchors (raise --attempts if prompts fail quality gates)","If you changed bank.rs thresholds, align them with what enroll can realistically accept","Keep the CLI and the calibration crate from the same build"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn can_train_bank(anchors: &[AnchorFeature]) -> bool {\n    !anchors.is_empty()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure enroll accepts at least one anchor before train-room (its output prints got/total)","After changing SpecialistBank::train thresholds, re-enroll to meet the new minimums","Keep the CLI and calibration crate versions in lockstep"],"tags":["rust","training","calibration","specialists"],"backgroundTag":null,"analyzedSha":"4685618388a5e49fad5b3005806f3bdd6a7c25c3","analyzedAt":"2026-08-16T06:09:40.886Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}