Repository navigation
vendor --force documents a missing-file tolerance and a mismatch warning that no vendored backend implements #923
Description
[agent] Filed by the scheduled architecture audit routine (ecosystems and formats). Register: discussion #560 register.
Kind: refactor (dead parameters + stale help/contract text; no behavior change). Source: new finding (extends review 5.2, which noted three backends ignoring _sources/_force); register E65.
Problem (verified on 9c43dfc)
Since vendored acquisition became service-only, every vendored backend threads force: bool and sources: &PatchSources down to a sink that discards both. Every sink is underscore-named:
- npm family:
npm_common::stage_patch_packandnpm_dir::stage_patch_dir(vlt), behind all seven npm-family drivers; cargo::vendor_cargo_crate,composer_lock::vendor_composer,``golang::vendor_go_module;gem::materialise_patched_copy,nuget_feed::materialise_patched_nupkg,pypi::acquire_patched_wheel, andmaven_repovendor_maven_jvm/materialise_and_write.``
All other uses of force and sources under vendor/ are pass-throughs to these sinks.
The user-facing documentation still describes the removed behavior:
- The
vendor --forcehelp (commands/vendor.rs#L71-L84) and the contract's flag row (CLI_CONTRACT.md#L89) say it "tolerate[s] missing patch-target files in the stage". The only live effect offorceis the CLI's variant-probe bypass (#L2060,#L2503). - Both texts, and the error-code table (
CLI_CONTRACT.md#L1234), promise avendor_content_mismatch_overwrittenwarning. No production code emits it; the string appears only in that doc comment and in tests that assert its absence. The test docs ofmismatched_install_does_not_change_the_server_artifact(in_process_vendor.rs) andscan_vendor_annotates_mismatched_baseline_and_vendors_anyway(scan_vendor_e2e.rs) still describe it, while the assertions checkvendor_prebuilt_downloaded. - The repo's own test
vendor_uses_server_artifact_when_installed_file_is_missingalready pins thatvendorandvendor --forcebehave the same with a missing target. The core testvendor_force_still_skips_missing_files(npm_lock.rs) claims "vendor --forcekeeps its missing-file tolerance" but passes for the same reason.
Proof (executed twice on 9c43dfc): a throwaway copy of vendor_force_still_skips_missing_files run with force in [false, true], with the installed index.js deleted, gave identical results: success=true entry=true warnings=["vendor_prebuilt_downloaded"] both times.
Symptoms / impact
- Users and CI scripts set
--force/SOCKET_FORCEfor vendoring expecting a tolerance that doesn't exist (and isn't needed). - Decision Decide: give SOCKET_FORCE per-command names so forcing a self-update doesn't also force apply and vendor #615 (split
SOCKET_FORCEper command) argues from "everyvendorwith missing-file tolerance on"; in vendor mode the variable only bypasses the variant probe. - 9 backend signatures carry two dead parameters, which also keeps the CLI building a
PatchSourcesfor vendoring (vendored_backend/mod.rs#L71-L83)`` only to discard it.
Proposed change
- Delete the
forceandsourcesparameters from every vendored backend entry point and sink listed above, fromtest_support's wrappers and fromApplyRequest's vendoring path. Keepforceonly where the CLI's variant probe reads it. - Rewrite the
--forcehelp andCLI_CONTRACT.md#L89to "bypass the installed-variant probe for multi-release ecosystems". Markvendor_content_mismatch_overwrittenin the error-code table as no longer emitted; keep the row so that consumers matching on it aren't surprised. - Rename
vendor_force_still_skips_missing_filesto state what it now pins: vendoring ignores the installed copy. Fix the two stale test doc comments.
Size and scope
About −60 production lines across ~15 files in vendor/, plus the CLI vendor.rs/vendored_backend call sites and two doc rows. Out of scope: PackageSource / installed_dir (#800), PatchSources::mem_blobs (#746) and the env-var naming decision (#615).
Acceptance criteria
-
grep -rn "_force\|_sources" crates/socket-patch-core/src/vendorfinds no parameters. -
vendor_uses_server_artifact_when_installed_file_is_missingand every vendored backend suite stay green. - The
--forcehelp,CLI_CONTRACT.mdanddocs/describe only the variant-probe bypass.
Dependencies
Best landed after or with #800 (the same signatures). Informs #615.
Activity
audit-ecosystems: file E22 (#920, #922) and E65 (#923); E64 in PR #909
Refactor run 2026-10-06T06:56Z: re-rank queue
mikolalysenko commentedon Oct 9, 2026
[agent] Re-checked against main @
03b9418(architecture audit, ecosystems and formats). The code moved, and the finding is unchanged.forceandsources:npm_common.rs#L306-L308,npm_dir.rs#L544-L546,cargo.rs#L726-L729,composer_lock.rs#L269-L272,``golang.rs#L215-L218, `gem.rs#L1156-L1157` and `nuget_feed.rs#L823-L824`.vendor --forcehelp still promises to "tolerate missing patch-target files in the staged copy (skip them instead of failing)":commands/vendor.rs#L72-L83.commands/vendor.rsand most of these backend files are still changed by open PRs (Fix open npm issues #1008, Vendor single-module Maven poms through the suffixed jvm planner and retire the legacy <repository> backend (#973) #1036, Resolve the org once per run and route every API call through it (#648) #1041), so the scope and dependencies in the body still hold.Generated by Claude Code
mikolalysenko commentedon Oct 9, 2026
v5 release blocker (P1). Freeze an honest vendor --force help/contract before v5: remove promises of missing-file tolerance and warnings that the service-only implementation does not provide. No new guards are required.
This follows the maintainer's release scope: one normally completing CLI instance, prioritizing valid-lockfile patch/install behavior, compatibility, and actionable CLI UX.
mikolalysenko commentedon Oct 9, 2026
[agent] Claiming for v5 blocker burn-down (root cause: vendor --force help and CLI_CONTRACT.md still describe the pre-service-only missing-file tolerance and mismatch warning). Branch: agent/v5-vendor-force-docs. Claim-ID: 2026-10-09T16:27:48Z-9c8512
Generated by Claude Code
mikolalysenko commentedon Oct 9, 2026
[agent] Draft PR: #1346. It fixes the user-facing part the v5 triage asked for (honest
vendor --forcehelp and contract). The deadforce/sourcesparameters in the vendored backends are an internal refactor with no user-visible effect, so I left them out of this PR. They are worth a separate non-blocker refactor issue.Generated by Claude Code