Repository navigation
fix(version): withhold release-build guidance from pre-release builds (#102) - #103
Merged
Merged
Conversation
…#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).
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.
Fixes #102.
The bug
versionTupleparses per dot-segment withparseInt, so the pre-release marker is dropped:A beta therefore inherited the reassurance gated on
NESTED_MIRROR_FROM_ROOT_SINCE: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:
atLeastalso gates hazards, and there a beta must stay inclusive — a6.0.0-beta2JianYing draft has to keep matching the>= 6.0 is encryptedbroken range instead of slipping under it.So the rule is a pre-release resolves toward caution in both directions:
atLeastkeeps its numeric semantics — unchanged, zero blast radius across its nine call sites. Hazard gates still catch betas.isPreReleasepredicate.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.5discard 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 versionnow 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_SINCEitself 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-warningsclean.