Carry hosted stale-install and takeover warnings as RunWarning, not serde_json::Value round-tripped through run_warning_of
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
Read scan/hosted.rs first, especially run_warning_of and run_redirect_selected_untracked, then trace the warning fields and constructors in scan/hosted/python.rs, scan/hosted/nuget.rs, scan/hosted/takeover.rs, and vlt_heal.rs. Convert these paths to carry RunWarning, mapping RewriteWarning once. Run the named hosted and redirect end to end suites; done when their human and JSON warning output is unchanged and no listed file contains a json! warning literal.
由索引模型根據 Issue 內容生成。
描述
[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register comment.
Kind: refactor. Register ID: T27 (part of T21, the warning sink).
Problem
Several hosted helpers build their warnings as untyped serde_json::json!({"code": .., "detail": ..}) values:
- the gem probe: scan/hosted.rs L300, L309;
- scan/hosted/python.rs L201;``
- scan/hosted/nuget.rs L75;````
- vlt_heal.rs L373, L417;
- scan/hosted/takeover.rs L161, L238, L286, L382, L492, L609, L623. takeover even converts typed core
RewriteWarnings into JSON values.
The caller then parses them back with run_warning_of, scan/hosted.rs L162-L167:`````
RunWarning::new(
w["code"].as_str().unwrap_or_default(),
w["detail"].as_str().unwrap_or_default(),
)
A typo in a key silently becomes an empty code. The fold in run_redirect_selected_untracked (hosted.rs L1863-L1898) juggles four warning shapes at once: RewriteWarning, Value, the go audit's (String, String), and RunWarning.
Proposed change
- Make
StaleInstallOutcome.warningsandtakeover::Finished.warnings(and the vlt heal outcome) aVec<RunWarning>. - Build those warnings with
RunWarning::newat each site. - Map
RewriteWarning→RunWarningonce with aFromimpl. - Delete
run_warning_of.
Size
5 files (scan/hosted.rs, scan/hosted/{python,nuget,takeover}.rs, vlt_heal.rs). Roughly −40 / +20.
Acceptance criteria
--jsonwarnings[]and the human output are unchanged. The e2e hosted suites (e2e_hosted_production.rs,e2e_redirect_*) guard them.- No
json!({"code"warning literal remains in these files.
- 主要語言
- Rust
- 星號
- 9
- 分支
- 2
- 平均合併
- 20 小時 47 分鐘
- 30 天內合併 PR
- 681
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
SocketDev/socket-patch 的其他 Issue
-
agent:triaged arch-audit priority:p3 refactor
難度 2/5 1-3 小時 新手友好度 83/100
SocketDev/socket-patch#1860 ·
維護者通常 1 天內回覆
-
agent:triaged arch-audit priority:p3 refactor
難度 2/5 1-3 小時 新手友好度 78/100
SocketDev/socket-patch#1838 ·
維護者通常 1 天內回覆
-
arch-audit refactor
難度 4/5 3-5 天 新手友好度 54/100
SocketDev/socket-patch#1993 ·
維護者通常 1 天內回覆
-
arch-audit refactor
難度 3/5 1-2 天 新手友好度 66/100
SocketDev/socket-patch#1992 ·
維護者通常 1 天內回覆
-
agent:triaged arch-audit priority:p3 refactor
難度 4/5 3-5 天 新手友好度 35/100
SocketDev/socket-patch#1987 · 1 則留言 ·
維護者通常 1 天內回覆
查看 SocketDev/socket-patch 的全部 Issue
相似的 Issue
-
docs(metrics): replace stale src/metrics.rs line anchors in dashboard-metrics.md with symbol names未關閉
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 1 天內回覆
-
ci-cd desktop size:low telemetry-improvement telemetry-round-1
難度 2/5 1-3 小時 新手友好度 66/100
vfarcic/dot-agent-deck#2079 ·
維護者通常 1 天內回覆
-
enhancement user-priority/P3
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 2 天內回覆