{"record":{"id":"98abffa1fbbeb841","repo":"Hmbown/CodeWhale","slug":"receipt-path-has-no-parent","errorCode":null,"errorMessage":"receipt path has no parent","messagePattern":"receipt path has no parent","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/integrations/dsh/receipt.rs","lineNumber":133,"sourceCode":"            Err(error) if error.kind() == std::io::ErrorKind::NotFound => Ok(Self::default()),\n            Err(error) => {\n                Err(error).with_context(|| format!(\"read DSH receipt {}\", path.display()))\n            }\n        }\n    }\n\n    pub(crate) fn push(&mut self, entry: DshReceiptEntry) {\n        self.history.push(entry);\n        if self.history.len() > MAX_HISTORY {\n            let excess = self.history.len() - MAX_HISTORY;\n            self.history.drain(0..excess);\n        }\n    }\n\n    pub(crate) fn save(&self, path: &Path) -> Result<()> {\n        let parent = path\n            .parent()\n            .ok_or_else(|| anyhow::anyhow!(\"receipt path has no parent\"))?;\n        std::fs::create_dir_all(parent).with_context(|| format!(\"create {}\", parent.display()))?;\n        let json = serde_json::to_vec_pretty(self)?;\n        write_atomic(path, &json)\n    }\n}\n\n/// Write via a sibling temp file + rename so a crash never leaves a torn\n/// receipt or overlay behind.\npub(crate) fn write_atomic(path: &Path, bytes: &[u8]) -> Result<()> {\n    let parent = path\n        .parent()\n        .ok_or_else(|| anyhow::anyhow!(\"path has no parent\"))?;\n    let tmp = parent.join(format!(\n        \".{}.tmp-{}\",\n        path.file_name()\n            .map(|n| n.to_string_lossy().into_owned())\n            .unwrap_or_else(|| \"file\".to_string()),\n        std::process::id()","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/integrations/dsh/receipt.rs#L115-L151","documentation":"Error \"receipt path has no parent\" thrown in Hmbown/CodeWhale.","triggerScenarios":"Thrown at crates/tui/src/integrations/dsh/receipt.rs:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}