Remove temporary-exception entitlement rejected by App Store#578
Remove temporary-exception entitlement rejected by App Store#578
Conversation
Apple rejected Guideline 2.4.5(i): the temporary-exception entitlement com.apple.security.temporary-exception.files.home-relative-path is not permitted for Mac App Store apps. The exception is unnecessary because the macOS sandbox remaps HOME to ~/Library/Containers/<bundle-id>/Data/, so all UserProfile-based paths (~/.polypilot/, ~/.copilot/) resolve inside the container automatically. The copilot helper process inherits the sandbox via Entitlements.Helper.plist and sees the same remapped HOME. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Multi-Model Code Review — PR #578 (Re-review after fixes)SummaryRemoves the CI StatusPrevious Review Findings — Status
New Findings (from migration code)🟡 MODERATE — Migration marker written unconditionally, permanently sealing failed/blocked migrations (3/3 reviewers)File:
Fix: Only write the marker when 🟡 MODERATE — Migration is effectively dead code on sandboxed App Store builds (3/3 reviewers, severity 2× 🔴 1× 🟢 → median 🟡)File: Impact: Users upgrading from sideloaded/dev builds to App Store won't get their data migrated. Their files still exist at the real home (no data loss), but they're invisible to the sandboxed app. Suggestion: If this matters for the user base, investigate 🟢 MINOR — Symlink following could cause StackOverflow or copy unintended data (2/3 reviewers)File: Fix: Check 🟢 MINOR — Missing newline at end of file (1/3 reviewers)File: Discarded Findings
Test Coverage
Recommendation
The entitlement removal itself is correct and safe. The migration is a nice-to-have but needs the marker fix to avoid being harmful (permanently lying about migration state). |
When a user upgrades from a sideloaded (non-sandboxed) build to the App Store (sandboxed) build, their data at the real ~/.polypilot/ and ~/.copilot/ becomes invisible because the sandbox remaps HOME to the container directory. This adds a one-time migration in Program.cs that: - Detects the sandbox by checking for /Library/Containers/ in HOME - Derives the real home path from the container path - Copies .polypilot/ and .copilot/ data into the container - Uses a .sandbox-migrated marker to prevent repeated attempts - Skips gracefully if the sandbox blocks access (best-effort) - Never overwrites existing container data (don't-clobber invariant) Also fixes stale comments in ConnectionSettings.cs that incorrectly stated Mac Catalyst runs without app sandbox. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Problem
Apple rejected the Mac App Store submission under Guideline 2.4.5(i) - Performance:
Temporary exception entitlements are not approved for new Mac App Store submissions.
Fix
Removed the
com.apple.security.temporary-exception.files.home-relative-path.read-writeentitlement fromEntitlements.AppStore.plist.This entitlement was unnecessary because:
HOMEto~/Library/Containers/<bundle-id>/Data/UserProfile-based paths (~/.polypilot/,~/.copilot/) resolve inside the container automaticallyEntitlements.Helper.plist) and sees the same remappedHOMETesting