Skip to content

Remove scan --apply/--vendor, get --no-apply and the download/gc aliases (#966) - #1031

Merged
Mikola Lysenko (mikolalysenko) merged 14 commits into
mainfrom
arch-refactor/966-remove-legacy-spellings
Oct 8, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 14 commits into
mainfrom
arch-refactor/966-remove-legacy-spellings

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #966.

Why

The maintainer asked on #966 to clean up the unused legacy spellings before v5 ships: retire --no-apply, download and gc, and remove scan --apply/--vendor. They are removed outright, with no warning release first.

User-visible changes

Each removed spelling is now a clap usage error (exit 2, no JSON envelope):

Removed Use instead
scan --apply scan --mode agent
scan --vendor scan --mode vendored
get --no-apply get --save-only (SOCKET_SAVE_ONLY is unchanged)
socket-patch download socket-patch get
socket-patch gc socket-patch repair

Unchanged: --sync (shorthand for --mode agent --prune; --mode hosted|vendored --sync is still exit 2), --save-only, SOCKET_SAVE_ONLY, repair, and --vex with its --vex-* options (Q2 on #966 is still open, so this PR is "Part of", not "Closes").

Code

  • scan/mod.rs: hidden apply/vendor fields deleted from ScanArgs; resolve_mode_flags now only rejects --sync next to a non-agent --mode, maps --sync to agent, and defaults to hosted (global-target check unchanged).
  • get.rs: alias = "no-apply" removed. lib.rs: download and gc aliases removed.
  • Comments in scan/{hosted,vendor_flow,discovery}.rs and apply.rs now use the --mode spelling.

Docs

  • CLI_CONTRACT.md: alias columns cleared, boolean scan spellings and the --no-apply/gc paragraphs removed, all references moved to --mode, exit-code 2 row updated, alias rows of the bump table rewritten generically.
  • docs/migrating-to-v5.md: five rows added to "Retired spellings", plus a note that removed spellings exit 2 and --sync stays.
  • docs/usage.md and READMEs already used only the new spellings. CHANGELOG.md is untouched.

Tests

  • About 70 test files moved to --mode vendored/--mode agent/--save-only; ScanArgs literals updated; boolean conflict tests became --mode hosted|vendored --sync tests; alias tests now assert the spellings are rejected.
  • New table test in cli_parse_main.rs checks all five removed spellings in the parser and through the binary (exit 2).
  • Removed three scan_vendor_e2e call sites that passed --mode vendored twice (harmless with --vendor, rejected by clap now).
  • Ran cargo test -p socket-patch-cli --lib --bins plus every non-docker --test target. All pass except failures from the local machine: e2e_vendor_cargo_build (2 tests, the x86 rustup 1.41.1 toolchain can't run here) and mode_migration_npm::berry_vendored_then_hosted_takeover_leaves_pure_hosted, which exercises code this branch doesn't change (not yet confirmed against main).
  • Reran after review fixes: cli_parse_get, cli_parse_main, cli_parse_scan, help_text_hygiene, in_process_vendor_bun_takeover, scan_vendor_e2e, all pass; all test targets compile. cargo clippy --all-targets adds no warnings on changed lines.

Review findings fixed

  • Contract exit-code 2 row still described a conflict with boolean spellings; now describes only --sync with a non-agent --mode.
  • Four test labels/comments still said scan --vendor; two comments still called the spellings "deprecated"/"legacy". All updated.

Follow-ups

🤖 Generated with Claude Code


Note

Medium Risk
Breaking CLI change: scripts using scan --apply, --vendor, get --no-apply, download, or gc will fail at parse time (exit 2) until updated.

Overview
v5 CLI cleanup: Removes legacy spellings with no deprecation period. scan --apply and scan --vendor are gone from ScanArgs; mode is only --mode plus --sync (agent + prune). get drops the hidden --no-apply alias (use --save-only). Subcommand aliases download and gc are removed (use get and repair).

Behavior: resolve_mode_flags no longer folds boolean mode flags; it only maps bare --sync to agent mode and rejects --sync combined with a non-agent --mode. Removed spellings are ordinary clap usage errors (exit 2).

Docs & tests: CLI_CONTRACT.md and related docs are updated to --mode agent / --mode vendored throughout; tests and comments follow the same naming.

Reviewed by Cursor Bugbot for commit 717a7d9. Configure here.


Generated by Claude Code

v5 drops these legacy spellings outright, with no warning release:

- scan --apply (use --mode agent) and scan --vendor (use --mode vendored).
  resolve_mode_flags loses its cross-mode boolean arms; the only conflict
  left is --sync with a --mode other than agent.
- get --no-apply (use --save-only; SOCKET_SAVE_ONLY is unchanged).
- the `download` alias for get and the `gc` alias for repair.

Each removed spelling is now an ordinary clap usage error (exit 2).
--sync stays as the shorthand for --mode agent --prune. Comments that
named the old flags now name the --mode spelling.

Part of #966.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Tests now pass --mode agent / --mode vendored instead of --apply /
--vendor, --save-only instead of --no-apply, and set ScanArgs.mode
instead of the deleted apply/vendor fields. The boolean conflict tests
become --mode X --sync conflict tests, the alias tests now assert that
the old spellings fail to parse, and cli_parse_main gains a table test
that checks every removed spelling is a usage error, in the parser and
through the binary (exit 2).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
CLI_CONTRACT.md no longer promises scan --apply/--vendor, get --no-apply
or the download/gc aliases; it uses the --mode spelling throughout and
notes the removal. migrating-to-v5.md lists each removed spelling with
its replacement.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The exit-2 row of the contract still described scan's cross-mode
conflict as a --mode next to another mode's boolean spelling; only
--sync with a non-agent --mode is left. Four test labels and comments
still read "scan --vendor", and two comments still called the removed
spellings deprecated or legacy.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Resolve vendor_flow.rs: keep main's gem takeover preview refusals in the
scan --mode vendored dry-run arm, with the PR's comment wording (no
reference to the removed `--apply` spelling).

Co-Authored-By: Claude <noreply@anthropic.com>
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

Resolves the CLI_CONTRACT.md get/remove rows: keep this branch's get
row without the removed --no-apply alias and take main's remove row.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] CI status: green on cfd141e (546 pass, 6 skipped). The PR had a merge conflict with main in CLI_CONTRACT.md (get/remove rows). I resolved it by keeping this branch's get row without the removed --no-apply alias and taking main's updated remove row. The earlier red checks were macOS/ubuntu runner-acquisition failures (job never started), not test failures.


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 8, 2026 11:15
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] Merged main, CI green; ready for review.


Generated by Claude Code

…ove-legacy-spellings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LD4qUfZKhg2qgt3x9vGeFf
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Resolve two CLI_CONTRACT.md conflicts by keeping main's new text (the
atomic vendored-to-hosted takeover wording from #1039 and the
gem_lock_unsupported warning from #768) while re-applying this PR's
migration away from the removed spellings: `scan --apply` becomes
`scan --mode agent`, and `--apply`/`--vendor` in the lockfile
supplement become agent mode / vendored mode.

Co-Authored-By: Claude <noreply@anthropic.com>
The branch was updated in parallel with a merge of an older main
(3b4ac84). This merge reconciles it with the merge of main at 823810a;
the resulting tree is unchanged from that merge.

Co-Authored-By: Claude <noreply@anthropic.com>
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

…ove-legacy-spellings

# Conflicts:
#	docs/migrating-to-v5.md
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 8, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Burn-down agent: labeled Ready for review at head 69c90b4cd4.

  • CI: 435/435 check runs on the head are green (success or skipped). The one failure was e2e (windows-latest, e2e_vendor_jvm_build, gradle 8.14.3, gradle_multi_project). Gradle got a 429 Too Many Requests from repo.maven.apache.org, which is a network flake and not this PR. It passed on a single re-run.
  • Bugbot reviewed 69c90b4 (main merged at d13657b) and found nothing. There are no open review threads.
  • Mergeable: clean.
  • For the reviewer: this is a breaking CLI contract change for v5. It removes scan --apply/--vendor, get --no-apply and the download/gc aliases. Check the docs/migrating-to-v5.md table, where the merge kept main's SOCKET_FORCE row.

Generated by Claude Code

@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 8, 2026
@mikolalysenko Mikola Lysenko (mikolalysenko) removed the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 8, 2026
…ove-legacy-spellings

# Conflicts:
#	crates/socket-patch-cli/CLI_CONTRACT.md
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Burn-down agent: main moved (#1030/#1085/#1095 landed) and this went CONFLICTING in CLI_CONTRACT.md (lock-lifecycle paragraph). Merged main at bd3b727: kept main's new interrupt-cleanup wording and spelled the agent-mode scan as scan --mode agent (this PR removes --apply). cargo check -p socket-patch-cli --all-targets, cli lib tests (887) and cli_parse_main pass locally. Removed Ready for review until CI is green on the new head.


Generated by Claude Code

Resolve conflicts with #1027 (--json usage errors print coded errors):
keep this branch's --sync-only cross-mode wording (the legacy mode
booleans are removed here) and add main's note that --json usage errors
now print the coded error on stdout, in scan/mod.rs and CLI_CONTRACT.md.

Co-Authored-By: Claude <noreply@anthropic.com>
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 717a7d9. Configure here.

@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 8, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[burn-down agent] Ready for review at 717a7d92d3

  • CI: all checks on the current head green (ci-ok success; 0 failing of 461 check runs, the rest success/skipped).
  • Mergeable against main, no conflicts; no CHANGELOG.md change.
  • Cursor Bugbot reviewed 717a7d92d3; no unresolved review threads.

Ready for a human approval.


Generated by Claude Code

@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 8, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[final reviewer] Enqueued (auto-merge on, squash) at head 717a7d92. Tanmay Singla (@Tanmay182003) approved 715ab090; everything since is merges from main (git log --no-merges 715ab090..717a7d92 ^origin/main is empty). ci-ok and clippy green on this head, mergeable, no open review threads. Entered the merge queue at 23:26 UTC.


Generated by Claude Code

Merged via the queue into main with commit 16106b1 Oct 8, 2026
462 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the arch-refactor/966-remove-legacy-spellings branch October 8, 2026 23:52
Mikola Lysenko (mikolalysenko) pushed a commit that referenced this pull request Oct 9, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-refactor PR opened by the scheduled architecture refactor routine Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants