ReviewOS

stacks/ts-cloud

Manage workers, schedules, cron jobs, and recurring operations from CLI and dashboard

#155
Closed chrisbbreuer opened this 24 days ago · 0 comments
24 days ago

Roadmap relationship

Outcome

Provide one job-management model for application workers, server cron/systemd timers, EventBridge schedules, serverless scheduled tasks, and recurring control-plane operations, including safe manual runs and execution history.

Current gap

Worker and cron server CLI commands are placeholders, while dashboard worker/scheduler data is partially config-derived and serverless schedules use separate operations. There is no unified ownership, timezone validation, concurrency/overlap policy, history, missed-run behavior, or per-job logs.

User experience

  • List jobs by environment/service with type, schedule/timezone, next/last run, duration, result, target, enabled state, overlap policy, and owner.
  • Use a schedule builder with common presets plus validated cron/rate expression, human-readable preview, and the next several run times across DST.
  • Manual run, enable/disable, edit, and delete show target and impact; execution detail links logs, deployment/release, and retry.
  • Worker views show process count, queue, restart policy, current job, failures, and safe restart/scale controls where supported.

Scope

  • Define scheduled job, worker definition, execution, trigger, retry, concurrency, timeout, and target schemas.
  • Adapters for cron/systemd timers, EventBridge Scheduler/rules, Lambda scheduled events, queue workers, and recurring platform jobs such as cleanup/backups.
  • Implement create/update/delete/enable/disable/list/manual-run/history and reconcile desired config with observed provider state.
  • Support timezone, start/end windows, flexible time, payload/command, missed-run/catch-up policy, overlap forbid/allow/replace, retry and dead-letter behavior.
  • Expose CLI/API/dashboard parity and operation/audit integration.

Technical direction

  • Normalize provider expressions without losing original syntax and compute previews with a tested timezone library.
  • Use idempotent execution IDs and queue locks for overlap policy.
  • Separate definition reconciliation from execution history and mark external/manual provider runs distinctly.
  • Redact payload fields and shell arguments before events/logs.

Safety and operability

  • Commands run through allowlisted service/runtime targets, not an unrestricted host scheduler endpoint.
  • Deleting/disabling production jobs and restarting all workers require scoped permission, confirmation, and audit.
  • Prevent duplicate execution after restart and make at-least-once semantics explicit.
  • Secret payloads use references, never inline persisted values.

Acceptance criteria

  • A user can create the same logical scheduled task on a server and serverless target and understand capability differences.
  • Next-run previews are correct across timezone and DST transitions.
  • Overlap/retry policies behave deterministically and every execution has linked logs/status.
  • Existing config-defined schedules/workers appear and reconcile without destructive import.

Verification

  • Cron/rate/timezone/DST, missed-run, overlap, idempotency, retry, and restart tests.
  • Adapter fixtures for systemd/cron and EventBridge.
  • End-to-end schedule → execution → failure → retry → history flow.

Non-goals

  • Building a general distributed workflow engine.
  • Exactly-once guarantees for arbitrary user code.
  • Silently translating unsupported provider scheduling semantics.

Sign in to comment on this issue.