Checking job health across all businesses (owner's view)

Who this guide is for: the platform OWNER side (platform operators) — not customer staff. Businesses' own administrators see their own queues in their own workspace; this is the cross-business operational view.

This read-only view answers one question: is any business's outbound-message queue blocked, resting, or piling up dead letters — right now? Every fact below is an answer from the real route; a supplementary browser run also drove the owner console that renders it (final section, with its honest standing — including one open backend defect).

The example businesses are synthetic. The three businesses in the run ("Blocked Co", "Light Co", "Quiet Co") and every queued message were seeded by the test. No live WhatsApp/Meta message was sent, no live worker was racing the reads, and no real customer's queue was ever read. The owner bearer in the run was a synthetic platform-admin credential — the same fail-closed gate contract, not a real CapCore-issued token.


Evidence record (kept for honesty)

(The body above is owner guidance; the receipts below are the internal record.)

The FULL3747-PG lane executed the mounted job-health suite against a real, ordinary (non-superuser, NOBYPASSRLS) throwaway PostgreSQL 16 cluster over real loopback HTTP, on the combined candidate (routes mounted in app.ts):

Evidence standing: this is combined-candidate, local evidence — the routes are mounted in the candidate's app.ts (the run proved the exact exported router over real HTTP with a fail-closed replica of the owner-gate contract; the app's own mount wires the real gate). Chief acceptance and publication are OPEN. Nothing here is a claim about a live or Main-built deployment.

The two reads

Read What it returns Refusals
GET /v1/platform/job-health Every business, worst backlog first 401 without a valid owner bearer; 403 for a verified-but-unlisted subject; 503 DB_UNAVAILABLE when the database is down
GET /v1/platform/job-health/{orgId} One business's full row Same gate; 404 for an unknown or malformed org id

Both answers carry Cache-Control: no-store — a health answer is a point-in-time fact and is never cacheable.

What each row tells you — and what it deliberately never tells you

Each business's row has four blocks, all read under that business's own tenant pin (PostgreSQL FORCE RLS; the run proved the app role is rolsuper=false, rolbypassrls=false):

The aggregate answer repeats the per-org counts in totals (orgs, pending, claimable, resting, deadLetter) and orders the org list worst-backlog-first: in the run, the business with 3 claimable + 2 resting pending came first, the single-claimable business second, and the never-queued business last with all-zero backlog.

Privacy separation (asserted by the run): the answer text contains no recipient, no template, no payload, and no idempotency key — seeded sentinel values for both recipient and template were searched for in the serialized aggregate and detail answers and were absent. The route reads counts and ages only.

The honesty notes, verbatim

Every answer returns the route's own notes array unchanged — six notes in the run. The first five, exactly as returned:

backlog.pending is the W1 outbox truth (send_intents status='pending') at read time — not a live provider probe. pending splits into claimable (no retry_after deadline ahead — the worker's claim query can take it) and resting (a bounded transient backoff deadline is still in the future, per ZC-1354 A-012).

A growing oldestPendingAgeSeconds with claimable > 0 is the blocked-tenant signal: work exists and nothing systemic rests it. A resting backlog is deliberate provider backoff, not a stall.

deadLetter mirrors the existing tenant review queue exactly: failed + uncertain send_intents (db/messaging.ts listReviewQueue). The human-approved retry stays the TENANT's own POST /v1/outbox/:intentId/retry; this platform surface is read-only and exposes no retry action.

retries.pendingWithRetries/maxPendingRetryCount reflect the automatic transient budget only (retry_count is capped at 3 by constraint); a platform operator never resets it here.

Aggregate counts and ages ONLY: no recipient, template, payload or idempotency key is read, logged or returned (P17 separates privacy-sensitive message content from operations dashboards).

The sixth note states that dispatched is a lifetime count and that every per-org row is read under the org's own tenant pin with no RLS bypass anywhere.

The gate refuses before it reads

The run proved the refusal order with the database deliberately switched off:

  1. No bearer at all → 401. A wrong bearer is equally 401.
  2. A verified bearer that is not a listed platform admin → 403.
  3. Only a verified, listed owner reaches the database; if the database is then unavailable, the answer is 503 DB_UNAVAILABLE — never a half-answer.

Crucially, the gate refusal wins even when the database is down: with the database unavailable, a missing bearer still got 401 and an unlisted subject still got 403 in the run. Nobody learns anything about queue state before they are fully authorized.

Open defect, honestly recorded (FULL3747-B-01): the browser lane found that the composed candidate applies no platform MFA step-up on GET /v1/platform/orgs or the job-health reads (verified owner gate only), while sibling platform routes do demand it. Until that step-up is merged, the console's entry can never raise the owner factor prompt the workspace flow expects. The API-level gate contract above (401/403/503, fail-closed) is what the PG suite proved and is unaffected; the missing piece is the additional factor step-up on top of it.

The owner console through the real screen — supplementary proof (SUP-J5)

The browser lane's supplementary run drove the real owner console in real Chromium on the same mounted candidate:

  1. Entry raised no factor prompt and no owner re-check card — the recorded honest consequence of defect FULL3747-B-01 above (the step-up the workspace flow expects is never demanded).
  2. The platform navigation entry appears for the owner; opening it renders the console root and the businesses list (no refusal card).
  3. Drilling into the seeded business opens its detail page with the backlog block rendered — the same worst-backlog facts the API returns.
  4. Back returns to the businesses list.
  5. Zero writes: the run counted every non-read request to any /platform/ path — the total was 0. The console is as read-only as the API beneath it.

The owner console after drilling into the seeded business: the job-health detail with its backlog block rendered, reached with zero platform writes

The screenshot is a byte-exact capture of the supplementary passing run (SHA256 and provenance in assets/ASSETS-MANIFEST.json). It is supplementary evidence — the SHA-bound journey 5 remains FAILED at its entry expectation and backend defect FULL3747-B-01 stays open. The seeded businesses and queue states are synthetic.

What this view is not