Repository navigation
Commit c751724
Stop fetching patch views during hosted scans (#2021)
* Stop downloading vlt artifacts during hosted scans
A hosted scan of a vlt project downloaded every granted patch archive
the way vlt fetches it, and withheld the dependency
(`redirect_vlt_artifact_unverifiable`) when the server re-gzipped it.
That guarded against patch.socket.dev's CDN re-encoding archives,
which vlt rejects with EINTEGRITY. The patch server has sent archives
with `Cache-Control: no-transform` since depscan #26856 and #26867,
and production serves them unencoded today. On any mirror that still
re-encodes, `vlt ci` fails closed with EINTEGRITY, so nothing installs
unpatched bytes.
So the scan no longer fetches the archives. It pins vlt dependencies
directly, without a full download of every patched package per run.
The in-memory hosted engine (the Node addon and `hosted-bundle`) has
no network, so it used to withhold every vlt dependency as "offline";
it now pins them the way the disk flow does.
The warm-tree heal now checks the Socket-owned lock instances this run
confirmed in `vlt-lock.json`. With no patch record and no hidden lock
it reports the copy as undeterminable (asking for `vlt ci`) instead of
comparing it against downloaded archive bytes.
The vlt backtest still probes the live artifact itself: a must-patch
hosted cell records `blocked-by-server-encoding` when its probe sees a
content-encoded response, without running the CLI.
Assisted-by: Claude Code:claude-opus-5-5
* Refuse vendored patches the same way everywhere
A vendored run decides before any download which patches the engine
would refuse, so it never fetches a view, asks for a grant or strips a
hosted pin for a package it cannot vendor. That decision was assembled
in the CLI from five sources (the Bun and vlt preflights, the
package-lock project refusal, the lock-text gates and the pnpm
takeover), and each entry point merged its own subset by hand. They
had drifted: the download phase never asked the package-lock project
refusal or the pnpm takeover gates, `get <uuid>` raised only the Bun
and vlt refusals before the engine, and the vendor loop judged only
Bun and vlt before its takeover.
All of it now lives in one core function,
`socket_patch_core::vendor::refusals::vendor_refusals`, which runs the
checks in the engine's order and scopes the lock-text gates (hosted
pins, the ledger's idempotency skip, packages that never reach their
backend). The scan preview and rollout plan, the download phase, both
`get` paths and the vendor loop call it. The CLI's bun_preflight.rs
and vlt_preflight.rs are gone, and their tests moved to core.
What users see: a v1 package-lock project, or a hosted pnpm pin whose
takeover the pnpm gates refuse, is now refused before its patch view
is fetched; `get <uuid> --mode vendored` raises every such refusal
with its pre-record error envelope and writes nothing; and `vendor`
refuses them before restoring a hosted pin instead of restoring and
rolling back. Codes and details are unchanged.
Assisted-by: Claude Code:claude-opus-5-5
* Stop fetching patch views during hosted scans
A hosted scan fetched the full patch view (every patched file's blob
content) for each confirmed redirect, only to judge installed copies
and feed the same run's VEX. It now makes no view call at all:
- In-run `--vex` fetches the records it attests from itself, through
the same record path the standalone `vex` uses, so the scan pipeline
never asks for them.
- The gem stale-install probe judges an installed gem by the archive
RubyGems installed it from (`<home>/cache/<leaf>.gem`) against the
patched artifact's sha256.
- The Python stale-install probe downloads the patched wheel the lock
now pins, through its grant URL and verified against the pinned
sha256, and compares the installed copy with the wheel's own RECORD
when the installed WHEEL tags match. It downloads only when a copy
is installed.
- Both probes still treat an agent-mode manifest record of the same
patch as proof of an in-place patch.
- The vlt warm-tree heal judges a store entry by vlt's hidden lock
alone: the pinned integrity there is healthy, another is stale, and
without a readable hidden lock the copy is kept and reported as
unchecked.
- The in-memory hosted engine no longer calls the provider's
`fetchPatch` or warns `record_fetch_failed`. The Node binding still
accepts a `fetchPatch` provider method and ignores it, so existing
providers keep working.
Assisted-by: Claude Code:claude-opus-5-5
* Read wheel probe files through the regular-file guard; fix vlt rule (c) e2e
judge_installed_wheel read the installed WHEEL and every RECORD path with
bare std::fs reads. Site-packages is user-writable, so a FIFO there would
block the hosted scan's blocking pool. Read through
read_regular_*_sync so a FIFO or device counts as unreadable, and add a
regression test for both the WHEEL and a RECORD path.
The real-vlt e2e for heal rule (c) without a hidden lock still expected
the old record-based heal (copies invalidated). Hosted scans no longer
fetch patch records, so that case is now undeterminable: the copies are
kept and the advisory says to run `vlt ci`. Match the in-process test and
check that `vlt ci` then installs the patched package.
Co-Authored-By: Claude <noreply@anthropic.com>
* Drop wiremock imports the vlt rule (c) tests no longer use
The record-fetch-failure test that mounted a 404 mock is gone, so
Mock, method and path were left unused after merging main.
Co-Authored-By: Claude <noreply@anthropic.com>
* Judge unevidenced stale installs by the patch view, else withhold
Owner decision on the hosted.rs:405 review thread. The gem and Python
stale-install probes no longer turn "can't judge" into "not stale":
- Gem: when there is no readable cache/<leaf>.gem (pruned cache, gem
cleanup) or no patched sha to compare it with, and no agent-mode
record, the probe fetches that patch's /patches/view record and judges
the installed dir by its afterHash map.
- Python: when the patched wheel cannot judge a copy (sdist pin, failed
download or sha256 check, installed copy of another build), the probe
falls back to the view record the same way, unless another variant
already proved the copy patched.
- A copy the view cannot judge either (fetch failure, or --offline) is
reported as unjudged: it leaves assume_applied and goes to a new
VexBuildParams::unjudged list, which in-run --vex withholds as
stale_install_unverified, even under --vex-no-verify.
The fallback fetches at most once per uuid and only for copies nothing
else settled, so the normal path still makes no view request. vlt is
unchanged: an undeterminable heal target already lands in stale_purls.
The in-memory engine runs no stale probe, so the Node binding's
fetchPatch stays ignored.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Mark every variant of a stale gem dir stale
/code-review high finding: a stale gem dir put only the variant named in
its warning in stale_purls. The other platform variants stayed in
assume_applied, and in-run VEX matches exemptions qualifier-insensitively,
so they re-exempted the stale dir. Also drops a leftover blank line in
the Node smoke test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent d19ce41 commit c751724
31 files changed
Lines changed: 2077 additions & 680 deletions
File tree
- crates
- socket-patch-cli
- src/commands
- scan
- hosted
- tests
- common
- in_process_redirect
- scan
- vlt_e2e_common
- vlt_hosted_common
- socket-patch-core/src
- api
- hosted
- memory
- patch/redirect
- socket-patch-node
- npm
- test
- src
- docs/testing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
181 | | - | |
| 182 | + | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| |||
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
208 | 215 | | |
209 | 216 | | |
210 | 217 | | |
| |||
232 | 239 | | |
233 | 240 | | |
234 | 241 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
241 | 248 | | |
242 | 249 | | |
243 | 250 | | |
| |||
368 | 375 | | |
369 | 376 | | |
370 | 377 | | |
| 378 | + | |
371 | 379 | | |
372 | 380 | | |
373 | 381 | | |
374 | 382 | | |
375 | 383 | | |
376 | | - | |
| 384 | + | |
377 | 385 | | |
378 | 386 | | |
379 | 387 | | |
| |||
597 | 605 | | |
598 | 606 | | |
599 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
600 | 612 | | |
601 | 613 | | |
602 | 614 | | |
| |||
946 | 958 | | |
947 | 959 | | |
948 | 960 | | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
949 | 989 | | |
950 | 990 | | |
951 | 991 | | |
| |||
1818 | 1858 | | |
1819 | 1859 | | |
1820 | 1860 | | |
1821 | | - | |
1822 | | - | |
1823 | | - | |
1824 | | - | |
1825 | | - | |
1826 | | - | |
1827 | | - | |
1828 | | - | |
1829 | | - | |
1830 | | - | |
1831 | 1861 | | |
1832 | 1862 | | |
1833 | 1863 | | |
1834 | 1864 | | |
1835 | 1865 | | |
| 1866 | + | |
| 1867 | + | |
1836 | 1868 | | |
1837 | 1869 | | |
1838 | 1870 | | |
| |||
2092 | 2124 | | |
2093 | 2125 | | |
2094 | 2126 | | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
2095 | 2132 | | |
2096 | 2133 | | |
2097 | 2134 | | |
| |||
2315 | 2352 | | |
2316 | 2353 | | |
2317 | 2354 | | |
| 2355 | + | |
2318 | 2356 | | |
2319 | 2357 | | |
2320 | 2358 | | |
| |||
2576 | 2614 | | |
2577 | 2615 | | |
2578 | 2616 | | |
| 2617 | + | |
2579 | 2618 | | |
2580 | 2619 | | |
2581 | 2620 | | |
2582 | 2621 | | |
2583 | 2622 | | |
2584 | | - | |
| 2623 | + | |
2585 | 2624 | | |
2586 | 2625 | | |
2587 | 2626 | | |
| |||
2655 | 2694 | | |
2656 | 2695 | | |
2657 | 2696 | | |
| 2697 | + | |
2658 | 2698 | | |
2659 | 2699 | | |
2660 | 2700 | | |
| |||
2855 | 2895 | | |
2856 | 2896 | | |
2857 | 2897 | | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
0 commit comments