{"record":{"id":"06323c20c11884d2","repo":"jdx/mise","slug":"tap-formula-name-mismatch-requested-name-ext","errorCode":null,"errorMessage":"tap formula name mismatch: requested '{name}', extracted '{}'","messagePattern":"tap formula name mismatch: requested '(.+?)', extracted '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/tap.rs","lineNumber":96,"sourceCode":"            (\"MISE_BREW_SOURCE_PATH\", source_path.clone()),\n            (\"MISE_BREW_SOURCE_CHECKSUM\", checksum),\n            (\"MISE_BREW_TAP_COMMIT\", tap_source.commit),\n            (\"MISE_BREW_MACOS_VERSION\", macos_version()),\n            (\"MISE_BREW_OS\", std::env::consts::OS.to_string()),\n            (\"MISE_BREW_ARCH\", std::env::consts::ARCH.to_string()),\n        ])\n        .with_timeout(METADATA_TIMEOUT)\n        .with_sandbox(metadata_sandbox()?);\n    runner.apply_sandbox().await?;\n    let output = runner\n        .read_bounded(METADATA_MAX_OUTPUT_BYTES)\n        .await\n        .wrap_err_with(|| format!(\"failed to evaluate {source_path}\"))?;\n\n    let formula: Formula = serde_json::from_str(&output)\n        .wrap_err_with(|| format!(\"invalid metadata extracted from {source_path}\"))?;\n    if formula.name != name {\n        bail!(\n            \"tap formula name mismatch: requested '{name}', extracted '{}'\",\n            formula.name\n        );\n    }\n    Ok(formula)\n}\n\npub(super) async fn cask_from_ruby(\n    owner: &str,\n    tap: &str,\n    token: &str,\n    tap_url: Option<&str>,\n    provision_ruby: bool,\n) -> Result<Cask> {\n    validate_name(token)?;\n    let tap_source = resolve_tap_source(owner, tap, tap_url).await?;\n    let (source, source_path) = fetch_ruby_source(&tap_source.raw_base, \"Casks\", token).await?;\n    let checksum = crate::hash::hash_sha256_to_str(&source);","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/tap.rs#L78-L114","documentation":"After evaluating a tap formula's Ruby definition, mise cross-checks that the name in the extracted metadata equals the formula name that was requested. A mismatch means the API snapshot, source path, and requested name are inconsistent — likely a wrong or stale metadata mapping — so mise returns the formula rather than proceeding with the wrong package.","triggerScenarios":"`formula_from_ruby` parses the JSON emitted by Ruby evaluation and `formula.name != name`, e.g. requesting `foo` while the .rb at ruby_source_path defines `bar`, or the tap renamed the formula and the metadata cache is stale.","commonSituations":"Formula renamed upstream in a third-party tap with cached metadata pointing to the old path; aliased formulas where an alias resolves to a differently-named definition; hand-edited metadata files.","solutions":["Clear the tap/metadata cache and re-fetch the current formula definitions","Request the formula by its canonical name instead of an alias or old name","Re-pull the tap so ruby_source_path points to the renamed .rb file","If a third-party tap is internally inconsistent, report/fix the formula naming in the tap"],"exampleFix":"// before: mise.toml\n\"brew:old-name\" = \"1.0\"  # renamed upstream to new-name\n// after\n\"brew:new-name\" = \"1.0\"","handlingStrategy":"validation","validationCode":"if extracted.name != requested_name {\n    eprintln!(\"tap metadata inconsistent; refetch tap\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clear tap metadata cache after upstream formula renames","Use canonical formula names, not aliases","Keep third-party taps pulled up to date"],"tags":["homebrew","tap","naming-mismatch"],"backgroundTag":"unexpected-api-response-shape","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}