Skip to content

fix(version): withhold release-build guidance from pre-release builds (#102) - #103

Merged
renezander030 merged 1 commit into
masterfrom
fix/prerelease-version-gating
Aug 31, 2026
Merged

renezander030 merged 1 commit into
masterfrom
fix/prerelease-version-gating

Conversation

@renezander030

Copy link
Copy Markdown
Owner

Fixes #102.

The bug

versionTuple parses per dot-segment with parseInt, so the pre-release marker is dropped:

8.5.0-beta1    tuple= [8,5,0]    atLeast("8.5.0")= true

A beta therefore inherited the reassurance gated on NESTED_MIRROR_FROM_ROOT_SINCE:

on this version the app is reported to regenerate Timelines/<id>/draft_info.json from the project-root file, so this root-mirror edit should survive the next open

That rests on one artifact — the byte-identical open/close round trip on the 8.5.0 release in #68. Handing it to a beta channel reassures a build the evidence never covered, which is the exact failure mode the boundary exists to prevent.

The rule this implements

The issue suggested ordering pre-releases below their release globally. That turned out to be wrong in one direction: atLeast also gates hazards, and there a beta must stay inclusive — a 6.0.0-beta2 JianYing draft has to keep matching the >= 6.0 is encrypted broken range instead of slipping under it.

So the rule is a pre-release resolves toward caution in both directions:

  • atLeast keeps its numeric semantics — unchanged, zero blast radius across its nine call sites. Hazard gates still catch betas.
  • Gates that grant reassurance additionally require a release build, via a new isPreRelease predicate.

Third branch, not a fallback to the 7.x text

A pre-release at or above the boundary gets its own wording rather than dropping through to NESTED_TIMELINES_WRITE_WARNING. Showing 7.x prose to a 9.2.8-beta4 user is precisely the bug #68 fixed, and reintroducing it here would trade one wrong message for another. The new text asserts nothing and names both gaps: #68's round trip was a release build, and the only >= 8.5 discard report on #50 came from a pre-release.

Note the side effect on #50 — k12ktv's 9.2.8-beta4 store now gets cautious wording instead of the survival reassurance. That is the correct outcome: they reported a discard.

Surfacing

capcut version now notes the marker and the tuple it collapses to, so a report carries the distinction instead of it being flattened before anyone reads it. Both current #50 reporters are on betas (9.2.8-beta4, 8.4.0-beta6), and #50 asks k12ktv whether their build was public or beta because it changes how the registry ceiling should treat it — a question the code previously could not act on.

Not in scope

Which file the CLI treats as canonical (#50 / #51) is untouched, and NESTED_MIRROR_FROM_ROOT_SINCE itself does not move. This only stops builds the evidence never covered from landing on the reassuring side of the line.

Tests

test/prerelease-version.test.mjs — 6 cases pinning both directions: real CapCut build strings parse correctly, hazard gates stay inclusive, the reassurance is withheld, the 7.x text does not reappear, sub-boundary betas are unaffected, and release/unknown versions are unchanged.

Full suite: 858 pass, 0 fail. biome check --error-on-warnings clean.

…#102)

versionTuple parses per dot-segment with parseInt, so "8.5.0-beta1" yields
[8, 5, 0] and compares equal to the 8.5.0 release. atLeast therefore handed
a pre-release the reassurance gated on NESTED_MIRROR_FROM_ROOT_SINCE — the
claim that CapCut regenerates Timelines/<id>/draft_info.json from the root
file, so a root edit survives the next open. That claim rests on one
artifact: the byte-identical open/close round trip on the 8.5.0 *release* in
#68. Extending it to a beta channel reassures a build the evidence never
covered, which is the failure mode the boundary exists to prevent.

Rather than reorder pre-releases below their release globally, the rule is
that a pre-release resolves toward caution in both directions. atLeast keeps
its numeric semantics, so a beta still trips a hazard gate (a 6.0.0-beta2
JianYing draft must still match the ">= 6.0 is encrypted" broken range
instead of slipping under it). Gates that grant reassurance additionally
require a release build via the new isPreRelease predicate.

A pre-release at or above the boundary gets its own wording rather than
falling back to the 7.x text, since showing 7.x prose to a 9.2.8-beta4 user
is the bug #68 fixed. It names both gaps: #68's round trip was a release
build, and the only >= 8.5 discard report on #50 came from a pre-release.

capcut version now notes the marker and the tuple it collapses to, so a bug
report carries the distinction instead of it being flattened before anyone
reads it. Both #50 reporters are on betas (9.2.8-beta4, 8.4.0-beta6).
@renezander030
renezander030 merged commit 5d89906 into master Aug 31, 2026
8 checks passed
@renezander030
renezander030 deleted the fix/prerelease-version-gating branch August 31, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

version: pre-release suffixes are dropped, so a beta inherits the release's evidence-gated guidance

1 participant