Repository navigation
Description
[agent] Filed by the scheduled architecture refactor routine. Register: register comment, lead L04.
Kind: bug (a warning that says the opposite of what happened). Checked on main at da012af.
Problem
The vlt heal runs in three directions: after a hosted rewrite (scan / get --mode hosted), after rollback / remove restore the registry pins, and after a hosted → vendored takeover. When it cannot check an installed copy (node_modules is a link, or node_modules/.vlt-lock.json is missing or unreadable), all three print the hosted direction's text.
What the rollback heal (rollback_heal) returns for a project with an installed store copy of left-pad and an unreadable hidden lock:
redirect_vlt_reinstall_required: vlt-lock.json pins Socket-patched packages, but socket-patch could not check 1 installed copies (node_modules is a link, or node_modules/.vlt-lock.json is missing or unreadable); run `vlt ci` to be sure the patched packages are installed.
Both halves are false there. The rollback has just taken the Socket-patched pin out of vlt-lock.json, and the copy that may still be installed is the patched one: vlt ci is what makes sure the registry package is installed. Someone who ran rollback or remove to get rid of a patch reads that the lock still pins it.
Every other arm of the same advisory is worded per direction. For a copy left stale, for example:
- hosted: "vlt-lock.json pins Socket-patched packages, but node_modules still holds N unpatched copies …"
- rollback: "restored registry pins for N packages, but node_modules still holds N patched copies …"
- takeover: "vendored N hosted-pinned packages, but node_modules still holds N installed copies of the vendored packages …"
The contract's redirect_vlt_reinstall_required row says the same: "vlt-lock.json pins (or, after rollback/remove, no longer pins) Socket-patched packages", and the detail "says what happened and what to run".
A project reaches this without anything exotic. Going by the code, the heal itself removes node_modules/.vlt-lock.json when it invalidates a stale copy, and keeps the copies it judged healthy. If rollback runs before the next vlt install, those kept copies have no hidden lock to be checked against. A symlinked node_modules gets there directly.
Where
rollback_detail and takeover_detail both call undeterminable_detail, whose one text fits only reinstall_detail. No test pins the rollback or takeover wording of this arm.
Evidence
A unit test in commands/vlt_heal.rs:
let tally = HealTally { undeterminable: 1, ..Default::default() };
let rollback = rollback_detail(&tally, 1).unwrap();
let takeover = takeover_detail(&tally, 1).unwrap();
for (what, detail) in [("rollback", &rollback), ("takeover", &takeover)] {
assert!(
!detail.contains("vlt-lock.json pins Socket-patched packages")
&& !detail.contains("be sure the patched packages are installed"),
"after a {what} the lock no longer pins a Socket-patched package: {detail}"
);
}On da012af:
rollback: vlt-lock.json pins Socket-patched packages, but socket-patch could not check 1 installed copies (…); run `vlt ci` to be sure the patched packages are installed.
takeover: vlt-lock.json pins Socket-patched packages, but socket-patch could not check 1 installed copies (…); run `vlt ci` to be sure the patched packages are installed.
after a rollback the lock no longer pins a Socket-patched package
test result: FAILED. 0 passed; 1 failed
Calling rollback_heal itself over a project with a store copy and a corrupt node_modules/.vlt-lock.json returns the same text, and keeps the copy.
Planned fix
Give the unchecked arm the direction the other arms have: rollback_detail says the registry pins were restored and that vlt ci makes sure the registry packages are installed, and takeover_detail says the packages were vendored. reinstall_detail keeps today's text. One file, about 20 production lines and the test above. The warning code, the exit codes and the JSON shape stay as they are; only the detail text of two arms changes.
What the lead claimed
L04 said the heal swallows ledger and lock read errors and goes on. That part does not hold: the heal itself reads no ledger, an unreadable vlt-lock.json after a rollback classifies the installed copy as stale and removes it (so vlt install puts the registry bytes back), and an unreadable hidden lock is reported as not checked. The report of that last case is what is wrong.
Generated by Claude Code
Activity
refactor: #2253, #2254 filed; #1982 confirmed
mikolalysenko commentedon Nov 26, 2026
[agent] Claiming this for the architecture refactor routine. Branch: arch-refactor/2254-vlt-heal-unchecked-direction.
Generated by Claude Code
Report an unchecked vlt copy as the run it follows
List the unchecked-copy tests in the vlt map
refactor: #2265 ready for #2254; L28 and L29 added