GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Sweep core utils notice, npm_range, pep440, pipenv, purl by mikolalysenko · Pull Request #1920 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Nov 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:claude-opus-5-5

Sweep of the audited core rows utils/{notice,npm_range,package_manager,pep440,pipenv,purl}.rs in coverage/files.tsv, done by the architecture refactor routine (discussion #1830). See the living document's Part 4 (structure) and Part 5 (tests).

Changes

  • notice.rs: inlined is_muted into notice_once, its only caller.
  • npm_range.rs: the operator character set was written out twice. It is now one private is_operator.
  • pep440.rs: the two copies of the trailing-zero trim are now one trim_trailing_zeros. Dropped a bare #1589.
  • pipenv.rs:
    • Inlined resolve_on_path, a forwarder to process::resolve_tool_with over the real env. It now calls process::resolve_tool("pipenv").
    • Deleted 3 tests (resolve_on_path_*) that repeat process.rs's resolve_tool_* tests of the same resolver.
    • The unused root parameter is now named _root, replacing let _ = root. Removing it would touch callers in scan/hosted.rs (Sweep scan/hosted.rs (helpers and tests region) #1897) and vendor/pypi.rs (Fix pylock wiring ignoring an out-of-root -r pin (#1851) #1853, Fix templated pip pins ignored beside pylock (#1873) #1874, Fix Pipenv stale-install remedy built twice (#1878) #1883).
  • purl.rs:
    • Deleted the JsrPurlParts alias and the is_purl wrapper. target.rs now calls starts_with("pkg:") in both places.
    • parse_name_version is private.
    • Trimmed the strip_purl_qualifiers essay, the JSR "as of writing" note, the builder banner, the REGRESSION/B73/remove and rollback don't PEP 503-normalise PyPI purl identifiers, so remove pkg:pypi/[email protected] exits 1 "No patch found" while get accepts the same identifier #1024 tags and 5 test section banners.
    • Folded the 3 test modules into one.
    • Tests: deleted test_is_purl, 7 test_build_*_purl tests (which restate a format!), 7 *_round_trip tests and cargo_purl_round_trips_through_the_encoded_spelling (which repeat the parse tests). They are replaced by one test, builders_round_trip_through_their_parsers, which round-trips every builder with a literal + version. It went red when build_jsr_purl was mutated to drop the /. test_parse_golang_purl_percent_decodes and test_parse_jsr_purl_percent_encoded_scope were duplicates; their one unique assert each (Azure case is kept; an encoded bare @ is rejected) moved into the parse tests.
  • package_manager.rs: nothing local. The yarn_major note is A13, and its callers' files (vendor/mod.rs) are held by Fix Go patch delivery, audits, and reinstalls #1698.

Not done because the files are held by open PRs: inlining the 7 build_*_purl wrappers (callers in crawlers and vendor files held by #1882, #1886, #1891 and #1698), inlining parse_jsr_purl into deno_crawler (#1891), and moving the PurlKey asserts to purl_key.rs (#1907).

Size

+135 / −432 in 6 files: about −55 production lines and −242 test lines.

Behavior change

None.

/code-review high

7 findings. I fixed 2: the builder/literal-+ round-trip coverage, and _root. I left 5 unchanged:

  • npm_range_admits(">=", v) reads as *: pre-existing, and fixing it changes behavior. It is noted in the register for an issue.
  • The Windows .bat spawn test went with pipenv.rs: process.rs tests PATHEXT resolution and the batch-shim spawn with .cmd. A .bat case belongs there, but process.rs is held by Fix env-keyed probe memo written three ways (#1888) #1895.
  • Removing pub fn is_purl is a breaking change: core is consumed only by this workspace's CLI, and earlier sweeps narrowed pub items the same way.
  • starts_with("pkg:") is case-sensitive: identical to the old is_purl.
  • Two copies of starts_with("pkg:"): a one-token literal; a wrapper for it is what the audit asked to remove.

Verification

  • cargo clippy --workspace --all-features -- -D warnings is clean.
  • cargo test -p socket-patch-core --lib: 6975 passed. The 4 failures are permission-dependent tests that fail under the root sandbox and are untouched here: copy_tree::relax_loop_must_not_traverse_symlinked_root, vlt_heal::an_unremovable_hidden_lock_keeps_every_store_entry, pypi_poetry::wire_write_failure_maps_error_and_leaves_lock_untouched and pypi_requirements::wire_failure_rolls_back_already_written_files.
  • CI (82 checks) and Bugbot are green on 9a0b930.

Risk

Low. The changes are local inlines and test edits. No platform-specific production code changed; only a cfg(windows) test was deleted.

https://claude.ai/code/session_011f9aeQHPtUvnVjDnuWKCpj


Generated by Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@claude
Start sweep of core utils notice..purl
6a70128
Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko Mikola Lysenko (mikolalysenko) added refactor Structural change: duplicated code or logic, missing abstraction, layering, dead code arch-refactor PR opened by the scheduled architecture refactor routine labels Nov 1, 2026
Claude (claude) added 2 commits November 1, 2026 07:02
@claude
Sweep core utils notice, npm_range, pep440, pipenv, purl
7791a0e
Inline notice's is_muted and pipenv's resolve_on_path, name npm's
operator set once, and share pep440's trailing-zero trim. Drop the
JsrPurlParts alias and the is_purl wrapper, and make
parse_name_version private.

Delete pipenv's three PATH-resolution tests (process.rs tests the
shared resolver) and purl's builder, round-trip and is_purl tests,
which restate a format! or repeat the parse tests. Fold purl's three
test modules into one, and drop history and banner comments.

Behavior is unchanged.

Assisted-by: Claude Code:claude-opus-5-5
@claude
Keep one purl builder round-trip test
9a0b930
Each builder now round-trips through its parser with a literal +
version, replacing the 14 deleted builder and round-trip tests with
one that fails when a builder and its parser disagree. The pipenv
probe's unused root parameter is named _root.

Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review November 1, 2026 07:18
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Nov 1, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

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 9a0b930. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Mikola Lysenko (mikolalysenko) pushed a commit that referenced this pull request Nov 1, 2026
@claude
refactor: sweep core utils notice..purl (#1920)
96ec6b6
Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Nov 1, 2026
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

[burn-down agent] Labeled Ready for review at 9a0b930.

  • CI: all 82 checks on 9a0b930 pass or are skipped (32 success, 50 skipped). Mergeable, no conflicts.
  • Bugbot: reviewed 9a0b930, no findings. No unresolved review threads.
  • Reviewer note: refactor sweep of core utils (notice, npm_range, pep440, pipenv, purl). Net −297 lines, most of it in utils/purl.rs. No CHANGELOG.md change.

Generated by Claude Code

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Nov 1, 2026
Sweep core utils redact, repo_root, uv_workspace and small helpers #1923
Merged
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

Final review brief (9a0b930)

What it does. A refactor sweep of six core utils files with no intended behavior change. It inlines is_muted, resolve_on_path and is_purl, folds duplicated helpers (npm is_operator, pep440 trim_trailing_zeros), and makes parse_name_version private. It also replaces 16 purl builder and round-trip tests with one test that round-trips every builder, and deletes 3 pipenv resolver tests that repeat process.rs's resolve_tool_* tests.

Risk: low. I compared each production rewrite with the old code and found them equivalent:

  • pipenv::installed_major now calls process::resolve_tool("pipenv"), which is resolve_tool_with(name, env::var_os), the same absolute-PATH-only resolver as before. The probe still runs in temp_dir().
  • is_purl(t) was t.starts_with("pkg:"), which is now inlined at both call sites in target.rs.
  • The notice, npm_range and pep440 changes are mechanical extractions or inlines.

Look here

  • pipenv.rs:53: the resolver call that replaced resolve_on_path
  • target.rs:93 and target.rs:370: the inlined is_purl
  • pep440.rs:39: trim_trailing_zeros, shared by versions_equal and equivalent_release_spellings
  • purl.rs:567: builders_round_trip_through_their_parsers, the replacement test

Verified

  • Read the full diff (6 files, +135/−432) and the description, and they match.
  • Coverage the deleted tests had is still there:
    • The coordinate-validation test purl_builders_validate_coordinates (path traversal, extra levels) was moved, not deleted.
    • The golang %2Bincompatible decode is still covered by parsers_percent_decode_the_version.
    • The relative-PATH and non-executable resolver cases are covered in process.rs.
  • Nothing else in the workspace uses is_purl or JsrPurlParts. CHANGELOG.md is untouched, and I found no debug leftovers.
  • CI is green on 9a0b930 (ci-ok and clippy pass). Bugbot found no issues, and there are no review threads. I didn't run the tests locally and relied on CI for this one.

Changes I made: none.

Open questions (not blocking)

  • The deleted cfg(windows) test resolve_on_path_honours_pathext_shims was the only test that spawned a .bat shim end to end. process.rs covers .cmd. The author deferred a .bat case because process.rs is held by Fix env-keyed probe memo written three ways (#1888) #1895. Consider a follow-up once that PR lands.
  • pub fn is_purl is removed from the published core crate. Nothing in this workspace uses it, and earlier sweeps narrowed pub items the same way.

Auto-merge is armed, so approving sends this straight to the merge queue.


Generated by Claude Code

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) enabled auto-merge November 1, 2026 09:51
Wenxin-Jiang
Wenxin Jiang (Wenxin-Jiang) approved these changes Nov 2, 2026
View reviewed changes

@Wenxin-Jiang Wenxin Jiang (Wenxin-Jiang) left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

[agent] Reviewed 9a0b930aaa3be4473d4ce5dca6ddbc71b1ea8d47. Checked notice suppression, npm range and PEP440 equivalence plus neutral pipenv probes. No major correctness issues found. Validation: source and regression-test review plus the available exact-head CI checks; no local test pass is claimed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 90a76c1 Nov 2, 2026
82 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the arch-refactor/sweep-core-utils-notice-purl branch November 2, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@Wenxin-Jiang Wenxin Jiang (Wenxin-Jiang) Wenxin-Jiang approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

arch-refactor PR opened by the scheduled architecture refactor routine Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review refactor Structural change: duplicated code or logic, missing abstraction, layering, dead code

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mikolalysenko @Wenxin-Jiang @claude
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.