AGENTS.md instructions for /Users/jdx/.codex/worktrees/4ee0/mise
Create GitHub pull requests ready for review. Never create draft pull requests unless the user explicitly requests a draft.
--- project-doc ---
Repository Agent Guide
This file provides guidance to AI coding agents when working with code in this repository. It keeps the CLAUDE.md filename for compatibility with existing tooling, and AGENTS.md symlinks to it for other agents.
Registry Submissions: READ THIS FIRST
Most registry PRs from agents get rejected. Before adding anything to registry/, understand the rules:
mise does not host self-written, personal, niche, or low-popularity tools. The registry is curated for tools that are already widely used. "It works" or "it has tests" is not the bar.
Tools that aren't VERY popular will be rejected without explanation. Per contributing.md: "@jdx won't explain why a given tool wasn't accepted." There is no appeal, no checklist, no second chance — the PR is closed and that's it.
Wasted PRs are the default outcome for tools the agent or user has not vetted against this bar. Do not submit one speculatively.
Required pre-submission check
Before touching registry/, ALWAYS do the following:
Ask the user: "Is this tool already widely used outside your own projects?" — if it's the user's own tool, a fork, an internal/company tool, or something with a small audience, stop and tell them the PR will be rejected. Do not submit.
Actively check popularity for every registry PR — no exceptions. Look up real numbers; do not guess. Useful sources:
Whether the project shows up in third-party docs, awesome-lists, or other tools
Apply the bar. Rough signals — very low numbers are disqualifying:
GitHub stars in the thousands, not hundreds
Active maintenance (recent releases, not abandoned)
Real third-party usage (referenced in docs, blog posts, other tools, package registries)
Recognizable in its ecosystem
Include the popularity data in the PR description. Every registry PR body MUST contain a short section like:
code
## Popularity
- GitHub: 12.3k stars, 480 forks, last release 2026-04-12
- crates.io: 1.2M downloads
- Used by: <project A>, <project B>
This is non-negotiable — it lets the maintainer evaluate the submission without re-doing the research. PRs without it look speculative and are more likely to be rejected.
If the tool is borderline or numbers are low, warn the user clearly that the PR is likely to be rejected without reason, and ask if they still want to proceed. Do not soften this — users have repeatedly been surprised when their PR was closed, and the agent should have warned them up front.
Suggest the alternative: users can install any tool themselves via explicit backend syntax (mise use aqua:owner/repo, mise use github:owner/repo, mise use cargo:name, mise use npm:name, etc.) or by writing a tool plugin. The registry is only for shorthand convenience for popular tools — not for enabling installation.
Backend choice: aqua (preferred) or github
For registry entries the backend tiers are:
Tier 1 — preferred:aqua:, github:, and gitlab:. These are the routinely accepted backends.
Prefer aqua: when the tool is in the aqua registry. Better UX, SLSA verification, and per-version logic.
Use github: when the tool isn't in aqua but ships GitHub releases.
Use gitlab: for tools released through GitLab.
Tier 2 — high bar, but lower than tier 3:conda:. Potentially acceptable when the tool can't be supported via aqua/github. The bar is lower than tier 3 because the conda backend in mise does not require a separately-installed package manager — mise downloads and extracts packages directly from anaconda.org via rattler, so users don't need conda/mamba on PATH. Still requires a popular, well-maintained tool.
Tier 3 — extremely high bar, almost never accepted:npm:, pipx:, gem:, cargo:, go:, dotnet:. These all rely on a separately-installed runtime/toolchain being present on PATH (node, python, ruby, cargo, go, dotnet), which is fragile — the wrong version, a missing install, or PATH ordering quirks all break them. npm:/pipx:/gem: are particularly painful because tools installed via them silently bind to whichever node/python/ruby was on PATH at install time. Don't reach for these for a registry PR unless the user has explicitly confirmed @jdx wants it that way for this specific tool.
Not accepted at all:
New asdf: plugins — supply-chain security. Use aqua/github instead.
New vfox: plugins — same reason. Use aqua/github instead.
ubi: is deprecated and will not be accepted under any circumstances.
Users can still install via any backend themselves with explicit syntax (mise use vfox:..., mise use cargo:..., etc.) — they just don't get a registry shorthand for it.
Development Commands
Building and Testing
mise run build or mise run b - Build the project with cargo
target/debug/mise - Run the built binary directly
mise run test or mise run t - Run all tests (unit + e2e)
mise run test:unit - Run unit tests only
mise run test:e2e - Run end-to-end tests only
mise run snapshots - Update test snapshots with cargo insta
Debugging
Use MISE_DEBUG=1 or MISE_TRACE=1 environment variables to enable debug output (not RUST_LOG)
Code Quality and Testing
mise run lint - Run all linting tasks
mise run lint-fix - Run linting and automatically fix issues
mise run format - Format code (part of CI task)
mise run ci - Run format, build, and test
mise run test:e2e [test_filename]... - Run specific e2e tests (use this instead of executing test files directly)
mise --cd crates/vfox run test - Run tests for the vfox crate
mise --cd crates/vfox run lint - Run linting for the vfox crate
mise --cd crates/vfox run lint-fix - Run linting and fix issues for the vfox crate
mise task ls - List all available tasks
Documentation and Generation
mise run render - Generate all documentation and completions
mise run render:usage - Generate CLI usage documentation
mise run render:completions - Generate shell completions
mise run docs - Start documentation dev server
mise run docs:build - Build documentation
Development
mise run install-dev - Install development version locally
mise run clean - Clean cargo build artifacts
Code Architecture
High-Level Structure
Mise is a Rust CLI tool that manages development environments, tools, tasks, and environment variables. The codebase follows a modular architecture:
Core Components:
src/main.rs - Entry point and CLI initialization
src/cli/ - Command-line interface implementation with subcommands
src/config/ - Configuration file parsing and management
registry: - Any changes to registry/ (no scope needed, use for both new tools and fixes)
Scopes:
For command-specific changes, use the command name: install, activate, use, exec, etc.
For subsystem changes: config, backend, env, task, vfox, python, github, release, completions, http, schema, doctor, shim, core, deps, ci
Use task (not run) for task-related changes, even if the code lives in src/cli/run.rs or src/cmd.rs
Description Style:
Use lowercase after the colon
Use imperative mood ("add feature" not "added feature")
Keep it concise but descriptive
Examples:
fix(install): resolve version mismatch for previously installed tools
feat(activate): add fish shell support
feat(vfox): add semver Lua module for version sorting
feat(env): add environment caching with module cacheability support
docs(contributing): update hk usages
chore: release 2026.1.6
chore(ci): add FORGEJO_TOKEN for API authentication
registry: add miller
Pre-commit Process
Run hk install --mise once to set up pre-commit hooks (runs hk fix automatically on commit)
Run mise run lint-fix and git add any lint fixes before committing
Use mise run test:e2e [test_filename]... for running specific e2e tests
Never run e2e tests by executing them directly - always use the mise task
Deprecation Policy
When deprecating a feature or backend:
Immediately: Mark as deprecated in docs (add warning banner)
6 months later (warn_at): Display deprecation warning in CLI using deprecated_at! macro from src/output.rs
12 months after warn (remove_at): debug_assert! in deprecated_at! fires, signaling the code should be removed
Use mise version format for dates (e.g., deprecated_at!("2026.10.0", "2027.10.0", "id", "message")).
If the replacement has been available for a long time, the CLI warning can start immediately (set warn_at to the current version).
Important Implementation Notes
Backend System
When implementing new tool backends, follow the pattern in src/backend/mod.rs. Each backend must implement the Backend trait with methods for listing versions, installing tools, and managing tool metadata.
DO NOT ASSUME SEMVER
Do not assume tool versions follow semver or any other orderable scheme. mise manages hundreds of tools with wildly different versioning conventions:
Tool-specific meanings of latest (e.g. some exclude pre-releases, some don't)
Rules:
Do not call versions::Versioning::new(...) (or any other semver comparator) at a new call site to pick the "newest" version, "resolve latest", or sort a version list. That crate silently returns None / arbitrary ordering for non-semver strings, which means wrong versions get chosen for many tools.
To resolve a version request (latest, a prefix, a channel name), delegate to the backend via Backend::latest_version, Backend::latest_installed_version, Backend::list_versions_matching, or ToolRequest::resolve — the backend knows what "latest" means for its tool.
To list installed versions in a meaningful order, use Backend::list_installed_versions_matching or the toolset's resolved versions. Do not reorder them yourself.
Lockfile version strings must be treated as opaque — compare with ==, never with a version ordering. Never write a non-concrete string (latest, lts/*, a prefix) into the lockfile; resolve first.
A few existing call sites (e.g. runtime symlinks) do use Versioning ordering today, but that's legacy behavior and arguably also wrong — do not point at them to justify new semver assumptions.
If you think you need to pick "the newest installed version" at a new call site, stop and ask — that call almost always belongs on the backend, not inline.
Plugin Development
Core tools are implemented in src/plugins/core/
External plugins use ASDF or vfox compatibility layers
Plugin metadata is defined in mise.plugin.toml files
Configuration Parsing
The configuration system supports multiple file formats and environment-specific configs. Changes to settings require updating settings.toml and running mise run render:schema.
Testing Strategy
E2E tests are organized by feature area (cli/, config/, backend/, etc.)
Use snapshot testing for CLI output verification
Backend-specific tests verify tool installation and version management
Slow tests (marked with _slow suffix) test actual tool compilation/installation
Cross-Platform Considerations
Windows-specific implementations in files ending with _windows.rs
Platform-specific tool installation logic in core plugins
Shim system varies by platform (especially Windows)
we don't chmod mise e2e tests to be executable
GitHub Interactions
When posting comments on GitHub PRs or discussions, always include a note that the comment was AI-generated (e.g., "This comment was generated by an AI coding assistant.").
Documentation
URL Structure
When referencing mise documentation URLs, use the correct path structure based on the docs/ directory layout:
Dev tools & backends: mise.en.dev/dev-tools/backends/<backend>.html (e.g., mise.en.dev/dev-tools/backends/s3.html)
Configuration: mise.en.dev/configuration/...
Tasks: mise.en.dev/tasks/...
Environments: mise.en.dev/environments/...
CLI reference: mise.en.dev/cli/...
Do NOT use shortened paths like mise.en.dev/backends/... - always include the full path matching the docs/ directory structure.
I’ll read the discussion and translate the technical points into plain language. I’m using the GitHub workflow because the question is about a specific repository discussion.
Assistant
They’re discussing a safety bug in mise prune.
The config says:
toml
minimum_release_age = "2d"
pnpm = "latest"
At that moment:
pnpm 11.10.0 was old enough, so normal resolution chose it.
pnpm 11.11.0 was newer but still inside the two-day quarantine period.
The problem is that mise prune later performs an offline resolution. Offline, mise knows which versions are installed but not when they were published. It therefore interprets “latest” as the newest installed version (11.11.0), protects that one, and decides the actually selected version (11.10.0) can be deleted.
So prune can effectively say:
“Your configuration currently requires 11.10.0, therefore I’m deleting 11.10.0.”
The hard part is that offline mise cannot reconstruct the right answer:
Version strings cannot reliably be sorted because mise supports many non-semver schemes.
Even perfect version ordering wouldn’t reveal publication dates.
Without registry metadata, it cannot know that 11.11.0 is too young.
They propose two approaches:
Conservative offline pruning: retain every version that might be required and warn the user. Add something like mise prune --remote for precise, network-backed cleanup. Safe, but potentially makes prune ineffective whenever latest or another floating version is configured.
Remember prior resolutions: record that pnpm@latest under the two-day policy resolved to 11.10.0, then use that record during offline pruning. More useful, but substantially more complicated because the cache must be invalidated correctly.
The reply is essentially: “Option 1 is safest, but if floating requests cause us to retain everything, is mise prune still useful?”
My read: the bug is legitimate and potentially destructive. The immediate fix should favor false negatives—leave an unnecessary version installed—over false positives that delete an actively selected version. Precise offline pruning probably requires persisted resolution metadata or lockfile-derived information. (discussion)
User
does mise prune need to be offline?
Assistant
I’ll check the rationale behind the offline behavior and the current prune implementation, because “need” here is a design question rather than a technical requirement. I’m using the GitHub workflow again to trace the linked change.
Assistant
No. More precisely, only the part of mise prune that determines which installed versions are still needed is deliberately forced offline. That was introduced in PR #9406, mainly because registry lookups could hang or slow down pruning.
The reasoning was:
Prune only deletes locally installed versions.
Therefore, local installed-version information should be enough.
A remotely resolved version that isn’t installed cannot be deleted anyway.
That reasoning mostly works for exact versions and ordinary floating requests, but minimum_release_age breaks it. The locally “newest installed” version can differ from the remotely “newest age-eligible” version.
So I’d frame it this way:
mise prune does not inherently need to be offline.
It’s desirable for the default operation to be fast, reliable, and usable without a network.
But it must not pretend offline data is sufficient when policies depend on remote metadata.
The clean behavior would be:
Resolve locally when the answer is unambiguous.
For floating requests involving minimum_release_age, either:
conservatively keep ambiguous versions offline, or
query remotely through an explicit --remote/--accurate mode.
Never delete based on an offline guess.
Making prune always online would fix this particular mismatch, but it would reintroduce the hangs and network dependency that #9406 was intended to eliminate—especially awkward because mise unuse also invokes pruning. The best design is probably safe offline by default, precise online optionally.
User
i'm a little confused, why does prune need the internet?
Assistant
Prune doesn’t need the internet to delete anything. It may need the internet to determine which installed version is still required.
But this config is a question, not an exact answer:
toml
pnpm = "latest"
minimum_release_age = "2d"
Suppose both 11.10.0 and 11.11.0 are installed. To know which one “latest” currently means, mise must know when each was published:
11.10.0: old enough → required
11.11.0: published yesterday → excluded
Those publication timestamps normally come from the remote registry. Offline, prune may only see:
text
11.10.0
11.11.0
It can’t tell which is old enough. That’s the only reason internet access enters the picture: not for pruning itself, but for resolving a floating configuration accurately.
Alternatively, mise could avoid the internet by remembering the previously resolved concrete version in a lockfile/cache, or safely retaining both when uncertain.
User
i would think "latest" would always be 11.11.0, why would it be 11.10.0? if they've installed it min_release_age should not be involved in this, latest should be latest installed despite that
Assistant
That’s the key semantic question. I’m going to trace where minimum_release_age is intentionally applied versus where an already-installed version short-circuits resolution; the bug report may be assuming a policy that mise doesn’t actually promise.
Assistant
Yes—I think your interpretation is more coherent.
minimum_release_age should constrain selecting a version to install, not make an already-installed version ineligible forever.
In the example:
pnpm = "latest" initially installs 11.10.0 because 11.11.0 is too new.
The user explicitly runs mise install pnpm@11.11.0.
That explicit install bypasses the fuzzy-version age filter, so the user has intentionally accepted 11.11.0.
From then on, the latest installed version is 11.11.0.
Prune can reasonably keep 11.11.0 and remove unused 11.10.0.
The discussion assumes a different meaning:
An explicit minimum_release_age continuously changes what latest means, including among already-installed versions.
That’s why they call 11.10.0 “the required version.” But the documentation describes the setting as preventing installation of newly published versions, and common runtime commands already prefer installed versions. Under that model, 11.11.0 should be active once explicitly installed.
There is a real inconsistency in the current resolver: online resolution with an explicitly configured cutoff can ignore installed versions and select the older age-eligible release, while offline/prefer-offline resolution selects the latest installed release. But I’d say the questionable behavior is the online resolver reverting to 11.10.0, not prune retaining 11.11.0.
So the likely resolution to #10944 is: this isn’t a prune safety bug if minimum_release_age is an installation gate. The semantics need clarification, and normal online resolution probably shouldn’t filter versions that are already installed.
User
ok what should we do?
Assistant
I’d resolve this as a semantics correction, not add network access to prune. I’m checking the command-specific resolver options so the change can preserve date-aware behavior for lock, upgrade, and remote listing while treating installed versions consistently.
Assistant
I’d reject the premise of #10944 and keep prune offline.
The intended invariant should be:
minimum_release_age filters remote versions before installation. It does not disqualify versions already installed.
Therefore, in the reproduction:
11.10.0 was initially selected because it was the newest eligible remote release.
The user explicitly installed 11.11.0, bypassing the cutoff.
latest should then resolve to the latest installed version, 11.11.0.
Pruning 11.10.0 is correct if nothing pins it.
What I’d do:
Reply to the discussion explaining that 11.10.0 is not required after 11.11.0 has been explicitly installed.
Close #10944 as not a prune bug.
Open/fix the actual inconsistency: normal online resolution with an explicit minimum_release_age currently suppresses the installed-version fast path and can resolve back to 11.10.0. That behavior was deliberately retained in #10315, but it conflicts with the installation-gate interpretation.
Add an explicit documentation sentence and regression test:
Already-installed versions are not filtered by minimum_release_age; the setting only limits new version selection from remote sources.
The code should preserve date-aware remote resolution for commands that intentionally discover versions—upgrade, latest, ls-remote, and lock generation—but ordinary toolset resolution and prune should prefer installed matches regardless of release age.
A concise discussion response could be:
I don’t think 11.10.0 should remain protected here. minimum_release_age limits which remote release mise selects for installation; it does not make an explicitly installed version ineligible. Once 11.11.0 has been explicitly installed, latest should resolve to the latest installed version, so pruning 11.10.0 is expected. The inconsistent part is the normal online resolution selecting 11.10.0; we should address that separately and clarify the setting’s semantics.
This comment was generated by an AI coding assistant.
User
make a pr, reply to discussion
Assistant
I’ll implement the resolver semantic explicitly, add regression coverage and documentation, then create a ready-for-review PR and reply to #10944 with the PR link and the required AI-generated note. I’m using the GitHub publish workflow because this includes committing, pushing, opening a PR, and posting externally.
User
before you reply, are we sure this isn't going to regress the perf fix that 10315 had?
Assistant
Yes. This should preserve—and slightly broaden—the #10315 performance fix.
#10315 made the built-in default cutoff use installed-version fast paths. Explicit cutoffs still disabled those paths and triggered remote resolution.
The proposed change would make both default and explicit cutoffs behave like this during ordinary tool resolution:
text
installed match exists → resolve locally
no installed match → query remotely and apply minimum_release_age
That means fewer network calls, not more.
Commands that intentionally request fresh version discovery remain unaffected because they set ResolveOptions.latest_versions = true, which already bypasses installed fast paths:
mise upgrade
installation’s final version-selection pass
date-aware lock resolution
mise latest / mise ls-remote through their dedicated paths
The important regression tests are:
ordinary resolution with an explicit cutoff uses the latest installed match without fetching;
no installed match still performs date-filtered remote resolution;
upgrade and lock still perform date-aware remote resolution;
prune retains the latest installed version.
I have not replied to the discussion or published anything yet.
User
ok continue
Assistant
I’ll proceed with the narrow change: ordinary resolution always accepts installed matches, while latest_versions callers retain fresh/date-aware discovery. I’ll validate the no-installed-match, upgrade, and lock paths before publishing or replying.
Assistant
The narrow regression test is building now. The code path removes only the explicit-cutoff veto on installed matches; latest_versions behavior remains unchanged for fresh discovery.
Assistant
The new regression and the #10315/#10595 performance regressions pass. The broader lock and release-age suites are running now to confirm fresh date-aware discovery is unchanged.
Assistant
The lock suite caught the exact boundary we wanted: lock generation intentionally re-resolves fuzzy requests against release metadata. I’m scoping that behavior to lock via an explicit resolver option, instead of restoring the global behavior that caused the inconsistency.
Assistant
The focused behavior, prune result, lock cutoff behavior, npm date filtering, and lint/format checks are green. I’m running the full unit suite before publishing.
Assistant
All 1,668 unit tests pass, along with the focused E2E coverage and lint/format checks. The lock-specific resolver option preserved date-aware lock generation while ordinary resolution and prune stay local. I’m publishing the ready-for-review PR now.
I’ll inspect unresolved review feedback and failing checks on PR #10973, then implement and verify the actionable fixes. I’m using the GitHub review-feedback workflow first, followed by the CI-debugging workflow, because both were explicitly requested.
Assistant
There is one actionable unresolved thread: lock’s non-monorepo cached toolset can bypass the new lock-only date filter. The bundled CI inspector currently reports no failing GitHub Actions checks, so I’m verifying the full check matrix directly before changing code.
Assistant
The review finding is valid and fixed locally: non-monorepo lock generation now rebuilds with lock-specific resolve options, and the regression test installs the excluded newer version before testing global and per-tool cutoffs. The exact lock E2E test, prune/resolution regression, and lint suite pass.
Assistant
I found two remaining review points: tighten the security-doc wording around lockfile behavior, and make the regression test also catch latest-stable network lookups. I’m applying both, then I’ll rerun the focused test and lint before pushing and resolving the threads.
Assistant
The strengthened regression test passes: ordinary resolution uses installed versions without invoking either remote-version hook, while prune still identifies the older install correctly. I’m running the repository’s full lint/fix gate now.
Assistant
Both requested changes are now committed and pushed as ff44ad595. Next I’m replying to the two review comments, resolving their threads, and checking the fresh CI run for any actual failures.
Assistant
All review threads are resolved, and the review scan now reports zero unresolved comments. GitHub currently reports no failing checks; the new push restarted the macOS, Windows, docs, benchmark, and Ubuntu jobs, so those are still pending rather than failing.
I’m using the GitHub review-feedback workflow first, then the CI-failure workflow. I’ll re-scan the current PR state, fix only newly actionable findings, validate, push, and resolve the corresponding threads.
Assistant
The fresh scan is clean: zero unresolved review threads and zero failing checks. All completed build, E2E, unit, docs, and bot checks pass; only benchmark, lint, and Windows E2E are still running, so I’m watching those final jobs before handing this back.
All completed build, unit, E2E, docs, and bot checks pass.
Benchmark, lint, and Windows E2E remain in progress.
No new changes were necessary; the worktree remains clean.
User
what about the greptile stufff?
Assistant
You’re right to call that out—the unresolved-thread scan can miss top-level Greptile review output. I’m checking all PR reviews, issue comments, and inline comments specifically for Greptile now.
Assistant
I found it. Greptile posted two P2 inline comments after my earlier scan:
Question whether the test’s spy/latest/bin expectation is genuinely exercising installed resolution.
A real performance concern: mise lock now rebuilds the toolset even when no release-age cutoff exists.
The second point overlaps your earlier concern about preserving the #10315 performance work. I’m tracing the effective-cutoff path now so we can restore the cached fast path without reintroducing the lock bug.
Assistant
Both findings are useful, but the first is clarification rather than a bug: bin-paths intentionally returns the fuzzy request’s runtime symlink (latest/bin), while the resolved current version is concrete. I’ll make that explicit in the test with a mise current spy == 2.0.0 assertion.
For the performance point, I’ll restore config.get_toolset() when there is no CLI, global, or per-tool release-age policy. Lock will rebuild only when an explicit cutoff requires rechecking installed fuzzy matches.
Assistant
The focused tests pass. They confirm both points: resolution is concretely 2.0.0 while bin-paths intentionally reports latest/bin, and lock still honors CLI, global, and per-tool cutoffs after restoring the no-policy cached path. I’m running lint now, then I’ll push and answer both Greptile threads.
Assistant
The Greptile threads auto-resolved when the fixing commit landed, but I’m still posting explicit explanations so the review record is clear—especially that latest/bin is intentional and that the cached no-cutoff lock path is restored.
Assistant
You were right—I’d missed two newer Greptile P2 comments because they arrived after the earlier scan.
Addressed in 02b677e0a:
Restored the cached mise lock path when no CLI, global, or per-tool release-age cutoff exists, preserving the performance behavior.
Confirmed the test resolves concretely to 2.0.0; bin-paths intentionally exposes the latest/bin runtime symlink.
Replied to both Greptile threads with the required AI disclosure.