Repository navigation
Remove --download-mode and the diff download path (#792) - #1049
Mikola Lysenko (mikolalysenko) merged 19 commits into
Conversation
Patch content is now always fetched as per-file blobs. v5 has not shipped stable, so the deprecated diff path goes before it does. Core: - delete patch/diff.rs (bspatch) and the qbsdiff dependency - apply: drop the diff strategy, AppliedVia::Diff, PatchSources::diffs_path and the now-unused `uuid` parameter of apply_package_patch / apply_go_redirect - blob_fetcher: drop DownloadMode, get_missing_archives and fetch_missing_sources; download_entries is blob-only. DIFF_ARCHIVE stays as the noun for the obsolete-archive sweep output - client: drop fetch_diff - package.rs: drop read_archive_filtered only; the other readers are used by the vendored and hosted backends - cleanup: .socket/diffs is obsolete like .socket/packages and every file in it is swept - telemetry: patch_fetched keeps download_mode, always "file" CLI: - remove --download-mode / SOCKET_DOWNLOAD_MODE outright (no alias, no warning), matching how #966 removes deprecated spellings - fetch_stage stages blobs only; with every afterHash blob staged up front, apply's mismatch-blob top-up is dead and is removed - repair downloads blobs only; the Downloaded event keeps details.mode, always "file" - appliedVia is always "blob" Tests: delete the diff e2e suites and diff/mode parse tests, add removal parse tests, a cold-cache no-/diff-request assertion and a stale referenced .socket/diffs archive sweep check. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
CLI_CONTRACT.md: drop the flag and env rows, note the removal, make appliedVia "blob" only, and mark .socket/diffs obsolete in the GC notes. migrating-to-v5.md: add the Retired spellings row and say .socket/diffs archives are no longer read. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Remove the deleted diff_created_file_e2e.rs from the bare-spawn ratchet (its stale-entry check failed), point leftover comments at the blob-only pipeline, and test repair's download messages with the blob noun. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
CodeQL flags the uuid as sensitive (cleartext logging); label the entries A/B in the assert message instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
[agent] CI status: all green on 1357bcf (552 pass, 6 skipped).
Generated by Claude Code |
Keep this PR's removal of the diff download path: drop main's updated mismatch-blob prefetch (ensure_blobs_for_mismatches / mismatch_blob_gaps) and its tests, and main's --download-mode parse tests. Keep main's new CLI_CONTRACT wording about added files and rollback, minus the diff text. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
[agent] Merged main, CI green; ready for review. Generated by Claude Code |
|
Ready for review (burn-down agent).
Nothing specific flagged for the reviewer beyond the PR description. Generated by Claude Code |
Resolve docs/migrating-to-v5.md: keep this PR's --download-mode removal row and main's new SOCKET_FORCE row (#1021) in the removed-spellings table. Co-Authored-By: Claude <noreply@anthropic.com>
|
bugbot run Generated by Claude Code |
Main (#1043) moved the agent download engine (DownloadParams, DownloadRun, filter_to_installed_releases, nested_apply_args_from_params, ...) out of commands/get.rs into commands/agent_download.rs and moved is_local_go into args.rs. This branch had edited that code in get.rs to drop the --download-mode plumbing, so the conflicts were "deleted on main, modified here". Resolution: - get.rs: take main's removal of the moved block, then re-apply this PR's change at the new home: agent_download.rs loses the DownloadParams::download_mode field, its forwarding into the nested apply's GlobalArgs, and the --download-mode mention in the nested-apply doc comment (GlobalArgs no longer has the field). - commands/apply.rs imports: keep main's `is_local_go` from crate::args; keep this PR's removal of `StagedSources` (only the deleted diff path used it). Also gate the core apply.rs `make_fixture` test helper on macOS: with the diff tests gone, its only remaining caller is the macOS-only chflags test, so `clippy --all-targets -D warnings` failed on Linux/Windows with dead_code. No docs still list --download-mode as a live flag. It appears only in the v5.0 removal note in CLI_CONTRACT.md and in the Retired spellings row of migrating-to-v5.md, next to main's SOCKET_FORCE row. Co-Authored-By: Claude <noreply@anthropic.com>
|
bugbot run Generated by Claude Code |
|
Ready for review at
Generated by Claude Code |
main renamed is_valid_uuid to is_uuid_shaped, including inside ApiClient::fetch_diff, which this branch deletes. Keep the deletion and main's rename everywhere else. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
[final reviewer] Merged Generated by Claude Code |
|
Burn-down agent: the main merge at Generated by Claude Code |
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 36e534e. Configure here.
|
Ready for review (burn-down agent).
Generated by Claude Code |
|
[final reviewer] I disarmed auto-merge. Tanmay Singla (@Tanmay182003), three non-merge commits landed after your approval at
Please take another look at Generated by Claude Code |
Resolve conflicts with #1049 (diff download path removed): - ArtifactReferences::active keeps the afterHash and beforeHash blobs of every active patch (#1316); the patch_uuids/diff-archive retention is dropped because #1049 sweeps every diff and package archive as obsolete. - after_removal builds on active() plus the originals of removed-but-not-installed patches. - cleanup_unused_blobs / format_cleanup_result / cleanup_archives stay removed (no callers left); the archive-retention unit tests go with them. - CLI_CONTRACT.md: repair row and scan --prune paragraph describe the combined policy. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The merge group failed `cargo check --all-targets` (lib test target): the read-only module-cache test added by this PR called apply_go_redirect with 11 arguments, but #1049 ("Remove --download-mode and the diff download path") removed the `uuid: Option<&str>` parameter on main. Pass the current 10-argument signature; behavior and test coverage are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Resolve against main's removal of the diff download path (#1049) and the restore-blob GC fix (#1316): repair drops the created-file blob pass and keeps the GcReport carrier; remove keeps the archive noun loop; the contract keeps "update" and drops the removed paidRequired status; the envelope contract test uses AppliedVia::Blob. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Removes the diff download path and the
--download-modeflag. Patch content is now always fetched as per-file blobs.Why
On #792 the maintainer said: "We should try to clean up older and deprecated options we don't need any more." The decision on the issue is option A, done fully in v5. v5 is not stable yet, so we skip the one-major
diffalias and remove the diff path and the flag in one PR. Withdiffgone,filewould be the only value, so the flag would do nothing.What changed
Core
patch/diff.rs, the diff branch of apply,AppliedVia::DiffandPatchSources::diffs_path.DownloadMode,fetch_missing_sourcesandget_missing_archivesfromapi/blob_fetcher.rs. The download loop fetches only blobs, and repair callsfetch_missing_blobsdirectly.ApiClient::fetch_diffandpackage::read_archive_filtered. The rest ofpackage.rsstays, because vendor, hosted npm and vlt heal use it.qbsdiffand its profile blocks (qbsdiff, bzip2, libbz2-rs-sys, suffix_array) from every Cargo.toml and from Cargo.lock..socket/diffsis swept whole, like.socket/packages.cleanup_unused_archivesis gone; only its own tests used it.apply_package_patchandapply_go_redirectno longer take auuidargument. It only fed the diff lookup (about 40 call sites).CLI
--download-modeandSOCKET_DOWNLOAD_MODEare removed with no alias.fetch_stage.rsfetches blobs only, and repair has no second download pass.appliedViais always"blob".User-visible changes
--download-modeto any command is now clap's unknown-argument error (exit 2). A leftoverSOCKET_DOWNLOAD_MODEis ignored.apply/get/scan/repairmakes no/diffs/requests..socket/diffs/is no longer read.repair,scan --prune,removeandrollbacksweep every archive in it. The cleanup output still says "N unused diff archives" when it removes old ones.--jsonappliedViano longer has the"diff"value.Downloaded/Verifiedevent keepsdetails.mode, and thepatch_fetchedtelemetry event keepsdownload_mode. Both are now always"file". Dropping them is the alternative if reviewers prefer it.Docs
CLI_CONTRACT.md: removed the flag and env rows, added a "removed in v5.0" note, madeappliedVia"blob"only, updated the GC, prune and repair-event text, and changed the defaults example to name--vendor-source.docs/migrating-to-v5.md: added a Retired spellings row and rewrote the closing note about.socket/diffs/.CHANGELOG.mdis unchanged.Tests
diff_e2e.rs,diff_created_file_e2e.rsand every diff and download-mode case.apply --download-mode file|diffandrepair --download-mode fileexit 2.apply_network, the fetch-stage covgap test and the repair lifecycle test: no request path contains/diffand no.socket/diffsis created. The repair test also checks that a stale.socket/diffs/<referenced-uuid>.tar.gzis swept.cargo test -p socket-patch-core --no-fail-fast: 6119 passed, 1 failed. The failure isutils::digest::tests::production_digests_go_through_the_helpers, which also fails on main and names files this PR doesn't touch.cargo test -p socket-patch-cli: the lib, the 35 integration targets this PR touches,rollback,vendor,spawn_env_hygiene,in_process_remove_repair_lifecycleand thecoverage_fix_*_silent_mute_exittargets all pass. The lib,rollback,spawn_env_hygiene,in_process_python_envsand the coreapi::clienttests were re-run after rebasing onto main.cargo treeshows noqbsdiff.cargo test --workspace. CI covers those.-D warningsreports one warning, an unusedunix_defaultinpython_crawler.rs. It comes from main, not this PR.Review findings fixed
tests/spawn_env_hygiene.rsstill listed the deleteddiff_created_file_e2e.rsinPENDING_RAW_SPAWNS, which would have failedno_new_bare_binary_spawns. Removed it.rollback.rs,rollback_multicopy_blob_gate.rs,in_process_remove_repair_lifecycle.rs,golang_local.rsandargs.rs.vendor.rsandtelemetry.rs. They are harmless.Coordination
#966 touches the same files (
args.rs,get.rs,scan/mod.rs,repair.rs, both docs, thecli_parse_*tests). Whichever PR lands second rebases, and both add rows to the Retired spellings table. Blob retry (#676) now covers one artifact kind, because diffs are gone.Closes #792
Closes #791 (there is no
--download-modevalue left to validate)🤖 Generated with Claude Code
Note
Medium Risk
This changes the core patch fetch/apply path and is a breaking CLI removal; behavior depends on blob staging succeeding where diff archives previously covered gaps.
Overview
v5 removes diff-based patch downloads and the global
--download-mode/SOCKET_DOWNLOAD_MODEcontrols. Passing the flag is a parse error; patch bytes are always loaded as per-file blobs under.socket/blobs/.The apply/repair/staging pipeline is blob-only:
fetch_stageno longer fetches or honors.socket/diffs/archives, repair drops the secondary “created-file blob” pass, and apply removes the on-demand mismatch blob top-up (staging must fetch all neededafterHashblobs up front).qbsdiffand related lockfile deps are dropped. JSONappliedViais always"blob"; repair telemetry still reportsdetails.mode: "file"for compatibility.Obsolete storage is swept, not read: leftover
.socket/diffs/and package archives are treated as junk and removed byrepair,remove,scan --prune, and related GC—matching updatedCLI_CONTRACT.mdand e2e tests that assert no/diffAPI calls on cold cache.Reviewed by Cursor Bugbot for commit 36e534e. Configure here.
Generated by Claude Code