Expand description
systemprompt-scheduler — background-job and service-orchestration
engine for the systemprompt.io AI governance platform.
The crate hosts:
- A
SchedulerServicethat usestokio_cron_schedulerto dispatch jobs registered viasystemprompt_provider_contracts::submit_job!. - A small set of built-in jobs (
BehavioralAnalysisJob,CleanupInactiveSessionsJob, …) that drive analytics and security maintenance. - Process- and database-level service reconciliation primitives
(
ProcessCleanup,ServiceReconciler,ServiceStateManager).
§Public error surface
Every non-trait public API returns
SchedulerResult<T> (alias for Result<T, SchedulerError>). SchedulerError composes the
sqlx, tokio-cron-scheduler, systemprompt-database,
systemprompt-analytics, and systemprompt-users error types via
#[from], plus an Internal(String) carve-out for cases where the
upstream cause is stringified at the call site rather than typed.
Provider-trait bodies (Job::execute, …) keep returning
systemprompt_provider_contracts::ProviderResult for ABI parity with
the trait contract; a From<SchedulerError> for ProviderError impl makes
? propagation transparent inside job bodies.
§Feature flags
This crate has no Cargo feature gates of its own — all functionality is
always compiled. Conditional compilation is limited to platform-specific
#[cfg(unix)] / #[cfg(windows)] shims inside
services::orchestration::ProcessCleanup.
Re-exports§
pub use error::SchedulerError;pub use error::SchedulerResult;pub use extension::SchedulerExtension;pub use jobs::BehavioralAnalysisJob;pub use jobs::CleanupEmptyContextsJob;pub use jobs::CleanupInactiveSessionsJob;pub use jobs::DatabaseCleanupJob;pub use jobs::GhostSessionCleanupJob;pub use jobs::MaliciousIpBlacklistJob;pub use jobs::NoJsCleanupJob;pub use models::JobStatus;pub use models::ScheduledJob;pub use repository::JobRepository;pub use repository::SchedulerRepository;pub use services::DbServiceRecord;pub use services::DesiredStatus;pub use services::ProcessCleanup;pub use services::ProcessInfo;pub use services::ReconciliationResult;pub use services::SchedulerService;pub use services::ServiceAction;pub use services::ServiceConfig;pub use services::ServiceManagementService;pub use services::ServiceReconciler;pub use services::ServiceStateManager;pub use services::VerifiedServiceState;
Modules§
- error
- Typed error boundary for the
systemprompt-schedulercrate. - extension
- Extension-framework registration for the scheduler crate.
- jobs
- Built-in job implementations registered via
systemprompt_provider_contracts::submit_job!. - models
- Domain models exposed by the scheduler crate.
- repository
- Persistence layer for the scheduler crate.
- services
- Service layer for the scheduler crate.