Schedules: engine semantics (missed runs, grid next-run, failures, cron zone) #119
Notifications
Due Date
No due date set.
Blocks
Depends on
Reference: sam/archie#119
Reference in new issue
Block a user
Rework the archied scheduler over the new store. Missed run fires once then next run follows the schedule grid. Failed run is recorded and advances. Cron evaluated in an instance time zone setting (default UTC); interval and once are UTC instants. Disabled schedules never fire. Run now creates a run at the current time without moving the grid. Delete the dangerous-payload regex guard, the chat and spawn-task runners and the systemOrgOnly wrapper.
Acceptance criteria
Table-driven domain tests for grid next-run after downtime, DST in the instance zone, and failure advancing; time zone setting works end to end via control plane.
Notes
Also: repeated run failures raise an alert through the existing alert path, and the row's Last Run shows the failure.
Seams (from 4d2cb/8fnip fork): domain scheduling.Job now carries ScheduleID, RunID, Name, ScheduledFor, BuiltIn. scheduling.Runner stays Run(ctx, Job) error; the engine records the outcome via the store, runners never touch runs. In archied, scheduleRunner{Builtins map[string]scheduling.Runner; Fire scheduling.Runner}: a BuiltIn job goes to Builtins[ScheduleID], any other job to Fire; a nil/missing entry fails the run with a clear error. w34dp sets Fire (publish schedule-fired). m1vvh sets Builtins and seeds rows through statestore Client.EnsureBuiltinSchedules(ctx, []schedule.Builtin{ID, Name, Interval}) which inserts missing built-in rows and never overwrites enabled/timing. Task reference on a run: Client.SetScheduleRunTask(ctx, runID, taskID).
Landed
cc5789eb. Built-ins: scheduleRunner.Builtins in internal/app/archied/scheduling.go is unset; wire (*Daemon).BuiltinJobs into it and call Client.EnsureBuiltinSchedules at boot. Built-in runs use the sequential pool. Schedule-settings resource (time_zone, run_retention, run_retention_count) is control-plane editable; no dashboard page yet (ielfm). A time zone change re-times cron schedules on the next claim. Run task link = capture_id on the run; tasks are binding dispatches for that capture.Close reason
Closed
Imported from beads
archie-core-8fnip· GitHub #1865 · type task · priority P1 · created 2026-10-25 · closed 2026-10-25