Bug: scheduler status emits missed-cadence alert immediately on clean startup before first due run
Severity: P2 — MEDIUM
Summary: A freshly seeded scheduler reports missed_cadence before the first hourly run is even due, creating false alarms on healthy startup.
Steps to Reproduce:
- Start the scheduler with a fresh seeded state from
buildIntentSignalDiscoveryState().
- Do not wait for the first hourly recurrence window.
- Call
GET /api/scheduler/status.
- Inspect the returned
alerts array.
Expected: No cadence-miss alert until the first due window has actually passed, or until an established cadence exceeds the 90-minute threshold.
Actual: checkMissedCadence() emits missed_cadence immediately whenever last_cycle_completed_at is null, even though task.next_recurrence_date is still in the future and no cycle has been missed.
Root Cause:
- File:
server/scheduler/monitoring.ts L65-L73
- File:
server/scheduler/intent-signal-discovery.ts L88-L91
The seed state intentionally starts with last_cycle_completed_at = null and next_recurrence_date = now + 1h. checkMissedCadence() treats any null last_cycle_completed_at as an alert condition, without checking whether the first run is still pending and on time.
Suggested Fix: Suppress missed_cadence until the first execution is actually overdue. A safe gate is: only alert when last_cycle_completed_at is null AND now > next_recurrence_date + threshold, or add an explicit bootstrap state that distinguishes "never due yet" from "missed first run".
Related: #10, PR #11
Bug: scheduler status emits missed-cadence alert immediately on clean startup before first due run
Severity: P2 — MEDIUM
Summary: A freshly seeded scheduler reports
missed_cadencebefore the first hourly run is even due, creating false alarms on healthy startup.Steps to Reproduce:
buildIntentSignalDiscoveryState().GET /api/scheduler/status.alertsarray.Expected: No cadence-miss alert until the first due window has actually passed, or until an established cadence exceeds the 90-minute threshold.
Actual:
checkMissedCadence()emitsmissed_cadenceimmediately wheneverlast_cycle_completed_atisnull, even thoughtask.next_recurrence_dateis still in the future and no cycle has been missed.Root Cause:
server/scheduler/monitoring.tsL65-L73server/scheduler/intent-signal-discovery.tsL88-L91The seed state intentionally starts with
last_cycle_completed_at = nullandnext_recurrence_date = now + 1h.checkMissedCadence()treats any nulllast_cycle_completed_atas an alert condition, without checking whether the first run is still pending and on time.Suggested Fix: Suppress
missed_cadenceuntil the first execution is actually overdue. A safe gate is: only alert whenlast_cycle_completed_atis null ANDnow > next_recurrence_date + threshold, or add an explicit bootstrap state that distinguishes "never due yet" from "missed first run".Related: #10, PR #11