Skip to content

Canonicalize VectorClock zero-counter entries#82

Merged
dexcompiler merged 2 commits into
mainfrom
codex/76-vectorclock-zero-canonicalization
May 15, 2026
Merged

Canonicalize VectorClock zero-counter entries#82
dexcompiler merged 2 commits into
mainfrom
codex/76-vectorclock-zero-canonicalization

Conversation

@dexcompiler
Copy link
Copy Markdown
Owner

Summary

  • canonicalize explicit zero-counter VectorClock entries away during parse/read
  • keep the internal VectorClockBuilder from reintroducing zero-counter entries during merges
  • add C# and F# coverage for zero-as-absence semantics and repeated property stability

Validation

  • dotnet test tests/Clockworks.Tests.csproj --filter VectorClockTests -v minimal
  • dotnet test property-tests/Clockworks.PropertyTests.fsproj --filter FullyQualifiedName~VectorClockProperties -v minimal
  • repeated VectorClock property suite runs
  • dotnet test Clockworks.sln -v minimal -m:1
  • npm run docs:build
  • dotnet pack src/Clockworks.csproj -c Release -v minimal

Fixes #76

@dexcompiler
Copy link
Copy Markdown
Owner Author

@copilot review this pr

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

@copilot review this pr

Reviewed at 5cd2b06. I re-ran the VectorClock unit and property test suites and checked the two PR commits; the zero-counter canonicalization and builder-merge behavior look correct, and I didn’t find additional changes needed.

@dexcompiler
Copy link
Copy Markdown
Owner Author

@claude[agent] review this pr

@Claude
Copy link
Copy Markdown

Claude AI commented May 15, 2026

@claude[agent] review this pr

Reviewed at 5cd2b06. The implementation correctly handles zero-counter canonicalization across all entry points:

Implementation (a7f1cc6)

  • VectorClock.cs:377-385,399 - ReadFrom tracks hasZeroCounter and skips fast path when present
  • VectorClock.cs:464-465,473-474,481-482 - CreateCanonical filters zero counters in single-entry, multi-entry, and empty-result cases
  • VectorClockBuilder.cs:130-131 - MergeEntry early-returns on zero counters to prevent reintroduction during merge operations
  • Tests validate string/binary parse paths, empty-clock edge case, and structural equality

Documentation (5cd2b06)

  • CHANGELOG.md and docs/changelog.md correctly classify this as a bug fix (structural equality now matches vector-clock semantics)
  • docs/guide/vector-clock.md updated to document zero-counter canonicalization alongside existing duplicate-deduplication behavior

Validation

  • All 45 VectorClock unit tests pass
  • All 11 VectorClock property tests pass (including new zero-canonicalization property)
  • Full test suite: 232 tests pass
  • Documentation builds successfully
  • Release package builds successfully

The changes are complete and correct. No additional changes needed.

@dexcompiler dexcompiler merged commit 831856c into main May 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Property: canonicalize or exclude zero-counter VectorClock entries

3 participants