Skip to content

ci(sync-server): run the cross-boundary sync protocol harness#559

Merged
h4yfans merged 1 commit into
mainfrom
ci/run-sync-harness
Jun 12, 2026
Merged

ci(sync-server): run the cross-boundary sync protocol harness#559
h4yfans merged 1 commit into
mainfrom
ci/run-sync-harness

Conversation

@h4yfans

@h4yfans h4yfans commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

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) — into Sync Server CI as 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 — adds Build sync-harness worker + Run sync protocol harness steps to the sync-server job (gating, between Test sync-server and Validate Worker bundle); adds tests/sync-harness/** to both the pull_request and push paths triggers.
  • package.json — adds a test:sync-harness convenience 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 (paidSyncMiddlewareassertPaidSyncAccess, landed 8bab76f4 on 2026-05-18, predating the plan), but createTestDevice seeded a users row and never a sync_entitlements row, so every push was rejected. Wiring a red suite as a hard gate is worse than no gate, so createTestDevice now 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)
  • Workflow YAML parses; new steps ordered correctly; tests/sync-harness/** present in both triggers
  • prettier --check clean; all pre-commit hooks pass; docs gate clean
  • First CI run on the branch: confirm the harness step actually ran (not skipped) and gates (not continue-on-error)

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.
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
memry-docs Ready Ready Preview, Comment Jun 12, 2026 10:26pm
memrynote-landing Ready Ready Preview, Comment Jun 12, 2026 10:26pm

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

React Doctor

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 ci/run-sync-harness vs. main.

View workflow run

Generated by React Doctor. Questions? Contact founders@million.dev.

@h4yfans h4yfans marked this pull request as ready for review June 12, 2026 22:30
@h4yfans h4yfans merged commit 69ec2dc into main Jun 12, 2026
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies documentation Improvements or additions to documentation test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run the cross-boundary sync protocol harness in CI

1 participant