remove and rollback each render VendorRevertStep in their own loop, and the loops drifted (remove --preserve-state --dry-run previews a full revert)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
[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.
- Lingua principale
- Rust
- Stelle
- 9
- Fork
- 2
- Merge medio
- 20h 20m
- PR unite (30g)
- 659
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SocketDev/socket-patch
-
agent:triaged arch-audit priority:p3 refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
SocketDev/socket-patch#1860 ·
I maintainer di solito rispondono entro 1 giorno
-
agent:triaged arch-audit priority:p3 refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
SocketDev/socket-patch#1838 ·
I maintainer di solito rispondono entro 1 giorno
-
Nightly gem e2e red on bundler 1.17/2.1: CRLF source-block rollback unattributableForse già presa @mikolalysenko l’ha presa 1 giorno fa. Apertaci-janitor
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
SocketDev/socket-patch#1997 ·
I maintainer di solito rispondono entro 1 giorno
-
arch-audit refactor
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
SocketDev/socket-patch#1993 ·
I maintainer di solito rispondono entro 1 giorno
-
arch-audit refactor
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
SocketDev/socket-patch#1992 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di SocketDev/socket-patch
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
near/near-sdk-rs#1676 ·
I maintainer di solito rispondono entro 2 giorni
-
auto:producer auto:security
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
fritzprix/libr-agent#2595 ·
I maintainer di solito rispondono entro 1 giorno
-
area:fs type:fix
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Tripstack-Corp/spyc#1002 ·
I maintainer di solito rispondono entro 1 giorno
-
github_actions security
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
dekobon/big-code-analysis#1815 ·
I maintainer di solito rispondono entro 1 giorno
-
[Detail Bug] Request logs can be forged via control characters in fetch object keys (log injection)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
s2-streamstore/cachey#211 ·
I maintainer di solito rispondono entro 1 giorno