Repository navigation
Conversation
FanWu-ai
marked this pull request as ready for review
October 9, 2026 21:38
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.
subset('1.0.0 || >2 <1', '>=1 <2')returns false, while reversing the two branches returns true. The contradictory branch matches no versions and should not change the union.The
sawNonNullflag persists between outer-loop iterations. After a valid subset branch sets it to true, a later empty branch inherits that state and causes the whole check to fail. Initialize the flag separately for each candidate branch.The regressions cover contradictory bounds, incompatible exact versions, exact versions excluded by bounds, branch permutations, multiple superset alternatives, loose/prerelease options, and a genuinely non-subset branch that must still return false.
This is separate from #854 and #894, which address coverage by a union of superset branches. Their current patches retain the cross-branch flag state; the minimal example here has only one superset branch.
Validation on Linux / Node 24.19.0:
npm test: 51 test files passing, 100% statement/branch/function/line coverage, ESLint and template checks passing.test/ranges/subset.js; 50 other test files pass.npm test: all 51 test files pass, 100% coverage, ESLint and template checks pass.git diff --checkpasses.The remote CI platform/Node-version matrix has not been run locally. No dependencies, coverage requirements, or tooling are changed.
AI assistance was used to prepare the implementation and regression tests.