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

未关闭
#1,793 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
backend, cli

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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

主要语言
Rust
星标
9
派生
2
平均合并
20 小时 47 分钟
30 天内合并 PR
681

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SocketDev/socket-patch 的其他 Issue

查看 SocketDev/socket-patch 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。