jdx/mise · warning · eyre::Report

app target is outside an allowed Applications directory

Error message

app target is outside an allowed Applications directory: {}

What it means

For each app path in the receipt, the prune validator requires all of: the target record's fingerprint kind is Directory, the path lies below one of the allowed appdir roots (standard Applications directories such as /Applications and ~/Applications via allowed_appdir_roots), and the installed bundle still matches the staged copy inside the Caskroom version directory (staged_app_matches_target). Failing any one refuses the prune — the app is somewhere it must not be or no longer matches what was installed.

Solutions

  1. If the app self-updated, reinstall the cask (mise install) to refresh fingerprints, then prune — or keep it and accept the skip.
  2. Move the app back under an allowed Applications root at its original path, then retry the prune.
  3. If you intentionally keep apps outside standard roots, uninstall that cask manually instead of pruning it.
Defensive patterns

Strategy: validation

Validate before calling

// Verify each recorded app sits under an allowed Applications root before pruning
fn app_in_allowed_root(path: &Path, roots: &[PathBuf]) -> bool {
    roots.iter().any(|root| {
        path.strip_prefix(root).is_ok_and(|rel| rel.components().next().is_some())
    })
}

Try / catch

Use `if let Err(reason) = validate_cask_prune_candidate(&candidate)` to skip-and-report; never bypass the validator to force deletion of a moved app.

Prevention

When it happens

Trigger: The user moved the .app out of an allowed Applications root (e.g. to ~/MyApps or another volume); the app self-updated so its fingerprint differs from the staged Caskroom copy; the record's kind is not Directory; the staged copy in the Caskroom version dir was deleted or modified.

Common situations: Self-updating apps (browsers, IDEs, Electron apps) whose bundles change after install; users reorganizing /Applications; custom HOMEBREW_PREFIX setups with non-standard app dirs.

Related errors


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/6a0babd9253e108d. Report an issue: GitHub.

Appendix: source

Thrown at src/system/packages/brew/cask.rs:7301

        bail!("receipt target inventory is incomplete or duplicated");
    }
    if records.keys().any(|path| !expected.contains(path)) {
        bail!("receipt target inventory contains an unclassified path");
    }

    for path in &receipt.apps {
        let record = records
            .get(path)
            .ok_or_else(|| eyre!("missing app target record"))?;
        if record.fingerprint.kind != CaskTargetKind::Directory
            || !allowed_appdir_roots()?
                .iter()
                .any(|root| path_is_below(path, root))
            || !path.file_name().is_some_and(|name| {
                staged_app_matches_target(record, &candidate.version_dir.join(name))
            })
        {
            bail!(
                "app target is outside an allowed Applications directory: {}",
                path.display()
            );
        }
    }
    for path in &receipt.binaries {
        let record = records
            .get(path)
            .ok_or_else(|| eyre!("missing binary target record"))?;
        if record.fingerprint.kind != CaskTargetKind::Symlink
            || !allowed_binary_target_roots()
                .iter()
                .any(|root| path_is_below(path, root))
            || !symlink_resolves_below(path, &candidate.version_dir)
        {
            bail!(
                "binary target is not an owned Caskroom symlink: {}",
                path.display()

View on GitHub (pinned to 6f52dcdf99)