Repository navigation
Sweep update, user_patches, vendor_orphans, vlt_heal - #1929
Mikola Lysenko (mikolalysenko) wants to merge 6 commits into
Conversation
Assisted-by: Claude Code:claude-opus-5-5
Inline download_status and the CHECKING_LATEST const into their one call site each, move channel_id to core as InstallChannel::id beside channel_label, build warnings with RunWarning::new and trim the note_warning essay. Delete the test that compared the const to its own literal and the sentence_case asserts that ui/text.rs already covers. Output is unchanged. Assisted-by: Claude Code:claude-opus-5-5
partition, evidence and skip_protected each open-coded the same selected-ecosystem and conflicts check; they now call one private protecting(). Behavior is unchanged. Assisted-by: Claude Code:claude-opus-5-5
Borrow the wired (eco, uuid) keys instead of cloning both strings per candidate, drop bare issue refs, and fix the still-wired test doc that claimed the advisory names a lockfile restore. The test now pins the whole advisory instead of three .contains checks. Assisted-by: Claude Code:claude-opus-5-5
Inline vlt_vendored_uuids and cleanup_disabled into their one caller each, and delete the healed_store fallback in heal_after_rewrite: a heal needs a heal target, which needs a final lock, so the bundled-copy block above it has always set healed_store. Drop bare issue refs and a full std path. Assisted-by: Claude Code:claude-opus-5-5
Keep vlt_vendored_uuids as a named helper, assert the healed-store invariant in debug builds instead of the deleted fallback, and pin InstallChannel::id's telemetry names in a table test. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Assisted-by: Claude Code:claude-opus-5-5
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 94d90fd. Configure here.
|
[burn-down agent] Labeled Ready for review at 94d90fd.
Generated by Claude Code |
Final review briefWhat it does: This is a cleanup refactor with no change in behaviour. It moves Risk: low. The only change that affects runtime is in Look here:
Verified:
Changes I made: none. Notes (non-blocking):
Auto-merge is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
LLM Description written by Claude Code:claude-opus-5-5
Sweep of
crates/socket-patch-cli/src/commands/{update,user_patches,vendor_orphans,vlt_heal}.rs, following theircoverage/files.tsvaudit notes (architecture refactor routine; living document in discussion #1830, Part 4 "structure"). All four files were audited and free of open PRs; the structural candidates scoring 6 or more are all still blocked by open PRs.Changes
update.rsdownload_statusand theCHECKING_LATESTconst into their one call site each.channel_idto core asInstallChannel::id, besidechannel_label, and pinned its telemetry names with a table test. Shown red→green by mutatingPypi => "pypi".note_warningbuilds its warning withRunWarning::new, and its 9-line doc is cut to 2.checking_latest_status_line, which compared the const to its own literal, and thesentence_caseasserts thatui/text.rsalready covers.user_patches.rs:partition,evidenceandskip_protectedeach open-coded the same selected-ecosystem +conflictscheck. They now share one privateprotecting().vendor_orphans.rs(&str, &str)keys instead of cloning two strings per candidate.rollbackandremoveleave an unledgered.socket/vendor/npm/<uuid>/artifact dir behind (e.g. the losing side of a merge), whilevendor --revertsweeps it, and nothing afterwards reports it #1610 ×2, Vendored yarn classic: after a git merge resolves .socket/vendor/state.json to one side,vendor --checkandrollbackexit 0 while the other side's package stays wired, and rollback deletes the ledger, stranding it #991) and trimmed the sweep's doc where it restated the struct.assert_eq!instead of three.containschecks.vlt_heal.rscleanup_disabled.healed_storefallback at the end ofheal_after_rewrite. It was dead:healedneeds a heal target, targets come only fromfinal_lock, and the bundled-copy block above it setshealed_storewheneverfinal_lockisSome. Adebug_assert!now states the invariant.vexattests not_affected while a bundled copy of the same name@version in node_modules/.vlt stays unpatched (the #325 fix covers npm locks only) #471 ×2, Support vlt in hosted, vendored and agent modes #269) and a fullstd::collectionspath.git diff --stat: 5 files, +80 / −116. That is about −27 production and −9 test lines.Not done from the notes, and why
update.rspin_versionassemver::Version(which would delete the unreachableErrarm):lib.rstests compare it as a string, andlib.rsis held by Sweep cli args.rs: inline, dedupe tests, trim docs #1842.parse_version_pin→ coreparse_release_tag: it changes behavior (vv3.4.0is accepted today).user_patchesreturningRunWarningandrefusereusinglock_cli::error_envelope: the callers are inget.rs,apply.rsandvendor.rs(Fix Go patch delivery, audits, and reinstalls #1698) and inlock_cli.rs(Sweep hosted_unwind, lock_cli, list, commands/mod (+ rollback dead branch) #1864). The cross-file gate loop is T38 (The project-patch (user_patches) gate loop is written five times, and scan's and vendor's copies have drifted #1911).vendor_orphans: thesweep_orphan_vendor_dirsforwarder stays, because its callers are invendor.rs(Fix Go patch delivery, audits, and reinstalls #1698).vlt_heal:vlt_vendored_uuidsstays as a named helper (see review below). The swallowedload_stateerror androllback_heal's.ok()change output, so they are left for an issue.advisory_variants_follow_severity_orderis kept: it is the only test of the precedence betweenstale_left,undeterminableandinvalidated, since the optional-copies test sets one at a time./code-review high
No correctness findings. Of its 6 low-severity notes, I applied 3: kept
vlt_vendored_uuidsnamed, added thedebug_assert!, and added theInstallChannel::idtable test. I skipped the other 3:format!.!contains("git checkout")checks next to the exact match. The exact match already pins their absence.idas a method vschannel_labelas a free fn. This is style; makingchannel_labela method would touch its other callers.Verification
cargo clippy --workspace --all-features -- -D warnings: clean.socket-patch-cli --lib(938 tests) and coreupdate::tests: pass.self_update_e2e,self_update_failures_e2e,update,user_patches,in_process_vendor,in_process_rollback_vendored,in_process_rollback_hosted,in_process_vendor_bun_takeover,mode_migration_vltandin_process_remove_repair_lifecycle: pass.in_process_redirect, 149 pass. 3 chmod-based tests fail identically onmainin the root sandbox:partial_lockfile_write_failure_exits_1_and_writes_no_ledger,redirect_json_mode_write_failures_emit_error_envelopeandvlt::scan_redirect_vlt_heal_invalidation_failure_warns.Behavior change: none. Output bytes, JSON, exit codes and telemetry values are identical. No
cfg(windows)/cfg(unix)code was touched.Risk: low.
🤖 Generated with Claude Code
https://claude.ai/code/session_011f9aePD791iNBnbWkcoVVH
Note
Low Risk
Refactor-only changes across self-update, patch gating, vendor cleanup, and VLT heal with no intended behavior change.
Overview
Architecture sweep across four CLI command modules (plus core channel telemetry): deduplication and colocation, not feature work.
Self-update (
update.rs+ core): Telemetry install-channel IDs move from a CLI-localchannel_idtoInstallChannel::id()in core, with a table test locking stable names. One-off helpers for status strings are inlined at their single call sites;note_warningbuilds advisories viaRunWarning::new. Redundant unit tests that only echoed literals or duplicatedsentence_casecoverage are removed.User patch gate (
user_patches.rs):protecting()centralizes the “selected ecosystem + project patch conflicts” check used bypartition,evidence, andskip_protected.Vendor orphan sweep (
vendor_orphans.rs): Lockfile wiring lookup uses(&str, &str)keys instead of cloning eco/uuid per candidate. Docs lose stale issue references; the still-wired advisory test pins the full message withassert_eq!.VLT heal (
vlt_heal.rs):cleanup_disabledis inlined; a deadhealed_storefallback after rewrite heal is dropped in favor of adebug_assert!on the existing invariant. Minor comment/type cleanup.Intended to be behavior-neutral (same user-visible output, JSON, exit codes, telemetry).
Reviewed by Cursor Bugbot for commit 94d90fd. Configure here.
Generated by Claude Code