{"record":{"id":"f3d64e81834bd847","repo":"jdx/mise","slug":"brew-cask-unsupported-kind-field-base-f3d64e","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/artifacts.rs","lineNumber":1118,"sourceCode":"    cask: &Cask,\n    kind: &str,\n    field: &str,\n    value: Option<&Value>,\n) -> Result<FlightPath> {\n    let object = value.and_then(Value::as_object).ok_or_else(|| {\n        eyre!(\n            \"brew-cask:{}: unsupported {kind} {field} metadata format\",\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(base) => bail!(\n            \"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    Ok(FlightPath {\n        base,\n        path: path.to_string(),\n    })\n}\n","sourceCodeStart":1100,"sourceCodeEnd":1136,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/cask/artifacts.rs#L1100-L1136","documentation":"A move/rename-style flight path object omitted the required \"base\" key. parse_flight_path requires an explicit \"staged_path\" base for move from/to paths; unlike run commands and guard paths, there is no literal default here.","triggerScenarios":"parse_flight_path (via FlightStep::Move / parse_flight_step) reads a from/to object like {\"path\": \"Old.app\"} with no \"base\" key, or with a non-string base.","commonSituations":"Hand-written move steps copied from the terser run-command style where base is optional, or JSON generated by tooling that drops defaults.","solutions":["Add \"base\": \"staged_path\" to each from/to path object of the move step.","Ensure \"base\" is a JSON string, not null or an object.","If a baseless path was intended, switch the step type to one that accepts literal paths (e.g. a run command)."],"exampleFix":"// before\n{\"type\": \"move\", \"from\": {\"path\": \"Old.app\"}, \"to\": {\"path\": \"New.app\"}}\n// after\n{\"type\": \"move\", \"from\": {\"base\": \"staged_path\", \"path\": \"Old.app\"}, \"to\": {\"base\": \"staged_path\", \"path\": \"New.app\"}}","handlingStrategy":"validation","validationCode":"function requireMoveBase(p) {\n  if (typeof p?.base !== \"string\") {\n    throw new Error('move path requires \"base\": \"staged_path\"');\n  }\n}","typeGuard":"function isWellFormedMovePath(p) {\n  return typeof p === \"object\" && p !== null && typeof p.base === \"string\" && typeof p.path === \"string\";\n}","tryCatchPattern":"try {\n  parseFlightArtifact(caskJson);\n} catch (err) {\n  if (String(err).includes(\"unsupported\") && /base\\s*\"$|base\"/.test(String(err)) && String(err).includes(\"move\") === false) {\n    console.error('Move path object is missing \"base\": \"staged_path\"');\n  }\n  throw err;\n}","preventionTips":["Always include the base key on move from/to path objects.","Validate move steps with a schema requiring {base, path} pairs.","Use a builder/serializer that emits base by default for move paths."],"tags":["brew","cask","config-validation","missing-field"],"backgroundTag":"missing-required-config-field","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"}