Skip to main content

Module cron

Module cron 

Modules§

scheduler

Structs§

CronJob
CronJobPatch
CronRun
DeliveryConfig

Enums§

JobType
Schedule
SessionTarget

Functions§

add_agent_job
add_job
add_once
add_once_at
add_once_at_validated
Create a one-shot validated shell job at an absolute timestamp.
add_once_validated
Create a one-shot validated shell job from a delay string (e.g. “30m”).
add_shell_job
add_shell_job_with_approval
add_shell_job_with_approval_and_format
Like add_shell_job_with_approval but with an explicit shell output format.
all_overdue_jobs
claim_job
clear_stale_locks
deserialize_maybe_stringified
due_jobs
get_job
get_job_for_agent
A job the calling agent owns. Anyone else’s is reported as missing rather than refused, so the error cannot confirm that it exists. Rows predating the agent_alias column belong to no agent and are reachable only from the unscoped operator surfaces.
list_jobs
list_jobs_by_agent
Cron jobs owned by agent_alias, for the agent-deletion export-then-delete archive
list_runs
next_run_for_schedule
normalize_expression
parse_delay
pause_job
pause_job_for_agent
Pause a job the calling agent owns. The ownership test travels with the write; see store::remove_job_for_agent.
record_last_run
record_last_run_with_status
record_run
release_job
remove_job
remove_job_for_agent
Delete a job only if agent_alias owns it, in one statement.
remove_jobs_by_agent
Delete every cron job owned by agent_alias, returning the row count (cron_runs cascade via their job_id FK). A job whose owning agent is gone can never run, so the agent-deletion cascade removes it
rename_jobs_by_agent
Re-point every cron job owned by from to to, returning the row count. Called by the agent-rename cascade the job keeps running, just under the renamed owner. agent_alias is plain TEXT (not a UUID), so this is a direct column update.
reschedule_after_run
reschedule_after_run_with_status
resolve_job_id_or_name
resume_job
resume_job_for_agent
Resume a job the calling agent owns.
schedule_cron_expression
skip_missed_run
sync_declarative_jobs
update_job
update_job_for_agent
Patch a job only if agent_alias owns it, with the ownership test carried into the UPDATE itself rather than performed as a separate read. See remove_job_for_agent for why the separate read is not enough.
update_shell_job_with_approval
Update a job with security validation for shell-command patches. Validates a new shell command against the named agent’s risk profile before persisting. Agent jobs remap command onto prompt first.
validate_delivery_config
validate_schedule
validate_shell_command
Validate a shell command against an agent’s security policy (allowlist + risk gate). agent_alias names the agent under whose risk profile the command will run. Returns Ok(()) if the command passes all checks, or an error describing why it was blocked.
validate_shell_command_with_security
Validate a shell command using an existing SecurityPolicy instance. Preferred when the caller already holds a SecurityPolicy (e.g. scheduler).