{"record":{"id":"4fa2ace81302d24d","repo":"jdx/mise","slug":"brew-cask-kind-terminate-process-field-mus","errorCode":null,"errorMessage":"brew-cask:{}: {kind} terminate_process {field} must be a boolean","messagePattern":"brew-cask:(.+?): (.+?) terminate_process (.+?) must be a boolean","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask.rs","lineNumber":5833,"sourceCode":"                .iter()\n                .map(|guard| parse_flight_guard(cask, kind, guard))\n                .collect::<Result<Vec<_>>>()\n        })\n        .transpose()\n        .map(|guards| guards.unwrap_or_default())\n}\n\nfn parse_optional_flight_bool(\n    cask: &Cask,\n    kind: &str,\n    object: &serde_json::Map<String, Value>,\n    field: &str,\n    default: bool,\n) -> Result<bool> {\n    match object.get(field) {\n        None => Ok(default),\n        Some(Value::Bool(value)) => Ok(*value),\n        Some(_) => bail!(\n            \"brew-cask:{}: {kind} terminate_process {field} must be a boolean\",\n            cask.token\n        ),\n    }\n}\n\nfn parse_run_command(cask: &Cask, kind: &str, value: Option<&Value>) -> Result<FlightPath> {\n    let object = value.and_then(Value::as_object).ok_or_else(|| {\n        eyre!(\n            \"brew-cask:{}: unsupported {kind} run command metadata format\",\n            cask.token\n        )\n    })?;\n    reject_unsupported_flight_fields(cask, kind, \"run command\", object, &[\"base\", \"path\"])?;\n    let path = object.get(\"path\").and_then(Value::as_str).ok_or_else(|| {\n        eyre!(\n            \"brew-cask:{}: unsupported {kind} run command path\",\n            cask.token","sourceCodeStart":5815,"sourceCodeEnd":5851,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/packages/brew/cask.rs#L5815-L5851","documentation":"Thrown by parse_optional_flight_bool, the shared helper for boolean step fields. Fields like terminate_process's sudo/must_succeed (and sibling steps' recursive/overwrite/source_glob/uninstall) must be true/false JSON booleans or absent; any other type bails. Note the message text hardcodes 'terminate_process' even when the helper rejects a field of another step kind.","triggerScenarios":"{\"type\": \"terminate_process\", \"name\": \"x\", \"must_succeed\": \"true\"} — string \"true\", 1, or null where a boolean is expected; equally a copy/symlink step with \"recursive\": \"yes\".","commonSituations":"Config round-trips through YAML or templates that stringify booleans; authors writing \"true\" in quotes out of habit; JSON producers emitting 0/1 flags.","solutions":["Use real JSON booleans: true / false, unquoted","Remove the field to accept its documented default (shown in the step's allowed-fields list in cask.rs)"],"exampleFix":"// before\n{\"type\": \"terminate_process\", \"name\": \"x\", \"must_succeed\": \"true\"}\n// after\n{\"type\": \"terminate_process\", \"name\": \"x\", \"must_succeed\": true}","handlingStrategy":"type-guard","validationCode":"fn flight_bools_ok(step: &serde_json::Value) -> bool {\n    [\"sudo\", \"must_succeed\", \"recursive\", \"overwrite\", \"source_glob\", \"uninstall\"]\n        .iter()\n        .all(|f| match step.get(*f) {\n            None | Some(serde_json::Value::Bool(_)) => true,\n            Some(_) => false,\n        })\n}","typeGuard":"fn is_json_bool_or_absent(v: Option<&serde_json::Value>) -> bool {\n    matches!(v, None | Some(serde_json::Value::Bool(_)))\n}","tryCatchPattern":"match parse_flight_step(&cask, kind, &step) {\n    Ok(step) => { /* proceed */ }\n    Err(e) if e.to_string().contains(\"must be a boolean\") => {\n        eprintln!(\"step boolean fields take unquoted true/false, not strings or numbers\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Emit real JSON booleans from generators; never stringify true/false","Prefer omitting optional booleans to take the documented default"],"tags":["brew-cask","mise","type-mismatch","boolean","flight-steps"],"backgroundTag":"brew-cask-stanza-validation","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}