Pattern 3

Make silent failure loud (the dead-man's switch)

Problem. A scheduled task that stops firing fails silently. You find out weeks later, when the thing it was supposed to produce is missing.

Pattern. Each task emits a success sentinel to its log. A watchdog scans for that sentinel inside a staleness window and raises a finding when it is missing or stale. Self-hosted, no external uptime service required.

Why this beats the obvious. "I'll notice if it breaks" is the alternative, and it is false. The whole point of a background task is that nobody is watching it. A sentinel converts absence-of-success into a visible, dated finding.

Cost. Per-task staleness configuration, plus a tolerance flag for tasks that run on demand rather than on a clock.

Where it lives: samples/scripts/security/check_task_freshness.py.

Seen in 1 of 8 teardowns · Practise: learn/05

All patterns · Markdown source on GitHub