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 — Decide which lockfile governs installs in one table by mikolalysenko · Pull Request #1044 · SocketDev/socket-patch Conversation
|
| Decision | Before | After |
|---|---|---|
| npm-family router (decision table) | 2 (disk + in-memory) | 1 |
| npm-family precedence / family lists | 8 (LOCKFILE_FAMILIES, in-memory router, inventory transcription, SIBLING_LOCKS, hosted vlt inputs, rewrite_npm_lock list, governing-root OWN_LOCKS, governing-root WORKSPACE_ROOT_LOCKS) |
1 table (governing-root keeps one extra name, pnpm's pre-v3 shrinkwrap.yaml) |
| pnpm-PnP layout predicate | 2 (disk fn + the in-memory router's "never detected") | 1 |
| PyPI tool-lock precedence | 3 (detect_pypi_flavor, pdm_drives, pdm_drives_project) |
1 table |
pypi_multiple_lockfiles warning described above.vendor_multiple_lockfiles warnings. Its only caller, the inventory, discards them.vendor_multiple_lockfiles per file, and the file list in hosted redirect_vlt_sibling_lockfiles. The wording is unchanged. In redirect_workspace_lockfile_elsewhere, a workspace root holding both npm locks now lists npm-shrinkwrap.json before package-lock.json (npm's own preference); nothing else in that message moves.All runs on macOS, after a rebase onto origin/main 6fe81ad, using heavy-job.sh with CARGO_INCREMENTAL=0 and -j4.
cargo test -p socket-patch-core --lib -- requirements_beside_the_governing_lock failed before the Vendored mode in a Pipenv project wires only Pipfile.lock and silently leaves a sibling requirements.txt unpatched, and the hosted → vendored takeover reverts that file's hosted pin to plain PyPI #612 change (Pipfile.lock: [], 0 warnings) and passes after it.cargo test -p socket-patch-cli --test mode_migration_pypi pipenv_hosted_to_vendored_names_the_unpatched_requirements passes, and fails at the warning assertion with the Vendored mode in a Pipenv project wires only Pipfile.lock and silently leaves a sibling requirements.txt unpatched, and the hosted → vendored takeover reverts that file's hosted pin to plain PyPI #612 requirements probe disabled (checked by a temporary local mutation, reverted).cargo test -p socket-patch-core --lib: 5582 passed, 0 failed. This includes formats::governing_locks, the formats purity guard, hosted::governing_root, the npm-flavor tests, the in-memory flavor test (now covering the pnpm-PnP carve-out for both store markers, and yarn.lock overriding it), and the inventory, vlt, pdm and pypi suites.cargo test -p socket-patch-core --test redirect_golden --test hosted_inventory: all pass.cargo test -p socket-patch-cli --test mode_migration_pypi (32/32) --test in_process_vendor_pypi_takeover (6/6) --test in_process_redirect (117/117) --test in_process_redirect_pipenv (9/9) --test in_process_redirect_pnpm (19/19, covers the workspace-root refusals); earlier rounds also ran mode_migration_vlt, in_process_vendor, e2e_vendor_pypi_build, e2e_vendored_production: all pass.mode_migration_npm. 18 of 19 pass. berry_vendored_then_hosted_takeover_leaves_pure_hosted fails identically from a build without this change, so the failure is not from this PR. It only runs where corepack can fetch yarn berry: hosted berry pins through resolutions, but the test expects a pristine package.json.cargo clippy -p socket-patch-core -p socket-patch-cli --all-targets -- -D warnings reports nothing on the lines this PR touches. Main's existing hits (python_crawler, jvm_jar, maven_repo, nuget_feed and others) remain.rustfmt --check is clean on every touched file.vlt-lock.json and pnpm-lock.yaml present and no node_modules/.vlt-lock.json sentinel, vendored wires vlt, while hosted's vlt_drives lets neither lock decide alone. Both rules now read the same family table, but choosing one rule is a maintainer decision.pipenv::rewrite still uses its own liveness rule (a Pipfile beside it) rather than the tool-lock precedence. A leftover Pipfile.lock beside uv.lock can still veto. Aligning it with pypi_tool_lock_governs would change hosted refusals.pdm_drives and pylock. pdm_drives still ignores standalone pylock, which vendored ranks above poetry when it pins the target. Adding it would make hosted rewrite fewer files.crawlers/pkg_managers::detect_npm_pkg_manager (agent mode) answers a different question, which package manager installed node_modules, so it keeps its own order. It shares only the PnP predicate.exists semantics.requirements.txt includes and non-pin lines. The Vendored mode in a Pipenv project wires only Pipfile.lock and silently leaves a sibling requirements.txt unpatched, and the hosted → vendored takeover reverts that file's hosted pin to plain PyPI #612 warning reads only the root requirements.txt, and only its named-requirement lines: -r/--requirement includes, -e editable installs, and bare path or URL lines are not probed, so the target installed through one of those stays silent.Related: #612 (partly addressed: the silent case is now loud; the takeover restore scope is deferred, so this does not close it).
🤖 Generated with Claude Code
Note
Medium Risk
Changes how npm/PyPI install drivers are chosen across vendor, hosted, and agent paths, with new user-visible warnings when requirements.txt competes with a wired tool lock.
Overview
Introduces a single governing-lock precedence table (formats/governing_locks.rs) for npm-family and PyPI tool locks, and replaces scattered hand-copied precedence lists in vendored routing, hosted vlt/npm checks, governing-root detection, PDM gates, and the agent crawler.
npm: Lock flavor detection is one ProjectView-based path (detect_npm_lock_flavor_in); the duplicate in-memory router is removed. pnpm PnP layout is shared via pnpm_pnp_layout_in and ProjectView::is_dir. Multiple-lockfile warnings and sibling-lock lists read the same table (warning order follows precedence).
PyPI (#612): When the governing tool lock is wired but a root requirements.txt pins the same package, vendoring (and hosted→vendored takeover) now emits pypi_multiple_lockfiles naming requirements.txt as still installing unpatched bytes—no longer silent. Contract doc and CLI/integration tests cover the Pipenv + requirements.txt takeover case.
Reviewed by Cursor Bugbot for commit 2a24bd1. Configure here.
Generated by Claude Code
d CRLF/LF outside edited spans and treating $ in URLs literally. Berry writers use BerryStanzas for BOM, EOL, and sorted re-insertion.
B16 behavior change:
CopySourcedistinguishes registry copies from remote tarballs (file:tgz, URL forks, codeload shorthands). Non-registry blocks are no longer repointed to Socket’s registry artifact; they are skipped with new warnings, excluded from VEX where applicable, and rollback refuses legacy hosted pins on those keys. Lock inventory drops registry verifiers for fork copies. Docs indocs/ecosystems.mdare updated.Reviewed by Cursor Bugbot for commit 209e36e. Configure here.
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
formats/governing_locks.rs holds the npm-family precedence (vlt > bun > pnpm > yarn > npm, as wiring families) and the PyPI tool-lock precedence (uv > poetry > pdm > Pipfile), with presence-only queries over both. It is pure, so the disk, snapshot and in-memory views all feed it. Audit B31 (section 3.A). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The vendored npm router is now written once over ProjectView (detect_npm_lock_flavor_in); the hand-copied in-memory router in lock_inventory/view.rs is deleted. The pnpm-PnP layout check runs over the view too (pnpm_pnp_layout_in, with a new ProjectView::is_dir). The inventory's migration-leftover fallback, hosted vlt's sibling list, the hosted vlt preflight inputs and the hosted npm rewriter's another-lock-owns-it check all ask the table instead of spelling the lock list again. Visible differences: the in-memory router now gets the pnpm-PnP carve-out, multiple-lockfile warnings (discarded by its only caller) and the disk refusal wording; vendor_multiple_lockfiles warnings and the redirect_vlt_sibling_lockfiles file list follow precedence order. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
detect_pypi_flavor, the hosted pdm_drives gate and the agent-mode PDM crawler's pdm_drives_project each spelled the uv > poetry > pdm > Pipfile order by hand. They now ask PYPI_TOOL_LOCKS. No behavior change. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ched Vendored PyPI wires one lock. A root requirements.txt exported beside the winning tool lock (pipenv requirements, uv export) never counted as a losing install source, so vendor left it unpatched without a word, vendor --check passed, and a hosted-to-vendored takeover silently restored its hosted pin to upstream (#612). When the root requirements.txt names the package being vendored, it is now listed among the losers of the documented pypi_multiple_lockfiles warning. The takeover runs the same router after its restore, so it now says so too. Keeping the hosted pin in the unwired file is a separate mixed-mode policy question and is not decided here. Refs #612 (audit B31). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The hosted governing-root check kept its own hand lists of npm-family locks: OWN_LOCKS (chained with NPM_LOCKS and VLT_LOCK) for "the project is its own lock root", and WORKSPACE_ROOT_LOCKS for the npm/yarn/Bun workspace-root check. A lock spelling added to NpmLockFamily::files() would not have reached either. Derive both from the table: npm_lock_files() plus pnpm's pre-v3 shrinkwrap.yaml, and the Npm, Yarn and Bun families' files(). The workspace refusal still names the locks npm, yarn, Bun; within the npm family it now lists npm-shrinkwrap.json before package-lock.json (the family's own preference order) when both are present. Also spell requirements.txt through PYPI_REQUIREMENTS in the python-locks branch of detect_pypi_flavor, so the function names the file one way. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- view.rs: the in-memory npm router now shares the pnpm-PnP carve-out with disk; pin it for both store markers (.modules.yaml and a .pnpm/ directory), and that a yarn.lock beside them keeps the yarn berry refusal. - mode_migration_pypi: a Pipenv project with an exported requirements.txt is hosted (both files pinned), then `vendor` takes it over. The takeover wires Pipfile.lock and must name requirements.txt in pypi_multiple_lockfiles as still installing the UNPATCHED bytes. Fails with the #612 requirements probe disabled. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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 2a24bd1. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Resolve conflicts with #978 (yarn nodeLinker-aware PnP detection) and #1073 (vlt package.json workspaces fallback): - npm_flavor.rs: the single ProjectView router keeps main's stale-loader rule (#975) through live_pnp_marker_with, with the configured linker supplied by the new ProjectView::yarn_node_linker (disk probe on disk, the repository's own .yarnrc.yml chain in memory, as main's in-memory copy did). main's in-memory router copy in view.rs stays deleted. - governing_root.rs: workspace-root locks still come from the governing table's Npm/Yarn/Bun families, plus main's vlt-lock.json fallback when vlt.json declares no workspaces. - hosted/memory tests import detect_npm_lock_flavor_in from npm_flavor. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Pick up #1093 so PR CI runs without the macOS legs. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was an error while loading. Please reload this page.
Resolve conflicts with #1044 (governing-locks table), #1083 (yarn offline-mirror outer config) and the ProjectView read path: - npm_family: keep main's npm_governing_family table; the Yarn arm reads the lock through the shared yarn grammar decision instead of trying both readers. - npm_flavor: sniff_yarn_lock takes main's ProjectView and keeps the shared grammar decision. - redirect: keep ClassicSegments and main's rewrite_yarn_classic_with outer-mirror wrapper; drop the now-redundant local import. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Brings in #1044 (governing lock table), #1035, #1038, #1083, #724. Drop the BUN_LOCK/BUN_LOCKB/NPM_LOCKS imports #1044 added to npm_flavor.rs: their only user, vendored_entry_in_use, is removed by this PR (liveness now comes from Discovery::vendor_entry_in_use). This unused import failed clippy in the merge group. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Main's #1044 moved npm lock detection behind a project view and one governing-lock table. The #556 refusal for a lone pnpm branch lock now takes that view too, so the in-memory and snapshot paths name the gitBranchLockfile setting instead of reporting a missing lockfile. Also adds main's new yarn_classic_outer option to the member-lock test helper in the hosted engine. Assisted-by: Claude Code:claude-opus-5-5
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.