Admin Health & Engine Quality

Operator dashboard surfacing 7-day rollups, engine-quality signals, and anomalies. Allowlist-gated.

The /admin/health page is an operator dashboard that surfaces what the engine is doing — and how well — over the trailing 7 and 14 days. It is allowlist-gated via the ADMIN_CLERK_USER_IDS env var. Non-admins see a 404.

What it shows

  • 7-day rollups — tool dispatches, leads, postflight events, and email sends, with per-day deltas.
  • Engine-quality signals — four numbers operators watch over time:
    • Demoted-scorer rate (7d) — what fraction of dispatches had at least one scorer's weight reduced because it underperformed. A rising rate means upstream data drift.
    • Ambiguous-merge average (14d trend) — how many ambiguous clusters per dispatch land in the review queue.
    • Golden/raw ratio (14d trend) — golden records produced ÷ source rows ingested. The number stays stable when ingest quality is stable; sudden drops point at duplicate-collapse anomalies.
    • F1 (latest + 14d trend) — F1 against the committed Febrl fixture (500 records, 133 match pairs), persisted in the benchmark_runs table. CI runs this on every PR and fails on a 0.05-point absolute drop.
  • Anomalies — orphaned leads, stuck events, open review items.
  • Audit-chain status — verifies the cryptographic chain across audit_log rows.
  • Links out — Sentry (frontend + backend projects) and Railway service dashboards.

Why operators look here

Engine quality is the leading indicator. A 1.5x jump in demoted-scorer rate means a source schema changed shape; a dropping golden/raw ratio means two upstream sources are now sending overlapping records that weren't overlapping last week. The dashboard catches both before a customer notices.

The benchmark line catches the third class of problem: code regressions in our own engine. A PR that breaks goldenmatch.dedupe_df shows up as an F1 drop on the next CI run — long before it lands on a customer dataset.

Access

Add your Clerk user ID to the ADMIN_CLERK_USER_IDS env var (comma-separated). The backend re-checks the allowlist on every API call to /api/admin/health — UI-only gating is not enough.