-g agent scan + rollback silently unpatch a hosted NuGet project's install

Đang mở
#1,793 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ó
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
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
backend, cli

Hướng nghiên cứu

Start with the hosted NuGet ownership handling described around NuGetCrawler::global_roots_shared_with, commands::vendor_owned_keys, and the hosted_wiring_retained warning, then inspect the e2e_nuget_dotnet_build fixture. Reproduce with hosted scan, locked restore, global agent scan, and global rollback using NUGET_PACKAGES set to the restore folder. Done means the global workflow preserves the hosted pin's patched bytes and reports the ownership outcome consistently; the issue leaves the CLI contract decision open.

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

Mô tả

agent:triaged bug pm:nuget priority:p3

[agent] Split out of #489 (the hosted-mode variant from https://github.com/SocketDev/socket-patch/issues/489#issuecomment-5937178049, reported 2026-10-01).

Summary

A hosted NuGet project's locked restore extracts the Socket-feed nupkg into the global packages folder (~/.nuget/packages or NUGET_PACKAGES). A global agent run started in that project treats the copy as a separate global install. scan -g --mode agent --yes reports applied: 1 and writes an agent record. rollback -g --yes then restores upstream bytes into it with rolledBack: 1. The next dotnet restore --locked-mode says "up-to-date" and keeps the pristine bytes, so the project builds unpatched with exit 0 everywhere.

This predates #446: -g never consulted the project's hosted pins. #1790 fixes the vendored half of #489. It treats the project's vendored NuGet packages as ledger-owned when the global folder is one the project restores into (NuGetCrawler::global_roots_shared_with, commands::vendor_owned_keys).

Why it's separate

Hosted mode has no ownership skip even in project scope. Agent scan over a hosted pin warns (hosted_wiring_retained) and proceeds, and project-scope rollback unwinds the pin through its hosted leg. Under -g neither the hosted leg nor the warning runs. Fixing this needs a contract decision: either a new skip reason/code for "hosted pin owns this copy" in scan/apply/rollback under -g, or running discovery under -g and reusing hosted_wiring_retained plus a rollback skip. That's new CLI surface, not the vendored ownership rule #1790 restores.

Repro

As in #489's hosted comment: the e2e_nuget_dotnet_build hosted fixture, scan --mode hosted, a locked restore, then scan -g --mode agent --yes and rollback -g --yes with NUGET_PACKAGES set to the restore's folder.


Generated by Claude Code

Ngôn ngữ chính
Rust
Star
9
Fork
2
Merge trung bình
20 giờ 20 phút
Pull request đã merge (30 ngày)
659

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.