{"record":{"id":"fe66426986331b33","repo":"jdx/mise","slug":"brew-cask-unsupported-kind-field-glob-outside-staged-path","errorCode":null,"errorMessage":"brew-cask:{}: unsupported {kind} {field} glob outside staged_path {}","messagePattern":"brew-cask:(.+?): unsupported (.+?) (.+?) glob outside staged_path (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/artifacts.rs","lineNumber":1174,"sourceCode":"            \"brew-cask:{}: unsupported {kind} {field} base {}\",\n            cask.token,\n            base\n        ),\n        None => bail!(\"brew-cask:{}: unsupported {kind} {field} base\", cask.token),\n    };\n    let path = object\n        .get(\"path\")\n        .and_then(Value::as_str)\n        .ok_or_else(|| eyre!(\"brew-cask:{}: unsupported {kind} {field} path\", cask.token))?;\n    if validate_flight_relative_path(path).is_err() {\n        bail!(\n            \"brew-cask:{}: invalid {kind} {field} path {}\",\n            cask.token,\n            path\n        )\n    }\n    if base == FlightPathBase::AppDir && is_flight_glob(path) {\n        bail!(\n            \"brew-cask:{}: unsupported {kind} {field} glob outside staged_path {}\",\n            cask.token,\n            path\n        )\n    }\n    Ok(FlightPath {\n        base,\n        path: path.to_string(),\n    })\n}\n\npub(super) fn collect_pkg_receipt_ids(value: &Value, pkg_ids: &mut Vec<String>) {\n    let Some(object) = value.as_object() else {\n        return;\n    };\n    let Some(metadata) = object.get(\"uninstall\") else {\n        return;\n    };","sourceCodeStart":1156,"sourceCodeEnd":1192,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/cask/artifacts.rs#L1156-L1192","documentation":"For permission flight paths whose base is \"appdir\", glob patterns are not allowed — globs are only meaningful relative to the staged_path, where the cask's extracted content lives. When a cask declares an appdir-based path containing glob characters, this error aborts parsing because matching against the /Applications directory with a wildcard is unsupported.","triggerScenarios":"parse_permissions_flight_path sees `base == FlightPathBase::AppDir` and `is_flight_glob(path)` is true — e.g. {\"base\": \"appdir\", \"path\": \"*.app\"}.","commonSituations":"A tap cask tries to express 'match any app in Applications' via a glob with base appdir; cask authors migrating stanzas from staged_path to appdir without removing glob syntax.","solutions":["Change the path to a concrete appdir entry (no glob characters), or switch base back to \"staged_path\" if a glob is actually needed","Fix the cask definition in the upstream tap","Enumerate the specific target paths instead of using a wildcard"],"exampleFix":"// before\n{ \"type\": \"permissions\", \"base\": \"appdir\", \"path\": \"*.app\" }\n// after\n{ \"type\": \"permissions\", \"base\": \"staged_path\", \"path\": \"Foo.app/**\" }","handlingStrategy":"validation","validationCode":"// Reject globs with appdir base before installing\nlet is_glob = |p: &str| p.contains('*') || p.contains('?') || p.contains('[');\nif base == \"appdir\" && is_glob(path) {\n    eprintln!(\"appdir-based permission paths cannot use globs\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use globs only with base \"staged_path\"","Enumerate concrete appdir entries instead of wildcards","Review cask stanzas for glob characters when migrating between bases"],"tags":["homebrew","cask","glob","permissions"],"backgroundTag":"unsupported-operation","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"}