Repository navigation
Commit abd5eff
* Start fix for #939, #1236
Assisted-by: Claude Code:claude-opus-5-5
* Read renamed yarn copies through one helper
Yarn keys a file: tarball or directory, a url tarball and a berry
portal:/link: dependency by the name the depender gave it, so
"lp2": "file:./left-pad-1.3.0.tgz" locks as lp2@file:... while
node_modules/lp2 is left-pad@1.3.0. Only VEX discovery could tell which
package such a copy really holds, and it skipped berry portal:/link:
copies entirely, so a lock-only vex still attested not_affected while
that copy installed unpatched (#939).
Move the copy-identity reading into formats::yarn::copy (CopyRef), so
every reader takes the package from the copy the same way: the
tarball's or directory's package.json, a registry url's path, or, for
portal:/link:, the target's package.json name and version (the lock
only records 0.0.0-use.local). VEX now records portal:/link: copies too.
Assisted-by: Claude Code:claude-opus-5-5
* Warn about renamed yarn copies in hosted scans
A hosted scan pinned the registry entry and reported a clean success
while the same yarn.lock also installed the patched name@version under
another dependency name (a renamed file: tarball in yarn classic, any
renamed file:/url/portal:/link: copy in yarn berry). That copy stays
unpatched, and nothing in the scan output said so (#939, #1236).
The run already checks its own result with lockfile discovery and names
each pnpm copy the pin cannot reach (redirect_copy_unpatched). Do the
same for yarn.lock, skipping a copy a yarn classic skip warning already
names, so every renamed copy discovery sees is reported and the in-run
VEX never assumes the patch applied.
Assisted-by: Claude Code:claude-opus-5-5
* Warn about renamed yarn copies when vendoring
Vendored scans keyed every check on the lock entry's own name, so a
yarn berry copy of the patched package under another dependency name
got no warning at all, and a yarn classic renamed file: tarball was
missed too (#939, #1236). The resolutions entry or re-lock vendoring
writes never reaches such a copy, so it installs unpatched.
Add vendor::yarn_copies, which lists those copies for either lock
grammar through the shared copy reader. The classic backend now names
renamed tarballs as well, and the berry backend names every renamed
copy with vendor_copy_unpatched while still wiring the registry entry.
Assisted-by: Claude Code:claude-opus-5-5
* Document warnings for renamed yarn copies
Describe how hosted and vendored scans and vex treat a yarn copy of the
patched package declared under another dependency name, and list the
widened redirect_copy_unpatched and new vendor_copy_unpatched codes.
Assisted-by: Claude Code:claude-opus-5-5
* Tighten renamed-copy checks after review
- hosted: skip a copy only when a yarn rewriter warning names the same
root yarn.lock entry, so a pnpm or unrelated warning never hides one
- vendored berry: a package installed only under other dependency names
is refused as vendor_lock_entry_not_rewritable naming those copies
(in the loop and the download plan), not "not found, run yarn
install", which can't help
- vendored: never read a copy of another version (no needless tarball
unpacking) or socket-patch's own .socket/ wiring as a user's copy
- keep the formats layer free of async code: the tarball read off the
runtime moves to vendor::yarn_copies::copy_identity
Assisted-by: Claude Code:claude-opus-5-5
* Document the berry not-rewritable refusal
A berry package installed only under other dependency names is now
refused as vendor_lock_entry_not_rewritable; say so beside the other
renamed-copy behavior.
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent ee8f662 commit abd5eff
13 files changed
Lines changed: 1094 additions & 224 deletions
File tree
- crates
- socket-patch-cli
- tests
- hosted_memory_common
- socket-patch-core/src
- formats/yarn
- hosted
- vendor
- vex/discover
- docs
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
257 | | - | |
| 256 | + | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1649 | 1649 | | |
1650 | 1650 | | |
1651 | 1651 | | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
0 commit comments