fix(shared): compare prerelease versions without locale or precision loss#32169

open1
main
GitHub fork: fix/semver-prerelease-order-nov6
opened6d agobyLluke2x
View on GitHubTwo-way sync enabledPR last imported 2d ago

Problem

Prerelease versions were ordered with locale collation and floating-point parsing. This can put Z after a, or treat distinct large numeric identifiers as equal, affecting update/version comparisons.

Change

Compare text identifiers by code point and numeric identifiers with BigInt. Extend the existing prerelease regression case to cover both failures.

Scope and approval

A small, focused fix for an obvious version-ordering bug. It corrects prerelease comparisons in the existing helper and its regression case, without introducing a new version policy or product behavior.

Verification

Validation: regression failed before the fix; vp test run packages/shared/src/semver.test.ts and vp run check:changed pass (format, lint, knip, affected-package typechecks, adjacent tests).

Model: gpt-6.1-sol. Harness: Codex in T3 Code.

Checks

22 successful ¡ 8 skipped
All checks passed
6619109

Added 1 commit

  • fix(shared): compare prerelease versions without locale or precision loss6619109
Synced from GitHub
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code Review✅ Completed 2026-11-06T20:18:09.479198Z6619109PR opened
â„šī¸ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Synced from GitHub

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Prerelease comparison now uses BigInt for numeric identifiers and direct string ordering for nonnumeric identifiers. Tests add cases for uppercase and lowercase ordering, hyphenated identifiers, and large numeric identifiers.

Changes: Prerelease comparison

Layer / File(s)Summary
Compare prerelease identifiers
packages/shared/src/semver.ts, packages/shared/src/semver.test.ts
Numeric identifiers are compared with BigInt. Nonnumeric identifiers use direct string ordering. Tests cover case-sensitive ordering, hyphenated identifiers, and large numeric values.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: romil-bijarnia

Merge Risk: External image Minimal ¡ up to 66191

No merge-blocking risk was identified in the prerelease comparison change.

Pre-merge checks: Passed 4

Check nameStatusExplanation
Title checkPassedThe title clearly describes the main change to prerelease comparison.
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
Description checkPassedThe description covers the problem, change, scope, and verification. It explains the exception to prior approval and identifies the model and harness.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix ¡ Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
External image Recent review info

External image Run configuration

External image Commits

Reviewing files that changed from the base of the PR and between bdb8d5dfc067134f460ea7757e62355fe5f9b2a7 and 6619109c1e54a4b7c306f463cfd90f0bc563033c.

External image Files selected for processing: 2

  • packages/shared/src/semver.test.ts
  • packages/shared/src/semver.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.