Repository navigation
CI: hermetic spawns in vlt test commons (#823) - #1488
Merged
Mikola Lysenko (mikolalysenko) merged 3 commits intoOct 13, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
This was referenced Oct 13, 2026
The vlt e2e, hosted and vendor test helpers each started socket-patch with a bare Command::new and their own SOCKET_* sweep. Those copies had drifted from tests/common/hermetic.rs: none removed flag-bound vars set in-process after the sweep, none used the hostile seeds that catch a dropped scrub, and the hosted helper left an ambient SOCKET_TELEMETRY_DISABLED=0 in place. All three now build on hermetic::command and keep only their own vlt and proxy scrubs. They leave PENDING_RAW_SPAWNS, so the ratchet keeps them hermetic. Refs #823 Assisted-by: Claude Code:claude-opus-5-5
The shared vlt scrub also removes SOCKET_* vars, so running it on a socket-patch child built by the hermetic builder would turn telemetry and the update check back on. Add a vlt scrub that leaves SOCKET_* to the builder, as the bun suites already have, and use it for the vlt e2e CLI child instead of re-applying the opt-outs by hand. Refs #823 Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 13, 2026 15:32
Collaborator
Author
|
BugBot review Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 9fed156. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 13, 2026
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-ci-hermetic-vlt-commons
branch
October 13, 2026 16:01
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.
LLM Description written by Claude Code:claude-opus-5-5
Refs #823 (slice 10 of the hermetic-spawn migration). The issue stays open for the 29 remaining
PENDING_RAW_SPAWNSentries (26 once #1484 lands too).Root cause
The three vlt test commons each started the
socket-patchchild with a bareCommand::newand a privateSOCKET_*sweep that had drifted fromtests/common/hermetic.rs:vlt_e2e_common::socket_cmdrelied oncache_env::scrub_ambient_vlt_env, which sweeps the parent'sSOCKET_*once but doesn't remove the flag-bound vars by name, so one set in-process after the sweep would reach the child, and it had no hostile seeds to catch a dropped scrub.vlt_hosted_common::scrubbed_clikept every ambientSOCKET_*TELEMETRY*var and never forcedSOCKET_TELEMETRY_DISABLED=1, so a developer shell withSOCKET_TELEMETRY_DISABLED=0let the unauthenticated child POST telemetry.vlt_vendor_common::clicarried a hand-written list of five extra names to remove.Change
socket_cmd,scrubbed_cliandclinow start fromhermetic::command/hermetic::binary_commandand keep only their own scrubs (vlt / npm /VIRTUAL_ENVfor the e2e helper,VLT_*for the vendor helper, proxies for all three).cache_env::scrub_ambient_vlt_tool_env: the vlt scrub minusSOCKET_*, the counterpart of the existingscrub_ambient_bun_tool_env. Running the full vlt scrub after the hermetic builder would remove the opt-outs it forces on; the tool variant leavesSOCKET_*to the builder. It has a self-test.PENDING_RAW_SPAWNS(42 -> 39 on main), so the ratchet inspawn_env_hygiene.rskeeps them hermetic. The entries aren't adjacent to the ones CI: hermetic spawns in vendor build tests (#823) #1484 removes, so the two PRs merge cleanly in either order.Files:
vlt_{e2e,hosted,vendor}_common/mod.rs,common/cache_env.rs,spawn_env_hygiene.rs.CI cost
Test code only, no workflow edits. A lean PR run keeps the same job count (~29 Linux jobs) and job-minutes (~31 job-min, ~8 min wall) before and after.
Test evidence (local)
spawn_env_hygiene::no_new_bare_binary_spawnsfails. Green with the change.cargo fmt --all -- --check: clean.cargo clippy --locked --workspace --all-features -- -D warnings(the CI command): clean.cargo check --tests -p socket-patch-cli --all-features: clean (every test target compiles).spawn_env_hygieneande2e_vendor_bun_build(acache_envincluder): 2019 passed, 8 failed, 135 ignored. The same 8 fail on unmodifiedorigin/mainin this container. They're chmod-based write-failure tests (*_state_write_failure_*,*_write_failures_*,*_unremovable,*_cleanup_failure_*) that can't fail as root, and the sandbox runs as uid 0.vlt_pinned_matrixlegs locally: their registry fixture fetches from npmjs directly, and the sandbox only allows proxied egress. Lean PR CI runse2e_redirect_vlt_buildon vlt 1.2.0, which drivessocket_cmd./code-review high
FORCED_OPT_OUTSafter the full vlt scrub, which was fragile. It now uses the newSOCKET_*-free tool scrub, and theis_ambient_vlt_vardoc says which children take which scrub.vlt_vendor_common::clisweeps onlyVLT_*, notnpm_config_*/VIRTUAL_ENVlike the e2e helper. That file doesn't includecache_env.socket-patchthrough the npx shim (VltRun::with_shims) wouldn't get the hermetic env. It has no callers today.Extra::Proxyin a later slice.vlt_hosted_common/vlt_vendor_commonincludehermetic.rsprivately, the same way they already includeoracle.rs/prebuilt_common, because their includers don't all have it at the crate root.🤖 Generated with Claude Code
https://claude.ai/code/session_01KfnzRvB2CbCgiSWbcKJWPD
Generated by Claude Code
Note
Low Risk
Changes are limited to integration-test spawn hygiene; no production CLI or runtime behavior is modified.
Overview
Test-only migration (hermetic-spawn #823): vlt integration helpers now spawn
socket-patchthrough the sharedhermetic::command/hermetic::binary_commandinstead ofCommand::newplus per-fileSOCKET_*sweeps that had drifted fromtests/common/hermetic.rs.vlt_e2e_common::socket_cmd,vlt_hosted_common::scrubbed_cli, andvlt_vendor_common::clikeep only their tool-specific scrubs (vlt/npm/proxy).cache_env::scrub_ambient_vlt_tool_envis the vlt ambient scrub withoutSOCKET_*, so a full vlt scrub after the hermetic builder does not strip forced telemetry/config opt-outs; docs and a self-test cover the split. Hosted/vendor commons includehermetic.rslocally like other shared test modules.spawn_env_hygiene: the three vlt common paths are removed fromPENDING_RAW_SPAWNS(42 → 39 pending bare spawns).Reviewed by Cursor Bugbot for commit 9fed156. Configure here.