Repository navigation
CI: hermetic spawns in Cargo/Composer suites (#823) - #1502
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 Cargo and Composer suites started socket-patch with a bare Command::new and their own partial SOCKET_* handling, which had drifted from tests/common/hermetic.rs. e2e_cargo and e2e_composer removed six named vars, so any other ambient SOCKET_* reached the child: with SOCKET_ECOSYSTEMS=npm in the shell, 5 e2e_cargo and 2 e2e_composer tests fail on main. None forced the config layer or the update notifier off. All three now start from hermetic::command, scrub an activated venv (Extra::Venv) and use the stand-in HOME from jvm_env::isolate_cli, since their scans are unscoped. The Composer suites also drop an ambient COMPOSER_VENDOR_DIR: it moves the vendor directory the crawler reads off the fixture's, and fails the agent-mode sync test in e2e_composer_version_identity on main. The files leave PENDING_RAW_SPAWNS (22 -> 19), so the ratchet keeps them hermetic. Refs #823 Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
force-pushed
the
agent/fix-ci-hermetic-cargo-composer
branch
from
October 13, 2026 20:00
f32f8f0 to
dce11cc
Compare
From /code-review high: the Composer suites only dropped an ambient COMPOSER_VENDOR_DIR. The crawler also reads vendor-dir from the user-level config.json, which it finds through COMPOSER_HOME or an absolute XDG_CONFIG_HOME, so a developer whose Composer config sets vendor-dir still failed 2 e2e_composer tests and 1 e2e_composer_version_identity test. hermetic::Extra::Composer now removes every ambient COMPOSER_* var and pins COMPOSER_HOME to a missing directory, which outranks XDG_CONFIG_HOME and holds no config. Both Composer suites use it, and spawn_env_hygiene checks the scrub. Refs #823 Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 13, 2026 20:14
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 cdb3669. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 13, 2026
Collaborator
Author
|
Ready for review (burn-down agent)
Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-ci-hermetic-cargo-composer
branch
October 13, 2026 22:59
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 13; the issue stays open for the remaining
PENDING_RAW_SPAWNSfiles)What
Three Cargo / Composer suites still on
PENDING_RAW_SPAWNSstartedsocket-patchwith a bareCommand::newand their own partialSOCKET_*handling, which had drifted fromtests/common/hermetic.rs:e2e_cargo.rsande2e_composer.rsremoved six named vars, so any other ambientSOCKET_*reached the child. WithSOCKET_ECOSYSTEMS=npmin the shell, 5e2e_cargotests and 2e2e_composertests fail onmain. Neither forced the config layer or the update notifier off.e2e_composer_version_identity.rshad a private sweep that let an ambientSOCKET_NO_CONFIGthrough and didn't force the update check off.COMPOSER_VENDOR_DIR, or a user-levelconfig.jsonwithvendor-dirreached throughCOMPOSER_HOMEorXDG_CONFIG_HOME, moves the crawl off the fixture'svendor/. That failsagent_sync_applies_and_keeps_a_padded_composer_patchonmain.All three now spawn through
hermetic::command/hermetic::binary_command, scrub an activated venv (Extra::Venv) and use the stand-inHOMEfromjvm_env::isolate_cli, because their scans crawl every ecosystem. A newhermetic::Extra::Composerremoves every ambientCOMPOSER_*var and pinsCOMPOSER_HOMEto a missing directory, which outranksXDG_CONFIG_HOMEin the crawler's home lookup. Both Composer suites use it, andspawn_env_hygienegets a self-test for it. The three files leavePENDING_RAW_SPAWNS(22 -> 19), so the ratchet keeps them hermetic.e2e_redirect_cargo_shapes.rsstays on the list for a later slice because #1429 edits it. #1498 trims other lines of the samePENDING_RAW_SPAWNSlist, so whichever PR lands second needs a trivial rebase of that list.Test-only change; no product code touched.
CI cost
No workflow change. A lean PR run has the same job count (~28 Linux jobs) and job-minutes before and after, because these suites already run in the same jobs.
Test evidence
cargo fmt --all -- --check: clean.cargo clippy --workspace --all-features -- -D warnings: clean.cargo check -p socket-patch-cli --all-features --tests: every test target builds. Clippy on the touched test targets reports only the existing lints inprebuilt_common/mod.rs, which this PR doesn't touch.Red on
main:SOCKET_ECOSYSTEMS=npm cargo test -p socket-patch-cli --all-features --no-fail-fast --test e2e_cargo --test e2e_composer: e2e_cargo 20 passed, 5 failed; e2e_composer 20 passed, 2 failed.COMPOSER_VENDOR_DIR=elsewhere cargo test ... --test e2e_composer_version_identity: 6 passed, 1 failed.Green on this branch with
-- --include-ignoredunder each of these hostile environments:SOCKET_ECOSYSTEMS=npm SOCKET_DRY_RUN=true SOCKET_NO_CONFIG=0 SOCKET_CLI_API_TOKEN=x SOCKET_SAVE_ONLY=true COMPOSER_VENDOR_DIR=xXDG_CONFIG_HOME=<dir with composer/config.json vendor-dir=deps>COMPOSER_HOME=<same>Under every one: e2e_cargo 25/25, e2e_composer 22/22, e2e_composer_version_identity 7/7, spawn_env_hygiene 16/16.
CI on cdb3669: all checks green (run 38461229984,
ci-oksuccess); Cursor Bugbot passed with no findings; mergeable state clean./code-review high
COMPOSER_HOME/XDG_CONFIG_HOME(two findings, reproduced as above). The one-offenv_remove("COMPOSER_VENDOR_DIR")copies are nowExtra::Composer. The doc comments no longer overstate the isolation.hermetic::command+Extra::Venv+isolate_cliinto one shared builder.e2e_composer_version_identitybuilds onprebuilt_common, notcommon, so acommonhelper wouldn't reach it, and changingcommon::run_bin_with_envto scrub the venv would affect every caller. That belongs in its own change.🤖 Generated with Claude Code
https://claude.ai/code/session_01Er9RqgedbBok557p98HiKT
Note
Low Risk
Test harness and environment isolation only; no production CLI or crawler behavior changes.
Overview
Cargo and Composer CLI e2e suites now spawn
socket-patchthrough the sharedhermetichelpers instead of bareCommand::newwith hand-rolledSOCKET_*scrubbing, so ambient env (e.g.SOCKET_ECOSYSTEMS, straySOCKET_*tokens) cannot skew discovery or proxy routing.Extra::Composerstrips allCOMPOSER_*variables and pinsCOMPOSER_HOMEto a nonexistent path soCOMPOSER_VENDOR_DIRand user-level Composer config viaXDG_CONFIG_HOMEcannot redirect the crawler away from fixturevendor/. Composer suites use it;spawn_env_hygieneadds a contract test and dropse2e_cargo,e2e_composer, ande2e_composer_version_identityfromPENDING_RAW_SPAWNS.Unscoped scans also scrub
VIRTUAL_ENVand isolateHOMEviajvm_env::isolate_cliso developer venvs and user caches do not inflate package counts.Reviewed by Cursor Bugbot for commit cdb3669. Configure here.
Generated by Claude Code