Repository navigation
refactor(scan): sweep rollout, rollout_args, withdrawn - #1985
Mikola Lysenko (mikolalysenko) merged 5 commits into
Conversation
Assisted-by: Claude Code:claude-opus-5-5
Fold human_lines and HumanContext into rollout::human, inline short_name, and replace Gate's three builder methods with a struct literal. Gate::may_admit's stage predicate moves to core Stage::may_admit. rollout_args drops its RolloutCarry and MAX_NEW_PATCHES_ENV re-exports and a parse test that tests/cli_parse_scan.rs repeats. withdrawn inlines is_gone, deletes the test that restated it, stores RunWarning, and drops bare issue numbers from its module doc. Assisted-by: Claude Code:claude-opus-5-5
Eleven scan/rollout.rs tests exercised only core rollout::stage (classify, mark_pinned, offers_from_results, lookup_incomplete, Stage warnings). They now live beside that code, which had no tests. The tests that check the CLI's human lines and updates[] stay. Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
Keep is_gone and its status table: build_failed keeps a withdrawn-sweep pin, which the vendor fetch reads the other way, so the list is not obvious. Stage::may_admit states the incomplete-lookup guard once, and the redirect's may_write builds each candidate's purl once. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review 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 010e80b. Configure here.
Assisted-by: Claude Code:claude-opus-5-5
|
[burn-down agent] Labeled Ready for review at 010e80b.
Generated by Claude Code |
Final review briefWhat it does. A cleanup sweep of Risk: low. I checked each logic change by hand. Old Look here
Verified
Changes I made: none. Open questions (non-blocking): Auto-merge is armed, so approving sends it straight to the merge queue. Generated by Claude Code |
|
[agent] On the open question about the
Generated by Claude Code |
Assisted-by: Claude Code:claude-opus-5-5
Wenxin Jiang (Wenxin-Jiang)
left a comment
There was a problem hiding this comment.
[agent] Reviewed 010e80bc2318a066b3df1708e1f65bedf4705b32. Checked rollout admission equivalence, incomplete-lookup gates, shared budgets and withdrawn-warning recording. No major correctness issues found. Validation: source and regression-test review plus the available exact-head CI checks; no local test pass is claimed.
LLM Description written by Claude Code:claude-opus-5-5
Sweep of
crates/socket-patch-cli/src/commands/scan/{rollout,rollout_args,withdrawn}.rs. It applies the audit's coverage notes for those rows (arch-audit ledger, Part 4 tally and Part 5 "Misplaced: 11scan/rollout.rstests").socket_yml_args.rsis left alone: its noted type change (min_severity: Option<String>→ parsed) reachestests/cli_parse_scan.rs(#1978) andhosted_bundle.rs(#1864).Changes
scan/rollout.rshuman_linesandHumanContext(one caller,human) are folded intohuman.short_name(one caller) is inlined.Gate::new/with_prior/with_referencesare deleted. They were builder methods with no invariant, so the two callers (scan/mod.rs,scan/hosted.rs) now buildGatewith a struct literal.Gate::may_admitis deleted. Its stage-only predicate is now coreStage::may_admit, with the incomplete-lookup guard stated once. Thehosted.rscaller callsgate.stage.may_admitand builds each candidate's purl once.rollout::stage(classify,mark_pinned,offers_from_results,lookup_incomplete,Stage::warnings, the lockless-pin regression). They now live in corerollout/stage.rs, which had no tests, and are otherwise unchanged. The tests that check the CLI'shuman()lines andupdates[]stay.scan/rollout_args.rspub(crate) use RolloutCarryandpub use MAX_NEW_PATCHES_ENVre-exports are dropped, andmod.rsnamesrollout::RolloutCarry.parses_numbers_and_noneis deleted, becausetests/cli_parse_scan.rsmax_new_patches_takes_a_count_or_noneandmax_new_patches_rejects_malformed_valuescover the same inputs through clap.scan/withdrawn.rsRunWarninginstead of(String, String)and handed to the envelope as they are.#1606/#1607references in the module doc are removed.is_goneand its status test are kept (see review below), with a doc line on whybuild_failedkeeps the pin.New test:
a_spent_budget_admits_only_packages_an_earlier_directory_admittedcoversStage::may_admit. I removed the incomplete-lookup guard as a mutation, and the test failed at the "a failed lookup admits nothing" assert. It passes again on the real code.Size
6 files, +440 / −437.
offer/manifestfixture builders (now in both crates) and the new test.Behavior change
None. The output bytes, JSON and exit codes are unchanged.
Verification
cargo clippy --workspace --all-features -- -D warningsis clean.cargo test -p socket-patch-cli --lib: 927 passed.cargo test -p socket-patch-core --lib: 7,006 passed. The 4 failures are the known root-sandbox ones (copy_treesymlinked root,vlt_healunremovable lock,pypi_poetry/pypi_requirementswire failure); they pass in CI.in_process_scan_withdrawn(13),scan_rollout_e2e(38),hosted_memory_rollout(8) andin_process_redirect(149 of 152) pass. The 3in_process_redirectfailures are the known root-sandbox chmod tests.scan/mod.rsorscan/hosted.rs(Sweep scan/hosted.rs (helpers and tests region) #1897, Sweep scan/discovery.rs #1884, Fix vendored dry-run counting in-sync patches (#1850) #1856, Fix vendored planning ignoring PyPI refusals (#1908) #1930, Fix npm lock-entry refusals missed by vendored preview (#1976) #1977, Fix Pipenv stale-install remedy built twice (#1878) #1883, Sweep scan/hosted nuget.rs and takeover.rs #1903), checked withgit merge-tree./code-review high7 findings. 3 are fixed:
is_gone's test lost the only check thatbuild_failedkeeps a pin, which core's vendor fetch treats the other way. I restored it.may_admitrepeatedmay_admit_new's guard. It now states the guard once.sel_purlwas built twice per candidate. It is now built once.4 are not changed:
SOCKET_MAX_NEW_PATCHESinhuman()was already there before this PR and is output text.offer/manifestfixture builders now exist in both crates. Moving them to core'stest-fixturesfeature is wider than this sweep.env.warningsdirectly matches whatvendor.rsalready does (Envelope::warnis a plain push).short_namekeeps the exact former expression. Its golang behavior is unchanged and was already there before.Risk: low. The production edits are mechanical, and the moved tests are byte-identical apart from
crate::paths.🤖 Generated with Claude Code
https://claude.ai/code/session_011f9aeQgEa6vYRbZ6T9GcRp
Note
Low Risk
Mechanical refactor and test relocation around gradual-rollout admission and messaging; behavior is explicitly unchanged and guarded by existing e2e and unit tests.
Overview
This PR refactors scan rollout, rollout args, and withdrawn handling without changing CLI output, JSON, or exit codes.
Rollout:
Gateis built with struct literals instead ofnew/with_*builders. Per-package admission moves fromGate::may_admittoStage::may_admitinsocket-patch-core, with the incomplete-lookup guard defined once; hosted lock eligibility callsgate.stage.may_admitand computes each candidate purl once. Rollout human messaging dropsHumanContext/human_linesin favor of a singlehuman()that readsStagedirectly.RolloutCarryis imported fromscan::rolloutrather thanrollout_args.Tests: Eleven rollout tests that only exercised core (
classify, pins, lockless-pin cap regression, etc.) move fromscan/rollout.rstorollout/stage.rs, plus a new test forStage::may_admitunder a spent budget. CLI-only tests forhuman()/updates[]stay; redundant parser tests are removed where clap integration tests already cover them.Withdrawn: Sweep warnings use
RunWarningend-to-end instead of(code, detail)tuples; module docs are trimmed (including explicit issue refs).Reviewed by Cursor Bugbot for commit 010e80b. Configure here.
Generated by Claude Code