Repository navigation
Reminders: named views, search paging, batch writes, strict address alarms, and list colors - #378
Conversation
…larms, list colors Adds reminders_today, reminders_upcoming, reminders_overdue, reminders_search, reminders_get, reminders_lists_get, reminders_lists_update, reminders_complete, reminders_delete_batch, and reminders_resolve_location. Extends create/update with all-day and timed due strings, priority numbers, recurrence strings, alarm strings, address-based location alarms, and completion_date. Pure logic lives in RemindersQuery.swift with unit tests. Behavior follows viticci/remctl (MIT).
|
Following up from #364, the two main fixes for |
…ers_delete is disabled
c05f818 to
e30126f
Compare
|
@mattt Dropped the ReminderKit commit (keeping that on my fork) and fixed both issues in the EventKit commit: |
|
Thanks, @oliverames. Both fixes are in. I only passed along two findings last time, and I should have sent the rest then. Sorry about that. Here's what's left before I merge:
The test for |
Mattt's pre-merge findings on mattt#378: - Read a stored relative alarm without trapping: an offset too large for an Int clamps instead of crashing. - All-day and timed dues carry the reminder's calendar and time zone, and timed dues keep their seconds. Views read a due date in its stored time zone instead of overwriting it. - A location alarm's house number is part of the street match, and a bare locality such as "Rome" is no longer accepted as a place. - reminders_complete is gated by reminders_update, and a list rename by reminders_lists_rename. Both refuse before touching EventKit. - A complete whose readback finds no reminder reports an uncertain result and stops the batch. - reminders_update accepts completion_date. - The batch-delete test drives the tool itself instead of the settings helper, so removing the guard fails it. The test target now compiles Reminders.swift and the two extension files it needs, so the tool-level tests exercise the real handlers.
|
Thanks @mattt. All seven are fixed. Reading a stored relative alarm clamps an offset that doesn't fit an The house number is part of the street match, and a bare locality like "Rome" isn't accepted as a place anymore.
|
The fork's integration build still had the pre-review code for the Reminders, Notes and AppleScript helper work. Bring in the same fixes Mattt is reviewing upstream: - Reminders: clamp stored relative alarms instead of trapping; carry the reminder's calendar and time zone on all-day and timed dues and keep seconds; read views in the stored time zone; include the house number in the street match and reject a bare locality; gate complete by reminders_update and rename by reminders_lists_rename; report an uncertain result when a complete's readback finds no reminder; accept completion_date on update; use the database tag records for notes_tags. - Notes: count scannedNoteCount against the scan budget and cap the page request by what is left; keep unreadableNoteIDs whether or not they matched; read tag filters from the database tag records; stop overwriting keywords from note text; don't pad short table rows; drop TagTally. - AppleScript: make beforeSending @sendable, drop nonisolated(unsafe), and check cancellation after the hook returns. 781 tests, 0 failures; format clean; the app builds.
…, pin the view time zone test Clamp relativeAlarmMinutes to the parsing cap and build the label from the magnitude so extreme stored offsets cannot trap. Reset the shared store after a failed or uncertain batch delete so a later commit cannot apply it. Make the view time zone test independent of the machine zone.
|
@mattt I went back over this before your next pass and found two more things, both fixed. The stored-alarm clamp I added could still trap.
I also made the time zone view test use fixed zones, since it passed on my Mac in Eastern time whether or not the fix was there. |
|
Thanks, @oliverames. The alarm, disabled-tool, readback, and
Could you build the Gregorian calendar with |
|
@mattt I made all three changes in |
This is #359 cut as one PR so it can merge on its own. It is public EventKit and MapKit only: the private ReminderKit tools stay on my fork and are not part of this PR. No stacking: this is based on current
mainand depends on no other open PR.iMCP's Reminders tools cover the basics, but an agent can't ask for today's or overdue reminders, page through search results, look up one reminder or list, or complete and delete in batches. viticci/remctl was the design reference for what a Reminders MCP should cover. None of its code is used.
What changed
reminders_today,reminders_upcoming,reminders_overdue,reminders_search(titles, notes and URLs, ignoring case and accents, withlimit,offset,total,hasMoreandnextOffset),reminders_get,reminders_lists_get,reminders_lists_update,reminders_completeandreminders_delete_batch(up to 50 identifiers, per-id results, no retry of a write that may have landed), andreminders_resolve_location, which refuses ambiguous or imprecise addresses.dueas an all-day date, a timed date or ISO with an offset;priorityby name or Apple number;recurrenceas strings such asweekly mon,wed,friormonthly 4th-fri; alarms as15m,1h,1dor a date;completion_date; and listcolor.dueis now all-day. It used to mean local midnight.RemindersQuery.swift, with unit tests.Review fixes
reminders_completeis gated byreminders_update, and a list rename byreminders_lists_rename. Both refuse before EventKit is touched.reminders_updateacceptscompletion_date.Testing
imcp-serverTests: 216 tests, 1 skipped (pre-existing), 0 failures.RemindersQueryTestscovers the tool-level gating, the address, due-date and alarm cases, extreme stored alarm offsets, and a stored time zone read with view and calendar zones that differ from it.swift format lint --strictis clean on the changed files.Not verified
iMCPapp scheme could not be built on my Mac from this branch: theiMCP Helpertarget uses Mattt's team for signing and this Mac has no profile for it. The test target compiles the changed service files, so the code is type-checked, but the full app build is left to CI.reminders_resolve_locationbeyond the synthetic-candidate tests.Replaces #359.