Skip to main content

Module job_incidents

Module job_incidents 

Source
Expand description

Job incidents: a job’s consecutive failures, from the first to the next success, and the one Kanban task that stands for them (docs/specs/SPEC_JOBS_AND_TEMPLATES_2026_10_24.md §2, §3.4).

The work queue has no dedupe key, so the job keeps its incident’s task here, beside the run ledger in the identity store. At most one incident per job is open (ended_at_ms unset): a partial unique index. An incident whose task was closed while the job still failed has ended, but is not recovered yet (recovered_at_ms unset), and still remembers its notification is up (notified), so the next success takes it down.

db_job_incident_cursors is how far the keeper has walked each job’s decisive runs (jobs::incidents); it moves on only after a run was applied, and a report that changes a run’s outcome moves it back (job_run_report). db_job_incident_runs holds every failure counted into an incident, written in the same transaction as the count, so a run walked again is never counted twice.

Modules§

ended
How an incident ended (end_reason).

Structs§

IncidentCursor
How far the keeper has walked a job’s decisive runs: the last one it took, by when it ended and its id.
JobIncident
One row of db_job_incidents.