Skip to content

The real-Rush test of hosted mode never runs: no CI leg opts in, and its Rush 5.100.0 fails rush update on a pnpm 9 lock, which the test reports as a pass #2363

Backlog

Description

[agent] Found by the architecture refactor routine on main at cfc870f. Test code only: hosted mode in a Rush repo works today (run by hand, below). The problem is that no test would notice if it stopped.

The problem

rush_hosted_real_rush_update_install (crates/socket-patch-cli/tests/e2e_redirect_rush_sim.rs, line 589) is the one test that runs hosted mode under the real @microsoft/rush: rush update, scan --mode hosted, rush install, the patched bytes, VEX, then the preventManualShrinkwrapChanges refusal and the rush update that recovers from it. It reports ok in CI on all three operating systems and has never run an assertion there, and it cannot run one when a developer opts in:

  1. No CI leg opts in. The test returns at line 590 unless RUSH_E2E=1. The three legs that run the suite (.github/workflows/ci.yml, lines 2137, 2253 and 2292) run it with --ignored and pnpm_required, and no workflow or script names RUSH_E2E.
  2. Opted in, it still skips. Its fixture pairs Rush 5.100.0 (line 52) with pnpm 9.15.9 (line 608). That Rush release fails on the pnpm 9 lock of this fixture, so rush update fails every time, and lines 669 to 675 turn a failed rush update into SKIP … (network?) and a pass. The pairing has been there since the test was added (e9b0a58, 2026-07-02).

#1400 (fd7c243, for #1054) fixed this class for the suite's toolchain probe: "a runner without pnpm would turn the leg green without running anything". It left these two skips as they were; the #[ignore] text records that ("tier-2 RUSH_E2E=1 self-skip unchanged").

The other two tests of the suite are a simulation, as the file's header says: they copy the rewritten lock into a hand-made common/temp and run pnpm install --frozen-lockfile there, over a lock written by hand (rush_common_lock, line 163). So nothing checks hosted mode against the lock Rush itself writes, against Rush's own validation of the lock, or against the preventManualShrinkwrapChanges flow that the scan's warning and docs/ecosystems.md ("Hosted mode in a Rush repo") describe.

Evidence

All runs use the binary built from main (cfc870f), Node 22.23.5 and corepack pnpm 9.15.9.

As CI runs it, and opted in:

$ SOCKET_PATCH_PNPM_E2E_REQUIRED=1 cargo test -p socket-patch-cli --test e2e_redirect_rush_sim -- --ignored --nocapture
test rush_hosted_real_rush_update_install ... SKIP e2e_redirect_rush_sim: set RUSH_E2E=1 to run the real-rush tier-2 leg
ok

$ RUSH_E2E=1 SOCKET_PATCH_PNPM_E2E_REQUIRED=1 cargo test -p socket-patch-cli --test e2e_redirect_rush_sim -- --ignored --nocapture
test rush_hosted_real_rush_update_install ... SKIP e2e_redirect_rush_sim (tier2): `rush update` failed (network?):
[…]
ERROR: Cannot get dependency key for temp project: @rush-temp/app-a
ok
test result: ok. 3 passed; 0 failed

The failure is the pairing, not the network or Node. The test's own fixture (one project, no useWorkspaces), by hand on the same machine:

Rush pnpm rush update
5.100.0 9.15.9 ERROR: Cannot get dependency key for temp project: @rush-temp/app-a
5.100.0 8.15.9 finished successfully
5.182.1 9.15.9 finished successfully

With a Rush that works, the test runs and passes on main. With RUSH_VERSION set to 5.182.1 (the release e2e_vendor_rush.rs pins and runs in CI) and no other change, the test runs every assertion in about 20 seconds and passes.

Two mutants of the hosted pnpm rewrite (plan_hosted, crates/socket-patch-core/src/formats/pnpm/hosted.rs), each behind an environment switch in one build, never committed:

  • M1: every Rush lock is left alone.
  • M2: a lock is left alone when it holds @rush-temp/ entries. That is the shape Rush writes for a repo without pnpm workspaces, and the shape of the test's own fixture.
simulated tests (2) real-Rush test, as CI runs it real-Rush test, RUSH_E2E=1 real-Rush test, RUSH_E2E=1 and Rush 5.182.1
main pass "ok" (skipped) "ok" (skipped) pass
M1 fail "ok" (skipped) "ok" (skipped) fail
M2 pass "ok" (skipped) "ok" (skipped) fail: "real rush install must land the PATCHED bytes"

M2 passes every test in the repository: no fixture of the hosted rewrite holds an @rush-temp/ entry (the string appears in vendor/pnpm_lock/rush.rs, in the contract and nowhere else), so only a lock that Rush wrote can reach it.

What the test would guard, run by hand with Rush 5.182.1 and a stand-in patch API serving a patched left-pad 1.3.0. All of it matches the documentation today:

  • pnpm 9.15.9 and 10.28.0, pnpm workspaces: the scan rewrites common/config/rush/pnpm-lock.yaml; rush install lands the patched file in the project that depends on it; vex attests it. On 10.28.0 a fresh clone installs the patched file, and rollback restores the lock byte for byte.
  • preventManualShrinkwrapChanges: rush install refuses the edited lock, rush update refreshes repo-state.json, and the pin is still in the lock afterwards.
  • Subspaces (pnpm 10.28.0): both subspace locks are pinned, both keep the pin through rush update, and an install into an empty common/temp lands the patched file in both.
  • pnpm 12.21.0 and 11.28.12: a plain rush install fails with ERR_PNPM_TARBALL_URL_MISMATCH; the remedies the warning names install the patched file (pnpm_config_trust_lockfile=true, and on pnpm 11 usePnpmFrozenLockfileForRushInstall as well). On pnpm 11 without the experiment the install exits 0 with the upstream file, as the warning says.

Planned fix

Test code and one CI key; no production change.

  1. Pin the Rush release the vendored suite pins (5.182.1), so the fixture can install.
  2. Drop the RUSH_E2E gate. e2e_vendor_rush already fetches the real Rush with npm x on the same CI legs, so the network is not a new dependency.
  3. Under SOCKET_PATCH_PNPM_E2E_REQUIRED, make a failed rush update a failure, as CI: fail pnpm e2e legs that skip every test (#1054) #1400 did for a missing pnpm.
  4. After the recovering rush update, assert that the lock still holds the hosted tarball. The scan prints "the hosted wiring survives rush update", and the test checks only that the command exits 0.
  5. Show the red and green: M2 above fails the fixed test and passes the test as it is.

Generated by Claude Code

Activity

  1. added
    arch-audit
    refactor
    on Nov 29, 2026
  2. added a commit that references this issue on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:triagedarch-auditpriority:p3refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions