Trust mise configs in the guest so project pins actually apply - #12
Merged
Conversation
mise refuses to load a mise.toml it has not been told to trust, and trust is host-side state that does not survive the mount. Every fresh sandbox therefore treats the mounted project's config as untrusted: mise skips it entirely, the project's pinned Ruby/Node quietly do not apply, and the only clue is a WARN naming the file and telling a human to run `mise trust`. Nobody can act on that advice where it appears. `orbx shell` lands in the project on a machine that exists solely to run it, and agents driving `orbx run` never see the warning at all -- they just get whatever the global install happens to provide. Sets trusted_config_paths from user-setup.sh. Scoped to $HOME rather than the mount path, which this template does not know: the auto-mount always lands under it (see orbx::mount_target), and a repo cloned inside the sandbox is covered too. What trust gates is code execution from a config file, and this is an isolated VM whose entire purpose is executing that project's code, so there is nothing left for the prompt to protect. Set alongside ruby.compile, before `mise use -g` -- which already demonstrates that a later `use -g` preserves settings written earlier into ~/.config/mise/config.toml. Verified on a fresh machine against a copy of a real project's mise.toml; a plain [tools] table needs no trust, but its [settings.ruby] block does. Before, the WARN reproduces verbatim. After, it is gone and mise instead reports `missing: node@24.16.0 ruby@4.0.5` -- the config being read for the first time. Known gap: a project living outside the host's $HOME keeps its absolute path in the guest, since orbx::mount_target rewrites nothing there, and so falls outside the trusted path.
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.
Problem
On a fresh sandbox, every project with a
mise.tomlgreets you with:Trust is host-side state and does not survive the mount, so the mounted project's config is untrusted in every new VM.
The warning undersells it. mise doesn't just complain — it skips the config entirely, so the project's pinned Ruby/Node never apply and you silently get whatever the global install provides. And the advice is unactionable where it appears:
orbx shelllands you in the project on a machine that exists solely to run it, and agents drivingorbx runnever see the warning at all.Fix
Set
trusted_config_pathsfromuser-setup.sh:Scoped to
$HOMErather than the mount path, which this template does not know. The auto-mount always lands under it (seeorbx::mount_target), and a repo cloned inside the sandbox is covered too. What trust gates is code execution from a config file — this is an isolated VM whose entire purpose is executing that project's code, so there is nothing left for the prompt to protect.Placed alongside
ruby.compile, beforemise use -g, which already demonstrates that a lateruse -gpreserves settings written earlier into~/.config/mise/config.toml.Verification
Tested on a real machine (
orbx-trust-test, since deleted), with a scratch project under$HOMEcarrying a copy of a real project'smise.toml— a plain[tools]table needs no trust, but its[settings.ruby]block does.Inside the guest:
mise settings get trusted_config_paths["/home/tomasz"]mise trust --showin the project dir~/code/orbx-trust-test: trusted~/.config/mise/config.toml[settings]and[tools]both intactA/B in the same VM:
mise WARN ~/code/orbx-trust-test/mise.toml is not trusted, run 'mise trust' to enable it— reproduces verbatim.mise WARN missing: node@24.16.0 ruby@4.0.5.That second message is the real proof: mise is now reading the config and reporting its pinned tools aren't installed. Before, it never even knew those versions were requested.
shellcheckclean; 89/89 bats pass (88 + the new template test).Known gap
A project living outside the host's
$HOMEkeeps its absolute path in the guest (orbx::mount_targetrewrites nothing there) and so falls outside the trusted path. The guest makes a general fix easy if we want it —/proc/mountslists the share asmac /home/tomasz/code/orbx-trust-test virtiofs, so provisioning could trust every virtiofs mountpoint instead.Follow-up worth a decision
The now-visible
missing: node@24.16.0 ruby@4.0.5is arguably correct behaviour. Provisioning installsruby@latest/node@ltsglobally, not the project's pins; runningmise installin the project dir during provisioning would resolve it, but it is slower and can fail on versions with no prebuilt binary. Left alone here.