{"record":{"id":"3c700b084417e19c","repo":"jdx/mise","slug":"mas-app-ids-must-be-numeric-adam-ids-e-g-mas-49","errorCode":null,"errorMessage":"mas app IDs must be numeric ADAM IDs (e.g. \"mas:497799835\")","messagePattern":"mas app IDs must be numeric ADAM IDs \\(e\\.g\\. \"mas:497799835\"\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/mod.rs","lineNumber":1575,"sourceCode":"fn is_opaque_package_manager(mgr: &str) -> bool {\n    is_brew_manager(mgr) || mgr == \"mas\"\n}\n\nfn normalize_use_spec_package_name<'a>(mgr: &str, name: &'a str) -> eyre::Result<&'a str> {\n    if mgr == \"mas\"\n        && let Some(name) = name.strip_suffix(\"@latest\")\n    {\n        if name.is_empty() {\n            bail!(\"invalid system package spec: expected '<manager>:<package>[@version]'\");\n        }\n        return Ok(name);\n    }\n    Ok(name)\n}\n\nfn validate_package_name(mgr: &str, name: &str) -> eyre::Result<()> {\n    if mgr == \"mas\" && !packages::mas::is_adam_id(name) {\n        bail!(\"mas app IDs must be numeric ADAM IDs (e.g. \\\"mas:497799835\\\")\");\n    }\n    Ok(())\n}\n\npub(crate) fn brew_taps_from_config(config: &Config) -> IndexMap<String, String> {\n    brew_taps_from_config_files(&config.config_files)\n}\n\nfn brew_taps_from_config_files(config_files: &ConfigMap) -> IndexMap<String, String> {\n    let mut brew_taps: IndexMap<String, String> = IndexMap::new();\n    for cf in config_files.values().rev() {\n        if let Some(sys) = cf.bootstrap_config() {\n            for (tap, url) in sys.brew.taps {\n                brew_taps.insert(tap, url);\n            }\n        }\n    }\n    brew_taps","sourceCodeStart":1557,"sourceCodeEnd":1593,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/mod.rs#L1557-L1593","documentation":"mise validates package names for each system package manager before resolving them. For the macOS App Store 'mas' manager, names must be numeric ADAM IDs (e.g. 497799835), not app names or slugs. validate_package_name in src/system/mod.rs:1575 bails out when packages::mas::is_adam_id(name) returns false.","triggerScenarios":"Declaring a system_packages entry with manager 'mas' whose name is not purely numeric, e.g. name = \"Xcode\" or \"slack\" instead of an ADAM ID; calling the package install/resolve path with validate_package_name(\"mas\", name) where name fails packages::mas::is_adam_id.","commonSituations":"Writing mise.toml [system_packages] with mas = [\"xcode\"] using human-readable app names; copying app names from the Mac App Store UI instead of the numeric ID from the mas CLI; pasting the full 'mas:497799835' form where only the bare ID is expected.","solutions":["Look up the app's numeric ADAM ID (e.g. via `mas search <name>`, or the number in the App Store URL) and use it as the package name","Ensure the name contains only digits, e.g. mas = [\"497799835\"] instead of [\"Xcode\"]","If you meant a Homebrew cask, move the entry to the brew manager instead of mas"],"exampleFix":"// before (mise.toml)\n[system_packages]\nmas = [\"Xcode\"]\n// after\n[system_packages]\nmas = [\"497799835\"]","handlingStrategy":"validation","validationCode":"fn is_valid_mas_id(name: &str) -> bool { !name.is_empty() && name.chars().all(|c| c.is_ascii_digit()) }\n// check every mas entry before writing it to mise.toml","typeGuard":"fn as_mas_adam_id(name: &str) -> Option<&str> {\n    let id = name.strip_prefix(\"mas:\").unwrap_or(name);\n    (!id.is_empty() && id.chars().all(|c| c.is_ascii_digit())).then_some(id)\n}","tryCatchPattern":null,"preventionTips":["Always source mas IDs with `mas search <app>` or the numeric ID in the App Store URL","Keep human-readable app names out of mas package entries; store them as comments","Add a lint in CI that asserts all mas entries match ^[0-9]+$"],"tags":["package-manager","validation","macos","mas"],"backgroundTag":"invalid-identifier-format","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}