Skip to content

scheduling: scheduler durable object, /remind, automations - #13

Merged
anott03 merged 8 commits into
mainfrom
amitav/scheduling
Aug 26, 2026
Merged

anott03 merged 8 commits into
mainfrom
amitav/scheduling

Conversation

@anott03

@anott03 anott03 commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a scheduling primitive for lynn, built in phases (design doc tracked locally in .thoughts/scheduler.md):

  • Schedule spec module (src/schedule/spec.ts): one-shot, daily, and weekly schedule values with a branded default zone (America/New_York)
  • Pure next-fire math (src/schedule/next-run.ts): strictly-after semantics, DST gap and overlap handling via Intl offsets
  • Scheduler Durable Object (src/schedule/scheduler.ts): job registry backed by SQLite storage, alarm-driven firing, task dispatch by payload type, automation reconcile on boot
  • Async command execution: Command.execute now returns Promise<CommandResult> end to end
  • /remind command with at / every / list / cancel subcommands, plus mention-path parsing and a natural-language time parser (in 30 minutes, tomorrow 9am, monday 10am, 2026-09-01 14:30)
  • Automation registry (src/discord/automations/index.ts): statically declared reminders reconciled into the DO on boot; ships an inert standup example until a channel id is configured

Verification

  • tsc, oxlint clean; 41 vitest tests green (parser cases, DST fixtures, interaction handling)
  • Live dev smoke: job fired on time through the alarm path, cancel/list behavior verified, adapter-to-DO chain exercised, reconcile skip/insert/delete all confirmed across boots
  • Slash commands registered in the guild via pnpm register

Notes

  • Recurring specs store wall-clock time plus IANA zone; UTC instants are computed only for next_fire_at so recurring jobs stay drift-free across DST transitions
  • Cancel is permission-free; created_by is stored for display only
  • The Gateway DO keeps its alarm reserved for reconnect logic, hence the dedicated Scheduler DO

Follow-ups

  • Manual Discord QA of /ping, mention ping, and the four /remind flows on real channels
  • Paste a real channel id into the standup example (or drop it) before enabling it
  • Deploy to prod after review

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@github-actions

github-actions Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Preview Deployed

URL: https://lynn-lynn-pr-13-gej5zaoqllpq5oze.amitavnott.workers.dev

Built from commit 7a001c8


This comment updates automatically with each push.

@abfibonacci4
abfibonacci4 self-requested a review August 26, 2026 03:02
@anott03
anott03 merged commit d5ebd08 into main Aug 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants