Skip to content

fix(lookup): refused lookups say what the Count saw, naming mise tool options - #326

Merged
sweepies merged 2 commits into
mainfrom
fix/lookup-refusal-wording
Nov 14, 2026
Merged

sweepies merged 2 commits into
mainfrom
fix/lookup-refusal-wording

Conversation

@sweepies

@sweepies sweepies commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

The Count's run on his own repository printed lookup failures that read badly. This PR rewrites the whole sentence, not just the fragments.

Before / after

cannot read rust from the registry options on rust in mise.toml that may move where mise installs it from
cannot look up rust where the repository says it comes from: its entry in mise.toml sets `profile`, `components` and `mr_boxington`, which may move where mise installs it from

cannot read forgejo:wvhulle/nu-lint from the registry options on (a name the Count does not repeat) in mise.toml that may move where mise installs it from
cannot look up forgejo:wvhulle/nu-lint where the repository says it comes from: its entry in mise.toml sets `api_url`, which may move where mise installs it from

tool `github:github/gh-actions-lock[bin=gh-actions-lock]` is not looked up: the character `[` is not allowed; tool options in brackets are not read
tool `github:github/gh-actions-lock[bin=gh-actions-lock]` is not looked up: the Count does not pass tool options in brackets to mise, since they can send a backend to another host

Changes

  • Datasource: the message for an unusable registry was cannot read {package} from the registry {value}. Every manager's Registry::Unusable value fills that slot, and most values are descriptions rather than registries: uv --no-index, [tool.uv.sources] in pyproject.toml, no source in Gemfile, the mise reasons. The new sentence is cannot look up {package} where the repository says it comes from: {value}. It reads correctly whether the value is a URL, a setting, a noun phrase or a clause. No recorded registry strings change, so the corpus snapshots and cache keys are untouched.
  • mise: the reason for options on a tool's entry now names the option keys, in backticks, and no longer repeats the tool name. If any key is not plainly a name, it lists none of them and says has options that may move …. The [settings] reason is now a clause: settings in mise.toml may move ….
  • origins::shown now returns Option<&str>. It still repeats only short [A-Za-z0-9._-] text that a repository wrote, so that safety property is kept. Callers now leave the name out (a source, a uv setting in …, a Poetry source without a URL, a setting in .bundle/config) instead of inserting (a name the Count does not repeat).
  • mise policy: a [ is refused with its own message. Other characters say … is not allowed in a tool name.
  • Tests: exact-wording tests for the mise option reasons, using this repository's rust and nu-lint entries plus multi-key, unsafe-key and settings cases. There are also tests for the bracket refusal and the datasource sentence. corpus:snapshot produces no diff. No docs page quoted these strings.

Are the refusals right?

  • rust (profile = "minimal", components = "clippy,rustfmt", mr_boxington = true): refusing this entry is correct, because mr_boxington is not an option mise's rust core plugin knows, and fail-closed applies. However, profile, components and targets cannot move the install source. mise's RustOptions (src/plugins/core/rust.rs) only passes them to rustup toolchain install as install arguments; the dist server comes from RUSTUP_DIST_SERVER. On their own they should not fail the lookup. Follow-up: allow-list profile, components and targets for the rust core tool.
  • forgejo:wvhulle/nu-lint (api_url = "https://codeberg.org/api/v1"): api_url is exactly the option that moves the source, so refusing is correct in general. Here, though, the value equals the forgejo backend's documented default (https://codeberg.org/api/v1), so the effective source does not change. Follow-up (optional): treat an api_url equal to the backend's default as absent. The comparison must be exact.
  • github:…[bin=gh-actions-lock]: per mise's github backend docs, bin only names the executable of a single-binary download and cannot change the host. Ignoring it would be safe. That is not true of all bracket options: api_url moves the host, and version_prefix, matching and friends change what ls-remote lists or which asset is picked. Follow-up: strip an allow-list of bracket options that cannot change the source or the version listing (bin, rename_exe) before check, and refuse everything else. This PR does not change the policy.

View guided diff Turn on auto-fix

… options

The datasource's 'cannot read X from the registry Y' read badly whenever Y
was a reason rather than a registry URL. It is now 'cannot look up X where
the repository says it comes from: Y', which reads with a URL, a setting or
a clause. mise names the options on a tool's entry that fail its lookup,
drops the repeated tool name, and refuses bracketed tool options for what
they are. A name the Count will not repeat is left out of the sentence
instead of replaced by a placeholder.
@sweepies
sweepies merged commit 3c6b2cc into main Nov 14, 2026
12 checks passed
@sweepies
sweepies deleted the fix/lookup-refusal-wording branch November 14, 2026 19:40
@sweepies-ops sweepies-ops Bot mentioned this pull request Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant