mirror of
https://github.com/PerpetualSoftware/pad.git
synced 2026-11-02 09:23:59 +00:00
81248f33e8
* feat(schedule): firing for item schedules, floating recipient zone, re-anchor and hooks (TASK-4102 PR1b) fireOneReminder gains a managed branch (unmanaged path unchanged): on Postgres one pin statement locks item, workspace and schedule before the arbiter takes the reminder; after the win the schedule is loaded and a floating occurrence is resolved in the recipient's zone, deferring (no event) when the row was armed early at the UTC+14 bound. A stored rule that no longer compiles leaves the row fired with no event and sets error_code. The schedule start is re-anchored to the fired occurrence under the plan's conditions. models.Reminder gains schedule_id and occurrence_at; the notification dedupe key uses occurrence_at for managed rows. The users.timezone writers and the assignee write reset the affected user's armed floating rows to the bound after they commit. Claude-Session: https://claude.ai/code/session_01Pa22hHpfXoZbQkEFvPtNeS * fix(schedule): UpdateSchedule locks the item first; hook-failure and lock-order tests (TASK-4102 PR1b) UpdateSchedule takes the item FOR KEY SHARE (Postgres) before its schedule FOR UPDATE, so every writer runs item, schedule, reminder. Adds a test-only seam to fail the recipient hook, a test that a floating row fires in the new zone when the hook fails, a PG test that UpdateSchedule waits on the item before the schedule, and a comment on the fire pin's rowmark-order reliance. Claude-Session: https://claude.ai/code/session_01Pa22hHpfXoZbQkEFvPtNeS * fix(store): compile a managed schedule's stored rule before the floating deferral (TASK-4102) A broken floating rule was deferred once before error_code was recorded. The compile now runs first, so it records error_code on the first fire attempt with no deferral write and no event. Claude-Session: https://claude.ai/code/session_01Pa22hHpfXoZbQkEFvPtNeS