Schedules: built-in maintenance jobs replace the daemon poll cycle #342
Notifications
Due Date
No due date set.
Depends on
Reference: sam/archie#342
Reference in new issue
Block a user
Volume cleanup, issue discovery, PR reconcile, PR review scan, binding dispatch where appropriate, and worktree mirror pruning become built-in schedules defined in code and seeded as locked rows: enable/disable, retime and run now only. Work runs inside archied. Remove them from Daemon.Cycle; keep only work that needs a tight loop (NATS drain).
Acceptance criteria
Each built-in appears as a locked schedule, runs on its interval, can be disabled; Cycle no longer calls them; mirror pruning exists.
Notes
See archie-core-8fnip notes for scheduleRunner.Builtins and EnsureBuiltinSchedules.
Done in
b87365ad(step 1 of 2): daemon.BuiltinJob{ID, Name, DefaultInterval time.Duration, Run func(ctx) error} and (*daemon.Daemon).BuiltinJobs() []BuiltinJob list volume-cleanup (1h), issue-discovery (1m), pr-reconcile (1m), pr-review-scan (1m), mirror-prune (24h, prunes mirrors idle 7 days with no sibling task clone). IDs are stable row keys. Cycle still runs every built-in each tick until the engine lands. Remaining, for the engine work: seed one locked row per BuiltinJob (built_in=true; enable/disable, retime and run-now only), dispatch built-in runs to job.Run in archied, then delete the BuiltinJobs loop from Daemon.Cycle. Binding dispatch and reaction draining stay on the intake tick: they turn arrived events into tasks and can't wait on a minute-grained schedule.Close reason
Built-in jobs seed as locked schedules and run through the scheduler; schedule runs fire captures and record capture_id.
Imported from beads
archie-core-m1vvh· GitHub #1864 · type task · priority P1 · created 2026-10-25 · closed 2026-10-25