CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

fix(status): four of six services reported health nobody measured #5483

Merged⚡ AI-generatedXSccantynz wants to mergefix/status-page-stops-fabricating-service-healthmainopened 21d ago
1 changed file+61−22
Modifiedsrc/routes/status.tsx+61−22View fileUnifiedSplit
354354 const aggregateStr = aggregatePct >= 100 ? "100.0" : aggregatePct.toFixed(1);
355355
356356 // Per-service status descriptors — kept here so the JSX is just markup.
357 //
358 // ── These used to be constants, and that is not a small thing ──────────
359 //
360 // Four of the six rows below were literally `state: "ok", uptimePct:
361 // "100.0%"` with nothing behind them. The table is headed "Real-time status
362 // of every platform surface" and "30-DAY UPTIME", so it asserted a
363 // measurement it had never taken.
364 //
365 // What that cost, found 2026-08-11: GitHub→Gluecron mirroring was dead for
366 // weeks — vapron 522 commits behind, davenroe 65, alecrae.com 17 — and this
367 // page read "All systems operational · 100.0% · 6/6 services up" throughout.
368 // The drift was eventually found by comparing `git ls-remote` by hand.
369 //
370 // Rule going forward: a row may claim "Operational" ONLY when something on
371 // this request actually established it. Anything else says "Not monitored"
372 // and shows "—". An unmeasured surface is not a healthy surface, and saying
373 // so plainly is the whole point of a status page.
357374 const services: Array<{
358375 name: string;
359376 sub: string;
360 state: "ok" | "down" | "idle";
377 state: "ok" | "down" | "idle" | "unknown";
361378 label: string;
362379 uptimePct: string;
363380 }> = [
364381 {
365382 name: "Database",
366 sub: "Neon PostgreSQL — primary datastore",
383 // Was labelled "Neon PostgreSQL". It is not Neon — production runs
384 // pgvector/pgvector:pg16 in Docker on the master box. Naming a vendor we
385 // do not use is the same class of untruth as the constants above.
386 sub: "PostgreSQL (pgvector) — primary datastore",
367387 state: dbOk ? "ok" : "down",
368388 label: dbOk ? "Operational" : "Down",
369 uptimePct: dbOk ? "100.0%" : "—",
389 // Real: derived from the incidents table, same source as the hero figure.
390 uptimePct: dbOk ? `${aggregateStr}%` : "—",
370391 },
371392 {
372 name: "Git Push / Smart HTTP",
373 sub: "Clone, fetch, push endpoints",
393 name: "API",
394 sub: "REST + Git Smart HTTP — verified by serving this page",
395 // Genuine signal: this response is produced by the same process that
396 // serves the API, so rendering it proves the process is alive. Narrow,
397 // but true — which is the bar.
374398 state: "ok",
375399 label: "Operational",
376 uptimePct: "100.0%",
400 uptimePct: `${aggregateStr}%`,
377401 },
378402 {
379 name: "AI Review",
380 sub: "Claude-powered pull request analysis",
403 name: "Git Push / Smart HTTP",
404 sub: "Clone, fetch, push — same process as the API",
381405 state: "ok",
382406 label: "Operational",
383 uptimePct: "100.0%",
407 uptimePct: `${aggregateStr}%`,
384408 },
385409 {
386 name: "CI Runner",
387 sub: "Continuous integration pipeline",
388 state: "ok",
389 label: "Operational",
390 uptimePct: "100.0%",
410 name: "AI Review",
411 sub: "Claude-powered pull request analysis — no health probe yet",
412 // No probe exists. Previously hardcoded "Operational / 100.0%", so an AI
413 // backend returning 400 on every call looked identical to a healthy one.
414 state: "unknown",
415 label: "Not monitored",
416 uptimePct: "—",
391417 },
392418 {
393 name: "API",
394 sub: "REST + Git Smart HTTP",
395 state: "ok",
396 label: "Operational",
397 uptimePct: "100.0%",
419 name: "CI Runner",
420 sub: "Continuous integration pipeline — no health probe yet",
421 state: "unknown",
422 label: "Not monitored",
423 uptimePct: "—",
398424 },
399425 {
400426 name: "Autopilot",
401427 sub: "Periodic platform-maintenance loop",
402428 state: autopilotDisabled ? "idle" : "ok",
403429 label: autopilotDisabled ? "Disabled" : "Running",
404 uptimePct: autopilotDisabled ? "—" : "100.0%",
430 uptimePct: autopilotDisabled ? "—" : `${aggregateStr}%`,
405431 },
406432 ];
407433
434 // Count only what is actually measured. Reporting "2/6 up" because four rows
435 // are unprobed would read as an outage; reporting "6/6" was the lie. The
436 // honest denominator is the number of surfaces we can actually see.
437 const monitoredServices = services.filter((s) => s.state !== "unknown");
438 const monitoredUp = monitoredServices.filter((s) => s.state === "ok").length;
439
408440 return c.html(
409441 <Layout title="Status — gluecron" user={user}>
410442 <style dangerouslySetInnerHTML={{ __html: statusStyles }} />
458490 <div class="status-hero-stat-label">Alerts · 24h</div>
459491 </div>
460492 <div class="status-hero-stat">
461 <div class="status-hero-stat-num">{services.filter(s => s.state === "ok").length}/{services.length}</div>
462 <div class="status-hero-stat-label">Services up</div>
493 <div class="status-hero-stat-num">{monitoredUp}/{monitoredServices.length}</div>
494 <div class="status-hero-stat-label">Monitored services up</div>
463495 </div>
464496 </div>
465497 </div>
11661198 color: var(--red);
11671199 box-shadow: inset 0 0 0 1px rgba(248,113,113,0.32);
11681200 }
1201 /* "Not monitored" — deliberately NOT green. A surface we cannot see is not
1202 a surface that is healthy, and it must not read like one at a glance. */
1203 .status-pill-unknown {
1204 background: rgba(110,118,129,0.12);
1205 color: #8b949e;
1206 box-shadow: inset 0 0 0 1px rgba(110,118,129,0.32);
1207 }
11691208 .status-pill-idle {
11701209 background: rgba(110,118,129,0.18);
11711210 color: #c9d1d9;
11721211
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts