Route `get <uuid>` agent mode through download_and_apply_patches_into instead of a second copy of the engine
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
Start in crates/socket-patch-cli/src/commands/get.rs at the UUID agent-mode path and compare it with download_and_apply_patches_into in crates/socket-patch-cli/src/commands/agent_download.rs. Read the existing UUID tests in get.rs and tests/get/, then route the fetched patch through the shared engine and remove the duplicate helpers. Done when the listed output, save-only, dry-run, and nested-apply behaviors meet the acceptance criteria and the UUID tests pass.
由索引模型根據 Issue 內容生成。
描述
[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register comment.
Kind: refactor. Register ID: T01.
Problem
get <uuid> in agent mode does not use the shared download engine. Instead, save_patch_record plus save_and_apply_patch (get.rs L1931-L2172, about 240 lines) repeat, for a single patch, every step of download_and_apply_patches_into (agent_download.rs L1700-L1886):``
- the lock acquire;
- the fail-closed manifest read-modify-write;
- the
files_for_manifestguard; decide_patch_action;write_all_patch_blobsand the unwind on failure;- the uuid-drift and gitignore warnings;
- the lock hand-off and the nested apply;
record_apply_outcome.
The copies have already drifted:
- No-files message: "Patch X has no applicable files; nothing to apply" in get.rs L1951, against "patch has no applicable files" in the engine.```
- Blob failure: get prints its own "Error: Blob decode or write failed for patch" line and builds a different envelope (L1976-L1995).
- Unchanged record: the uuid path re-applies a record that hasn't changed (L2064-L2068). The engine applies only added or updated records.
persist_blobs: the uuid path ignoresDownloadParams.persist_blobs.
The engine already supports a pre-fetched patch: fetch_selected_patches takes a prefetched map, and the vendored arm of the uuid path already goes through download_patch_records_preflighted with it.
Proposed change
- Build the one-element prefetched map from the
PatchResponsethatget <uuid>fetched, and calldownload_and_apply_patches_into, as the vendored arm does. - Delete
save_patch_recordandsave_and_apply_patch. - If the re-apply of an unchanged record (#454) is still wanted, make it an engine rule for every caller, not a get-only branch.
Size
get.rs and possibly agent_download.rs. About −230 / +30 lines.
Acceptance criteria
get <uuid>human and--jsonoutput stay the same, except the no-files and blob-failure wording, which takes the engine's form.- The existing
getuuid tests inget.rsmod testsandtests/get/stay green, and they are updated only where they pinned the drifted wording. --save-only,--dry-runand the nested-apply exit codes are unchanged.
- 主要語言
- 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 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 63/100
qingjian-team/qingjian#894 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
rubys/roundhouse#1757 ·
-
enhancement user-priority/P3
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆