{"record":{"id":"59eedbcb4f54d16f","repo":"ruvnet/RuView","slug":"cannot-read-baseline-path-e-run-calibrate","errorCode":null,"errorMessage":"cannot read baseline {path}: {e} — run `calibrate` first","messagePattern":"cannot read baseline (.+?): (.+?) — run `calibrate` first","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v2/crates/wifi-densepose-cli/src/room.rs","lineNumber":51,"sourceCode":"}\n\n/// Per-frame scalar: mean amplitude across all subcarriers/streams.\n///\n/// Carries presence/motion energy plus the breathing amplitude modulation.\n/// (Validated live on the ESP32 — picks up breathing where a max-variance\n/// subcarrier instead locks onto motion artifacts. A phase-based carrier on a\n/// *stable* subcarrier is the proper higher-SNR refinement — ADR-151 §4.)\nfn frame_scalar(frame: &CsiFrame) -> f32 {\n    let a = &frame.amplitude;\n    if a.is_empty() {\n        return 0.0;\n    }\n    (a.sum() / a.len() as f64) as f32\n}\n\nfn load_baseline(path: &str) -> Result<BaselineCalibration> {\n    let bytes = std::fs::read(path)\n        .map_err(|e| anyhow::anyhow!(\"cannot read baseline {path}: {e} — run `calibrate` first\"))?;\n    BaselineCalibration::from_bytes(&bytes)\n        .map_err(|e| anyhow::anyhow!(\"invalid baseline {path}: {e}\"))\n}\n\n/// Persisted enrollment output (labelled features + audit log).\n#[derive(serde::Serialize, serde::Deserialize)]\nstruct EnrollmentData {\n    room_id: String,\n    baseline_id: String,\n    fs_hz: f32,\n    anchors: Vec<AnchorFeature>,\n    session: EnrollmentSession,\n}\n\n// ---------------------------------------------------------------------------\n// enroll\n// ---------------------------------------------------------------------------\n","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/ruvnet/RuView/blob/4685618388a5e49fad5b3005806f3bdd6a7c25c3/v2/crates/wifi-densepose-cli/src/room.rs#L33-L69","documentation":"load_baseline in room.rs failed to std::fs::read the --baseline file. The message appends 'run calibrate first' because the expected artifact is the binary BaselineCalibration written by the calibrate command's finalise_and_save. The io::Error is usually NotFound but can be permission denied or another OS read failure.","triggerScenarios":"Running enroll or room-watch before any calibrate run produced the baseline; --baseline pointing at a wrong path or at the JSON enrollment file instead of the binary baseline; unreadable file permissions.","commonSituations":"New machine or checkout without the artifacts directory; running the CLI from a different working directory so a relative baseline path misses; mixing up the binary baseline with the JSON artifacts.","solutions":["Run calibrate first and use the exact path it prints ('[calibrate] baseline saved to …')","Point --baseline at that binary file, not the enrollment JSON or room bank","Use absolute paths or run from a fixed working directory","If the file exists, fix read permissions"],"exampleFix":"// before\n$ ruview enroll --baseline ./baseline.bin   # cannot read: run `calibrate` first\n\n// after\n$ ruview calibrate --output ./artifacts/baseline.bin\n$ ruview enroll --baseline ./artifacts/baseline.bin","handlingStrategy":"validation","validationCode":"fn baseline_readable(path: &str) -> bool {\n    std::path::Path::new(path).is_file()\n}","typeGuard":null,"tryCatchPattern":"match std::fs::read(path) {\n    Ok(bytes) => bytes,\n    Err(e) if e.kind() == std::io::ErrorKind::NotFound => {\n        return Err(anyhow::anyhow!(\"cannot read baseline {path}: {e} — run `calibrate` first\"));\n    }\n    Err(e) => return Err(anyhow::anyhow!(\"cannot read baseline {path}: {e}\")),\n}","preventionTips":["Pipeline wrappers should assert the baseline artifact exists before starting enroll","Prefer absolute artifact paths in automation","Regenerate the baseline after firmware or PHY tier changes and record its path"],"tags":["rust","filesystem","calibration","cli"],"backgroundTag":null,"analyzedSha":"4685618388a5e49fad5b3005806f3bdd6a7c25c3","analyzedAt":"2026-08-16T06:09:40.886Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}