feat(sandbox): add smolvm sandbox mode - #92
Open
chriswritescode-dev wants to merge 5 commits into
Open
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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.
Summary
Adds a
smolvmsandbox backend alongside the existingsbxbackend, selected viasandbox.mode. ThesmolvmCLI embeds libkrun and drives the local hypervisor directly, with no daemon.Behavior
src/sandbox/smolvm.ts(new): smolvm runtime —machine createfrom adocker savetar image store at<dataDir>/smolvm-images/,machine execshell routing, per-machine--allow-hostnetwork flags fromsandbox.network.allow, env-file sourcing in-guest, and transparent restart-then-retry when a machine was stopped out-of-band.src/sandbox/runtime-factory.ts(new):createSandboxRuntimeis the single mode-dispatch point;resolveSandboxModeresolvessandbox.mode('sbx'default,'smolvm'), falling back to'sbx'for unknown/legacy values.src/sandbox/sbx.tsandsrc/sandbox/shell-shim.ts: backend-neutral rework —describeUnavailableandtemplateLoadHintmoved onto the runtime; the generated shell shim routes throughsmolvm machine execwhen mode is smolvm and fails closed exactly like the sbx shim.src/sandbox/path.ts,manager.ts,template.ts,types.ts,src/index.ts,src/tui.tsx: mode-aware wiring —resolveSandboxEnvDir, network allowlist passthrough, per-mode template build/store commands, andSandboxModetyping.sandbox.network.allowmeans unrestricted egress (the opposite of sbx's deny-by-default proxy); host loopback stays unreachable.smolvm-runtime.test.ts,runtime-factory.test.ts,sbx-runtime.test.ts,shell-shim.test.ts,manager-network-allow.test.ts, plus helpers.Notes
pr-reviewledger findings touch this change set.docs/sandbox.mdconflicts againstmain. The new work here is the smolvm backend.Validation
pnpm typecheckandpnpm lintclean; sandbox runtime tests pass.