{"record":{"id":"4b894e284f617040","repo":"Hmbown/CodeWhale","slug":"no-review-receipt-found-for-the-current-diff-run","errorCode":null,"errorMessage":"No review receipt found for the current diff. Run `codewhale review --write-receipt` first, or pass --receipt-path.","messagePattern":"No review receipt found for the current diff\\. Run `codewhale review --write-receipt` first, or pass --receipt-path\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":9106,"sourceCode":"        );\n    }\n    Ok(())\n}\n\nfn run_review_receipt_check(\n    diff: &str,\n    args: &ReviewArgs,\n    pr_view: Option<&GhPullRequest>,\n) -> Result<()> {\n    let (path, receipt) = if let Some(path) = args.receipt_path.as_ref() {\n        (\n            path.clone(),\n            crate::tools::review::read_review_receipt(path)\n                .with_context(|| format!(\"failed to read review receipt {}\", path.display()))?,\n        )\n    } else {\n        crate::tools::review::latest_review_receipt_for_diff(diff)?.ok_or_else(|| {\n            anyhow!(\n                \"No review receipt found for the current diff. Run `codewhale review --write-receipt` first, or pass --receipt-path.\"\n            )\n        })?\n    };\n    let mut validation =\n        crate::tools::review::validate_review_receipt_for_diff(diff, &receipt, Some(path.clone()));\n    if validation.passed\n        && pr_view\n            .is_some_and(|view| !crate::tools::review::receipt_matches_pr_revision(&receipt, view))\n    {\n        validation.passed = false;\n        validation.reason =\n            \"review receipt does not match the current PR base/head revision\".into();\n    }\n\n    if args.json {\n        println!(\n            \"{}\",","sourceCodeStart":9088,"sourceCodeEnd":9124,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L9088-L9124","documentation":"run_review_receipt_check found no stored receipt whose diff matches the current diff and no --receipt-path was given; receipt checking is diff-bound, so an unrelated or changed diff invalidates prior receipts.","triggerScenarios":"Thrown at crates/tui/src/lib.rs:9106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run `codewhale review --pr --write-receipt` first, then check.","Pass --receipt-path pointing at an existing receipt file."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}