|
| 1 | +--- |
| 2 | +'@objectstack/spec': minor |
| 3 | +'@objectstack/core': patch |
| 4 | +'@objectstack/runtime': patch |
| 5 | +--- |
| 6 | + |
| 7 | +feat(spec): one declaration per version grammar — eight regex carriers of "the version of a package or plugin" now reference three exported constants |
| 8 | + |
| 9 | +Clause-②: yes (widening) |
| 10 | + |
| 11 | +**No accept set moves, and that is the whole point of this change.** Eight sites |
| 12 | +spelled a version regex out as a literal of their own. Five of those spellings |
| 13 | +were byte-identical to each other, two more were byte-identical to each other, |
| 14 | +and the eighth stood alone — three accept sets written eight times, growing on |
| 15 | +their own: three of the eight were published schema declarations with no parse |
| 16 | +caller at all, added by authors who copied a neighbour's literal. Each site now |
| 17 | +references the constant carrying the pattern it already enforced, byte for byte. |
| 18 | +A ninth in-repo carrier of the same concept spelled no regex at all: |
| 19 | +`PackageManifestSchema.version` is a bare `z.string()`, and it stays one here. |
| 20 | + |
| 21 | +`@objectstack/spec/kernel` gains three exported patterns: |
| 22 | + |
| 23 | +- `MAJOR_MINOR_PATCH_VERSION_PATTERN` — three numeric segments and nothing |
| 24 | + else. Referenced by `ManifestSchema.version`, |
| 25 | + `MetadataPluginManifestSchema.version`, `PluginRegistryEntrySchema.version`, |
| 26 | + `PluginMetadataSchema.version`, and the `PATCH /api/v1/packages/:id` door in |
| 27 | + `@objectstack/runtime`. |
| 28 | +- `SEMVER_SHAPED_VERSION_PATTERN` — `major.minor.patch` with an optional |
| 29 | + `-prerelease` and an optional `+build` suffix, identifiers in either ASCII |
| 30 | + case. Referenced by `PluginSchema.version` and by |
| 31 | + `PluginLoader.isSemverShapedVersion` in `@objectstack/core`. Those two |
| 32 | + converged on one spelling under the widen-never-narrow ruling and were held |
| 33 | + equal by hand until now; they reference one declaration and can no longer |
| 34 | + drift apart. |
| 35 | +- `SEMVER_SHAPED_LOWERCASE_VERSION_PATTERN` — the same with the suffix |
| 36 | + identifiers restricted to lowercase ASCII. Referenced by |
| 37 | + `PackageVersionSchema.version`. |
| 38 | + |
| 39 | +⛔ **The three are not interchangeable** — they are three different accept sets, |
| 40 | +and referencing the wrong one moves a published accept set. None of the three is |
| 41 | +a SemVer 2.0.0 conformance check and none is named as one: two accept forms |
| 42 | +SemVer forbids (leading zeroes in the numeric core, empty and leading-zero |
| 43 | +identifiers), one refuses forms it requires. For ordering or precedence, |
| 44 | +`dependency-resolver.ts` in `@objectstack/core` is still the module to extend. |
| 45 | + |
| 46 | +**Nothing an author can write changes.** Every regex is byte-identical to the |
| 47 | +literal it replaces — verified per carrier by sha256 over the extracted literal |
| 48 | +— and every existing suite passes unedited. Those two together are the |
| 49 | +neutrality proof, and they are the whole of it. `PackageManifestSchema.version` |
| 50 | +keeps its bare `z.string()`; it is deliberately untouched here. No `.describe()` |
| 51 | +text, refusal message or JSON Schema `pattern` moves. Regenerating the spec's |
| 52 | +artifacts moved `api-surface/kernel.json` and `export-origins/kernel.json` and |
| 53 | +nothing else, each gaining the three constant names — ⛔ read that as a check |
| 54 | +that nothing unexpected regenerated, never as evidence about the accept set: the |
| 55 | +artifacts that stayed byte-unchanged do not record a `.regex()` pattern in the |
| 56 | +first place. A new pin, |
| 57 | +`src/kernel/version-grammar.test.ts`, records each grammar's verdict on twelve |
| 58 | +witness strings so the next deliberate move to any of them is one visible edit |
| 59 | +to one matrix. |
0 commit comments