Description
Classify the highest differing SemVer core component and separately report full precedence comparison; component names do not prove semantic compatibility.
Semantic versions have a major.minor.patch core, optional prerelease identifiers after a hyphen, and build identifiers after a plus. Prereleases precede the corresponding release; build metadata does not affect precedence. A textual spelling, an equal-precedence group and a major.minor release lane therefore answer different questions.1
Classify the highest differing SemVer core component and separately report full precedence comparison; component names do not prove semantic compatibility.
When to use this tool
Use this tool to classify the highest differing SemVer core component and separately report full precedence comparison; component names do not prove semantic compatibility.
How to use the tool and how it works
- Enter left, right using the field definitions below.
- Run the operation. Correct input errors before interpreting an output.
- Read result.component, result.direction. Use the ordering, boundary rules and absence conditions described below.
Report the first differing core component in major/minor/patch order, or none. Separately return the SemVer comparison of left against right.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| left | Left semantic version for comparison or subtraction. | Text, at most 8,192 UTF-16 code units; the operation’s grammar also applies. |
| right | Right semantic version for comparison or subtraction. | Text, at most 8,192 UTF-16 code units; the operation’s grammar also applies. |
| Output field | Interpretation |
|---|---|
| result | Object containing the named fields below. |
| result.component | First changed core component, or none when all three are equal. |
| result.direction | SemVer comparison of left to right: −1 before, 0 tied, 1 after. |
{
"input": {
"left": "1.2.3",
"right": "1.3.0"
},
"output": {
"result": {
"component": "minor",
"direction": -1
}
}
} Limitations and assumptions
- Comparison is −1 when left precedes right; suffixes may change comparison even when component is none.
- Version text is limited to 1,024 UTF-16 code units with no whitespace. Parsed core and numeric prerelease components must be nonnegative safe integers. Range expressions and a leading v are not accepted.
- Every declared top-level input field is required and unexpected fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
- Numeric outputs must be finite and no larger in absolute magnitude than the safe-integer limit; operations returning exact large integers use decimal text. Positions are zero-based and spans end exclusively unless the operation explicitly states a different convention.
Alternative or Complementary methods
Choose whether you need exact spelling, precedence or a release-lane grouping. Use a separate package manager or compatibility review for dependency resolution and release-policy decisions.
References
-
Semantic Versioning 2.0.0 — Semantic Versioning
-
Tool behavior and example: Semantic Version Core Change Classifier — tool.io
Similar or alternative tools
- Semantic Version Core Component Distance
Return signed componentwise SemVer core deltas as arithmetic evidence, not a scalar version distance or compatibility metric.
- Semantic Version Core Record Extractor
Extract strict SemVer core fields through the existing parser, bounded to safe integer components; no coercion of prefixes, whitespace or leading zeros.