fix(toolchain): scope the active view to projects that declare one - #257
Open
saimeunt wants to merge 1 commit into
Open
fix(toolchain): scope the active view to projects that declare one#257saimeunt wants to merge 1 commit into
saimeunt wants to merge 1 commit into
Conversation
`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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A component installed with
midenup install <channel> --component <name>was invisible todispatch unless a
miden-toolchain.tomlhappened to name it. It was missing frommiden help toolchain, and running it went through the outside-the-view fallback, warningthat it was not part of the toolchain it had deliberately been installed into.
ensure_current_is_installednarrowed the view by an intent built from whatever toolchain itresolved. Only a toolchain file carries a request, though:
Toolchain::currentsynthesizes anempty
componentsandprofilefor the requested, override and default justifications, so thatintent resolved to the
minimalprofile — and a component installed with--componentbelongsto 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 toolchainlisted neither the component nor itsregistryalias, andmiden registry listran but warned. Both are correct after the change, while a project whosetoolchain file does not ask for it still has it scoped out.
tests/operations.rsgains a test beside the other section 8.5 ones, running the real binarythrough a
midensymlink and asserting on its listing. It fails without the change.Fixes #256.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DrwmYXnHf6D6Ktb11UYDG1