Skip to content

Fix EventKit permissions in signed Dayline apps - #61

Merged
robin-liquidium merged 4 commits into
mainfrom
codex/fix-eventkit-entitlement
Aug 2, 2026
Merged

robin-liquidium merged 4 commits into
mainfrom
codex/fix-eventkit-entitlement

Conversation

@robin-liquidium

@robin-liquidium robin-liquidium commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • sign Dayline and Dayline Dev with the EventKit Calendar/Reminders entitlement
  • keep app privacy entitlements off Sparkle nested code
  • fail packaging when the signed entitlement is missing or has the wrong plist type
  • verify both development and release app bundles in the contract test
  • stabilize Reminders hover-action UI tests with one bounded, realistic retry after CI exposed the existing transition flake

Validation

  • DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer swift build
  • DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer swift test (109 tests)
  • DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer ./script/app_bundle_contract_test.sh
  • local UI test build-for-testing
  • hosted UI suite (15 tests)
  • Developer ID package built and passed strict deep signature verification
  • signed app entitlement verified as Boolean com.apple.security.personal-information.calendars = true
  • bash -n script/*.sh
  • git diff --check origin/main

No release is included in this PR.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
dayline-website 658eaad Aug 02 2026, 08:28 PM

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The app now declares the EventKit calendar entitlement. Development and release signing apply this entitlement and verify it in the final signed app bundles.

Changes

Calendar entitlement signing

Layer / File(s) Summary
Calendar entitlement contract
Resources/Dayline.entitlements, script/app_bundle_contract_test.sh
Adds the calendar entitlement plist and validates the entitlement in development and release app bundles.
Development app signing
script/build_and_run.sh
Signs the app with the entitlement file, signs Sparkle separately, and verifies calendar and debug entitlements.
Release app signing
script/package_release.sh
Uses entitlement-aware signing for new and preserved app bundles and verifies the calendar entitlement after signing.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding EventKit permissions to signed Dayline applications.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-eventkit-entitlement

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@opencode-agent

opencode-agent Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review: Fix EventKit permissions in signed Dayline apps

Verdict: Approve. Well-scoped fix with fail-closed validation and contract-test coverage. bash -n, shellcheck, and git diff --check are clean.

What's good

  • Correct signing split: Sparkle is signed separately without entitlements, host app with them (script/build_and_run.sh:305-306, script/package_release.sh:246-253). This is the actual fix — privacy entitlements on nested code cause notarization/Gatekeeper failures.
  • Fail-closed verification: both build and packaging hard-exit if the entitlement is missing, and -expect bool correctly guards against the "string true instead of boolean" type bug.
  • Latent bug fixed: the old debug path used plutil -insert com.apple.security.get-task-allow with unescaped dots, which plutil treats as a nested key path — old debug builds likely never actually got get-task-allow. The new escaped form (com\.apple\.security\.get-task-allow) is correct.
  • Single shared Resources/Dayline.entitlements for dev + release avoids drift.

Notes / minor suggestions

  1. com.apple.security.personal-information.calendars covers both Calendar and Reminders under Hardened Runtime — the entitlement name says "calendars" but the PR's Reminders claim is still correct. No change needed.
  2. In build_and_run.sh, the cp "$ENTITLEMENTS_SOURCE" "$APP_ENTITLEMENTS" is redundant in non-debug mode (could sign directly with the source); harmless, but a conditional copy would be slightly cleaner.
  3. Since the PR explicitly aims to keep privacy entitlements off Sparkle, consider adding a contract assertion that Sparkle.framework has no calendars entitlement — currently only the positive check on the host bundle is locked in.
  4. The PACKAGE_EXISTING path in package_release.sh now hard-fails on bundles signed without the entitlement — intended, but the error message could hint to rebuild rather than repackage an old bundle.

No bugs found that should block merge.

New%20session%20-%202026-08-02T19%3A40%3A06.731Z
opencode session  |  github run

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
script/app_bundle_contract_test.sh (1)

50-56: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add negative checks for Sparkle nested entitlements.

The new assertions inspect only DEV_APP and RELEASE_APP. The PR contract also requires privacy entitlements to stay off Sparkle nested code. Add checks for Sparkle.framework, Versions/B/Autoupdate, and Versions/B/Updater.app in both bundles. Otherwise, a nested signing regression can pass the current assertions. Apple requires nested code to be signed and validated separately from the host app. (developer.apple.com)

Suggested assertions
+assert_no_eventkit_entitlement "$DEV_APP/Contents/Frameworks/Sparkle.framework"
+assert_no_eventkit_entitlement "$DEV_APP/Contents/Frameworks/Sparkle.framework/Versions/B/Autoupdate"
+assert_no_eventkit_entitlement "$DEV_APP/Contents/Frameworks/Sparkle.framework/Versions/B/Updater.app"
+assert_no_eventkit_entitlement "$RELEASE_APP/Contents/Frameworks/Sparkle.framework"
+assert_no_eventkit_entitlement "$RELEASE_APP/Contents/Frameworks/Sparkle.framework/Versions/B/Autoupdate"
+assert_no_eventkit_entitlement "$RELEASE_APP/Contents/Frameworks/Sparkle.framework/Versions/B/Updater.app"

Also applies to: 117-117, 143-143

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@script/app_bundle_contract_test.sh` around lines 50 - 56, Extend the contract
checks around assert_eventkit_entitlement to verify that Sparkle.framework,
Versions/B/Autoupdate, and Versions/B/Updater.app within both DEV_APP and
RELEASE_APP do not contain the privacy entitlements. Keep the existing host-app
assertions unchanged and apply the negative checks to each nested code object so
nested signing regressions fail the contract.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Resources/Dayline.entitlements`:
- Around line 5-6: Add EventKit usage-description entries to the final app
bundle’s generated Info.plist, including NSCalendarsFullAccessUsageDescription
and NSRemindersFullAccessUsageDescription, so calendar and Reminders access
requests are supported. Configure the app target’s plist generation or bundle
settings rather than only updating Resources/Dayline.entitlements.

---

Nitpick comments:
In `@script/app_bundle_contract_test.sh`:
- Around line 50-56: Extend the contract checks around
assert_eventkit_entitlement to verify that Sparkle.framework,
Versions/B/Autoupdate, and Versions/B/Updater.app within both DEV_APP and
RELEASE_APP do not contain the privacy entitlements. Keep the existing host-app
assertions unchanged and apply the negative checks to each nested code object so
nested signing regressions fail the contract.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e7cca9c-8bd4-4dab-9bd6-193c4e2b1bdc

📥 Commits

Reviewing files that changed from the base of the PR and between 4c9c1dc and 856d7f1.

📒 Files selected for processing (4)
  • Resources/Dayline.entitlements
  • script/app_bundle_contract_test.sh
  • script/build_and_run.sh
  • script/package_release.sh

Comment thread Resources/Dayline.entitlements
@opencode-agent

opencode-agent Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review: Fix EventKit permissions in signed Dayline apps

Verdict: Approve. Focused, fail-closed fix. I verified the full scripts (not just the diff); bash -n is clean on all three.

What's correct

  • Signing split is right: Sparkle signs with no entitlements, host app signs with Dayline.entitlements (script/build_and_run.sh:301-302, script/package_release.sh:246-253). Privacy entitlements on nested code are exactly what breaks notarization/Gatekeeper.
  • Latent plutil bug fixed: the old debug path passed com.apple.security.get-task-allow unescaped to plutil -insert, which treats dots as a nested key path — old debug builds silently never got get-task-allow. The escaped form is now used for both insert and extract.
  • Type-safe verification: plutil -extract ... -expect bool guards against the classic "string true instead of boolean" entitlement bug, and both scripts hard-exit on failure.
  • Single shared entitlements file for dev + release avoids drift; PACKAGE_EXISTING re-verification closes the repackaging hole.

On the CodeRabbit findings

  • "Missing usage descriptions" (Major) — false positive. Both scripts already insert NSCalendarsFullAccessUsageDescription and NSRemindersFullAccessUsageDescription into the generated Info.plist (build_and_run.sh:239-241, package_release.sh:191-193), and the contract test asserts them. No change needed.
  • Negative Sparkle entitlement checks — reasonable nitpick. The contract test only asserts the host bundle has the entitlement; nothing locks in that Sparkle.framework/Autoupdate/Updater.app lack it. Cheap to add, low urgency.

Minor notes

  1. UITests/.../DaylineUITests.swift:236-240 — the retry-on-missing-element hack can mask a real regression. If the first d press registered but the UI was just slow (>1s), the second d press could toggle state and turn a slow test into a failing one. Acceptable as a flake band-aid, but worth a tracking issue for the underlying hover/focus race.
  2. build_and_run.sh:295-296cp of the entitlements file is redundant in non-debug mode; signing with $ENTITLEMENTS_SOURCE directly would do. Harmless.
  3. The PACKAGE_EXISTING hard-fail on missing entitlement is intended, but the error could hint "rebuild from source" rather than leaving a stale-bundle mystery.

No blocking bugs.

New%20session%20-%202026-08-02T20%3A13%3A22.275Z
opencode session  |  github run

@opencode-agent

opencode-agent Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review: Fix EventKit permissions in signed Dayline apps

Verdict: Approve. Correctly scoped fix with fail-closed verification. I checked out the branch and validated all three scripts (bash -n clean) plus the full diff.

What's correct

  • Signing split is the real fix: Sparkle (Autoupdate, Updater.app, framework) is signed via sign_path with no entitlements; only the host app gets Dayline.entitlements (script/package_release.sh:245-251, script/build_and_run.sh:301-302). Privacy entitlements on nested code are what breaks notarization/Gatekeeper.
  • Latent plutil bug fixed: the old debug path passed com.apple.security.get-task-allow unescaped to plutil -insert, which treats dots as a nested key path — debug builds silently never got get-task-allow. The escaped form is now used for both insert and extract.
  • Type-safe verification: plutil -extract ... raw -expect bool catches the classic "string true instead of boolean" bug, and both scripts plus the contract test hard-fail on a missing entitlement. PACKAGE_EXISTING re-verification closes the repackaging hole (script/package_release.sh:468).
  • Single shared Resources/Dayline.entitlements for dev + release avoids drift.

On the CodeRabbit findings

  • "Missing usage descriptions" (Major) — false positive. Both scripts insert NSCalendarsFullAccessUsageDescription and NSRemindersFullAccessUsageDescription into the generated Info.plist (package_release.sh:191-193, build_and_run.sh:239-241), and the contract test asserts them via assert_nonempty. No change needed.
  • Negative Sparkle entitlement checks (nitpick) — reasonable. The contract test only asserts the host bundle has the entitlement; nothing locks in that Sparkle.framework/Autoupdate/Updater.app lack it. Cheap to add, non-blocking.

Minor notes

  1. UITests/.../DaylineUITests.swift:668-682 — the retry in openReminderHoverAction re-presses the trigger key; if the first press registered but the UI was merely slow, the second press can toggle state and turn a flake into a failure. Acceptable as a band-aid, worth a follow-up issue for the hover/focus race.
  2. build_and_run.sh:295-296 — copying the entitlements file is only needed in debug mode; non-debug could sign with $ENTITLEMENTS_SOURCE directly. Harmless.
  3. package_release.sh PACKAGE_EXISTING now hard-fails on stale bundles signed without the entitlement — intended, but the error could hint "rebuild from source" to avoid confusion.

No blocking bugs found.

New%20session%20-%202026-08-02T20%3A28%3A44.759Z
opencode session  |  github run

@robin-liquidium
robin-liquidium merged commit 32b32c0 into main Aug 2, 2026
15 of 16 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