Skip to content

fix(toolchain): scope the active view to projects that declare one - #257

Open
saimeunt wants to merge 1 commit into
0xMiden:nextfrom
walnuthq:fix-active-view-without-toolchain-file
Open

fix(toolchain): scope the active view to projects that declare one#257
saimeunt wants to merge 1 commit into
0xMiden:nextfrom
walnuthq:fix-active-view-without-toolchain-file

Conversation

@saimeunt

@saimeunt saimeunt commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

A component installed with midenup install <channel> --component <name> was invisible to
dispatch unless a miden-toolchain.toml happened to name it. It was missing from
miden help toolchain, and running it went through the outside-the-view fallback, warning
that it was not part of the toolchain it had deliberately been installed into.

ensure_current_is_installed narrowed the view by an intent built from whatever toolchain it
resolved. Only a toolchain file carries a request, though: Toolchain::current synthesizes an
empty components and profile for the requested, override and default justifications, so that
intent resolved to the minimal profile — and a component installed with --component belongs
to no profile, which is the whole reason it has to be named.

Section 8.5 defines the active view as this project's request, so where there is no project
file there is nothing to narrow by and there is no view: dispatch works against the installed
set. That also keeps a superset-only alias conflict a warning rather than promoting it to an
error, which is what the same section asks for. The intent itself is untouched, so what gets
installed does not move.

Reproduced on the 0.16.0 toolchain with local-registry, which belongs to no profile:
miden help toolchain listed neither the component nor its registry alias, and
miden registry list ran but warned. Both are correct after the change, while a project whose
toolchain file does not ask for it still has it scoped out.

tests/operations.rs gains a test beside the other section 8.5 ones, running the real binary
through a miden symlink and asserting on its listing. It fails without the change.

Fixes #256.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DrwmYXnHf6D6Ktb11UYDG1

`ensure_current_is_installed` narrowed dispatch by an intent built from
whatever toolchain it resolved. Only a `miden-toolchain.toml` carries a
request, though: `Toolchain::current` synthesizes an empty `components`
and `profile` for the requested, override and default justifications, so
that intent resolved to the `minimal` profile and dropped every
component belonging to no profile.

That is exactly what `midenup install <channel> --component <name>`
installs. Such a component was absent from `miden help toolchain`, and
running it went through the outside-the-view fallback, warning that it
was not part of the toolchain it had deliberately been installed into.

Section 8.5 defines the active view as *this project's* request, so
where there is no project file there is nothing to narrow by and there
is no view: dispatch works against the installed set. That also keeps a
superset-only alias conflict a warning rather than promoting it to an
error, which is what the same section asks for.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DrwmYXnHf6D6Ktb11UYDG1
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.

miden help toolchain omits components installed with --component

1 participant