Skip to content

Share the protocol code-point comparator with the WAL - #93

Open
Herklos wants to merge 1 commit into
masterfrom
cursor/share-code-point-compare-83f0
Open

Herklos wants to merge 1 commit into
masterfrom
cursor/share-code-point-compare-83f0

Conversation

@Herklos

@Herklos Herklos commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

The WAL clock tie-break and stableStringify key sort were the same Unicode code-point comparison, copied in packages/ts/wal/src/clock.ts and kept private in packages/ts/protocol/src/hash.ts.

compareCodePoints is now exported from @drakkar.software/starfish-protocol. The WAL imports that function and re-exports it, so compareClocks and existing WAL callers keep the same results. Python needs no twin: sorted() is already code-point order.

No lockfile change. CHANGELOG.md is left untouched because other open pull requests already edit it.

Tests

  • pnpm --filter @drakkar.software/starfish-protocol test (248 passed) and typecheck
  • pnpm --filter @drakkar.software/starfish-wal test (77 passed) and typecheck
Open in Web Open in Cursor 

The WAL clock tie-break and stableStringify key sort were the same function. WAL now calls the protocol export, so the two orders cannot drift.

Co-authored-by: herklos.dev <herklos.dev@protonmail.com>
@Herklos Herklos self-assigned this Oct 13, 2026

This branch has not been deployed

No deployments
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.

2 participants