{"record":{"id":"4ce02a4a4bcf8e2b","repo":"jdx/mise","slug":"brew-cask-kind-terminate-process-match-must","errorCode":null,"errorMessage":"brew-cask:{}: {kind} terminate_process match must be name or full","messagePattern":"brew-cask:(.+?): (.+?) terminate_process match must be name or full","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask.rs","lineNumber":5730,"sourceCode":"                ],\n            )?;\n            let name = object.get(\"name\").and_then(Value::as_str).ok_or_else(|| {\n                eyre!(\n                    \"brew-cask:{}: {kind} terminate_process name must be a string\",\n                    cask.token\n                )\n            })?;\n            if name.is_empty() {\n                bail!(\n                    \"brew-cask:{}: {kind} terminate_process name must not be empty\",\n                    cask.token\n                );\n            }\n            let match_mode = match object.get(\"match\") {\n                None => ProcessMatch::Name,\n                Some(Value::String(value)) if value == \"name\" => ProcessMatch::Name,\n                Some(Value::String(value)) if value == \"full\" => ProcessMatch::Full,\n                _ => bail!(\n                    \"brew-cask:{}: {kind} terminate_process match must be name or full\",\n                    cask.token\n                ),\n            };\n            let sudo = parse_optional_flight_bool(cask, kind, object, \"sudo\", false)?;\n            let must_succeed =\n                parse_optional_flight_bool(cask, kind, object, \"must_succeed\", false)?;\n            let attempts = match object.get(\"attempts\") {\n                None => 1,\n                Some(value) => value\n                    .as_u64()\n                    .and_then(|value| usize::try_from(value).ok())\n                    .filter(|value| *value > 0)\n                    .ok_or_else(|| {\n                        eyre!(\n                            \"brew-cask:{}: {kind} terminate_process attempts must be a positive integer\",\n                            cask.token\n                        )","sourceCodeStart":5712,"sourceCodeEnd":5748,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/packages/brew/cask.rs#L5712-L5748","documentation":"Thrown while parsing a terminate_process step. The optional 'match' key selects how the process name is compared: omitted defaults to 'name' (match by process name), 'name' and 'full' (match the full executable path) are the only accepted spellings; anything else bails.","triggerScenarios":"{\"type\": \"terminate_process\", \"name\": \"x\", \"match\": \"exact\"} — values like \"regex\", \"partial\", \"path\", or a non-string match value all land in the wildcard arm and bail.","commonSituations":"Assuming Homebrew's audit vocabulary or pgrep semantics (e.g. \"-f\" or \"full_path\"); typos like \"FullName\"; copying match syntax from a different tool's config.","solutions":["Use \"match\": \"name\" (or omit the key) to match by process name","Use \"match\": \"full\" to match the complete executable path"],"exampleFix":"// before\n{\"type\": \"terminate_process\", \"name\": \"/Applications/Zoom.app/Contents/MacOS/zoom.us\", \"match\": \"path\"}\n// after\n{\"type\": \"terminate_process\", \"name\": \"/Applications/Zoom.app/Contents/MacOS/zoom.us\", \"match\": \"full\"}","handlingStrategy":"validation","validationCode":"fn match_mode_ok(step: &serde_json::Value) -> bool {\n    match step.get(\"match\") {\n        None => true,\n        Some(serde_json::Value::String(s)) => s == \"name\" || s == \"full\",\n        Some(_) => false,\n    }\n}","typeGuard":"fn is_valid_match(v: &serde_json::Value) -> bool {\n    v.as_str().map(|s| s == \"name\" || s == \"full\").unwrap_or(false)\n}","tryCatchPattern":"match parse_flight_step(&cask, kind, &step) {\n    Ok(step) => { /* proceed */ }\n    Err(e) if e.to_string().contains(\"match must be name or full\") => {\n        eprintln!(\"terminate_process match accepts only 'name' or 'full'\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Default to omitting 'match' — name matching covers most cases","Use 'full' only with the complete executable path in 'name'"],"tags":["brew-cask","mise","terminate-process","enum-validation","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"}