{"record":{"id":"848d56b0ed81b7df","repo":"jdx/mise","slug":"brew-cask-unsupported-kind-field-base","errorCode":null,"errorMessage":"brew-cask:{}: unsupported {kind} {field} base {}","messagePattern":"brew-cask:(.+?): unsupported (.+?) (.+?) base (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask.rs","lineNumber":5952,"sourceCode":"    }\n}\n\nfn parse_context_flight_path(\n    cask: &Cask,\n    kind: &str,\n    field: &str,\n    object: &serde_json::Map<String, Value>,\n) -> Result<FlightPath> {\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    let base = match object.get(\"base\").and_then(Value::as_str) {\n        Some(\"staged_path\") => FlightPathBase::StagedPath,\n        Some(\"appdir\") => FlightPathBase::AppDir,\n        Some(\"homebrew_prefix\") => FlightPathBase::HomebrewPrefix,\n        Some(\"relative\") => FlightPathBase::Literal,\n        Some(base) => bail!(\n            \"brew-cask:{}: unsupported {kind} {field} base {}\",\n            cask.token,\n            base\n        ),\n        None => FlightPathBase::Literal,\n    };\n    Ok(FlightPath {\n        base,\n        path: path.to_string(),\n    })\n}\n\nfn parse_context_flight_path_value(\n    cask: &Cask,\n    kind: &str,\n    field: &str,\n    value: Option<&Value>,\n) -> Result<FlightPath> {","sourceCodeStart":5934,"sourceCodeEnd":5970,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/packages/brew/cask.rs#L5934-L5970","documentation":"Thrown by parse_context_flight_path, the path resolver shared by run guards and copy source/target fields (the field name is interpolated, e.g. 'run guard path', 'copy source'). Unlike run-command bases, this resolver also accepts \"relative\" (mapped to Literal). Accepted bases: staged_path, appdir, homebrew_prefix, relative; absent means literal. Any other base string bails.","triggerScenarios":"{\"condition\": \"if_exists\", \"path\": \"x\", \"base\": \"home\"} in a guard, or a copy step source {\"path\": \"data\", \"base\": \"caskroom\"} — any base token outside the four accepted values.","commonSituations":"Assuming run-command and guard bases share vocabularies when they differ slightly; guessing base names; metadata produced for a different mise version.","solutions":["Use \"staged_path\", \"appdir\", \"homebrew_prefix\", or \"relative\"","Omit \"base\" when the path is a literal/absolute path"],"exampleFix":"// before\n{\"condition\": \"if_exists\", \"path\": \"marker\", \"base\": \"stage\"}\n// after\n{\"condition\": \"if_exists\", \"path\": \"marker\", \"base\": \"staged_path\"}","handlingStrategy":"validation","validationCode":"fn context_base_ok(obj: &serde_json::Value) -> bool {\n    match obj.get(\"base\") {\n        None => true,\n        Some(serde_json::Value::String(s)) => {\n            matches!(s.as_str(), \"staged_path\" | \"appdir\" | \"homebrew_prefix\" | \"relative\")\n        }\n        Some(_) => false,\n    }\n}","typeGuard":"fn is_supported_context_base(v: &serde_json::Value) -> bool {\n    v.as_str().map(|s| [\"staged_path\", \"appdir\", \"homebrew_prefix\", \"relative\"].contains(&s)).unwrap_or(false)\n}","tryCatchPattern":"match parse_context_flight_path(&cask, kind, field, object) {\n    Ok(p) => { /* proceed */ }\n    Err(e) if e.to_string().contains(\"base\") => {\n        eprintln!(\"guard/copy bases: staged_path, appdir, homebrew_prefix, relative (or omit)\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Note 'relative' is valid here but NOT on run-command bases — the vocabularies differ","Omit base for literal paths in guards and copy source/target"],"tags":["brew-cask","mise","guards","path-validation","enum-validation"],"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"}