{"record":{"id":"8c8106f5346628fb","repo":"Hmbown/CodeWhale","slug":"receipt-path-requires-write-receipt-or-check","errorCode":null,"errorMessage":"--receipt-path requires --write-receipt or --check-receipt","messagePattern":"--receipt-path requires --write-receipt or --check-receipt","errorType":"error_code","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":9076,"sourceCode":"        should_force_configured_exec_route(false, explicit_provider, explicit_model);\n    Ok((resolved, force_configured_route))\n}\n\nfn non_empty_flag(value: Option<&str>) -> Option<&str> {\n    value.map(str::trim).filter(|value| !value.is_empty())\n}\n\nfn resolve_review_model(config: &Config, explicit_model: Option<&str>) -> String {\n    explicit_model\n        .map(str::trim)\n        .filter(|model| !model.is_empty())\n        .map(str::to_string)\n        .unwrap_or_else(|| config.default_model())\n}\n\nfn validate_review_receipt_args(args: &ReviewArgs) -> Result<()> {\n    if args.receipt_path.is_some() && !args.write_receipt && !args.check_receipt {\n        bail!(\"--receipt-path requires --write-receipt or --check-receipt\");\n    }\n    if args.write_receipt && args.check_receipt {\n        bail!(\"--write-receipt and --check-receipt are mutually exclusive\");\n    }\n    if args.pr.is_none() && args.max_passes != 1 {\n        bail!(\"--max-passes applies only to --pr reviews\");\n    }\n    if !(1..=crate::tools::review::MAX_REVIEW_PASSES).contains(&args.max_passes) {\n        bail!(\n            \"--max-passes must be from 1 to {}\",\n            crate::tools::review::MAX_REVIEW_PASSES\n        );\n    }\n    Ok(())\n}\n\nfn run_review_receipt_check(\n    diff: &str,","sourceCodeStart":9058,"sourceCodeEnd":9094,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L9058-L9094","documentation":"CLI argument validation in validate_review_receipt_args: `--receipt-path` only has meaning together with one of the receipt operations, `--write-receipt` (create a receipt) or `--check-receipt` (validate one). Passing a path with neither operation is rejected at startup.","triggerScenarios":"Running `codewhale review ... --receipt-path <file>` without also passing --write-receipt or --check-receipt.","commonSituations":"Copy-pasting a receipt command and dropping the action flag; assuming --receipt-path alone implies writing a receipt; scripting the review command with a stale flag set.","solutions":["Add --write-receipt to write the receipt at the given path","Add --check-receipt to validate an existing receipt at the given path","Drop --receipt-path if you do not intend to use receipts"],"exampleFix":"// before\ncodewhale review --pr 123 --receipt-path receipt.json\n// after\ncodewhale review --pr 123 --receipt-path receipt.json --write-receipt","handlingStrategy":"validation","validationCode":"// validate flags before invoking\nconst ok = (args.receipt_path == null) || args.write_receipt || args.check_receipt;\nif (!ok) throw new Error(\"--receipt-path requires --write-receipt or --check-receipt\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair --receipt-path with --write-receipt or --check-receipt","Build review commands from a wrapper script that enforces flag combos","Check `codewhale review --help` for receipt flag requirements"],"tags":["cli","argument-validation","receipt"],"backgroundTag":"missing-required-flag","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"}