{"record":{"id":"01a8fabbb10f9873","repo":"jdx/mise","slug":"brew-cask-unsupported-kind-run-command-base-01a8fa","errorCode":null,"errorMessage":"brew-cask:{}: unsupported {kind} run command base {}","messagePattern":"brew-cask:(.+?): unsupported (.+?) run command base (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/artifacts.rs","lineNumber":953,"sourceCode":") -> 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\n        )\n    })?;\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(base) => bail!(\n            \"brew-cask:{}: unsupported {kind} run command base {}\",\n            cask.token,\n            base\n        ),\n        None => FlightPathBase::Literal,\n    };\n    let path_value = Path::new(path);\n    let invalid_absolute_path = base == FlightPathBase::Literal\n        && !path_value.is_absolute()\n        && path_value.components().count() > 1;\n    let invalid_based_path = matches!(\n        base,\n        FlightPathBase::StagedPath | FlightPathBase::AppDir | FlightPathBase::HomebrewPrefix\n    ) && (path_value.is_absolute()\n        || path_value\n            .components()\n            .any(|component| matches!(component, Component::ParentDir)));\n    if invalid_absolute_path || invalid_based_path {","sourceCodeStart":935,"sourceCodeEnd":971,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/cask/artifacts.rs#L935-L971","documentation":"When parsing a Homebrew cask's flight artifact (preflight/postflight/uninstall etc.), a run command's path object specified a \"base\" key whose value is not one of the recognized bases: \"staged_path\", \"appdir\", or \"homebrew_prefix\". The library only supports anchoring run commands to those base directories, so any other base string is rejected at parse time. This keeps flight step path resolution deterministic instead of guessing what an unknown base means.","triggerScenarios":"Calling parse_run_command (via FlightStep::Run) on a cask JSON artifact whose run command object contains e.g. {\"base\": \"app_bundle\", \"path\": \"...\"} or any typo'd/renamed base other than staged_path/appdir/homebrew_prefix, or omitting \"base\" while relying on a custom base semantics.","commonSituations":"Hand-editing a cask JSON, translating casks from other formats (e.g. custom installers) that use different base names, typos like \"stagedpath\" or \"APPDIR\", or upstream Homebrew adding a new base kind this port has not implemented yet.","solutions":["Change the run command's \"base\" to one of the supported values: \"staged_path\", \"appdir\", or \"homebrew_prefix\".","If the path needs no anchoring, remove the \"base\" key entirely so it defaults to FlightPathBase::Literal and use an absolute path.","If the base is a legitimately new Homebrew base kind, extend parse_run_command in src/system/packages/brew/cask/artifacts.rs to map it to a new FlightPathBase variant."],"exampleFix":"// before\n{\"path\": {\"base\": \"app_bundle\", \"path\": \"Contents/MacOS/tool\"}}\n// after\n{\"path\": {\"base\": \"appdir\", \"path\": \"Contents/MacOS/tool\"}}","handlingStrategy":"validation","validationCode":"const ALLOWED_RUN_BASES = new Set([\"staged_path\", \"appdir\", \"homebrew_prefix\"]);\nfunction validateRunBase(cmd) {\n  const base = cmd?.path?.base;\n  if (base != null && !ALLOWED_RUN_BASES.has(base)) {\n    throw new Error(`unsupported run command base: ${base}`);\n  }\n}","typeGuard":"function hasSupportedRunBase(cmd) {\n  const base = cmd?.path?.base;\n  return base == null || [\"staged_path\", \"appdir\", \"homebrew_prefix\"].includes(base);\n}","tryCatchPattern":"try {\n  parseFlightArtifact(caskJson);\n} catch (err) {\n  if (String(err).includes(\"unsupported\") && String(err).includes(\"run command base\")) {\n    console.error(`Cask ${caskToken}: fix the run command \"base\" field`);\n  }\n  throw err;\n}","preventionTips":["Only emit \"base\" values from the fixed enum: staged_path, appdir, homebrew_prefix.","Run cask JSON through a JSON Schema validator with a base enum before parsing.","When porting casks from other formats, map foreign base names explicitly instead of passing them through."],"tags":["brew","cask","config-validation","unsupported-value"],"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"}