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.