ci(sync-server): run the cross-boundary sync protocol harness#559
Merged
Conversation
Wire @memry/sync-harness into Sync Server CI: build the worker bundle and run the protocol suite as a gating step in the sync-server job, and trigger the workflow on tests/sync-harness changes. Add a test:sync-harness root convenience script. The harness was red locally: sync routes are gated by paidSyncMiddleware (assertPaidSyncAccess), but createTestDevice seeded no sync_entitlements row, so every push returned 402 SYNC_PAYMENT_REQUIRED. Seed an active 'pro' entitlement for the harness user so the suite exercises the protocol again (32/32 green). The paid-sync gate landed 2026-05-18, predating the plan, so the plan's "harness is green" premise was already stale.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
React Doctor found 4 files changed in this pull request, but none matched the files covered by its enabled checks. Scope: 4 files changed on Generated by React Doctor. Questions? Contact founders@million.dev. |
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
Wires
@memry/sync-harness— the only suite that exercises the end-to-end sync protocol across the desktop↔server boundary (simulated devices encrypt/push/pull/converge against a Miniflare-hosted worker) — intoSync Server CIas a gating step, so a serialization or vector-clock-encoding bug that only manifests between the two sides becomes a CI gate instead of relying on someone remembering to run it by hand.Resolves #550 (Plan 009).
Changes
.github/workflows/sync-server-ci.yml— addsBuild sync-harness worker+Run sync protocol harnesssteps to thesync-serverjob (gating, betweenTest sync-serverandValidate Worker bundle); addstests/sync-harness/**to both thepull_requestandpushpathstriggers.package.json— adds atest:sync-harnessconvenience script (build:worker && test).tests/sync-harness/src/test-auth.ts— see deviation below.plans/README.md— Plan 009 → DONE.Deviation from the plan (intentional)
The plan assumed the harness was already green and was out-of-scope to touch. It was not: 31/32 tests failed with
402 SYNC_PAYMENT_REQUIRED. The sync routes are gated behind an active paid entitlement (paidSyncMiddleware→assertPaidSyncAccess, landed8bab76f4on 2026-05-18, predating the plan), butcreateTestDeviceseeded ausersrow and never async_entitlementsrow, so every push was rejected. Wiring a red suite as a hard gate is worse than no gate, socreateTestDevicenow seeds an active'pro'entitlement for the harness user. With that, the suite is green again (32/32).Test plan
pnpm test:sync-harness→ builds worker, 32/32 pass (verified 3×, incl. committed state)tests/sync-harness/**present in both triggersprettier --checkclean; all pre-commit hooks pass; docs gate cleancontinue-on-error)