Endpoint GET /api/operations/summary Portal /portal/ops/ Diagnose bun run ops:diagnose Runbook bun run docs:ops-summary-endpoint
Two pipelines serve the same dashboard. Confusing them produces “proofs green but ops empty” or “JSON URL looks broken.”
Layer 1 — API (server assemble)
scripts/serve-public.ts liveOpsSummary() → lib/operations/ops-summary.ts buildOpsSummary(db, 'live')data/operations.db + Bun.mmap of public/registry/*.json + in-process buildBunUtilsProof()fetch() on the happy path — BUN_CONFIG_VERBOSE_FETCH stays quiet when you curl the summary APILayer 2 — Portal (browser)
public/portal/operations-dashboard.js load() fetches summary, then loadVerificationArtifacts() issues 12+ fetch('/registry/*.json') for full panelsRead source (and optional fallback) in the JSON body:
live — DB + proofs OK (local serve:public)snapshot + fallback: db-unavailable — SQLite failed; last public/registry/ops-summary.jsonerror + HTTP 503 — DB and snapshot both missingPages edge: functions/api/operations/summary.ts serves snapshot only (no bun:sqlite).
$0 and empty arrays are valid empty DB stateBUN_CONFIG_VERBOSE_FETCH logs Bun fetch() / node:http only. Use on:
bun tools/verify-networking.tsNot on: curl localhost:3000/api/operations/summary
Bun --inspect on bun --inspect scripts/serve-public.ts:
liveOpsSummary — DB exception → snapshot fallbackbuildOpsSummary — full payload assemblyload() — client fetch failure (browser DevTools)Embedded routing in the summary is probed against the Pages public origin
(ROUTING_PROBE_BASE_URL / default https://score.factory-wager.com), not npm
REGISTRY_URL. Bun’s publish/install registry is configured separately
(bun publish --registry,
root bunfig.toml, .npmrc).
Local serve-public on :3000 is a dev mirror — use
bun tools/routing-registry-proof.ts --base http://localhost:3000 for local
routing smoke, not REGISTRY_URL=....
bun run ops:diagnose --compare-routing compares embedded fail paths vs live
probe on --base-url (default localhost when diagnosing local server).
curl + bun run ops:diagnose; check source / HTTP status / missing blocksops-snapshot · claim ops-snapshot-cron-v1channel-meta-verification · claim channel-meta-verification-v1bun run ops:diagnosebun test tests/ops-summary-diagnose.test.tsbun run docs:ops-summary-endpoint