remove and rollback each render VendorRevertStep in their own loop, and the loops drifted (remove --preserve-state --dry-run previews a full revert)
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
- 55/100
Hướng nghiên cứu
Start with crates/socket-patch-cli/src/commands/vendored_backend/mod.rs, then compare the revert handling loops in commands/remove.rs and commands/rollback.rs. Read the vendored rollback and remove tests named in the acceptance criteria, then add coverage for remove --preserve-state --dry-run --json. Done means dry-run and wet-run emit the same event code and preserved count, with the listed vendored tests passing.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register comment.
Kind: refactor (with one suspected behavior drift). Register ID: T16.
Problem
Both commands call VendoredBackend's revert for each ledger key and then turn the VendorRevertStep into events, warnings and counters, each in its own loop:
vendor.rs classifies the same steps two more times (L4537-L4610, L4637-L4710).
The loops have drifted in four ways:
1. Dry run with --preserve-state. Core returns WouldRevert before it checks keep_artifact (vendored_backend/mod.rs L380-L384).``
- rollback handles this with a
WouldRevert if preservearm, which counts the key as preserved. - remove has no such arm. It prints "(artifact preserved)" but emits
Verified/vendor_would_revert/ "vendoring would be reverted on remove" and never bumpsleg.preserved. - So a dry run reports a revert, while the wet run reports
skipped/vendor_state_preserved. - I found this by reading the code; I did not run it, and no remove test covers it.
2. Go-undo warnings.
- remove turns them into per-key
Skippedevents. - rollback turns them into run warnings and drops the key.
3. Drift-keep text.
- remove uses
cause.reason(). - rollback writes its own "lockfile wiring drifted…" text.
4. Failures.
- remove stops at the first failed key.
- rollback collects every failure.
Proposed change
- Add a
WouldPreservestep to corerevert_one(opts.dry_run && opts.keep_artifact). - Give
VendoredBackenda typed per-run tally: reverted, preserved, kept-with-cause, failed and warnings. - Leave remove and rollback with rendering only, in their own verb ("remove" / "roll back again").
- Decide in the PR whether remove keeps stop-at-first-failure. If it does, keep it as an explicit option on the tally driver rather than a second loop.
Size
3 files (vendored_backend/mod.rs, remove.rs, rollback.rs), about −150 lines.
Acceptance criteria
- rollback's vendored tests (
in_process_rollback_vendored.rs,rollback_duality_invariants.rs) and remove's vendored e2e tests pass unchanged. - A new test runs
remove --preserve-state --dry-run --jsonover a vendored entry and asserts the same event code and the samepreservedcount as the wet run.
- Ngôn ngữ chính
- Rust
- Star
- 8
- Fork
- 2
- Merge trung bình
- 18 giờ 47 phút
- Pull request đã merge (30 ngày)
- 637
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của SocketDev/socket-patch
-
agent:triaged arch-audit priority:p3 refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
SocketDev/socket-patch#1860 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged arch-audit priority:p3 refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
SocketDev/socket-patch#1838 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
arch-audit refactor
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
SocketDev/socket-patch#1987 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged arch-audit priority:p3 refactor
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
SocketDev/socket-patch#1983 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged arch-audit bug priority:p3
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 55/100
SocketDev/socket-patch#1982 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của SocketDev/socket-patch
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 70/100
OpenZeppelin/openzeppelin-relayer#967 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DecisionOutcome::label() / n_dosed(): engine-side mapping so downstream needs no wildcard armĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
src/runs.rs:1987: a missing --source-run-id now answers 400 "Source run ... does not exist", not 404Đang mởnightly-audit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
antithesishq/snouty#602 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
libnativeapi/nativeapi#21 ·