{"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":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/system/mod.rs","lineNumber":1884,"sourceCode":"\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 == \"nix\" {\n        packages::nix::Installable::parse(name)?;\n    }\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\n/// Collect export declarations before manager validation can warn and skip an\n/// invalid entry. Export must either represent the entire selection or fail.\npub(crate) fn nix_packages_for_export(config: &Config) -> Vec<(String, PackageTomlConfig)> {\n    let environments = &crate::env::MISE_ENV_WITH_AUTO;\n    package_configs_from_config_files(&config.config_files)\n        .into_iter()\n        .filter(|(spec, package)| {\n            spec.starts_with(\"nix:\")\n                && package.is_os_supported()\n                && package.is_env_supported(environments)\n                && package.desired() == packages::PackageDesiredState::Present\n        })\n        .collect()\n}","sourceCodeStart":1866,"sourceCodeEnd":1902,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/mod.rs#L1866-L1902","documentation":"validate_package_name checks the `mas` (Mac App Store) manager specially: package names must be numeric ADAM IDs such as 497799835. The given name is not numeric (possibly an app name), so the spec is rejected before any mas invocation.","triggerScenarios":"Calling bootstrap packages with a mas spec whose package name fails packages::mas::is_adam_id, e.g. 'mas:xcode' or 'mas:497799835@latest' handled elsewhere.","commonSituations":"Using an app name instead of its ADAM ID in bootstrap packages config; copying an App Store URL slug; mistyping digits (letters in the ID).","solutions":["Look up the app's numeric ADAM ID (e.g. via the App Store URL or a search tool) and use it: mas:497799835","Remove non-numeric characters from the mas package name","Switch to a different manager (brew) if you need name-based installs"],"exampleFix":"// before\npackages = [\"mas:xcode\"]\n// after\npackages = [\"mas:497799835\"]","handlingStrategy":"validation","validationCode":"const isAdamId = (name) => /^\\d+$/.test(name);","typeGuard":"const isAdamId = (name) => typeof name === \"string\" && /^\\d+$/.test(name);","tryCatchPattern":null,"preventionTips":["Store mas entries as numeric ADAM IDs, not app names","Extract the ID from the App Store URL digits","Regex-check ^\\d+$ before adding mas entries","Use brew for name-based installs instead"],"tags":["cli","system-packages","mas","validation"],"backgroundTag":"invalid-identifier-format","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"}