Commit a7b0d00
v5: fix partial-stage repair bug, cut redundant downloads (#292)
* Fix apply of created files from diff caches
A diff archive has no delta for a file the patch creates, yet the
disk stager counted a cached diff archive as covering the whole
patch. With only diffs on disk, `apply --offline` passed the gate,
patched the modified files, then failed on the created file's
missing blob and left the package half-patched; online `apply`
never fetched that blob at all.
Coverage is now per file: a diff covers only files with a
before-hash, and created files need their blob. Online, a cached
diff archive no longer suppresses the download, and the top-up
fetches just the created files' blobs.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzdTEhubve9yWfqBE7vAsB
* Batch vendor package-reference requests
A vendor run asked the patch service for each package's download
reference in its own request, though the endpoint takes 500 uuids
at once: N round trips and N quota units for N packages.
The run's download plan now resolves every planned uuid in one
request, sent by the first planned call in place of its own and
with the same retries, so an outage costs what it did before.
Each package takes its answer from that batch at its turn; one
still building is asked again then, as before. Hosted scan's
reference lookup is chunked at the endpoint's 500-uuid cap,
which it used to exceed with a 400.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzdTEhubve9yWfqBE7vAsB
* Skip downloading pypi sdists vendoring rejects
pypi vendoring is wheel-based, yet a pypi patch the service serves
as an sdist (every patch without a file qualifier) was downloaded
in full, then rejected because it is not a .whl.
The service's reference already names the artifact, so a pypi
reference whose artifact is not a wheel is now refused before the
download, in the vendor loop and in its download plan alike. The
outcome is unchanged: `auto` warns and builds the wheel locally,
and `service` refuses.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzdTEhubve9yWfqBE7vAsB
* Repair downloads created files' blobs
A default (diff-mode) `repair` downloaded only diff archives, but a
diff has no delta for a file the patch creates. After such a repair
`apply --offline` still could not apply a patch that creates files.
In diff mode, repair now also downloads the blobs of created files
(and lists them under `--offline` and `--dry-run`), reported as
their own blob download.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzdTEhubve9yWfqBE7vAsB
* Defer pristine fetches the service makes moot
With the patch service on, `vendor` deferred the registry download
of a not-installed package only for cargo; npm, golang and composer
packages were downloaded and verified up front even when the
service's prebuilt artifact made the pristine copy unnecessary.
Those backends also ask the service first and read the pristine
tree only on a local-build fallback, so their download is now
deferred the same way. A package is deferred only when its fetch
would really download: the fetchers' pre-download refusals (a
foreign yarn berry cacheKey, a go module go fetches without a
proxy, a composer entry with no dist URL) are now one shared check
that both the fetch and the deferral use. pypi and gem keep the
up-front fetch, which their installed-variant probe reads.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzdTEhubve9yWfqBE7vAsB
* Run the vlt get e2e leg in agent mode
A bare `get` defaults to hosted mode since v5, so the real-vlt
get_and_remove leg found the installed copy unpatched. Pass
`--mode agent` as #283 does, which this ports.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzdTEhubve9yWfqBE7vAsB
* Address review of the waste-review fixes
- repair --json no longer counts created-file blobs twice (once
under the diff-mode event); the closing line names both failure
counts when both passes fail.
- The vendor reference batch names the plan from the first call's
position on, so a package the loop passed over is never granted.
- The npm and yarn classic registry views no longer take a non-http
resolution's integrity (a local tarball's hash, a git commit id)
as a registry integrity, so such a package is never deferred
behind, or vendored from, the service's registry build.
- CHANGELOG entries for the new behavior, and the repair event row
in CLI_CONTRACT.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzdTEhubve9yWfqBE7vAsB
* Keep yarn git deps out of the registry view
A yarn classic block resolved to a git repository over plain https
(`https://…/repo.git#<commit>`, or a codeload tarball) passed as a
registry tarball: its commit id became a sha1 integrity, and an
`integrity` field on any git block was kept. With npm now deferring
behind the patch service, such a lockfile-only git dependency could
be vendored from the service's registry build instead of refusing
`vendor_fetch_unverifiable`.
A git resolution, over any protocol, now carries no URL and no
integrity in the registry view, like npm's non-registry entries.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzdTEhubve9yWfqBE7vAsB
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent f9cb7e1 commit a7b0d00
16 files changed
Lines changed: 1450 additions & 171 deletions
File tree
- crates
- socket-patch-cli
- src/commands
- tests
- socket-patch-core/src
- api
- vendor
- lock_inventory
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1183 | 1183 | | |
1184 | 1184 | | |
1185 | 1185 | | |
1186 | | - | |
1187 | | - | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
1188 | 1190 | | |
1189 | 1191 | | |
1190 | 1192 | | |
| |||
1194 | 1196 | | |
1195 | 1197 | | |
1196 | 1198 | | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
1197 | 1214 | | |
1198 | 1215 | | |
1199 | 1216 | | |
| |||
1817 | 1834 | | |
1818 | 1835 | | |
1819 | 1836 | | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
1820 | 1846 | | |
1821 | 1847 | | |
1822 | 1848 | | |
| |||
1927 | 1953 | | |
1928 | 1954 | | |
1929 | 1955 | | |
1930 | | - | |
1931 | | - | |
1932 | | - | |
1933 | | - | |
1934 | | - | |
1935 | | - | |
1936 | | - | |
1937 | | - | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
1938 | 1966 | | |
1939 | 1967 | | |
1940 | 1968 | | |
1941 | 1969 | | |
1942 | 1970 | | |
1943 | 1971 | | |
1944 | | - | |
1945 | | - | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
1946 | 1975 | | |
1947 | 1976 | | |
1948 | 1977 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments