Fix HLC UUID node id contract#73
Merged
Merged
Conversation
Owner
Author
|
@copilot do a careful review this pr |
Agent-Logs-Url: https://github.com/dexcompiler/Clockworks/sessions/d7e3a2dd-771f-4d9f-a4ea-dc681577c2e4 Co-authored-by: dexcompiler <115876036+dexcompiler@users.noreply.github.com>
Contributor
Reviewed carefully. The core logic, encoding/decoding math, and tests are all correct. I found and fixed two gaps (commit
Everything else checked out:
|
Resolve #73 changelog conflict after release workflow updates.
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.
Summary
HlcGuidFactorynode IDs to the 14-bit range recoverable from RFC-compatible UUIDv7 valuesHlcGuidFactory.MaxNodeIdand reject unsupported IDs instead of silently losing the top two bitsRoot cause
The HLC UUIDv7 encoding stores the node ID in bytes 8-9, but byte 8 also carries the RFC UUID variant bits. That leaves 14 recoverable node-id bits. The public contract previously accepted any
ushort, allowing values above0x3FFFto be truncated in generated GUIDs.Validation
dotnet test tests/Clockworks.Tests.csproj --filter HlcGuidFactoryNodeIdTests -v minimaldotnet test property-tests/Clockworks.PropertyTests.fsproj --filter "HlcGuidFactory UUID preserves supported node id" -v minimaldotnet test Clockworks.sln -v minimal -m:1Fixes #71