[claude] Poka-yoke cron heartbeats: write, check, and report (#1096) #1107
Reference in New Issue
Block a user
Delete Branch "claude/issue-1096"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1096
What this does
Makes silent cron failures impossible by implementing the full poka-yoke triad:
Prevention
scripts/cron-heartbeat-write.sh— any cron job calls this on completion to write/var/run/bezalel/heartbeats/<job>.lastatomically (temp+rename). Always exits 0 so it never crashes the caller.Detection
bin/bezalel_heartbeat_check.py— meta-heartbeat checker (pure stdlib Python). Scans all.lastfiles, computes age vs2×interval, logs P1 alert and writesalerts/<job>.alertfor any stale job.scripts/systemd/bezalel-meta-heartbeat.service+.timer— fires every 15 minutes via systemd.Correction (via Night Watch report)
nexus/morning_report.pyupdated with a heartbeat panel — importscheck_cron_heartbeats()and prints+/-status for every registered job. Stale jobs are added toreport["blockers"]so they appear as escalations in the nightly Night Watch.Tests
18 new tests in
tests/test_bezalel_heartbeat.py— all passing.