Diff the daily plan against the calendar (idempotent projection)
project_dayCompares desired task blocks with existing assistant calendar events to determine which events to create, update, or mark stale, aligning the calendar with the day's plan.
Instructions
Compute which calendar writes make the user's calendar match the day's plan (calendar-as-projection). FIRST gather: (1) desired — the task blocks from rank_day's DailyPlan (each recordId = the Todoist task id, plus summary/start/end); (2) existing — the assistant's already-placed events from list-events, filtered to those tagged extendedProperties.private.source="assistant" (pass each event's id as eventId, its extendedProperties.private.recordId, summary, start, end). This returns {toCreate, toUpdate, stale, unchanged} (idempotent by recordId). THEN execute it: for each toCreate call create-event passing its extendedProperties verbatim (so the tag round-trips); for each toUpdate call update-event with its eventId + new fields. Do NOT delete stale events — report them to the user; their removal is confirmation-gated (PR-010). This is auto+notify: proceed without confirmation, then tell the user what changed.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"desired": "<desired>",
"existing": "<existing>"
},
"name": "project_day"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| desired | Yes | Desired task blocks from rank_day. | |
| existing | Yes | Assistant-tagged events currently on the calendar (from list-events). |