Skip to content

feat: Background Jobs M1 β€” Foundation (org timezone + DB schema + cron wrappers)#151

Open
clemenshelm wants to merge 29 commits into
mainfrom
background-jobs
Open

feat: Background Jobs M1 β€” Foundation (org timezone + DB schema + cron wrappers)#151
clemenshelm wants to merge 29 commits into
mainfrom
background-jobs

Conversation

@clemenshelm

@clemenshelm clemenshelm commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Closes #138 (partial β€” M1 of 6 milestones)
Closes #194 (org timezone docs, folded in from #386)

Summary

  • Org timezone setting β€” admin can set org-wide IANA timezone in Settings β†’ Organization. Browser timezone is captured automatically during initial setup. Changes are audited with from/to diff.
  • DB schema β€” 4 new tables: briefings, briefing_runs (slim β€” telemetry stays in OpenClaw), notifications, notification_recipients. Drizzle migration included.
  • Audit event types β€” briefing.created / updated / deleted added to AuditEventType.
  • OpenClaw cron wrappers β€” thin Pinchy-side wrappers for cron.list / add / update / remove / run / runs / status. Used by M2 (sync layer) and beyond.

What's NOT here yet (M2–M6)

No Automations tab, no Activity feed, no scheduled briefings running. All background jobs infrastructure is invisible to users β€” the only user-visible change is the Org Timezone field in Settings.

Test Plan

  • Start dev stack: docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build
  • Settings β†’ Organization β†’ Timezone selector visible (admin only)
  • Change timezone β†’ toast "Settings saved" β†’ reload β†’ value persists
  • Audit log shows settings.updated with changes.timezone.from / to
  • Fresh setup wizard β†’ check SELECT * FROM settings WHERE key = 'org.timezone'; in DB β†’ timezone from browser captured
  • DB has 4 new tables: briefings, briefing_runs, notifications, notification_recipients
  • pnpm --filter web test β†’ 2697 passed

Clemens Helm added 24 commits April 15, 2026 07:51
Adds browserTimezone param to createAdmin, calls setOrgTimezone (fallback UTC).
Setup form sends Intl.DateTimeFormat().resolvedOptions().timeZone in POST body.
Adds a TimezoneSettings component with an IANA timezone select (Intl.supportedValuesOf) and Save button, wired into a new "Organization" admin tab in Settings. POSTs to /api/settings with key org.timezone, shows success toast on save and inline error on failure.
Generates migration 0028_parallel_rocket_racer.sql with CREATE TABLE
for briefings, briefing_runs, notifications, and notification_recipients,
including all foreign keys and indexes.

Also fixes a drizzle snapshot chain collision (0025/0026 had identical
content pointing to a non-existent prevId) caused by merging the audit
and Odoo branches β€” rebuilt both snapshots with correct table sets and
proper UUID chain.
Clemens Helm added 4 commits April 29, 2026 20:41
# Conflicts:
#	packages/web/drizzle/meta/0028_snapshot.json
#	packages/web/drizzle/meta/_journal.json
#	packages/web/src/components/settings-page-content.tsx
#	packages/web/src/lib/audit.ts
# Conflicts:
#	packages/web/src/__tests__/app/setup-page.test.tsx
#	packages/web/src/app/api/settings/route.ts
#	packages/web/src/app/api/setup/route.ts
#	packages/web/src/lib/audit.ts
The drift guard caught these as missing from APPLICATION_TABLES after
merging main β€” main added the guard, this branch added the tables.
Add a Reference page describing the org-wide IANA timezone setting
introduced by Background Jobs M1 (#138 / #151): where it lives, default
behavior, format, validation, and audit shape. Linked from the Reference
sidebar so the field is discoverable before later milestones add user-
facing automations on top of it.

Closes #194
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.

docs: document org timezone setting (M1 follow-up) Scheduled Briefings: admin-configured background runs with notification feed

1 participant