pnpm reader follow-ups from #2009's review

Đang mở
#2,044 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
backend, devtools

Hướng nghiên cứu

Start with the burn-down review comment on #2009 and read the referenced pnpm inventory, lock, grammar, and hosted files. The issue lists several independent follow-ups, including a deduplication bug and mismatched env-document detection; establish which item is still in scope before tracing its named functions. Done means the selected follow-up is addressed and its behavior is covered by relevant tests, though this issue names no tests.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

agent:triaged pm:pnpm priority:p1

Follow-ups from the /code-review high pass on #2009 (pnpm readers through one walk, lock-model PR 2a). The owner settled the main question there: an env-document ref is withheld when the project document of the same lock resolves the same release elsewhere. These lower-impact findings were left out of #2009 on purpose. Paths are as of the lock-model/2a-pnpm-readers branch.

  • Custom patch-server origins under lockfile=false. withhold_hosted_pins (crates/socket-patch-core/src/vendor/lock_inventory/npm_family.rs) calls hosted_patch_uuid(url, &[]). Under lockfile=false, a pin from a custom --patch-server-url origin keeps its integrity, while discovery withholds it. The inventory has no per-run origin list yet (lock-model PR 12).
  • Dedup rank after the integrity drop. Dropping a hosted entry's integrity under lockfile=false lowers its rank in dedup_prefer_integrity (crates/socket-patch-core/src/vendor/lock_inventory/mod.rs). A member or Rush registry duplicate that has integrity can then replace the hosted instance in the collapsed inventory.
  • Config-only entries count as lock-resolvable for vendor. PnpmLock::entries() (crates/socket-patch-core/src/formats/pnpm/mod.rs) now lists env-document (config-dependency) packages. The vendored planners (vendor/pnpm_lock.rs, vendor/pnpm_lock_legacy.rs) wire only the project document, so vendoring a package that exists only as a config dependency fails late instead of with package_not_installed.
  • UnwiredCopy scope vs the Unattested key. UnwiredCopy is scoped per (file, TreePart) (crates/socket-patch-core/src/vex/discover/mod.rs), but the Unattested mark it produces is keyed by (purl, uuid). An env-tree bundled-copy mark therefore also withholds the project tree's ref of the same patch. This direction fails closed, so it is a missed attestation, never a false one. The reverse direction (project copies withholding env refs) is now intended (#2009).
  • is_env_document vs check_env_document disagree. grammar::is_env_document (crates/socket-patch-core/src/formats/pnpm/grammar.rs) needs at least one env field and is CRLF-aware. lines::check_env_document (crates/socket-patch-core/src/formats/pnpm/lines.rs) accepts zero fields. They can disagree on which document is the env one.
  • Cleanups.
    • LockfileEntry::pnpm_env: bool (vendor/lock_inventory/mod.rs) on the cross-ecosystem entry duplicates TreePart.
    • PnpmLockState::materialize() (formats/pnpm/hosted.rs) clears the vendored cache when it doesn't need to.
    • is_rush is probed twice per inventory (vendor/lock_inventory/npm_family.rs and vendor/lock_inventory/pnpm.rs).

Context: the burn-down review comment on #2009.

🤖 Generated with Claude Code

Ngôn ngữ chính
Rust
Star
9
Fork
2
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
309

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của SocketDev/socket-patch

Tất cả issue của SocketDev/socket-patch

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.