Skip to content

test(cloud): P0C3C actual local workerd tenant WebSocket end-to-end - #8

Draft
Nardo021 wants to merge 6 commits into
feature/mote-cloud-p0c3b-staging-gates-20261117from
feature/mote-cloud-p0c3c-local-realtime-20261117
Draft

Nardo021 wants to merge 6 commits into
feature/mote-cloud-p0c3b-staging-gates-20261117from
feature/mote-cloud-p0c3c-local-realtime-20261117

Conversation

@Nardo021

@Nardo021 Nardo021 commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

P0C3C — Stacked Draft PR (depends on P0C3B #7, P0C3A #6, P0C2 #5, P0C1 #4, P0B #3, P0A #2).

Implementation

  • Added cloud/wrangler.integration.ci.jsonc with an isolated local-only D1 UUID and CLOUD_TENANTS DO binding, no public routes/worker.dev; no Cloudflare account credentials.
  • Added cloud/scripts/test-local-realtime.mjs that applies all three migrations into a temporary local D1, inserts exactly two synthetic accounts/devices/sessions, starts actual local workerd, makes HTTP requests and a hand-written RFC6455 WebSocket client (no new library dependencies).
  • Tests the real gateway → tenant Durable Object WebSocket upgrade and Protocol v1 auth, heartbeat, phone lock, device command_result, 10s TTL, cross-account 404, mismatched device credentials, offline 409 and no queued delivery.
  • Uses ephemeral 256-bit staging and internal DO secrets stored in an ignored, 0600 .dev.vars exclusively created by the script and removed after; refuses to overwrite existing local credentials.
  • Cloud CI now must pass this enabled local DO/D1 WebSocket integration after disabled-gate workerd smoke and Cloud bundle dry-run.
  • Full scoped record: docs/cloud-p0c3c-local-integration.md.

Verification

GitHub Actions is required; do not mark passing until the latest head run is complete. This is local workerd, not Cloudflare's live D1/DO, Apple native token verification or real OS lock.

Production / Cloudflare safety

No Worker deployed to Cloudflare and no changes to old mote-rc or production DNS. Real App ID and operator-controlled staging secrets are not provisioned; public customer service remains BLOCKED. Next separate step: real disabled, unroutable Cloud Worker deployment after verified configuration and CI, then live two-account/WSS/hardware adversarial acceptance.

Final CI evidence (2026-11-17)

GitHub Actions CI #50 — 9/9 jobs success at HEAD 4bf132f3b943a1d972f64b1425257fad0d7098f8. The Mote Cloud staging job started local workerd with a separately migrated local D1 and actual tenant Durable Objects; its log includes CLOUD_WORKER_LOCAL_REALTIME_PASS: D1+DO+WebSocket auth/lock/owner/offline. Enhanced tests verify parallel A/B live device WebSockets and rejection of client-forged internal tenant headers. The other eight CI jobs (Relay/Protocol, Cloudflare Worker, Dashboard, macOS, Windows, Windows E2E, repository consistency and Windows test-mode release artifact) also passed.

Proof boundary: This is real local workerd runtime, not the remote Cloudflare service. Cloudflare account inspection still finds mote-rc and the isolated mote-cloud-staging D1, but NO mote-cloud-staging Worker deployment. No actual Apple-signed iOS identity token, native client or physical OS lock was exercised. Remains Draft / public BLOCKED.

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.

1 participant