fix(semver): parser accepts invalid SemVer 2.0 values + crashes on leading-zero patch (octal interpretation) #329
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit#329
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Empirical failure
scripts/lib/semver.shclaims SemVer 2.0.0 compliance but the regex at line 27 accepts these invalid values then crashes on bump:01.2.3,1.02.3,1.2.03— leading zeros1.2.3-alpha..1— empty identifier1.2.3-01— numeric prerelease with leading zero1.2.3-.alpha,1.2.3-alpha.— leading/trailing dot1.2.3+build..1— empty build idThen crashes:
semver_bump patch 1.2.08→08: value too great for base(bash octal interpretation).Test coverage gap
tests/semver.batshas 34 tests but does not cover leading zeros, empty identifiers, or leading/trailing dots. Textbook "high test count, insufficient specification coverage."Blocking rationale
Core invariant of a release tool. Silent acceptance + downstream crash is a v1.0.0 blocker.
Fix
Either replace parser with reference implementation OR implement complete SemVer 2.0 grammar. Test cases required for every invalid input class above +
1.2.08bump case.Anchor
External correctness cold-read (anonymous ChatGPT session, uploaded to operator 2026-07-03). Full review surfaced 10 findings across 5 blocking-v1.0.0 + 2 should-fix pre-v1.0.0 + 3 post-v1.0.0 backlog. This tracker addresses one of them.
BLOCKING v1.0.0.