Repository navigation
Commit 09c49a6
* Start fix for #664
Assisted-by: Claude Code:claude-opus-5-5
* Refuse vendoring through a linked vendor dir
When two projects shared one vendor store through a symlinked
.socket/vendor/<eco> dir, rolling back one project deleted the other
project's committed artifacts, and the rollback still reported
success. The other project's next frozen install then failed.
socket-patch never creates links under .socket/vendor, so a linked
.socket/vendor, <eco> or <uuid> dir is not ours. Vendoring now
refuses it with vendor_dir_symlink_unsupported before writing, and
every vendored revert fails on the same check before it edits a lock
or deletes anything. The shared unit-removal helper also refuses to
delete through a link, and the stale pre-stage sweep and the vendor
dir sweep no longer follow a linked vendor dir.
Fixes #664
Assisted-by: Claude Code:claude-opus-5-5
* Stop repair redownloading into a linked store
repair's artifact redownload wrote into .socket/vendor/<eco>/<uuid>
through a symlinked vendor dir, landing bytes in a store another
project may own. It now refuses with vendor_dir_symlink_unsupported
before downloading. Also adds a real yarn classic e2e for the
two-project shared-store rollback from #664.
Assisted-by: Claude Code:claude-opus-5-5
* Expect the shared code for a linked JVM vendor dir
The JVM symlink-escape test expected its backend's own
build_file_outside_root reason for a linked .socket/vendor. The new
up-front gate now refuses that case for every ecosystem with
vendor_dir_symlink_unsupported, still before writing anything. The
.mvn and module-dir cases keep their JVM reason.
Assisted-by: Claude Code:claude-opus-5-5
* Check the maven dirs for jvm vendor entries too
A jvm ledger entry is reverted by the maven backend, and maven-family
entries can own files in the JVM repository tree under
.socket/vendor/maven2. The linked-dir check only looked at
.socket/vendor for jvm entries, so a linked maven or maven2 dir got
past dispatch and the lock was restored before the delete was
refused. The check now covers maven, maven/<uuid> and maven2 for both.
Assisted-by: Claude Code:claude-opus-5-5
* Check the gradle vendor tree for linked dirs too
Gradle JVM entries write and revert files under
.socket/vendor/gradle, so a shared linked gradle dir could still be
deleted through by a rollback. The JVM vendor trees are now one
constant that both the tree-write allowlist and the linked-dir check
read, so maven and jvm entries check maven2 and gradle.
Assisted-by: Claude Code:claude-opus-5-5
* Refuse a linked vendor dir before a hosted takeover
The linked-dir guard ran inside dispatch, after the vendor loop had
already restored a live hosted pin's upstream entry. A scan --mode
vendored over a hosted project with a linked .socket/vendor/npm then
failed with the hosted patch already unwired: the lock and .npmrc had
changed and no vendored artifact replaced them.
The loop now refuses with vendor_dir_symlink_unsupported before the
takeover, and the service prefetch plan leaves such purls out, so no
download grant is spent on them. Dispatch keeps the same check as a
backstop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AHr7bqqwKnGKwkSCCcdWrN
* Test that the prefetch plan skips a linked vendor dir
Pins the prefetch half of the ordering fix: plan_service_downloads
leaves out a package whose vendor unit is a link, so a prefetch running
ahead of the loop never stages or extracts an archive through it. The
test fails without the exclusion and passes with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AHr7bqqwKnGKwkSCCcdWrN
* Drop the unrelated rustfmt churn from this branch
Main is not rustfmt-clean under the pinned 1.93.1 toolchain, so the
cargo fmt --all in 5db2fd3 reformatted 127 files this fix never
touches, and reformatted untouched code in the 11 files it does. This
puts those files back to main's bytes and keeps only the fix's own
edits. CI does not run rustfmt, and the code is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AHr7bqqwKnGKwkSCCcdWrN
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6dd293f commit 09c49a6
11 files changed
Lines changed: 751 additions & 14 deletions
File tree
- crates
- socket-patch-cli
- src/commands
- tests
- socket-patch-core/src
- utils
- vendor
- jvm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1200 | 1200 | | |
1201 | 1201 | | |
1202 | 1202 | | |
| 1203 | + | |
1203 | 1204 | | |
1204 | 1205 | | |
1205 | 1206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
116 | 124 | | |
117 | 125 | | |
118 | 126 | | |
| |||
133 | 141 | | |
134 | 142 | | |
135 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
136 | 154 | | |
137 | 155 | | |
138 | 156 | | |
| |||
238 | 256 | | |
239 | 257 | | |
240 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
241 | 266 | | |
242 | 267 | | |
243 | 268 | | |
| |||
1904 | 1929 | | |
1905 | 1930 | | |
1906 | 1931 | | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
1907 | 1936 | | |
1908 | 1937 | | |
1909 | 1938 | | |
| |||
2377 | 2406 | | |
2378 | 2407 | | |
2379 | 2408 | | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
2380 | 2421 | | |
2381 | 2422 | | |
2382 | 2423 | | |
| |||
3754 | 3795 | | |
3755 | 3796 | | |
3756 | 3797 | | |
| 3798 | + | |
| 3799 | + | |
| 3800 | + | |
| 3801 | + | |
| 3802 | + | |
| 3803 | + | |
| 3804 | + | |
| 3805 | + | |
| 3806 | + | |
| 3807 | + | |
| 3808 | + | |
| 3809 | + | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
| 3813 | + | |
| 3814 | + | |
| 3815 | + | |
| 3816 | + | |
| 3817 | + | |
| 3818 | + | |
| 3819 | + | |
| 3820 | + | |
| 3821 | + | |
| 3822 | + | |
| 3823 | + | |
| 3824 | + | |
| 3825 | + | |
| 3826 | + | |
| 3827 | + | |
| 3828 | + | |
| 3829 | + | |
| 3830 | + | |
| 3831 | + | |
| 3832 | + | |
| 3833 | + | |
| 3834 | + | |
| 3835 | + | |
| 3836 | + | |
| 3837 | + | |
| 3838 | + | |
| 3839 | + | |
| 3840 | + | |
| 3841 | + | |
| 3842 | + | |
| 3843 | + | |
| 3844 | + | |
| 3845 | + | |
| 3846 | + | |
| 3847 | + | |
| 3848 | + | |
| 3849 | + | |
| 3850 | + | |
| 3851 | + | |
| 3852 | + | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
| 3863 | + | |
| 3864 | + | |
| 3865 | + | |
| 3866 | + | |
3757 | 3867 | | |
3758 | 3868 | | |
3759 | 3869 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
0 commit comments