Skip to content

Migrate per-VM resource limits + virtualized identity from env to the BARE wire#82

Merged
NathanFlurry merged 1 commit into
mainfrom
env-vs-bare-migration
Jun 20, 2026
Merged

Migrate per-VM resource limits + virtualized identity from env to the BARE wire#82
NathanFlurry merged 1 commit into
mainfrom
env-vs-bare-migration

Conversation

@NathanFlurry

@NathanFlurry NathanFlurry commented Jun 19, 2026

Copy link
Copy Markdown
Member

Classifies which per-VM settings belong on the ambient AGENT_OS_* env channel vs the BARE wire / structured request, encodes the rule in CLAUDE.md, and migrates the resource limits and virtualized identity families off env onto typed/structured channels.

Migrated to the wire

  • Resource limits — V8 heap, sync-RPC wait, WASM fuel/memory/stack, Python timeout/old-space/output-buffer/vfs-rpc → typed *ExecutionLimits request fields, sourced from CreateVmConfigVmLimits.
    • Fixes the AGENT_OS_WASM_MAX_STACK_BYTES dead cap (was written to env, never read) and a latent disconnection (wire limit fields were parsed but never plumbed → engine silently used defaults).
  • Virtualized identityprocess.{pid,ppid,uid,gid} interpolated into the runtime shim; os.{cpus,totalmem,freemem,homedir,userInfo,…} via the __agentOsVirtualOs structured global the shim sets. The AGENT_OS_VIRTUAL_{PROCESS,OS}_* env inserts are removed; os POSIX env (HOME/USER/SHELL) is kept (bucket-2 standard env). The v8-bridge bundle is regenerated from source.

Not migrated (deferred, documented)

Isolation policy (GUEST_PATH_MAPPINGS, EXTRA_FS_*_PATHS, ALLOWED_NODE_BUILTINS, LOOPBACK_EXEMPT_PORTS, WASM_PERMISSION_TIER) stays on env — bucket 3 but not yet moved. PARENT_NODE_ALLOW_* are dead (defined + scrubbed, never read).

Testing

  • Per-limit tests assert each limit is enforced from the wire value while a contradictory env value is inert.
  • Sidecar-level identity regression test (builtin_conformance::os_resource_limits_are_vm_scoped): a guest's os.cpus/totalmem/freemem reflect the configured VM resource limits, and os.userInfo().username / os.homedir() reflect the configured VM identity (distinct from the loader's root//root defaults) — exercising the real guestOs/import os path through the sidecar.
  • cargo check --workspace --all-targets clean; full cargo test -p secure-exec-execution green; sidecar suites green except 3 pre-existing/environmental failures (TLS-over-loopback, a child-process SIGABRT signal test, a pyodide asset-resolution test) — each verified to fail identically on main.

@railway-app

railway-app Bot commented Jun 19, 2026

Copy link
Copy Markdown

🚅 Environment secure-exec-pr-82 in rivet-frontend has no services deployed.

@NathanFlurry
NathanFlurry force-pushed the env-vs-bare-migration branch 2 times, most recently from 2756e21 to ac7a6f4 Compare June 19, 2026 11:07
@NathanFlurry NathanFlurry changed the title Classify env vs BARE protocol; migrate per-VM resource limits off env Migrate per-VM resource limits + virtualized identity from env to the BARE wire Jun 19, 2026
@NathanFlurry
NathanFlurry force-pushed the env-vs-bare-migration branch from ac7a6f4 to eb4a2bb Compare June 19, 2026 11:54
@NathanFlurry
NathanFlurry force-pushed the env-vs-bare-migration branch from eb4a2bb to ee175f9 Compare June 19, 2026 11:58
@NathanFlurry
NathanFlurry merged commit 2f66120 into main Jun 20, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant