#13678·mise

Install layout: full-named, hash-addressed installs, and verifying cached installs

Author: jdxCreated Sep 26, 2026Updated Sep 30, 2026

TL;DR

mise keeps one folder per tool version, like installs/node/20.0.0. That's too coarse. It can't tell a glibc build from a musl one, or which backend installed a tool, so mise can't check an existing install against your lockfile without two projects overwriting each other's install.

The plan is to name each install folder after the tool plus a short hash of exactly what was installed, like installs/age-3f9a1c2e7b40, and keep the familiar version paths working as links. Once that's in place, mise install can start checking existing installs against the lockfile, which is what protects against a poisoned CI cache.

It all ships in one release, behind a setting, opt-in first.

Summary

mise installs tools into installs/<short>/<version>. That path can't say which backend made an install or which locked artifact it came from, and this now matters for two reasons:

  1. Backend identity. Registry moves, version-split tools, and shorthand-versus-explicit installs all resolve to the wrong directory or to two directories (see Current problems).
  2. Cached installs aren't checked against mise.lock. A couple of users have pointed out that an existing install is used without checking it against the lockfile, so a poisoned cache (for example a CI cache restoring ~/.local/share/mise) is trusted. This isn't a major vulnerability, since an attacker first needs a way to write to your cache. I'd still like to close the gap.

The second one can't be fixed on the current layout. Two lockfiles can disagree on the same [email protected] (glibc versus musl, different options), and one directory per version can only hold one of them. Checking against the lockfile would make two projects reinstall over each other.

Current problems

Every non-core install lives in installs/<short>/<version>, and which backend installed a tool is recorded once per tool, in installs/<short>/.mise.backend.toml. That causes three problems:

  1. Registry backend switches reinterpret existing installs. When the registry moves a tool to another backend, mise reads the versions already on disk with the new backend. If the layouts differ, the tool disappears from PATH, and mise install still considers it installed. jdx/mise#11397 added a fallback for one case of this. Moving yarn from vfox to aqua reproduces it: yarn 1.22.22 and 4.18.1 installed through vfox give yarn: command not found after the switch.
  2. Version-split tools mix backends in one directory. With registry min_version/max_version (hk today, yarn next), one installs/<short>/ holds versions from several backends, but it has a single .mise.backend.toml (the last install wins). Code that walks installed versions (reshim, ls, prune) pairs every version with one backend. With yarn this computed aqua-berry bin paths for a v1 install, and a shared bin-path cache entry left yarn off PATH.
  3. Shorthands and explicit backends don't share installs. [email protected] and aqua:yarnpkg/[email protected] are two separate downloads in two directories, with separate locks.

Proposal

Installs move to a flat layout, installs/<name>-<hash>/, in one release. An integrity check on mise install follows.

installs/age-3f9a1c2e7b40/       # `age` and `aqua:FiloSottile/age` share this
installs/hk-51c0d9a4e8b2/        # hk 1.57.0, from aqua
installs/hk-9be2407f13aa/        # hk 1.58.1, from Packslip
installs/node-c7d2e91a05f3/      # node 20.0.0, glibc
installs/node-4a6b8e3d1c92/      # node 20.0.0, musl

The hash

Each install directory gets a 12-hex-character hash of the full backend name, the version, the platform, and the options that change the artifact (a github asset_pattern, for example). Variants that differ in any of those get different directories and can coexist, including core tools: the glibc-versus-musl node above is the motivating case. Shorthand and explicit installs that resolve to the same backend name share a directory.

The hash comes from config and platform, so mise lock and mise prune can compute it for any platform and any tracked project, and every backend is treated the same way. The locked artifact checksum is deliberately not an input: a lockfile update or a re-released artifact would change the directory, force a reinstall of identical bytes, orphan the old directory, and break anything that embedded the old path. A re-released artifact under the same inputs is what the integrity check below is for.

The name

The <name> part is a label so that ls installs/ and error messages say what a directory is. The hash carries the identity, so the label is cosmetic. It is derived from the backend identifier, not the registry shorthand, so adding a shorthand to the registry later never moves an existing install.

The rule:

  1. Drop the backend prefix, any [options], a trailing @version, and a trailing .git.
  2. Take the last path segment, skipping Go major-version segments like v2.
  3. Drop a leading @ from npm scopes, lowercase it, replace characters outside [a-z0-9._-] with -, and cap it at 24 characters.
Backend identifier Name
aqua:FiloSottile/age age
core:node node
aqua:yarnpkg/berry berry
go:github.com/slsa-framework/slsa-verifier/v2/cli/slsa-verifier slsa-verifier
go:github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen oapi-codegen
npm:@yarnpkg/cli-dist cli-dist

Some labels are less helpful than the registry shorthand (berry for yarn, cli-dist). The shorthand stays available as the version-link directory (below). The rule is fixed once shipped, because changing it would change every path.

Integrity check on mise install

This is what closes the poisoning gap. The hash alone doesn't, because the path is predictable and an attacker can write to it. On mise install only, mise would verify an existing install against an integrity record and reinstall on a mismatch. Shims, mise x, and mise run would keep trusting what is on disk. Which backends can support this, and what the record is (a tree digest filled in by the first install on each platform, or a re-extract-and-compare against the locked artifact), are open questions. Source-built and mutating backends likely won't be covered at first.

Why two hashes

Identity hash Integrity hash
Answers Which variant is this? Are these the bytes I expect?
Lives in The directory name mise.lock or alongside it
Available at mise lock time Yes, for any platform No, only after an install on that platform
Covers Every backend Only backends with a stable tree

The identity hash can ship without the integrity hash, and the integrity hash can arrive later without another path change.

Version links

The versioned paths are part of mise's UI, and people hardcode them. They keep working as links:

  • installs/<short>/<version> -> ../<name>-<hash>, where <short> is the registry shorthand, as today. This works inside a legacy directory that is still a real directory, so a version installed after the switch also appears at the old path.

Each link points at one variant, and the most recent install wins. Version-split tools need nothing special, because each version link points at the backend that installed it.

mise never reads through these links. Installs are found by real directories and their receipts, and a link is recognised by pointing at a <name>-<hash> sibling directory, which tells it apart from the runtime symlinks (latest, 20) that point at a sibling version. That avoids the problems of links that mise reads through: mise ls "(symlink)" status, outdated skipping linked versions, and remove_all removing only the link.

  • Windows: junctions (absolute targets), or skip links.
  • System install dirs: the publish helper rejects relative .. links, so use absolute targets or skip.

Existing installs

There is no migration job in the first release. Nothing on disk moves:

  • Legacy installs/<short>/<version> directories are read in place as long as the backend recorded there is still the one the tool resolves to. If the registry has since moved the tool, mise installs afresh from the current backend instead of reading an install that backend didn't make.
  • Not renaming keeps absolute paths working, including the ones pipx, gem and aube installs embed, and it keeps an older mise working against the same data dir.
  • The whole layout change is gated by the rollout setting below.
  • Reclaiming or relocating old directories is a separate, explicit step (a flag or command, not plain mise prune). Until then a tool can exist under both layouts, which costs disk for large tools.
  • Read-only shared and system install dirs are never touched.

Downgrading: an older mise sees installs/<name>-<hash>/ as an unknown directory and the legacy directories as before. Nothing breaks.

Windows

MAX_PATH has been a recurring Windows problem in mise (aqua lock-time downloads, the self-update helper), and it fails quietly: with a 200-character cache dir, mise install and mise lock still exit 0.

Relative path length under the installs directory, over the 1,177 non-plugin registry backends with 8-character versions:

median p95 max
Today, <short>\<version> 15 24 37
<name>-<12 hex> 20 28 37

The layout is about 5 characters longer at the median. To win some back, the default installs directory on Windows would use a shorter name than installs (for example i), saving about 7 characters. MISE_INSTALLS_DIR still overrides it. Legacy and new directories can share one directory, because <name>-<hash> names can't clash with legacy <short> names.

The bigger cost is the base directory (C:\Users\<name>\AppData\Local\mise, about 34 characters), which this doesn't change.

Pruning

Prune works at tool-and-version granularity today: tracked configs say which versions are needed, and everything else is uninstalled. With hashed directories:

  • The unit becomes (tool, version, variant). Each tracked config resolves to an identity hash and the installed set is compared against those hashes. Because the hash doesn't include the lockfile checksum, prune stays config-driven and doesn't need to read every tracked project's lockfile.
  • Each directory has a receipt recording the backend name, version, options, and platform, for mise ls, prune, and reshim, since <name>-<hash> can't be decoded. Listing one tool's versions means reading receipts, so mise may need an index alongside them (the consolidated .mise-installs.toml already exists for this kind of metadata). A poisoned cache can rewrite a receipt, but it only affects listing and pruning, never verification.
  • Links follow variants. Pruning a variant removes the version links that point at it, and retargets a link to a surviving variant of the same version when there is one. Deletion goes by the real path from the receipt and never through a link. Rebuilding links can ride on the rebuild that already runs after prune.
  • Legacy directories are not prunable by default (see Existing installs), even though a configured version in the new layout makes them "unneeded".
  • Output. mise ls --prunable and the confirmation prompt can show the same version twice, so they need to show the variant, not just the version.

Compatibility and rollout

The versioned paths are part of mise's UI, so I want to get this right and only change them once.

  • One release for all path changes, behind a setting (name TBD, e.g. install_layout = "legacy" | "hashed").
  • Rollout: opt-in first, then the default flips with a deprecation warning for legacy, then legacy is removed. Dates are TBD and follow the deprecation policy.
  • Old installs stay where they are (see Existing installs).
  • Compatibility links keep installs/<short>/<version> working (see Version links). A link can point at only one variant when several exist, which is no worse than today, where the path can hold only one. The current workaround for variants is aliases, which keep their own directories.

Known problems

  • The version link is shared mutable state. Which variant installs/node/20.0.0 points at depends on which project installed last, so a hardcoded path can flip between glibc and musl. mise where has to choose between the stable link and the accurate hash directory.
  • Options classification. Some options change what is installed (asset_pattern, rename_exe) and some don't (postinstall, env). A wrong call causes duplicate installs or collisions. jdx/mise#13668's mismatch detection already encodes part of this.
  • Symlink resolution bakes in the real path. Tools that resolve symlinks will embed the <name>-<hash> directory in venvs, shebangs, pipx installs, and IDE SDK registrations. That's the other reason the hash has to stay stable. Core tools move too, so venvs and shebangs created after opting in point at new paths.
  • Versions aren't visible in paths. ls installs/ shows tool names but not versions, and realpath-resolving tools show a hash. Receipts and links carry that information instead.
  • The security payoff comes last. The layout change stands on its own for variant coexistence. The poisoning fix depends on the integrity record, which can't be computed at mise lock time, covers only some backends, and runs only on mise install. The hash alone only catches stale or wrong-variant caches, not an attacker writing to a predictable path.
  • Disk. Legacy and new layouts coexist during the transition, and variants multiply installs, which costs real space for large tools.
  • Links where links can't exist: Windows without symlink privileges, read-only shared or system dirs, and caches restored to a different home when targets are absolute.

Open questions

  • Should the new layout be opt-in first, or default-on sooner?
  • Downloads and cache directories: key them by the same <name>-<hash>, or by the full backend name, which shares downloads across variants but makes paths longer?
  • Options that change the artifact: the hash covers them, since they're hash inputs. Whether #13668's install-option mismatch detection is still needed alongside it is open.
  • mise backends switch: it becomes an install into another directory plus a lockfile update, and the old version stays until pruned.
  • OCI image builder and --shared/--system installs compute installs/<tool_dir_name>/<v> themselves (src/oci/builder.rs, src/toolset/toolset_install.rs). They need to use the same resolver.
  • The Windows directory name (i is a placeholder).

Plan

  1. Refactor: route every install, cache and download path through one resolver keyed by the resolved backend, with no behavior change. This covers ToolVersion::install_path, ToolRequest::install_path, and the duplicates in the http backend, pipx, the OCI builder, --shared/--system, and lockfile sidecars.
  2. New installs go to <name>-<hash> directories behind the rollout setting, with receipts. Readers understand both layouts. jdx/mise#13693 moves onto this layout.
  3. Version links, and prune, ls, and reshim working from receipts.
  4. The shorter default installs directory on Windows.
  5. Verification of existing installs on mise install, for backends where it is possible.
  6. yarn: aqua for v1 (max_version = "2.0.0") and berry (min_version = "2.0.0"), using jdx/mise#13676.

AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5; version: unavailable.

AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: 2.1.284.