Skip to content

feat(cli): oa check reads poetry.lock, uv.lock and Cargo.lock - #486

Merged
M0Rf30 merged 1 commit into
openartifact:mainfrom
orcamedia:feat/lockfile-python-cargo
Nov 16, 2026
Merged

M0Rf30 merged 1 commit into
openartifact:mainfrom
orcamedia:feat/lockfile-python-cargo

Conversation

@orcamedia

Copy link
Copy Markdown
Contributor

oa check reads poetry.lock and uv.lock (against a PyPI repository) and Cargo.lock (against a cargo repository); --fetch requests the simple API page or sparse index file of each package. --no-dev is refused for every lockfile that does not record dev dependencies (yarn.lock, Cargo.lock, a poetry.lock of Poetry 1.5 to 1.8).

Fixtures are real lockfiles from uv 0.11, Poetry 2.2 and 1.8 and cargo 1.99, renamed to acme-*. Checked end to end against PyPI and cargo proxies to pypi.org and index.crates.io behind groups: cold proxies answer unknown, --fetch makes them available, a minimum age holds the young version with its until time, and a version upstream lacks is not_found.

Known limits, both server-side: the server matches PyPI versions against how the file names spell them, and a PyPI upstream that serves only HTML pages answers unknown. pylock.toml (PEP 751) is not covered.

🤖 Generated with Claude Code

pkg/lockfile gains three TOML parsers (go-toml/v2, already linked by oa):

- poetry.lock: packages from PyPI or a "legacy" source (a custom index);
  git, directory, file and URL packages are left out. Poetry 2 lists each
  package's groups and Poetry before 1.5 a category, so a package outside
  "main" is development-only; Poetry 1.5 to 1.8 record neither.
- uv.lock: packages with a registry source. The workspace members (virtual
  or editable) are the project: no requirers, and a package is
  development-only when their dependencies and extras do not reach it, only
  their dependency groups. A dependency that names a version picks that one
  of several locked versions.
- Cargo.lock: crates of a registry+ or sparse+ source; git crates are left
  out and crates without a source (workspace members, path crates) are no
  requirers. Cargo.lock records no dev-dependencies.

Python names are normalized (PEP 503), as an index and the requirement keys
agree on. lockfile.DevRecorded tells oa check when --no-dev means nothing:
yarn.lock, Cargo.lock and a poetry.lock of Poetry 1.5 to 1.8, which it now
refuses for all of them. --fetch requests the simple API project page
(simple/<name>/) or the sparse index file (index/<prefix>/<crate>).

The fixtures are real lockfiles of one project generated by uv 0.11, Poetry
2.2 and 1.8 and cargo 1.99, with the packages renamed to acme-*, the
descriptions and extras dropped and the file hashes removed; uv and Poetry
2.2 parse to the same packages and dev flags. Fuzz targets for each format.
Checked end to end against a compose stack with PyPI and cargo proxies to
pypi.org and index.crates.io behind groups: a cold proxy answers unknown,
--fetch makes every package available, a minimum age holds the young
version with its until time, and a version upstream lacks is not_found.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@M0Rf30
M0Rf30 merged commit d73b33e into openartifact:main Nov 16, 2026
23 checks passed
@M0Rf30

M0Rf30 commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Thanks @orcamedia, merged!

orcamedia added a commit to openartifact/openartifact-agent-plugin that referenced this pull request Nov 16, 2026
check-lockfile reads uv.lock, poetry.lock and Cargo.lock with awk and
jq, and traces what requires a package in each. On the fixtures of
openartifact/openartifact#486 the commands give the same packages as oa
check's parsers, also with mawk and jq 1.6. New eval lockfile-uv (a
curation hold on a transitive package); the lockfile cases score 1.00
with the plugin, mean delta +0.73.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Areef <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@orcamedia
orcamedia deleted the feat/lockfile-python-cargo branch November 16, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants