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
- Core Job Registry — Foundation (5 files)
- Config Migration & Registry-Driven Normalization (5 files)
- Web Job Registry & Zustand Jobs Slice (4 files)
- Refactor Scheduling Page to Use Registry (3 files)
- 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
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
packages/core/src/jobs/) — single source of truth for job metadata, defaults, env parsing rulesIBaseJobConfiginterface — uniform{ enabled, schedule, maxRuntime }for all jobsconfig-normalize.tsandconfig-env.tswith generic loopsweb/utils/jobs.ts) — UI metadata (icons, labels, endpoints) for Scheduling/Settings pagesPhases
PRD
Full PRD:
docs/PRDs/job-registry.mdAcceptance Criteria