From 5a3cecc194eb8b51d1a56acc8408e53094f94d10 Mon Sep 17 00:00:00 2001 From: Tomasz Mazur Date: Sun, 30 Aug 2026 21:50:53 +0200 Subject: [PATCH] fix: trust mise configs under the guest's home 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. --- templates/default.yaml | 16 ++++++++++++++++ test/template.bats | 10 ++++++++++ 2 files changed, 26 insertions(+) diff --git a/templates/default.yaml b/templates/default.yaml index ec72f81..712f01f 100644 --- a/templates/default.yaml +++ b/templates/default.yaml @@ -391,6 +391,22 @@ write_files: export PATH="$HOME/.local/bin:$PATH" eval "$("$HOME/.local/bin/mise" activate bash)" || true + # Trust project configs living under this user's home. mise refuses to + # load a mise.toml it has not been told to trust -- so the mounted + # project's pinned Ruby/Node/env silently do not apply, and the only clue + # is a WARN on every prompt telling a human to run `mise trust`. Nobody + # can: `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. + # + # 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; this is an isolated VM whose entire + # purpose is executing that project's code, so there is nothing left to + # protect. Trust is a HOST-side boundary; it does not survive the mount. + "$HOME/.local/bin/mise" settings set trusted_config_paths "$HOME" \ + || log "could not set mise trusted_config_paths (expect trust warnings)" + # Prefer precompiled Ruby (jdx/ruby: Linux arm64/x86_64, macOS arm64). # This becomes mise's default in 2026.8.0; we opt in now so first boot # fetches a binary in seconds instead of compiling for minutes. mise falls diff --git a/test/template.bats b/test/template.bats index 0c6d310..cdbb52f 100644 --- a/test/template.bats +++ b/test/template.bats @@ -178,6 +178,16 @@ load helpers/test_helper [ "$status" -eq 0 ] } +@test "default template trusts mise configs under the user's home" { + # Trust does not survive the mount: a project trusted on the host is + # untrusted in the VM, so mise skips its mise.toml and the project's pinned + # Ruby/Node quietly do not apply. The only symptom is a WARN telling a human + # to run `mise trust` -- which agents driving `orbx run` never see. + run grep -E 'mise" settings set trusted_config_paths "\$HOME"' \ + "$ORBX_TEST_ROOT/templates/default.yaml" + [ "$status" -eq 0 ] +} + @test "default template registers git-lfs filters, not just the binary" { # Installing git-lfs is not enough: until `git lfs install` writes the # clean/smudge filters, cloning an LFS repo silently yields pointer files.