Skip to content

fix: describe every UUID with the same fields in getInfo() and the validators - #125

Merged
Shinrai merged 8 commits into
nextfrom
fix/uuid-detail-fields-123
Nov 25, 2026
Merged

Shinrai merged 8 commits into
nextfrom
fix/uuid-detail-fields-123

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

getInfo(), validate() and validateDetailed() describe every UUID, RFC or CLDMV, with the same fields, null where the id's variant doesn't have one. isUUID() means a well-formed UUID and isCLDMV() marks our ids; variant is the family number and fullVersion is variant.subvariant.version. RFC v1/v6/v7 ids report their timestamp and UUID.compare() sorts them by time. UUID.v1() and UUID.v6() now write RFC 9562 timestamps and match the RFC test vectors.

Also adds a generated UUID detail reference: docs/reference/uuid-details.md (kept in sync by a test) and an HTML version published to GitHub Pages by .github/workflows/docs.yml, both linked from the README.

Resolves #123, resolves #124

v1 wrote time_hi from the wrong bits, v6 laid the time field out 4 bits
off, and both computed the 60-bit tick count as a number past 2^53, so
low bits were lost. Both now build the ticks as a bigint and match the
RFC 9562 test vectors.

Fixes #124
…lidators

getInfo(), validate() and validateDetailed() read the custom-variant bit
positions on every id, so RFC ids got a subvariant, issuer ID and
category from unrelated bits, and the validator report ignored the
subvariant and timestamp layout.

One decoder (src/lib/describe.mjs) now describes every id with the same
keys, null where the variant doesn't define a field:
- RFC ids report their RFC version and, for v1, v6 and v7, their
  timestamp; getTimestamp(), the new getTimestampUnit() and
  UUID.compare cover them too
- getInfo() adds variantFamily, timestampUnit and date
- Nil and Max are RFC ids; Max no longer reads as a custom id
- getIssuerID()/getIssuerCategory() are null except on Issuer Variants
- validator fields are the getInfo() fields plus the raw timestamp bit
  fields, named after the spec (timestampSegmentA, timestampLayout);
  timestampLower63, reservedBit69, actualTimestamp and
  categoryValidation are gone
- entropy counts the real random bits per variant
- one issuer category name everywhere, and issuer IDs 512-1023 warn
  about the future RFC range again

Fixes #123
@cldmv-bot cldmv-bot Bot added ! fix → next v4 flow: fix contributor PR targeting the next integration branch area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure type: documentation Relates to docs, README updates, guides, or inline code comments labels Nov 25, 2026
…ily name our ids

isUUID() returned false for every RFC id because it only checked for
variant 111. It now means a well-formed UUID: RFC versions 1-8, Nil,
Max and CLDMV ids. The new isCLDMV() (and getInfo().isCLDMV) carries
the old meaning, and variantFamily names variant 111 "CLDMV" instead
of "Custom".

Refs #123
getInfo().variant was the raw bits 64-66, which read 4 or 5 on an RFC
id depending on a data bit. It is now the family's number: CLDMV 7, RFC
2 (Nil and Max included), Microsoft 6, NCS 0. getVariant() still
returns the raw bits.

fullVersion is variant.subvariant.version as numbers, 0 for a part the
id doesn't have: "7.0.6" for TB, "7.1.1" for IA, "2.0.4" for RFC v4.

Refs #123
docs/reference/uuid-details.md shows what every detail method returns
for each RFC version, the Nil, Max and Microsoft ids, and each kind of
CLDMV id. npm run docs:details regenerates it from the library, and a
test fails when the committed page is out of date.
@cldmv-bot cldmv-bot Bot added the type: dependencies Relates to dependency updates, version bumps, or package management label Nov 25, 2026
…ucible

v7() takes no random input, so the page changed on every run. The
generator now sets the id's random bits itself.
npm run docs:build renders docs/dist/index.html from the same generator
as the Markdown page. .github/workflows/docs.yml builds it on pushes to
master and deploys it with the GitHub Pages actions; the README links
it at https://cldmv.github.io/uuid/ next to the Markdown version.
@cldmv-bot cldmv-bot Bot added type: ci Changes to CI workflows, actions, or build pipelines type: config Changes to repository or project configuration files labels Nov 25, 2026
CodeQL's sensitive-data heuristic read UUID.DNS as a secret reaching the
MD5/SHA-1 that RFC v3/v5 require (js/weak-cryptographic-algorithm). The
generated ids are unchanged.
@Shinrai
Shinrai merged commit f3cb1b9 into next Nov 25, 2026
30 checks passed
@cldmv-bot
cldmv-bot Bot deleted the fix/uuid-detail-fields-123 branch November 25, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure ! fix → next v4 flow: fix contributor PR targeting the next integration branch type: ci Changes to CI workflows, actions, or build pipelines type: config Changes to repository or project configuration files type: dependencies Relates to dependency updates, version bumps, or package management type: documentation Relates to docs, README updates, guides, or inline code comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant