Skip to content

mobile: keep computer tokens device-only; harden prune and npm publish - #402

Merged
0xSero merged 1 commit into
mainfrom
fix/device-only-computer-tokens
Sep 29, 2026
Merged

0xSero merged 1 commit into
mainfrom
fix/device-only-computer-tokens

Conversation

@0xSero

@0xSero 0xSero commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Purpose

A Codex review of #400 found that cross-device computer sync cannot work in the shipping app, while it still moved Kittylitter tokens into iCloud Keychain. This removes the sync before release and fixes the other must-fix findings. The Mobile Release for #400's merge was cancelled before any TestFlight or Play upload, so no tester received the sync code.

Key changes

  • Remove computer sync. iCloud KVS is not entitled: com.apple.developer.ubiquity-kvstore-identifier is commented out in project.yml pending the iCloud container. The ledger, its KVS key and the Swift wiring are removed.
  • Tokens device-only. Tokens a pre-release build put in iCloud Keychain are moved back (device-only copy written before the iCloud copy is deleted). saveToken adds or updates in place instead of delete-then-add, so a failed write can't drop a working token.
  • Prune script. Only acts on a Cargo target (named target, with Cargo's CACHEDIR.TAG), rejects / and $HOME, rejects a non-numeric cap, skips while cargo/rustc is running, and never deletes the target directory itself.
  • npm publish boundary. publish-npm runs in the new npm-publish environment, restricted to main. The npm trusted publisher will be bound to that environment too.

Kept from #400: reconnect waits for the in-flight pass, detached account probes with a 10 s deadline, in-memory token cache, coachmark removal.

Verification

  • cargo test -p codex-mobile-client --lib cloud_sync: 8 passed.
  • make ios-sim-fast: BUILD SUCCEEDED. SavedServerStoreTests: passed.
  • Prune script: tested against a non-Cargo dir, $HOME, a non-numeric cap, and staged pruning in a temp target (only the iOS deps survive stage 2; stage 3 leaves only CACHEDIR.TAG).

Follow-ups (not in this PR)

Real cross-device sync needs the iCloud container and provisioning profiles, plus a redesign per the review: opaque ids and no credential-bearing URLs in KVS, logical clocks with a device tie-breaker, no tombstones from decode failures, element-level merge instead of whole-value LWW, and fixing the CloudKVSBridge echo. Also from the review: coalesce concurrent reconnect callers onto one result, and cancel timed-out account RPCs in the session worker.

🤖 Generated with Claude Code

Review of #400 found that cross-device computer sync cannot work in the
shipping app (iCloud KVS is not entitled; the identifier is commented out
in project.yml pending the iCloud container) while it still moved
Kittylitter tokens into iCloud Keychain. Remove the sync until it can be
redesigned and entitled:

- Remove the computer ledger (cloud_sync::computers), its KVS key, and the
  SavedServerStore/CloudKVSBridge wiring.
- Alleycat tokens are device-only again. Tokens a pre-release build put in
  iCloud Keychain are moved back: the device-only copy is written before
  the iCloud copy is deleted. saveToken adds or updates in place, so a
  failed write never removes a working token. The in-memory cache stays.
- prune-rust-target.sh only acts on a Cargo target (named `target` with
  Cargo's CACHEDIR.TAG), rejects a non-numeric cap, skips while cargo or
  rustc is running, and never removes the target directory itself.
- release.yml: publish-npm runs in the `npm-publish` environment, which
  GitHub restricts to `main`, so a dispatch from another branch cannot
  obtain an npm publish token.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@0xSero
0xSero merged commit 7a55092 into main Sep 29, 2026
10 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