Skip to content

Spike: SyncState (iCloud) feasibility for a CLI #19

Closed

Description

@0xLeif

Investigate whether AppState SyncState (NSUbiquitousKeyValueStore) can meaningfully work from a bare CLI process: entitlements, container provisioning, and headless-runner behavior are all open questions.

Deliverable

Short findings doc in the issue: feasible / not feasible, what a demo would require, and a go/no-go recommendation. No production code.

Activity

  1. added this to the v1.2 milestone on Jul 18, 2026
  2. added
    dogfoodExercises an AppState feature surface
    spikeInvestigation before implementation
    agent:cursorTicket claimed by a Cursor agent. One agent per ticket; remove when the PR is up or work stops.
    on Jul 18, 2026
  3. 0xLeif commented on Jul 18, 2026

    @0xLeif
    OwnerAuthor

    Claimed by agent:cursor.

    Working branch: cursor/issue-19-syncstate-spike
    Worktree: ../aps-cli-wt/issue-19

  4. 0xLeif commented on Jul 18, 2026

    @0xLeif
    OwnerAuthor

    SyncState spike findings

    Verdict: no-go for dogfooding or shipping SyncState in the bare aps CLI (0.x and while packaging stays SPM swift run).

    Full write-up: docs/spikes/syncstate-feasibility.md in PR #23

    Feasible / not feasible

    Surface Result
    Compile / call NSUbiquitousKeyValueStore from a CLI Compiles on Apple platforms
    Meaningful iCloud sync from bare SPM aps Not feasible without signed entitlements + stable bundle id
    Headless CI proof Not feasible (Linux has no SyncState; macOS runners lack iCloud + provisioning)
    Local fallback via AppState StoredState Works, but is not SyncState dogfooding

    Local probe (unsigned executable)

    synchronize=false
    bundleID=nil
    synchronize_after_set=false
    read_back=nil
    

    What a real demo would require

    • Apple Developer team + App ID with iCloud Key-Value storage
    • Entitlement com.apple.developer.ubiquity-kvstore-identifier
    • Code signing that embeds that entitlement (SPM build does not)
    • Likely an app-bundle / Xcode-managed target (restricted entitlements + profile)
    • Interactive macOS session signed into iCloud
    • Long-lived process to observe didChangeExternally (short CLI exits race sync)

    Recommendation

    No-go. Keep SyncState out of scope (already listed in GOAL.md). Revisit only if aps gains a signed macOS app-bundle distribution path and an explicit non-CI dogfood story. No production SyncState code in this spike.

  5. removed
    agent:cursorTicket claimed by a Cursor agent. One agent per ticket; remove when the PR is up or work stops.
    on Jul 18, 2026
  6. 0xLeif commented on Jul 18, 2026

    @0xLeif
    OwnerAuthor

    PR open: #23 (closes #19).

    Releasing claim label agent:cursor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dogfoodExercises an AppState feature surfacespikeInvestigation before implementation

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions