Generate reference containment fixtures - #40
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the tools/harvest fixture generator to produce a large matrix of generated containment reference cases by crossing harvested native ranges with harvested version pools and evaluating them against pinned reference implementations (Node, PyPI, RubyGems, Composer, Pub, Cargo, Maven). It also updates Composer branch containment behavior in the library to match the newly generated reference expectations.
Changes:
- Add per-ecosystem “reference evaluator” adapters to compute containment results from pinned reference implementations and emit generated containment JSON fixtures.
- Refactor harvester flow to support generated-range outputs alongside harvested native-range outputs, recording them in
testdata/local/provenance.json. - Adjust Composer branch-version containment semantics (and wildcard handling) and add tests to cover the updated behavior.
Reviewed changes
Copilot reviewed 11 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/harvest/reference.go | Adds runtime-backed evaluators (Node/Python/Ruby/PHP/Dart/Rust/Java) and helpers to generate containment results. |
| tools/harvest/reference_test.go | Unit tests for containment query cross-product, result application, and runtime detection. |
| tools/harvest/main.go | Wires generated containment harvesting into the main harvest pipeline; adds per-source runtime/evaluator configuration. |
| tools/harvest/extract.go | Fixes Composer bound-containment extraction for dev-* versions in harvested native-range assertions. |
| tools/harvest/extract_test.go | Updates/extends tests for Composer bound-containment extraction and for rejecting conflicting native→VERS conversions. |
| testdata/local/tests/pub_range_generated_test.json | Adds generated Pub containment fixtures (large matrix). |
| testdata/local/tests/maven_range_generated_test.json | Adds generated Maven containment fixtures. |
| testdata/local/tests/composer_range_reference_test.json | Updates Composer reference fixtures to reflect branch containment differences. |
| testdata/local/provenance.json | Records the additional generated containment JSON files per source. |
| range.go | Updates Range.Contains to handle Composer branch containment and interval containment semantics. |
| composer_pub.go | Updates Composer wildcard handling and introduces isComposerBranchVersion used by comparison/validation. |
| composer_pub_test.go | Adds tests covering Composer branch containment across wildcards, comparisons, and exclusions. |
💡 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.
Generate 10,299 containment cases by crossing harvested native ranges with version pools and evaluating them with pinned ecosystem implementations. Add harvest-time adapters for Node, Python, Ruby, PHP, Dart, Rust, and Maven's Java classes while keeping the generated JSON self-contained for
go test.Fix Composer branch containment differences exposed by the new matrix.
Stacked on #39. Part of #36.