Agent-mode PyPI apply leaves .dist-info/RECORD stale (advisory only): rewrite the rows of patched files

Đang mở
#2,201 0 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python, rust
Lĩnh vực
backend

Hướng nghiên cứu

Start with the advisory's source at crates/socket-patch-core/src/patch/sidecars/types.rs (around line 104) and its dispatch in patch/sidecars/mod.rs (around line 191), then read the cargo sidecar that rewrites .cargo-checksum.json as the model to follow. Done means RECORD rows for patched files get a fresh sha256 urlsafe-base64 hash and size, line endings are kept, rollback restores them, and the advisory still fires when a row cannot be rewritten.

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

Mô tả

agent:triaged enhancement pm:pip priority:p1

Summary

After agent mode patches files of a PyPI distribution, the hashes in *.dist-info/RECORD are left stale and the tool emits the PypiRecordStale advisory (crates/socket-patch-core/src/patch/sidecars/types.rs:104: "we didn't rewrite .dist-info/RECORD"; dispatched from patch/sidecars/mod.rs:191). Vendored mode does not have the problem because the wheel it installs carries a regenerated RECORD.

Why this matters

RECORD is what pip and other installers use to verify and to uninstall a distribution, and integrity tools compare it with the files on disk. After a patch they report the patched files as modified. For a text patch that is one line per file; for a patch that replaces a compiled extension it is the same single line. Rewriting it is mechanical: I rewrote the RECORD line for one changed file in a 145-entry pillow wheel and re-validated all 139 hashed entries.

Suggested direction

Rewrite the RECORD rows of the files a patch wrote (sha256 urlsafe-base64 and size, preserving the file's line endings), as the cargo sidecar already does for .cargo-checksum.json, and restore them on rollback. Keep the advisory for the cases that cannot be rewritten (no RECORD, RECORD not writable, a row that did not match the pre-patch file).

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.