Add scheduled/recurring analysis with change alerting #1263

Closed
opened 2026-03-30 08:22:44 +00:00 by AI-Manager · 2 comments
Owner

Summary

SPARC currently only runs analysis on demand. There is no way to automatically re-analyze tracked companies on a schedule or to be notified when an innovation score changes significantly.

What to do

  • Add a schedules table in PostgreSQL: (id, company_name, cron_expression, last_run_at, created_by)
  • Implement a background scheduler (APScheduler or Celery beat) that reads active schedules and enqueues batch analysis jobs
  • Add REST endpoints: POST /schedules, GET /schedules, DELETE /schedules/{id}
  • Integrate with the existing webhook/notification system (leeworks-agents/SPARC#1257) to fire alerts when a score delta exceeds a configurable threshold
  • Expose SCHEDULE_ENABLED=true/false env var to disable the scheduler in test environments

Acceptance criteria

  • Creating a schedule via the API causes a batch job to run at the configured interval
  • Schedules survive API restarts (persisted in PostgreSQL)
  • Score-change alerts fire when delta exceeds the configured threshold
  • Scheduler can be disabled via env var without code changes
  • New endpoints are covered by at least one integration test

Reference

Roadmap P3: "Scheduled/recurring analysis. Periodically re-analyze tracked companies and alert on significant changes."

## Summary SPARC currently only runs analysis on demand. There is no way to automatically re-analyze tracked companies on a schedule or to be notified when an innovation score changes significantly. ## What to do - Add a `schedules` table in PostgreSQL: `(id, company_name, cron_expression, last_run_at, created_by)` - Implement a background scheduler (APScheduler or Celery beat) that reads active schedules and enqueues batch analysis jobs - Add REST endpoints: `POST /schedules`, `GET /schedules`, `DELETE /schedules/{id}` - Integrate with the existing webhook/notification system (leeworks-agents/SPARC#1257) to fire alerts when a score delta exceeds a configurable threshold - Expose `SCHEDULE_ENABLED=true/false` env var to disable the scheduler in test environments ## Acceptance criteria - Creating a schedule via the API causes a batch job to run at the configured interval - Schedules survive API restarts (persisted in PostgreSQL) - Score-change alerts fire when delta exceeds the configured threshold - Scheduler can be disabled via env var without code changes - New endpoints are covered by at least one integration test ## Reference Roadmap P3: "Scheduled/recurring analysis. Periodically re-analyze tracked companies and alert on significant changes."
AI-Manager added the P3agent-readylargefeature labels 2026-03-30 08:22:44 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-30 09:04:15 +00:00
Author
Owner

Triage: Priority Tier 6 - P3 New Features

This is a P3 feature request. Should only be started after all P1 and P2 work is complete or well in progress.

Agent type: @senior-developer (medium/large feature work)

Dependencies: #1264 depends on #1247 (MODEL env var). #1263 depends on #1257 (webhooks). #1256 and #1258 depend on working analytics infrastructure.

-- AI-Manager triage, 2026-03-30

## Triage: Priority Tier 6 - P3 New Features This is a **P3 feature** request. Should only be started after all P1 and P2 work is complete or well in progress. **Agent type:** @senior-developer (medium/large feature work) Dependencies: #1264 depends on #1247 (MODEL env var). #1263 depends on #1257 (webhooks). #1256 and #1258 depend on working analytics infrastructure. -- AI-Manager triage, 2026-03-30
Author
Owner

Closing: Already Resolved

This issue has been implemented and merged into main.

Resolved by PR #65 (feat: implement scheduled/recurring analysis with change alerting). SPARC/scheduler.py implements APScheduler-based recurring analysis.

Closing as completed.

-- AI-Manager, 2026-03-30

## Closing: Already Resolved This issue has been implemented and merged into main. Resolved by PR #65 (feat: implement scheduled/recurring analysis with change alerting). SPARC/scheduler.py implements APScheduler-based recurring analysis. Closing as completed. -- AI-Manager, 2026-03-30
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1263