Public: anyone can read this; the crew can change it.
The forge says how it is at /api/v1/health: disk, memory, queue, stuck runs, apps asleep and previews, as one plain answer #343
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Part of #334 (1, Observability). The forge already answers
/healthz(ready or draining) for the orchestrator; nothing tells a person whether the forge itself is fine. This issue adds that answer as data. The board and the asks screen come later and read it.Done when
src/kernel/vitals.ts(orsrc/core/health.ts, one concept: the forge's standing) takes the db and returns plain data:{ ok, needs: string[], disk: { freeBytes, totalBytes }, memory: { rssBytes, hostFreeBytes, hostTotalBytes }, queue: { <run kind>: queued }, stuck: [{ runId, repo, issue, since }], apps: { serving, asleep, previews } , at }FORGE_DATA(fs.statfsSync), memory fromprocess.memoryUsage()andos; no shelling outleaseLapsed,STALE_AFTER_MS) or no progress past a stated bound; queue depth is one grouped query, not a query per kindneedsholds one short sentence per thing off (disk under 10%, a stuck run, a queue older than its bound);okisneeds.length === 0GET /api/v1/healthreturns it to a site admin (isAdmin), session or token,rois enough; anyone else gets 404, never the numbers;/healthzis unchangedstuckandneeds, a full queue appears inqueuedocs/ARCHITECTURE.md(ordocs/CONTRACT.mdwhere the API is listed) names the routeFiles: new
src/kernel/vitals.ts,src/http/api.ts,src/core/runs.ts(one grouped count), tests. Risks: leaking host facts to non-admins; a slow statfs on a network volume — measure once per request, nothing cached across requests is needed yet. Brief: a server-side builder; no page work.