Fail the uptime run when the database was not checked (A7-01)

Merged
BI
1d ago
+38-15

Why

From 3–8 November the uptime monitor finished green while it could not see the database (audit A7-01). A missing or mismatched WARD_FLOW_UPTIME_TOKEN hides the database field. The workflow already warned and left the backend-down issue alone, then exited 0, so the run looked healthy for days.

#1598, already on main, opens a "monitor not set up" issue after about a day of those gaps. This PR makes the run itself red as soon as the database was not checked.

What changes

In .github/workflows/backend-uptime.yml, when the health check's state is unknown (database not checked), the raise step prints an error and exits 1. It still does not open or close a backend-down issue, because the database itself was not seen. A rate-limited or unset workspace check, with the database itself checked, stays a warning only.

The backend README now says that warning fails the run, and that this is not a database outage.

Tests (local, synthetic only)

  • tests/ward-audit-m80-scheduled-jobs.test.ts: 28 passed, including a new case that a hidden database check fails the run, leaves any backend-down issue alone, and that a rate-limited workspace check stays green.
  • backend/ward-flow/healthz-uptime-token.test.mjs and workspace-monitor-workflow.test.mjs: 13 passed (unchanged files).
  • Lint on the changed TypeScript test, and typecheck, passed.

No Cursor cloud, no live Supabase, Railway or production. Auto-merge is not armed.

Head: 5393df2a7cb2eb52a82089479f756e9af9a21009