Repository navigation
Fix vlt vendoring of prepare-family scripts (#1633) - #1637
Open
Mikola Lysenko (mikolalysenko) wants to merge 3 commits into
Open
Mikola Lysenko (mikolalysenko) wants to merge 3 commits into
Mikola Lysenko (mikolalysenko) wants to merge 3 commits into
Conversation
Assisted-by: Claude Code:claude-opus-5-5
vlt runs a package's preprepare and postprepare scripts for a file: directory dependency, each on its own, just like prepare. Vendored vlt mode only refused packages with preinstall, install, postinstall or prepare, so a package whose only script was postprepare got vendored. The next `vlt ci` then ran that script inside the committed vendor directory: `vendor --check` and `vex` failed, and `repair` looped. Such packages now get vendor_vlt_build_scripts_unsupported like the others, and the docs name all six scripts. Fixes #1633 Assisted-by: Claude Code:claude-opus-5-5
A project that vendored a postprepare-only package with an earlier release kept that directory on every re-run, so the next `vlt ci` still rewrote it. Re-running vendor now refuses such a directory with the same vendor_vlt_build_scripts_unsupported refusal, pointing to --mode hosted, instead of reporting success. The refusal detail now lists several build steps with commas instead of a chain of "and". Refs #1633 Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 18, 2026 01:15
Collaborator
Author
|
BugBot review Generated by Claude Code |
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 8ab8b12. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLM Description written by Claude Code:claude-opus-5-5
Fixes #1633
Summary
Vendored vlt mode now refuses a package whose
preprepareorpostpreparescriptvlt buildwould run inside the committed vendor directory. Before, such a package was vendored with exit 0, and the nextvlt cirewrote the artifact. After thatvendor --checkandvexfailed, andrepairlooped.Root cause
vlt_build_steps(crates/socket-patch-core/src/vendor/npm_dir.rs) lists whatvlt buildruns in a package's own directory. Vendored vlt refuses any package with a non-empty result (vendor_vlt_build_scripts_unsupported). The list hadpreinstall,install,postinstallandprepare. vlt also runspreprepareandpostpreparefor a prepable (file:) node, and each one runs even when it is the package's only script: vlt'snodeNeedsBuildtestsprepare || preprepare || postprepare.Changes
vlt_build_stepsnow covers all six scripts. This one helper backs both the read-only preflight (vlt_vendor_preflight) and the staged-download refusal, so both now refuse.vendor/scan --mode vendoredon it now gives the same refusal (--mode hosted) instead of success, so projects that are already in Vendored vlt scan accepts a package with apreprepareorpostpreparescript, whichvlt cithen runs inside the committed vendor directory, sovendor --checkandvexfail andrepairloops #1633's broken state get told what to do.docs/ecosystems.mdandCLI_CONTRACT.mdnow name all six scripts.Test evidence
Red→green regression tests for #1633. Each was run failing before the fix and passing after it:
vendor::npm_dir::tests::vlt_build_steps_name_every_script_vlt_build_runs_in_place:preprepare-only andpostprepare-only manifests (before:left: []).vendor::vlt_lock::tests::the_preflight_decides_every_refusal_without_writing: preflight refuses both scripts.vendor::vlt_lock::tests::a_prepare_family_only_package_refuses_on_the_local_build: a full vendor run refuses both scripts, writes nothing, and leaves the lock untouched.vendor::vlt_lock::tests::a_dir_vendored_with_a_postprepare_script_refuses_on_reuse: the committed dir was vendored before the fix, the installed copy is clean, and the dir is refused on reuse (dry run and real run) with the lock unchanged. With the reuse check disabled, this test fails.Local runs:
cargo fmt --all -- --check: cleancargo clippy --workspace --all-features -- -D warnings: cleancargo test --workspace --all-features --no-fail-fast: 232 suites ok. 4 suites had environment-only failures, none in vlt build-step code:e2e_bun_lockbandvlt::scan_redirect_vlt_heal_invalidation_failure_warnsneed network, and the rest are write-failure/unremovable-file tests that can't fail as root in this container.e2e_vendor_vlt_buildwith vlt 1.2.0: couldn't run here, because the container's proxy blocks the suite's npmjs fetch (could not fetch left-pad@1.3.0 from npmjs). CI runs it on Linux/macOS/Windows.Per-issue checklist
preprepareorpostpreparescript, whichvlt cithen runs inside the committed vendor directory, sovendor --checkandvexfail andrepairloops #1633postprepare-only: unit, preflight, staged-run and reuse testspreprepareorpostpreparescript, whichvlt cithen runs inside the committed vendor directory, sovendor --checkandvexfail andrepairloops #1633preprepare-only: unit, preflight and staged-run testsdocs/ecosystems.mdvlt notes andCLI_CONTRACT.mdrefusal rowReview notes (/code-review high)
bun_lockb.rs. That list is bun.lockb's binary field order for its script table, which is a different contract from "what vlt runs in place". Coupling the two would let a change to one silently change the other.Generated by Claude Code