{"record":{"id":"f030bc9714f42199","repo":"jdx/mise","slug":"brew-cask-kind-terminate-process-match-must-f030bc","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/artifacts.rs","lineNumber":816,"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":798,"sourceCodeEnd":834,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/cask/artifacts.rs#L798-L834","documentation":"The optional `match` field of a `terminate_process` flight step controls how `name` is interpreted: `\"name\"` (default) matches the process name exactly, `\"full\"` matches the full command line. Any other value — or a non-string — is rejected with this error naming the cask token and step kind.","triggerScenarios":"A terminate_process step with `match` set to something other than \"name\" or \"full\", e.g. `match = \"exact\"`, `match = \"prefix\"`, or a non-string value like `match = true`.","commonSituations":"Guessing at match modes not in the schema, copying values from other tools' process-matching APIs (e.g. pgrep patterns), or typoing \"fullname\"/\"cmdline\".","solutions":["Change `match` to either \"name\" or \"full\".","Remove the `match` field entirely to use the default (\"name\") behavior."],"exampleFix":"// before\n[[flight.steps]]\ntype = \"terminate_process\"\nname = \"myapp\"\nmatch = \"exact\"\n// after\n[[flight.steps]]\ntype = \"terminate_process\"\nname = \"myapp\"\nmatch = \"full\"","handlingStrategy":"validation","validationCode":"if (step.match !== undefined && ![\"name\", \"full\"].includes(step.match))\n  throw new Error(`invalid match mode: ${step.match}`);","typeGuard":"function isProcessMatch(v) {\n  return v === undefined || v === \"name\" || v === \"full\";\n}","tryCatchPattern":"try {\n  parseCaskArtifacts(cask);\n} catch (err) {\n  if (err.message.includes(\"match must be name or full\")) {\n    // normalize the match value or drop the field\n  } else throw err;\n}","preventionTips":["Only use the documented values \"name\" and \"full\" for match.","Omit `match` when the default name-matching behavior is wanted.","Add a lint rule restricting terminate_process.match to the two enum values."],"tags":["brew-cask","config","enum","process"],"backgroundTag":"invalid-enum-value","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}