Repository navigation
Fix VEX pyproject product purl name (#1547) - #1577
Merged
Mikola Lysenko (mikolalysenko) merged 3 commits intoOct 15, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
A Python project named `My_Service` got the VEX product `pkg:pypi/My_Service@1.2.0`. SBOMs, and the pypi components in the same document, use the PEP 503 name (`my-service`). OpenVEX consumers match products by exact purl, so they silently ignored every statement in the document. The pyproject.toml product (PEP 621 `[project]`, `[tool.poetry]` and legacy `[tool.pdm]`) is now built through `utils::purl::pypi_purl`, which normalizes the name. Poetry's two name fields are now compared after normalization: `My_Service` and `my-service` name the same distribution, so they no longer count as a conflict. Fixes #1547 Assisted-by: Claude Code:claude-opus-5-5
A pyproject.toml version written with surrounding spaces ended up inside the product purl, so the purl was invalid and matched nothing. The name was already trimmed when it was canonicalized. Refs #1547 Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 15, 2026 15:01
Collaborator
Author
|
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 4a442ec. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 15, 2026
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-vex-pyproject-purl-name
branch
October 15, 2026 16:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
LLM Description written by Claude Code:claude-opus-5-5
Fixes #1547
Summary
When
vex,scan --vexorapply --vexdetects the product frompyproject.toml, the product purl now uses the canonical PEP 503 name.My_Service→pkg:pypi/my-service@1.2.0, andDemo_Pkg.Core→pkg:pypi/demo-pkg-core@0.1.0. These now match the SBOM and the pypicomponent purls in the same document. Before this change, OpenVEX
consumers, which match products by exact purl, silently ignored every
statement in the document for any Python project whose name had
uppercase letters,
_or..Root cause
parse_pyproject(crates/socket-patch-core/src/vex/product.rs) builtformat!("pkg:pypi/{name}@{version}")from[project].name,[tool.poetry].nameor[tool.pdm].nameexactly as written. It now goesthrough
utils::purl::pypi_purl, the builder the pypi component purlsalready use, which canonicalizes the name.
Two related corrections:
[project].namevs[tool.poetry].nameconflict check nowcompares canonical names.
My_Serviceandmy-servicebuild the samedistribution, so they no longer count as a conflict (before,
None).packagingdoes. A" 1.2.0 "version nolonger puts spaces inside the purl.
The npm, PyPI and gem wrappers only dispatch to the binary, so they need
no change.
Tests (red → green)
My_Service(binary,vex --no-verify)e2e_vex::auto_detect_pyproject_uses_canonical_pypi_namepkg:pypi/My_Service@1.2.0❌My_Service(detector)vex::product::tests::detect_pyproject_canonicalizes_pep621_name[tool.poetry]My_ServiceandDemo_Pkg.Corepyproject_canonicalizes_tool_poetry_namepkg:pypi/My_Service@0.1.0❌[tool.pdm]legacy tablepyproject_canonicalizes_tool_pdm_namepyproject_poetry_names_equal_after_canonicalizationpyproject_trims_name_and_versionRun locally:
cargo fmt --all -- --check: clean.cargo clippy --workspace --all-features -- -D warnings: clean.cargo test -p socket-patch-core --all-features: 6519 passed, 4failed. The 4 failures are chmod-denial tests (
copy_tree,vlt_heal,pypi_poetry,pypi_requirements) that fail only becausethe sandbox runs as root, which ignores permission bits. None of them
touch files in this diff.
cargo test -p socket-patch-cli --all-features --lib --test e2e_vex --test vex_terminal_output --test cli_parse_vex --test covgap_commands_vex --test e2e_embedded_vex: all pass (921 + 132).cargo test --workspacelocally: its ~30 GBof test binaries fill the sandbox's disk allowance. CI covers the rest.
Review notes (
/code-review high)form (
1.0.0-rc1stays as written, while a built wheel records1.0.0rc1). The purl spec doesn't require version normalization, andfull PEP 440 normalization is a separate, larger change than this
name fix. It is a candidate for
utils::purl::pypi_purlitself.pypi_purlrejects names or versions containing/,\\,:or NUL. None of these can appear in a valid PEP 503 nameor PEP 440 version, and a purl built from them was malformed anyway.
Generated by Claude Code