Skip to content

CI: hermetic spawns in e2e_redirect_cargo_shapes (#823) - #1522

Merged
Mikola Lysenko (mikolalysenko) merged 2 commits into
mainfrom
agent/fix-ci-hermetic-redirect-cargo-shapes
Oct 14, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 2 commits into
mainfrom
agent/fix-ci-hermetic-redirect-cargo-shapes

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:claude-opus-5-5

Refs #823 (slice 19: the e2e_redirect_cargo_shapes suite). This uses Refs, so #823 stays open for the last two PENDING_RAW_SPAWNS files: e2e_hosted_production.rs and e2e_vendored_production.rs.

Summary

run_socket_env in e2e_redirect_cargo_shapes.rs now starts socket-patch through hermetic::binary_command() and scrubs an activated venv (Extra::Venv). It sets the leg's own CARGO_HOME after those calls. The file comes off PENDING_RAW_SPAWNS (3 → 2). The change touches tests only: no product code and no workflows.

Root cause

The suite spawned the CLI with a bare Command::new and its own sweep of every ambient SOCKET_*. That sweep was mostly sound, but it had drifted from the shared harness:

  • It forced only SOCKET_NO_CONFIG. The update check and telemetry opt-outs that hermetic::FORCED_OPT_OUTS sets were never forced. (Every call does pass --no-telemetry.)
  • There were no hostile seeds, so a dropped scrub line would not turn the suite red.
  • VIRTUAL_ENV reached the unscoped scan and vex runs.

To be clear about impact: I found no ambient shell that fails this suite on main. Under VIRTUAL_ENV=<real venv with six installed> SOCKET_DRY_RUN=true SOCKET_ECOSYSTEMS=npm SOCKET_NO_CONFIG=0 SOCKET_NO_UPDATE_CHECK=0 SOCKET_TELEMETRY_DISABLED=0 ..., it passes 32/32 both before and after this change. This slice is about consistency and the ratchet, not a live failure.

Test evidence

  • Red with only the PENDING_RAW_SPAWNS removal: spawn_env_hygiene fails no_new_bare_binary_spawns with ["e2e_redirect_cargo_shapes.rs"] (15 passed, 1 failed).
  • Green at 4d4ade7: e2e_redirect_cargo_shapes 32/32 (real cargo 1.93.1 against crates.io through the wiremock mirror) and spawn_env_hygiene 16/16. Both are also green under the hostile shell above. e2e_maven is 22/22 after rebasing onto CI: hermetic spawns in the e2e_maven suite (#823) #1519.
  • Re-verified at takeover (2026-10-14, branch 0 commits behind main): cargo fmt --check clean, clippy on both test targets clean, spawn_env_hygiene 16/16, e2e_redirect_cargo_shapes 32/32.
  • cargo fmt --all -- --check is clean. cargo clippy --locked --workspace --all-features -- -D warnings is clean, and so is clippy --test e2e_redirect_cargo_shapes --test spawn_env_hygiene -- -D warnings.

/code-review high

  • Fixed: the doc comment said the venv scrub was there for the scan only. It applies to every call, because vex also discovers packages under --cwd.
  • Not fixed here (follow-up under Spawn every CLI test child through one hermetic Command builder; 10 test files inherit ambient SOCKET_* today #823): the real-cargo children (cargo_e2e_matrix::cargo_command) pin CARGO_HOME and drop CARGO_TARGET_DIR, but they still inherit CARGO_BUILD_TARGET_DIR, CARGO_NET_OFFLINE, CARGO_REGISTRIES_* / CARGO_SOURCE_* and RUSTFLAGS. That helper is shared by every cargo matrix suite, so changing it belongs in its own slice.
  • Not fixed here (follow-up): about 20 suites now repeat binary_command() + scrub_extra(Venv). Making the shared builder scrub VIRTUAL_ENV by default (or adding a ratchet for it) would remove the copies.

CI cost

No workflow changes. A lean PR run costs the same before and after: about 28 Linux jobs and about 8 minutes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FFQDbPARQNb93vs7DiZJoP


Generated by Claude Code


Generated by Claude Code

The cargo redirect-shapes suite started socket-patch with a bare
Command::new and its own SOCKET_* sweep. That sweep never forced the
update check or telemetry off, and an activated venv reached the
unscoped hosted scan. It now spawns through the shared hermetic
builder, scrubs VIRTUAL_ENV, and leaves PENDING_RAW_SPAWNS.

Refs #823

Assisted-by: Claude Code:claude-opus-5-5
The venv scrub covers every call, not just scan: vex also discovers
packages under --cwd. Reformat the two-entry PENDING_RAW_SPAWNS list
the way rustfmt wants it.

Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 4d4ade7. Configure here.

Merged via the queue into main with commit 6a06ddd Oct 14, 2026
86 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/fix-ci-hermetic-redirect-cargo-shapes branch October 14, 2026 07:57
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.

3 participants