{"record":{"id":"030f47d4ecf31d5f","repo":"ruvnet/RuView","slug":"invalid-baseline-path-e","errorCode":null,"errorMessage":"invalid baseline {path}: {e}","messagePattern":"invalid baseline (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v2/crates/wifi-densepose-cli/src/room.rs","lineNumber":53,"sourceCode":"/// 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\n/// Arguments for `enroll`.\n#[derive(Args, Debug, Clone)]","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/ruvnet/RuView/blob/4685618388a5e49fad5b3005806f3bdd6a7c25c3/v2/crates/wifi-densepose-cli/src/room.rs#L35-L71","documentation":"The baseline file was read but BaselineCalibration::from_bytes rejected its contents. from_bytes (wifi-densepose-signal/src/ruvsense/calibration.rs:405) fails with TruncatedBuffer (below the 28-byte header or short subcarrier payload), InvalidMagic, VersionMismatch (baseline written by a different format version), or UnknownTier (bad tier byte).","triggerScenarios":"Passing a non-baseline file (JSON enrollment, text log) as --baseline; a baseline truncated by a partial write or interrupted transfer; a baseline produced by an older/newer RuView build with a different format VERSION; a corrupted tier byte.","commonSituations":"Mixing up CLI artifact types; upgrading the toolchain and reusing old baselines; interrupted scp/rsync transfers; binary files touched by re-encoding tooling.","solutions":["Regenerate the baseline with the current build by re-running calibrate","Verify you passed the binary baseline, not enrollment JSON or room-bank.json","Re-transfer the file and compare sizes/checksums if it came from another host","Keep baselines and the consuming binaries from the same release so the format VERSION matches"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn check_baseline(path: &str) -> Result<(), String> {\n    let buf = std::fs::read(path).map_err(|e| format!(\"read {path}: {e}\"))?;\n    BaselineCalibration::from_bytes(&buf).map_err(|e| format!(\"not a valid baseline: {e}\"))\n}","typeGuard":"fn looks_like_baseline(buf: &[u8]) -> bool {\n    // header = magic(4) + version(1) + tier(1) + reserved(2) + captured_at(8) + frame_count(8) + n(4)\n    buf.len() >= 28 && BaselineCalibration::from_bytes(buf).is_ok()\n}","tryCatchPattern":null,"preventionTips":["Pin baseline artifacts to the producing build's version; regenerate after upgrades","Store checksums alongside transferred baselines and verify before use","Never hand-edit the binary baseline; regenerate via calibrate"],"tags":["rust","serialization","calibration","binary-format","versioning"],"backgroundTag":null,"analyzedSha":"4685618388a5e49fad5b3005806f3bdd6a7c25c3","analyzedAt":"2026-08-16T06:09:40.886Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}