Skip to content

Add opt-in iCloud JSON API for widget records - #72

Merged
everettjf merged 3 commits into
mainfrom
codex/icloud-json-api
Oct 27, 2026
Merged

everettjf merged 3 commits into
mainfrom
codex/icloud-json-api

Conversation

@everettjf

@everettjf everettjf commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Outcome

Widgets can opt into $icloud to keep JSON records in ScriptWidget’s iCloud Drive container. This adds native read/write, explicit sync, cache-first reads and conflict resolution without a server or third-party SDK. Existing $storage and Habit Heatmap records stay local and unchanged.

  • Declare icloud and Runtime 1.5 in Package 2.0, then connect a store from the native widget context menu. Another device explicitly connects the same store ID. Disconnect revokes access without deleting records.
  • Native grants bind to the installation owner and iCloud account; imports/remixes never inherit permission. Writes require declared user actions. Paths, JSON sizes, history and queries are bounded.
  • Immutable content-addressed revisions preserve concurrent offline writes. Explicit resolution retains every original revision. Sync never claims confirmed upload; deleted cloud stores are not recreated.
  • Add isolated Web Studio mocks, editor/Skill API documentation, generated bundles and a runnable iCloud Note example.

Contract and setup: iCloud JSON API.

Web Studio iCloud JSON mock

Validation

Passed locally:

  • node Scripts/test-icloud-json.mjs: 11 native fixture tests, including two-device offline forks, explicit resolution, account/installation isolation, shared-store locking, cache recovery, disconnect, symlinks/hardlinks, harmless Finder metadata and deleted-store preservation. Uses production service/helpers with disposable directories; no real iCloud account.
  • Web readiness gate: SCRIPTWIDGET_SKIP_XCODE=1 ./Scripts/release-readiness.sh (editor tests/build/docs, 180 preview tests, 101 Studio tests, production builds and all browser smoke checks). The focused iCloud suite includes 6 cases.
  • iOS/macOS app builds, iOS build-for-testing, native CLI Release build, all three Xcode project lints, release/doc validators.
  • Runtime delivery, service authorization, atomic/file storage and macOS widget-link probes.

Outstanding before release:

  • Application-host XCTest runs on this Mac stall connecting to testmanagerd before cases execute. These are not passing; The full local gate reached this step after passing Web/editor and independent native probes, then was stopped at its 300-second bound while waiting for the test daemon. It is not a passing full gate. PR CI must provide the application-host result. Independent native iCloud tests pass without that daemon.
  • Native CLI smoke execution is blocked locally: both the installed prior CLI and this build time out on the same invalid-manifest check. The suite was stopped after repeated worker timeouts. Neither build is being reported as passing CLI execution; the PR’s dedicated CLI CI run is pending.
  • Signed real-container acceptance on two devices: grants, offline reconnect, conflicts, eviction, account switching, foreground reload, native UI and extension memory. Simulator/temp-directory results do not establish actual iCloud delivery.

This PR does not migrate existing user data, merge to main, deploy Web Studio or submit an App Store build.

Keep existing local storage unchanged. Require native per-installation grants, bind caches to the iCloud account, retain offline conflicts, and provide isolated Web Studio mocks. Include bounded service tests, API docs and an example package.
@everettjf
everettjf merged commit c97b5b0 into main Oct 27, 2026
4 of 5 checks passed
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