Show a 3.0.0 prerelease: version parser rejects vX.Y.Z-alpha.N, and git_ref origin/v3 breaks after the branch move · Issue #106 · project-minigraf/minigraf-docs · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Show a 3.0.0 prerelease: version parser rejects vX.Y.Z-alpha.N, and git_ref origin/v3 breaks after the branch move #106
src/version.rsVersion::parse splits on . and requires exactly three numeric parts, so v3.0.0-alpha.1 fails with "is not a number". The version-time mapping ((2000+MAJOR)-01-01 + MINOR days + PATCH seconds) has no slot for a prerelease either.
Content is annotated @since v3.0.0. Under semver, 3.0.0-alpha.1 < 3.0.0, so if the alpha became its own version every v3 fragment would be hidden on it.
Corrections (Codex review): ignore the 'local checkout is 2 commits behind' note; it was about my local clone and isn't a repo issue. v3.0.0-alpha.1 actually fails the component-count check first ('must be vMAJOR.MINOR.PATCH'), not the numeric check. Option 1 also needs a display change: config.rs:34 has no label field and site.rs:70 renders 'unreleased'. Published alpha docs should read the immutable alpha tag; only a separate development preview should follow origin/main. /latest/ must keep following the newest stable v2 release, including future v2 patches (main.rs:228 picks the last released entry).
Decided in project-minigraf/minigraf#928 (2026-11-30): the version is 3.0.0-alpha; later prereleases are -beta, -rc1, -rc2, … (a second alpha or beta would be -alpha2 / -beta2). The alpha is the first v3 release and triggers the branch move (project-minigraf/minigraf#937). So this issue takes option 2: prereleases become site versions, with a fixed place on the version-time axis.
Proposed convention
Today millis(vX.Y.Z) = ((days(2000+X-01-01) + Y) × 86,400 + Z) × 1000, so version times are whole seconds, and the second before vX.Y.Z belongs to the previous version (vX.Y.(Z−1), the maximum patch 86,399 of the previous minor, or the previous year). The 999 milliseconds in between are free. A prerelease goes there:
millis(vX.Y.Z-<stage><N>) = millis(vX.Y.Z) − 1000 + base(stage) + N
alpha → base 100 (v3.0.0-alpha = +100, -alpha2 = +102)
beta → base 400
rc → base 700 (rc1 = +701, rc2 = +702)
N ≤ 99
Every prerelease then sorts after the previous release and before its own release, in semver order. For v3.0.0-alpha that is 2002-12-31T23:59:59.100Z. The property test (version_time_follows_semver) should cover prereleases, including vX.Y.86399 < vX.(Y+1).0-alpha.
What changes
Version::parse accepts -alpha[N], -beta[N], -rcN and rejects anything else. Version gets an optional prerelease field, and ordering puts a release after its prereleases (so derived Ord can't be used as is). Display round-trips, which also gives the URL path (/v3.0.0-alpha/).
site.toml: a released entry tag = "v3.0.0-alpha" reading the alpha tag (CHANGELOG and error reference from that immutable tag). Keep a separate unreleased v3.0.0 development preview, with git_ref = "origin/main" after the move.
/latest/ (main.rs:228) picks the newest released non-prerelease entry, so it keeps following v2.x until 3.0.0. Prerelease pages carry a "prerelease" label in the version picker and banner (site.rs:70, config.rs:34).
Annotations. With strict ordering, @since v3.0.0 would hide all v3 text from the alpha. Before the alpha, rewrite the existing @since v3.0.0 → @since v3.0.0-alpha and @until v3.0.0 → @until v3.0.0-alpha (after checking the content matches what's on v3 at the alpha). From then on, annotate new v3.0.0 work with the prerelease that first ships it, or v3.0.0 if it first ships in the final release.
Semver compares rc10 before rc2 (alphanumeric identifiers sort as text), but this mapping wouldn't. Reject rc numbers ≥ 10 rather than disagree with the registries.
Activity
adityamukho commentedon Nov 29, 2026
Corrections (Codex review): ignore the 'local checkout is 2 commits behind' note; it was about my local clone and isn't a repo issue.
v3.0.0-alpha.1actually fails the component-count check first ('must be vMAJOR.MINOR.PATCH'), not the numeric check. Option 1 also needs a display change:config.rs:34has no label field andsite.rs:70renders 'unreleased'. Published alpha docs should read the immutable alpha tag; only a separate development preview should followorigin/main./latest/must keep following the newest stable v2 release, including future v2 patches (main.rs:228picks the lastreleasedentry).adityamukho commentedon Nov 30, 2026
Decided in project-minigraf/minigraf#928 (2026-11-30): the version is
3.0.0-alpha; later prereleases are-beta,-rc1,-rc2, … (a second alpha or beta would be-alpha2/-beta2). The alpha is the first v3 release and triggers the branch move (project-minigraf/minigraf#937). So this issue takes option 2: prereleases become site versions, with a fixed place on the version-time axis.Proposed convention
Today
millis(vX.Y.Z) = ((days(2000+X-01-01) + Y) × 86,400 + Z) × 1000, so version times are whole seconds, and the second beforevX.Y.Zbelongs to the previous version (vX.Y.(Z−1), the maximum patch86,399of the previous minor, or the previous year). The 999 milliseconds in between are free. A prerelease goes there:Every prerelease then sorts after the previous release and before its own release, in semver order. For
v3.0.0-alphathat is2002-12-31T23:59:59.100Z. The property test (version_time_follows_semver) should cover prereleases, includingvX.Y.86399<vX.(Y+1).0-alpha.What changes
Version::parseaccepts-alpha[N],-beta[N],-rcNand rejects anything else.Versiongets an optional prerelease field, and ordering puts a release after its prereleases (so derivedOrdcan't be used as is).Displayround-trips, which also gives the URL path (/v3.0.0-alpha/).site.toml: a released entrytag = "v3.0.0-alpha"reading the alpha tag (CHANGELOG and error reference from that immutable tag). Keep a separate unreleasedv3.0.0development preview, withgit_ref = "origin/main"after the move./latest/(main.rs:228) picks the newest released non-prerelease entry, so it keeps following v2.x until 3.0.0. Prerelease pages carry a "prerelease" label in the version picker and banner (site.rs:70,config.rs:34).@since v3.0.0would hide all v3 text from the alpha. Before the alpha, rewrite the existing@since v3.0.0→@since v3.0.0-alphaand@until v3.0.0→@until v3.0.0-alpha(after checking the content matches what's onv3at the alpha). From then on, annotate new v3.0.0 work with the prerelease that first ships it, orv3.0.0if it first ships in the final release.rc10beforerc2(alphanumeric identifiers sort as text), but this mapping wouldn't. Rejectrcnumbers ≥ 10 rather than disagree with the registries.feat: prerelease site versions (#106)