Skip to content

Fix hosted scan not reading the Pipfile (#333) - #425

Merged
Mikola Lysenko (mikolalysenko) merged 4 commits into
mainfrom
agent/fix-pipenv-hosted-pipfile-candidate
Oct 1, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 4 commits into
mainfrom
agent/fix-pipenv-hosted-pipfile-candidate

Conversation

@mikolalysenko

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

Copy link
Copy Markdown
Collaborator

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

Fixes #333

Summary

A hosted scan never read the project's Pipfile, so every Pipenv project looked like it had an abandoned Pipfile.lock. When that lock pinned the package to the user's own wheel, another version or a VCS source, the scan still redirected a sibling requirements.txt, reported success, and warned that there was no Pipfile. Pipenv kept installing the unpatched package. A conflicting entry in a live Pipfile.lock now refuses the patch for the whole project, which is what the Pipenv rewriter already intended.

Root cause

The hosted planners read the files listed in REDIRECT_CANDIDATE_FILES, which come from the HOSTED rows of formats/registry.rs. Pipfile.lock has a row there, but Pipfile doesn't. The Pipenv rewriter (patch/redirect/pipenv.rs) tells a live lock from an abandoned one with files.contains_key("Pipfile"), and that check was never true in the disk flow or the in-memory flow.

Fix

  • Pipfile is now a pypi HOSTED | PRESENCE_ONLY row in the format registry. It's read, never edited, and names no ecosystem for the symlink and unreadable refusals. Both the disk and in-memory hosted engines read it.
  • read_candidate_files: a presence-only row that the in-memory host lists without usable content (a symlink, or an oversize or presence-only entry) is recorded as present (empty) instead of dropped. Without this, the in-memory engine would still treat a live lock as abandoned.
  • The pinned candidate-list test lists Pipfile, and there's a CHANGELOG entry.

Tests (per issue)

  • Hosted scan never sees the Pipfile, so a live Pipfile.lock conflict is treated as abandoned and a sibling requirements.txt is redirected anyway #333: in_process_redirect_pipenv::live_pipfile_lock_conflict_vetoes_the_requirements_redirect. Before the fix it fails: requirements.txt is rewritten to the hosted URL (left: "urllib3 @ https://patch.socket.dev/...", right: "urllib3==1.26.18\n..."). With the fix it passes, and requirements.txt, Pipfile.lock and Pipfile are left unchanged.
  • Counterpart: abandoned_pipfile_lock_conflict_does_not_veto_the_requirements_redirect. With no Pipfile, the same conflict still lets requirements.txt be redirected. This was the intended behavior before and is unchanged.
  • In-memory engine: hosted::engine::tests::the_pipfile_is_read_for_its_presence covers a disk read, a symlinked or content-less memory entry recorded as present, and an absent Pipfile that stays absent.
  • formats::registry / engine::file_ecosystem: Pipfile names no ecosystem, so it never triggers a symlink or unreadable refusal.

Evidence

  • CI on 6565fac: all 10 workflows green (CI, Pipenv, Poetry, PDM, npm, pnpm, Bun, vlt, Composer, Audit GHA). Bugbot found no issues on 6565fac.
  • Local: cargo clippy --workspace --all-features -- -D warnings is clean. in_process_redirect_pipenv passes 6/6. The real-Pipenv 2026.8.0 e2e_vex_build pipenv:: --ignored passes.
  • Local cargo test --workspace --all-features --no-fail-fast: only 14 chmod-based write-failure tests fail. They can't fail as intended in this sandbox, which runs as uid 0, and all pass in CI.
  • cargo fmt --check already fails on main (CI doesn't run it). The new hunks are rustfmt-clean, and I didn't reformat any unrelated code.

Follow-ups

🤖 Generated with Claude Code


Generated by Claude Code

Assisted-by: Claude Code:claude-opus-5-5
A hosted scan never read the project's Pipfile, so every Pipenv
project looked like it had an abandoned Pipfile.lock. When that lock
pinned the package to the user's own wheel, another version or a VCS
source, the scan still redirected a sibling requirements.txt, reported
success, and warned that there was no Pipfile. Pipenv kept installing
the unpatched package.

The format registry now lists Pipfile as a hosted, presence-only file.
Both the disk and the in-memory hosted engines read it, and the
in-memory engine still counts it as present when the host has no
usable content for it (a symlink or an oversize file). A conflict in a
live Pipfile.lock now refuses the patch for the whole project.

Fixes #333

Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 1, 2026 05:50
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

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 6565fac. Configure here.

@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 1, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[burn-down agent] Ready for review on 6565fac: mergeable, 0 commits behind main.

  • CI: 97/97 green (3 skipped by design).
  • Bugbot: reviewed 6565fac, no findings.
  • Reviewer focus: the new Pipfile HOSTED | PRESENCE_ONLY registry row and the read_candidate_files change that records content-less presence-only entries as present.

Generated by Claude Code

@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit c7af4df into main Oct 1, 2026
482 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/fix-pipenv-hosted-pipfile-candidate branch October 1, 2026 16:48
Mikola Lysenko (mikolalysenko) pushed a commit that referenced this pull request Oct 1, 2026
Keeps both new hosted-engine tests: the BUNDLE_GEMFILE cases from this
branch and the Pipfile presence test from #425.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6i4cQ51yarBFnFs2b8HRx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hosted scan never sees the Pipfile, so a live Pipfile.lock conflict is treated as abandoned and a sibling requirements.txt is redirected anyway

3 participants