Harvest native range fixtures - #39
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the local conformance dataset by harvesting native-range containment fixtures from multiple ecosystems’ reference implementations, and updates VERS parsing/containment behavior to match the newly harvested reference cases (notably around prerelease and PEP 440 boundary handling) while keeping the existing native-to-VERS rendering stable.
Changes:
- Extend
tools/harvestto extract and generatecontainment-type reference fixtures (including Maven) and record them in provenance. - Update range containment semantics (npm/cargo prerelease admission rules; PyPI PEP 440 boundary/equality nuances) and expand native-range parsing support (npm partials/hyphens, PyPI
==/!= X.*, cargo partial upper bound handling). - Add large harvested fixture JSONs under
testdata/local/tests/plus extractor unit tests.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tools/harvest/main.go | Adds containment fixture generation path, new input schema shape, and provenance tracking for multiple generated files per source. |
| tools/harvest/extract.go | Implements native-range containment extractors for npm, PyPI, RubyGems, Composer, Pub, Cargo, and Maven. |
| tools/harvest/extract_test.go | Adds unit tests covering new range extractor behavior and range fixture normalization/deduplication. |
| testdata/local/tests/npm_range_reference_test.json | Adds harvested npm containment reference fixtures. |
| testdata/local/tests/pubb_range_reference_test.json | Adds harvested Pub containment reference fixtures. |
| testdata/local/tests/gem_range_reference_test.json | Adds harvested RubyGems containment reference fixtures. |
| testdata/local/tests/composer_range_reference_test.json | Adds harvested Composer containment reference fixtures. |
| testdata/local/tests/maven_range_reference_test.json | Adds harvested Maven containment reference fixtures. |
| testdata/local/provenance.json | Records additional source files and generated fixture outputs (including Maven provenance). |
| range.go | Aligns Range.Contains with reference containment behaviors (scheme-specific comparison and prerelease/PEP440 semantics). |
| parser.go | Fixes/extends native range parsing for npm/cargo/PyPI and preserves legacy rendering via RawConstraints while enabling correct containment semantics. |
| parser_test.go | Adds test coverage for new/adjusted parsing and containment edge cases. |
| pypi_test.go | Updates expectations to match corrected PEP 440 containment behavior around exclusive release upper bounds. |
| composer_pub.go | Extends Composer range parsing to handle *-dev wildcard forms used by reference fixtures. |
| composer_pub_test.go | Expands negative tests and adds coverage for composer *-dev wildcard range behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Harvest native range containment fixtures from npm, PyPI, RubyGems, Composer, Pub, Cargo, and Maven reference implementations.
Extend
tools/harvestto regenerate the pinned fixtures and record Maven provenance. Fix the range parsing and containment differences exposed by the reference cases while preserving existing native-to-VERS rendering.Part of #36.