Skip to content

Job Registry — Scalable Job Architecture #75

@jonit-dev

Description

@jonit-dev

Summary

Adding a new job type currently requires touching 15+ files across 4 packages. This PRD introduces a Job Registry pattern to make job definitions declarative and reduce new-job boilerplate to 2-3 files.

Key Changes

  • Core Job Registry (packages/core/src/jobs/) — single source of truth for job metadata, defaults, env parsing rules
  • IBaseJobConfig interface — uniform { enabled, schedule, maxRuntime } for all jobs
  • Registry-driven normalization — replace per-job blocks in config-normalize.ts and config-env.ts with generic loops
  • Legacy config migration — auto-detect and migrate flat executor/reviewer fields to nested format
  • Web Job Registry (web/utils/jobs.ts) — UI metadata (icons, labels, endpoints) for Scheduling/Settings pages
  • Zustand jobs slice — computed job state derived from config
  • Generic server routes — generate action routes from registry

Phases

  1. Core Job Registry — Foundation (5 files)
  2. Config Migration & Registry-Driven Normalization (5 files)
  3. Web Job Registry & Zustand Jobs Slice (4 files)
  4. Refactor Scheduling Page to Use Registry (3 files)
  5. Refactor Settings Page Job Sections (3 files)

PRD

Full PRD: docs/PRDs/job-registry.md

Acceptance Criteria

  • Adding a new job type requires only 2-3 files (registry entry + CLI command)
  • Legacy configs auto-migrated on load
  • No breaking changes to API endpoints
  • All existing tests pass
  • Scheduling and Settings pages render identically

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions