test(contracts): add sync cluster schema coverage - #236
Merged
Conversation
Adds Zod schema validation tests for the 6 sync-domain contracts: - sync-api: push/pull envelopes, cursors, conflict response, device keys - sync-payloads: per-type payloads with Phase 8 fieldClocks regression - ipc-sync: merged channel barrel composition - ipc-sync-ops: queue/retry/cursor/manifest IPC shapes - ipc-crdt: Yjs update envelope (Uint8Array, sequence, discriminator) - ipc-events: device-ready and sync event bus schemas 194 tests, 100% line/branch/function coverage across all 6 source files.
h4yfans
added a commit
that referenced
this pull request
May 6, 2026
Adds Zod schema validation tests for the 6 sync-domain contracts: - sync-api: push/pull envelopes, cursors, conflict response, device keys - sync-payloads: per-type payloads with Phase 8 fieldClocks regression - ipc-sync: merged channel barrel composition - ipc-sync-ops: queue/retry/cursor/manifest IPC shapes - ipc-crdt: Yjs update envelope (Uint8Array, sequence, discriminator) - ipc-events: device-ready and sync event bus schemas 194 tests, 100% line/branch/function coverage across all 6 source files.
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
Phase 4 U5 — Vitest coverage for the six sync-cluster Zod contracts in
packages/contracts.sync-api.test.ts— push/pull envelopes, pagination cursors, batch size, conflict response, device keys (79 tests)sync-payloads.test.ts— per-item payload shapes + Phase 8fieldClocksregression (48 tests)ipc-sync.test.ts— composition barrel:SYNC_CHANNELS/SYNC_EVENTSmerge integrity (12 tests)ipc-sync-ops.test.ts— queue/retry/cursor/manifest IPC shapes (16 tests)ipc-crdt.test.ts— Yjs update envelope (Uint8Array, sequence, note/journal discriminator) (18 tests)ipc-events.test.ts— device-ready + sync event bus payloads (21 tests)194 tests, 100% line/branch/function coverage across the 10 source files touched by these tests.
No production code changes. No
z.record(z.unknown())Zod v4 quirks found in the sync cluster.Test plan
pnpm --filter @memry/contracts exec vitest run— 194/194 passingpnpm --dir apps/desktop test:coverage— 6066 passing, 1 skipped, no failuresvitest.config.tsor files outside the 6 new test files