Skip to content
This repository was archived by the owner on Sep 2, 2026. It is now read-only.
This repository was archived by the owner on Sep 2, 2026. It is now read-only.

Multi-machine sync architecture #12

Closed

Description

@64ix

Part of #1

Question

Sync the personal fork's state across machines (user confirmed useful between machines). emdash's implementation: self-operated Cloudflare Worker + D1 relay (opaque row bodies), AES-256-GCM per-row encryption (HKDF per (table, pk), AAD bound to space/row/version/keyId), two-half pairing secrets with checksum, device tokens + revocation, tombstones, LWW by server version, machine-local columns, tasks provisionable on demand, long-poll.

Decisions inside:

  • What state syncs in Orca: worktree meta (stage, links, order), automation configs, …? Orca has no SQLite app DB — state is orca-data.json — so "tables + triggers" does not port; a key/value LWW layer over the JSON state is the likely shape.
  • Relay: Cloudflare Worker + D1 model is good, but porting emdash's code verbatim may not fit once storage and task model are decided.
  • Whether Orca's existing pieces cover part of it: Orca Mobile relay + E2EE pairing, Remote Orca Servers, Orca Account cloud.
  • Deep-link join UX, devices screen, offline behavior.

Activity

  1. added
    wayfinder:grilling
    on Aug 12, 2026
  2. self-assigned this
    on Aug 20, 2026
  3. 64ix commented on Aug 20, 2026

    @64ix
    OwnerAuthor

    Answer

    Multi-machine sync for the fork: board + worktree state over a self-hosted E2E relay, LWW.

    • What syncs: board/worktree state only — worktreeMeta (workflowStage, linkedIssue/PR, column order lists, isArchived, isPinned), board ui keys (per-project column order, dismissed ghost ids). Machine-local (NOT synced): terminal sessions/tabs, settings, automation runs.
    • Relay: self-hosted Cloudflare Worker + D1 (emdash pattern), deployed by the user, configured in fork settings. The relay stores opaque E2E-encrypted rows only — reusing Orca's existing crypto (e2ee-crypto NaCl box / HKDF key schedule); per-row encryption with AAD-bound keys like emdash. NOT the upstream Orca Cloud (fragile for a fork).
    • Storage shape: Orca has no SQLite — sync = a key/value LWW layer over the orca-data.json state: sync unit = per-key values (one worktreeMeta per id, one order list per project), server-versioned LWW, tombstones for deletes. Existing rekey primitives (moveKey, priorWorktreeIds) stay the conflict-free identity mechanism.
    • Conflicts: last-write-wins by version, no dialogs.
    • Offline: local write queue, push + pull on reconnect (long-poll/WS from the worker).
    • Pairing/join: reuse the existing QR / orca://pair deep-link flow + devices screen with per-device revocation (device-registry pattern); two-half pairing secret like emdash.
    • Protocol is new surface (client ↔ self-hosted relay) — capability-negotiated per docs/reference/remote-wire-compatibility.md when the spec lands.
    • Out of this scope: "Board × remote workspaces" fog stays open.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

wayfinder:grilling

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions