GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Agent mode honours the Pipfile's `[pipenv] venv_in_project = true` for every Pipenv, but only 2026.2+ read it, so on Pipenv 2018–2026.1 the WORKON_HOME venv stays unpatched, the system Python is patched instead, and VEX attests not_affected · Issue #842 · SocketDev/socket-patch Closed Labels agent:triagedbugSomething isn't workingSomething isn't workingbughuntFound by a scheduled package-manager bug-hunt agentFound by a scheduled package-manager bug-hunt agentpm:pipenvPipenvPipenvpriority:p2 Description[agent] Found by the scheduled Pipenv bug-hunt routine (ledger #313). Summary
That holds only for Pipenv 2026.2.0+, the first release that reads the key (
This is the mirror image of the ImpactA silent miss with a false attestation, plus an unrequested write into the system interpreter. A team that adopts the documented Pipenv 2026.2 setting gets wrong results on every older Pipenv in its fleet. Repro (Linux, real Pipenv)export WORKON_HOME=/tmp/wh PIPENV_YES=1 mkdir proj && cd proj printf '[[source]]\nurl = "https://pypi.org/simple"\nverify_ssl = true\nname = "pypi"\n\n[packages]\nsix = "==1.16.0"\n\n[pipenv]\nvenv_in_project = true\n' > Pipfile pipenv install # Pipenv 2025.1.3: venv at $WORKON_HOME/proj-<hash>, no ./.venv pipenv --venv # -> /tmp/wh/proj-qzUn2fQZ socket-patch scan --mode agent --yes # patch API serving a six 1.16.0 patch pipenv run python -c "import six; print(getattr(six, 'SOCKET_PATCHED', 'UNPATCHED'))" # UNPATCHED sha256sum /usr/lib/python3/dist-packages/six.py # changed: the system copy was patched socket-patch vex --product pkg:pypi/[email protected] --output vex.json # statement: not_affected Patch data came from a local mock patch API (batch / by-package / view / blob) serving a six 1.16.0 patch that appends Expected vs actual
Matrix (Linux, main
|
| Pipenv | venv Pipenv uses | pipenv run six after scan |
system six | vex | result |
|---|---|---|---|---|---|
| 2018.11.26 (py3.8) | $WORKON_HOME/proj-… |
UNPATCHED | patched | not_affected | fail |
| 2023.12.1 | $WORKON_HOME/proj-… |
UNPATCHED | patched | not_affected | fail |
2023.12.1, venv_in_project = "yes" |
$WORKON_HOME/proj-… |
UNPATCHED | patched | not_affected | fail |
| 2025.1.3 | $WORKON_HOME/proj-… |
UNPATCHED | patched | not_affected | fail |
| 2026.1.0 | $WORKON_HOME/proj-… |
UNPATCHED | patched | not_affected | fail |
| 2026.8.0 | ./.venv |
patched | untouched | not_affected | pass |
2025.1.3, no [pipenv] key (control) |
$WORKON_HOME/proj-… |
patched | untouched | not_affected | pass |
PR #654 head d8356ae, 2023.12.1 / 2025.1.3 |
$WORKON_HOME/proj-… |
UNPATCHED | patched | not_affected | fail |
macOS and Windows weren't probed (probe branches are blocked, see the ledger). The code path doesn't depend on the OS.
The Pipfile key was first read in ccd43f5 (#388, "Fix Pipenv venv discovery order"), according to git log -S venv_in_project. I didn't build its parent for this shape.
crates/socket-patch-core/src/crawlers/python_crawler.rs:668 (pipenv_venv_in_project): the Pipfile key is treated as authoritative, like the env var.crates/socket-patch-core/src/crawlers/python_crawler.rs:711: in_project == Some(true) && !dot_venv.exists() returns no venv.crates/socket-patch-cli/src/commands/scan/hosted/python.rs:53) goes through the same find_local_venv_site_packages, so I'd expect it to miss a warm WORKON_HOME venv in this shape too. I haven't verified that in this run.Related: #645 (the env-var form, "not in project"), #504 (the global fallback that turns this miss into a system-Python write) and PR #654.
[agent] Triaged as priority:p1 (Pipenv). This shares its root cause with open PR #654 (#645, #546). Pipenv venv discovery treats an explicit in-project setting from the Pipfile as true for every Pipenv version, but only Pipenv 2026.2+ reads the [pipenv] venv_in_project key. #654 already handles the = false half of this. The = true with no ./.venv branch at python_crawler.rs:711 is the remaining half: when the key comes from the Pipfile rather than PIPENV_VENV_IN_PROJECT, it should also look up the $WORKON_HOME venv. The fix belongs in #654 or a follow-up stacked on it, so this issue is left unclaimed until #654 is settled.
Generated by Claude Code
[agent] Hosted-mode shape of this bug, on main 0d302dc (Linux, real Pipenv, mock patch API, 2/2 runs each). Hosted mode has the same root cause: the Pipfile [pipenv] venv_in_project = true key hides the warm WORKON_HOME venv, so the hosted scan never prints its stale-install warning.
Repro: the Pipfile pins six = "==1.16.0" and has [pipenv]\nvenv_in_project = true. Run pipenv install, which creates $WORKON_HOME/proj-<hash> on these versions, then socket-patch scan --mode hosted --yes.
| Pipenv | Venv Pipenv uses | Lock redirected | pypi_pipenv_stale_install warning |
Installed six |
|---|---|---|---|---|
| 2018.11.26 | WORKON_HOME | yes | missing (exit 0) | upstream |
| 2023.12.1 | WORKON_HOME | yes | missing (exit 0) | upstream |
| 2026.1.0 | WORKON_HOME | yes | missing (exit 0) | upstream |
| 2026.8.0 | ./.venv |
yes | printed | upstream (expected, the remedy applies) |
2023.12.1, no [pipenv] key (control) |
WORKON_HOME | yes | printed | upstream |
Impact: the user gets a clean exit 0 with no remedy. Their venv keeps running the unpatched release, and every later pipenv install / sync / install --deploy leaves it that way (documented warm-venv behaviour). A fresh checkout is protected.
Hosted VEX stays conservative: it fails closed and doesn't attest. With no six in the system Python it omits the package as file_not_found (2023.12.1 / 2026.1.0); with the distro's unpatched six present it omits it as not_applied. So nothing is falsely attested in hosted mode, but the file_not_found reason points the user away from the real cause.
The fix sketched in the triage comment, which also probes $WORKON_HOME when the key comes from the Pipfile, should cover this shape too. It's worth a hosted stale-warning test next to the agent one.
Generated by Claude Code
pipenv: 2026-10-05 19:15Z ledger (#790 verified, #842 hosted shape)
[agent] Still reproduces on main f3c6313, but the agent-mode symptom has changed (Linux, Pipenv 2023.12.1, real pipenv sync, mock patch API, 2/2).
Since #950 / #504, agent mode no longer falls back to the system Python. With the Pipfile's [pipenv] venv_in_project = true key, the WORKON_HOME venv Pipenv 2023 actually uses ($WORKON_HOME/a1-<hash>-python3.11, six 1.16.0 installed) is still missed, so now:
$ socket-patch scan --mode agent
[skip] pkg:pypi/[email protected] (not installed; run your package manager's install first, or `socket-patch scan --mode vendored` to vendor it from the lockfile)
No patches selected. # exit 0, no .socket/manifest.json written
$ pipenv run python -c 'import six; print(open(six.__file__).readline())'
# Copyright (c) 2010-2020 Benjamin Peterson # upstream bytes
Deleting the [pipenv] key (control) on the same venv gives # PATCHED by socket. So the system-Python write and the false not_affected in the title no longer happen. The user gets exit 0 and a "not installed" remedy for a package that is installed, and since no manifest is recorded, apply --check says "nothing to apply" (exit 0) and vex has nothing to attest. Nothing is falsely attested now; the venv just stays silently unpatched. The root cause in the triage comment (python_crawler.rs honouring the Pipfile key on Pipenv < 2026.2) is unchanged.
Generated by Claude Code
v5 triage: P2, not a release blocker. Retain old-Pipenv interpretation of a newer configuration key at P2. Recent comments confirm the system-Python mutation has already been fixed.
This follows the maintainer's release scope: one normally completing CLI instance, prioritizing valid-lockfile patch/install behavior, compatibility, and actionable CLI UX.
[agent] Claiming this issue (shared root cause: Pipenv venv discovery treats the Pipfile's [pipenv] venv_in_project = true as authoritative when no ./.venv exists, though Pipenv < 2026.2 ignores the key and uses WORKON_HOME). Branch: agent/fix-pipenv-pipfile-in-project-workon. Claim-ID: 2026-10-26T12:34:53Z-2f499c
Generated by Claude Code