メインコンテンツへスキップ

How ARC Implements Local-First: From Local Directories to Multi-Device DID Space Sync

Robert Mao
Local-FirstARCAFSDID SpaceArchitecture

Many apps talk about "local-first" while stopping at surface gestures: caching a web page with a service worker, or hiding an export button three menus deep in settings.

The cracks show up quickly in daily use. Your desktop library will not open on your phone, letting an AI agent read one project folder requires handing over raw shell access to your entire machine, and switching hosting providers means rewriting the app. In ARC (Agentic Realm Computer), local-first is an engineering constraint across storage and runtime, built around one goal: let data work locally first, while moving cleanly across devices, edge clouds, and agents.

ARC Multi-Target Runtimes and Unified AFS Path Protocol

Local machines, native mobile apps, and Cloudflare Workers read and write local storage and DID Space through the same AFS path protocol.

Why the data interface decides whether multi-device sync actually works

If every client invents its own storage layer, with web calling one REST API, desktop reading local JSON files, and mobile talking to a separate cloud database, multi-device sync turns into endless glue code.

In ARC, every runtime faces the same AFS (Agentic File System) path interface built on read, write, list, stat, and exec. When you start an application locally with the arc CLI, it mounts a chosen folder at /workspace/... and exposes local SQLite through paths. When the same declarative application runs on Cloudflare Workers, those mounts map to R2 and D1 while the application logic stays intact.

Mounting by path also solves the safety boundary for AI agents. Instead of handing an agent raw shell access to your whole laptop, you mount only the directory relevant to the task. Everything outside that mount simply does not exist to the agent.

DID Space (ArcSpace): Separating durable data from disposable compute

One of ARC's core engineering rules is simple: compute instances are disposable; user data is not.

If an app runs on your laptop and you buy a new machine, what happens to your history? If it runs on Cloudflare Workers and you decide to move to your own server, how does your data follow? DID Space (ArcSpace) is the layer that separates durable state from replaceable compute.

On the server side, DID Space supports dual backends: Cloudflare R2 plus D1 for edge deployments, and pure SQLite for local nodes or self-hosted servers. Writes are addressed by cryptographic CID hashes so integrity holds across renames and backend migrations.

On mobile and Apple desktop, platforms/swift (iOS/macOS) and platforms/kotlin (Android) are full native implementations rather than WebView wrappers. Each includes its own AFS core, native AUP renderer (SwiftUI and Jetpack Compose), and built-in AFSDIDSpace / afs-didspace sync engines backed by local SQLite tree indexes. Offline edits land in local SQLite first and sync incrementally when connected, while keys and secrets stay inside OS-backed encrypted Vault storage such as Android Keystore.

Testing the model in daily life: Aside on iOS

One practical test of this direction is our consumer iOS app, Aside.

Mobile bookmark and note tools usually fail in two ways: they stall when you lose signal on the subway, or they trap years of saves when you want to leave. On iPhone, Aside writes every shared link, quote, and image straight into local SwiftData storage first, syncs automatically via NSPersistentCloudKitContainer with CloudKitSyncMonitor and deduplication services when online, and ships full JSON export and restore with UUID deduplication.

Aside is only one application built on this model. The reusable foundation sits underneath it: ARC for portable runtimes, AFS for bounded path access over local files and spaces, and DID Space to keep the primary copy and sync path in the user's hands. Get those three layers right, and local-first no longer requires users to run their own servers just to own their data.

このページに関わるもの

製品

  • ARC active

    Blocklet のランタイム。Blocklet として記述されたアプリケーションを、その Blocklet が必要と宣言したリソースとともに実行する場所を開発者に提供します。

  • ARC Space active

    DID に紐づくデータ空間。個人用の空間を作ることも、あるタスクが必要とする権限とデータモデルでアプリケーションを接続することもできます。

  • Aside active

    気になるものを集めて、コレクションで振り返る。

用語

  • AFS

    AFS(Agentic File System)は、タスクに関係するファイル、サービス、実行中の作業を確認可能なリソース表示にします。agent に区別のないマシンや API の束を渡すのではなく、名前と境界を持つ作業世界を与えます。

  • AUP

    AUP(Agentic UI Protocol)は、アプリケーションが何を表示し、どの操作を可能にするかを表現します。runtime はデバイス能力に合う部分を render し、一つの画面の pixel をアプリケーションそのものとして扱いません。

  • DID

    DID はデジタル識別子です。保持者と検証者が、そのアイデンティティを誰が管理し、ある主張が誰に関わるかを確認するために使います。DID はウォレットではなく、アプリケーションのアカウント、サインイン方法、権限ルールを置き換えるものではありません。