Skip to content

feat(cloud): P0C2 tenant WebSocket and online-only Protocol v1 lock routing - #5

Draft
Nardo021 wants to merge 19 commits into
feature/mote-cloud-p0c-pairing-20261116from
feature/mote-cloud-p0c2-realtime-20261116
Draft

Nardo021 wants to merge 19 commits into
feature/mote-cloud-p0c-pairing-20261116from
feature/mote-cloud-p0c2-realtime-20261116

Conversation

@Nardo021

@Nardo021 Nardo021 commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

P0C2 SOURCE VERIFIED — Stacked Draft PR #5 (base P0C1 #4 → P0B #3 → P0A #2). No merge or production deployment.

Implemented

  • Separate Cloud-only MoteCloudTenant Durable Object, hibernation attachments, persistent per-account binding, fresh D1 credential/owner checks and stale socket cleanup.
  • Existing Protocol v1 auth, heartbeat, command, command_result frames; allowlisted lock with 10-second TTL, unique nonce/ID, one in-flight/device, no offline queue, response matched to authenticated device socket.
  • Separate staging gateway for GET /cloud/v1/ws/device/:uuid (provisional routing by D1 owner, then real auth frame in DO) and POST /cloud/v1/devices/:uuid/commands (phone session and owner validated in gateway and again in DO). Overrides forged internal tenant headers; requires a distinct server-only internal secret.
  • Dedicated Cloudflare worker module, Cloud-only DO binding and SQLite migration in separate Wrangler CI/staging configs; root self-host Worker unchanged.
  • Offline SQLite/Protocol integration tests, mocked DO namespace/forged-header tests, separate hosted Worker TypeScript code generation and strict typecheck, complete operational/security notes in docs/cloud-p0c2-realtime.md.
  • Deterministic negative Apple JWT test fix from predecessor, preventing random signature-tampering test flakes.

CI evidence — verified 2026-11-16

GitHub Actions CI #41 — 9 / 9 jobs success, head e2eee784546d87f24f60917806b9c3d0d2df47fd.
Relay / Protocol 158 tests PASS + TypeScript PASS (personal and hosted Cloud), staging Worker DO bundle dry-run PASS, existing Worker PASS, Dashboard PASS, repository consistency PASS, Windows PASS, Windows E2E PASS, macOS PASS, Windows Release Artifact test-mode PASS. Earlier CI #33 syntax error and #34/#39 typecheck/test problems were fixed; this CI is the authoritative result for current head.

Still blocked for customer/public launch

This CI is synthetic / bundle-only: no real Cloudflare D1 migration/DO WSS/hibernation or live remote lock, no genuine Apple ID/iOS or desktop Cloud onboarding, no active revocation broadcast, no public abuse/rate controls, account deletion, production signing, App Store approval or deployment. Do not embed the temporary staging gate or internal secret in public clients. The original personal Relay and public domain have not been modified.

Next P0C3

Review/configure a new isolated Cloudflare Staging D1 and DO, verify actual D1 migrations and authentic Apple identity, perform two-account adversarial and real-device WebSocket → OS lock tests, harden revocation and rate limits; only then proceed with native client onboarding and customer release.

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