Ghost-region detection report
GET/api/v1/system/regions/health
One row per region slug seen anywhere — in the declared regions system parameter, in a check's regions array, in a check_jobs.region, or in a live or previously-live worker's announced region — so the caller gets the ghosts and the healthy baseline in one call.
A ghost is a slug something depends on (a job or a check reference) that nothing live can serve: (jobs > 0 || checksReferencing > 0) && liveWorkers == 0. A declared region with zero live workers and zero references is dark but unused, not a ghost — the alarm condition is work assigned to nobody, not an idle region.
liveWorkers reuses the exact prefix rule the scheduler claims jobs with (workerRegion has the slug as a prefix, so a us job is served by a us-1 worker) and the same liveness window as the region capability report. lastWorkerSeenAt spans every matching worker, soft-deleted included, so it dates when the region actually went dark. NULL-region (any-region) jobs never count toward any row — they are claimable by every cloud worker by construction.
Read-side companion of POST /system/regions/migrate: its output names exactly the from slugs a migration should target. Cheap and unpaginated — a handful of bounded scans, not a query per region. Super-admin only.
Responses
- 200
- 401
- 403
Ghost-region detection report
Authentication required
Permission denied