Repository navigation
Sweep bun_preflight, composer_hints, context, fetch_stage - #1855
Mikola Lysenko (mikolalysenko) wants to merge 6 commits into
Conversation
Sweep bun_preflight.rs, composer_hints.rs, context.rs and fetch_stage.rs under crates/socket-patch-cli/src/commands/. Assisted-by: Claude Code:claude-opus-5-5
refusal_with_exemptions had one caller; fold it into preflight_pairs and skip the per-purl lock probe loop entirely unless the code is the workspace gate. One is_npm helper replaces three copies of the npm purl test. Comments trimmed to the why. Assisted-by: Claude Code:claude-opus-5-5
The hint tests checked sentence fragments with .contains; they now compare the whole line, so a wording change in any part of a hint fails a test. Bare #658 references removed. Assisted-by: Claude Code:claude-opus-5-5
The module doc listed vendor and vex as users; the real users are scan, list, get and apply. The discovery doc linked discover_wiring where the code calls discover_wiring_in. Assisted-by: Claude Code:claude-opus-5-5
report_offline_missing had one caller and a remedy parameter with one value; it and the two single-use constants are inlined into stage_patch_sources. The orphaned doc comment for the long-gone vendor stager and the stale "apply, vendor" module doc are deleted. Tests: the two archive tests could not fail (nothing reads .socket/diffs or .socket/packages) and duplicated the no-source tests, so they are deleted. The fully-cached test now runs online as well as offline, so it covers the missing_blobs.is_empty() fast path. Assisted-by: Claude Code:claude-opus-5-5
Restore the exact relocated-vendor-dir assertion for the Composer 1 note, assert it by literal rather than by a second call, and correct three doc comments (patches_without_source, the vlt case of the bun preflight, and a stale helper name in the silent staging suite). Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Assisted-by: Claude Code:claude-opus-5-5
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 bdc7d7b. Configure here.
|
[agent] CI on bdc7d7b: Generated by Claude Code |
|
[agent] The re-run lost its Depot runners as well: Generated by Claude Code |
Assisted-by: Claude Code:claude-opus-5-5
|
Burn-down agent: labeled Ready for review at
Generated by Claude Code |
Final review briefWhat it does: A behaviour-preserving cleanup of four CLI command modules: Risk: low. I read every hunk and found no behaviour change. The inlined offline error is byte-identical, including the Look here:
Verified: I read the full diff and checked coverage for the two deleted tests. The legacy-archive case is still covered end to end by Changes I made: none. Open questions: none. One nit: the diff stat in the description is slightly off (+175/−288 actual). Auto-merge (squash) is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
LLM Description written by Claude Code:claude-opus-5-5
This PR sweeps four files in
crates/socket-patch-cli/src/commands/:bun_preflight.rs,composer_hints.rs,context.rsandfetch_stage.rs. The work list came from the audit notes in thecoverage/files.tsvrows on thearch-audit/ledgerbranch (living document: discussion #1830). Behavior, output bytes, JSON and exit codes don't change.I didn't touch the callers in
get.rs,agent_download.rs,apply.rsorvendor.rs, because the open #1698 changes those files. That rules out two items from the audit notes:bun_vendor_preflight*entry points;StageOutcome::Unavailablecarry its code/detail.Changes
bun_preflight.rs(production −41)refusal_with_exemptions(one caller) intopreflight_pairs.is_npmhelper in place of three copies of the npm purl test.composer_hints.rs(tests +11)#658references..containschecks with exact-stringassert_eq!on the hint lines. This covers both vendor dirs (vendor,lib) and both branches ofhosted_reinstall_hint.context.rs(−2)scan,list,getandapply.discover_wiring; the code callsdiscover_wiring_in.#745and two comments that only restated the code.fetch_stage.rs(production −39, tests −51)report_offline_missing(one caller, and its remedy parameter only ever took one value), plus the single-use constantsAPPLY_OFFLINE_REMEDYandDOWNLOADING_ARTIFACTS.apply,vendor)" module doc.stage_offline_ignores_obsolete_diff_archiveandstage_online_fetch_failure_ignores_legacy_package_archive. Nothing in the crate reads.socket/diffsor.socket/packages, so neither test could fail. Each one also duplicates the matching no-source test./code-reviewpointed out that they guard against a future fallback to those stores. I kept the deletion anyway: a test for code that doesn't exist checks nothing today.stage_reads_socket_dir_in_place_when_fully_cachednow runs online as well as offline. Before, only the offline path ran, so themissing_blobs.is_empty()fast path was never tested.tests/apply/apply_silent_staging_errors.rs: a doc line named the deleted helper; it now describes what that helper did.Red → green
stage_patch_sources, I brokeif common.offline || missing_blobs.is_empty()toif common.offline. The updated fully-cached test fails; the old version passed against this break.lock_derived_exemption_matches_the_engine_gatefails.Diff stat
4 source files plus one test doc line: +170 / −292. Production is about −82 lines, tests about −40.
Verification
cargo clippy --workspace --all-features -- -D warnings: clean.cargo check --locked --workspace --all-targets --all-features: clean.cargo test -p socket-patch-cli --lib: 938 passed.--test apply: 157 passed.--test vendor: 151 passed./code-review high: no correctness findings. I fixed its test and doc findings, except the archive-test deletion explained above.clippy,coverage (2),e2e-build).coverage (1)passed. This PR needs a fresh CI run once the runners recover.Behavior change: none. Risk: low. No platform-specific code changed.
https://claude.ai/code/session_011f9aeTCACoNHTCNfSXXGDT
Generated by Claude Code