Expand description
A job on the expect source is a dead man’s switch: it starts a run when a job it watches has not had a good
run lately (docs/specs/SPEC_DRONE_REAL_WORLD_JOBS_2026_11_11.md §3.2). Silence is the event: “the nightly report
did not come” is the failure nobody sees, and this is how someone does.
The job’s filter says what is expected:
jobrequired: the name or id of the job whose runs are looked at.within_minutesrequired: 1 to 43200 (30 days). The watched job should have a good run that ended within this long ago.every_minuteshow often to look, 1 to 1440, default 5.
A good run is the newest run of the watched job that is a finished one whose outcome is ok or findings (it did its work). A run that failed, or ended
with an unknown outcome, is not one. While a run of the watched job is still going, nothing fires: it may yet
succeed in time.
When the last good run is older than within_minutes (or there is none, or no job has that name), the job’s
run starts once for that gap: the event is keyed by the last good run, so a restart, or the next look, does not
repeat it, and a good run followed by a new gap is a new event. The run reads {{trigger.expected}} (the watched
job), {{trigger.within_minutes}}, {{trigger.last_ok_ms}} (null when there has never been one),
{{trigger.job_found}} and {{trigger.last_seen}} (the newest run, if any).
(The ledger is asked for the last good run on its own, so a long bad stretch does not hide it.)
The local form checks this machine’s run ledger, so it cannot fire while the machine is off; the cloud form that can is a later phase.
Structs§
- Expect
State - The expect poller’s memory: when each job looks next.
Constants§
Functions§
- expect_
due - Looks at the watched job of every expect job that is due and starts a run for each gap. Returns how many runs it
started or queued.
checkanswers the App query’sjobs. - validate_
filter - An
expecttrigger’s filter: the job, how recent a good run must be, and how often to look.