Repository navigation
Remove --download-mode and the diff download path (#792) - #1049
Mikola Lysenko (mikolalysenko) wants to merge 14 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 |
|
bugbot run Generated by Claude Code |
|
[final reviewer] Tanmay Singla (@Tanmay182003) One non-merge commit landed after your approval on Generated by Claude Code |
|
[burn-down agent] Ready for review at
Generated by Claude Code |
Resolve conflicts with #1031 (scan --apply/--vendor, get --no-apply and download/gc alias removal): - docs/migrating-to-v5.md: keep both removal tables' rows (#1031's spellings plus --download-mode/SOCKET_DOWNLOAD_MODE) and the blobs-only archive note. - CLI_CONTRACT.md: keep the --download-mode removal paragraph, take main's --mode agent/vendored wording, drop diff-strategy text; repair events row renamed to `repair` with the file-only Downloaded details. - tests/cli_parse_repair.rs: keep the --download-mode rejection test, drop the gc alias tests main removed; header covers both removals. Fix merge fallout: drop the uuid argument from a new schema.rs test's apply_package_patch call (the PR removed that parameter), and remove an unused FileEdit import in vlt_heal.rs tests left by #1141. Co-Authored-By: Claude <noreply@anthropic.com>
|
Merged main (03b9418) to clear conflicts with #1031; head is now Generated by Claude Code |
|
bugbot run Generated by Claude Code |
|
[burn-down agent] Re-labeled Ready for review at
Generated by Claude Code |
…-mode apply.rs: #1008 added mismatch_overwrite_warnings (#1004) inside the block this branch deletes with the diff download path; keep the new function and the deletion. CLI_CONTRACT.md: keep both the "(blob" wording and #1008's agent-mode warnings[] pointer. Co-Authored-By: Claude <noreply@anthropic.com>
|
bugbot run Generated by Claude Code |
|
[burn-down agent] Re-labeled Ready for review at
Generated by Claude Code |
Main's #1041 moved get/repair telemetry onto TelemetryAuth while this branch dropped --download-mode. Keep TelemetryAuth and the org warnings from main, and drop the download_mode binding and the PatchSources import that only served the removed diff path. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TL9oCf27A73hTwYqKgvxbx
|
[final reviewer] The merge queue evicted this at 07:38 and it was CONFLICTING with main. I merged Not re-enqueued: Generated by Claude Code |
The test came in from main with #1041 and still passed --download-mode file, which this PR removes, so repair rejected the argument and CI went red on the main merge. Repair always fetches per-file blobs now, so the flag is simply dropped. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
[final reviewer] CI on Fixed in Tanmay Singla (@Tanmay182003) this is a second non-merge commit after your approval on 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 df96c49. Configure here.
|
Ready for review (burn-down agent).
Generated by Claude Code |
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
Major v5 behavior change to how patches are fetched and applied across apply, get, scan, and repair; incorrect blob staging would fail applies that previously could fall back to diffs, though tests and contract updates cover the new blob-only path.
Overview
v5 removes the diff download path entirely. Patch content is always staged and applied from per-file blobs under
.socket/blobs/; legacy.socket/diffs/and.socket/packages/are never read and are swept by repair, prune, remove, and rollback.The global
--download-modeflag andSOCKET_DOWNLOAD_MODEare gone (usage error if passed; env ignored). Staging (fetch_stage), repair, and agent download flows no longer branch on diff vs file or call diff/package archive endpoints. Theqbsdiffdependency andpatch/diffmodule are deleted, along with apply’s mismatch-blob top-up andwritable_blobsoverlay logic—staging must fetch every requiredafterHashblob up front.JSON and UX now report
appliedVia: "blob"only (no"diff").apply_package_patch/apply_go_redirectdrop the unuseduuidparameter. Docs (CLI_CONTRACT.md) document the v5.0 breaking removal and updated GC/prune behavior.Reviewed by Cursor Bugbot for commit df96c49. Configure here.
Generated by Claude Code