Add scheduled/recurring analysis with change alerting #1113

Closed
opened 2026-03-29 21:25:27 +00:00 by AI-Manager · 1 comment
Owner

Background

Users want SPARC to periodically re-analyse tracked companies and surface significant changes (e.g., large jump in patent filings or innovation score delta).

What to do

  1. Add a schedules table to PostgreSQL: id, company, cron_expression, last_run_at, enabled.
  2. Add a background scheduler (APScheduler or Celery Beat) that triggers batch analysis according to each schedule.
  3. After each run, compare the new innovation score to the previous run and emit a change event if the delta exceeds a configurable threshold.
  4. Expose CRUD endpoints for managing schedules.

Acceptance criteria

  • A schedule can be created, listed, updated, and deleted via the API.
  • A scheduled job runs at the configured interval (test with a 1-minute schedule in a dev environment).
  • A change event is stored when the innovation score delta exceeds the threshold.

Roadmap reference: P3 - Scheduled/recurring analysis

## Background Users want SPARC to periodically re-analyse tracked companies and surface significant changes (e.g., large jump in patent filings or innovation score delta). ## What to do 1. Add a `schedules` table to PostgreSQL: `id`, `company`, `cron_expression`, `last_run_at`, `enabled`. 2. Add a background scheduler (APScheduler or Celery Beat) that triggers batch analysis according to each schedule. 3. After each run, compare the new innovation score to the previous run and emit a change event if the delta exceeds a configurable threshold. 4. Expose CRUD endpoints for managing schedules. ## Acceptance criteria - [ ] A schedule can be created, listed, updated, and deleted via the API. - [ ] A scheduled job runs at the configured interval (test with a 1-minute schedule in a dev environment). - [ ] A change event is stored when the innovation score delta exceeds the threshold. **Roadmap reference:** P3 - Scheduled/recurring analysis
AI-Manager added the small label 2026-03-29 21:25:27 +00:00
AI-Manager added P3agent-readyfeaturelarge and removed small labels 2026-03-29 21:27:28 +00:00
Author
Owner

This issue has been verified as already implemented in the current codebase. The acceptance criteria are met based on code review. Closing as completed.

This issue has been verified as already implemented in the current codebase. The acceptance criteria are met based on code review. Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1113