Admin Health Report
public.get_admin_operations_checklist() is the admin-facing operations checklist for barbelic. It wraps the DB-side health report with Edge Function deployment probes and Supabase migration history checks.
public.get_admin_health_report() still exists as the lower-level DB/import/stats health report. Admin UI should call get_admin_operations_checklist().
RPC
select public.get_admin_operations_checklist();Lower-level DB/import/stats report:
select public.get_admin_health_report();Optional thresholds:
select public.get_admin_operations_checklist(
p_stale_after := '15 minutes'::interval,
p_stats_stale_after := '1 day'::interval,
p_rpc_response_warning_bytes := 3000000
);RPC response size outliers are measured from samples supplied by the caller. Admin UI passes recent frontend operation logs as p_rpc_response_samples. It also appends Edge Function deployment samples by probing each configured function's health GET endpoint:
select public.get_admin_operations_checklist(
p_rpc_response_samples := '[
{
"operationName": "get_calendar_month_summary",
"durationMs": 220,
"responseBytes": 4200000,
"at": "2026-06-22T00:00:00.000Z"
},
{
"sampleKind": "edge_function_deployment",
"name": "wodup-start-import",
"expectedVersion": "20260821-barbelic-headers-v1",
"deployedVersion": "20260821-barbelic-headers-v1",
"ok": true,
"status": 200
}
]'::jsonb
);Permissions
The function is security definer, but execution is still restricted:
service_rolecan execute it for backend/admin automation.- Authenticated users must pass
public.is_lift_guild_admin(). anonandpublichave no execute grant.
Checks
The report returns:
status:ok,warning, orcriticalok:trueonly when no critical check is presentsummary: count-only fields for dashboards and alertschecks: detailed status and samples for each health area
Health areas:
orphan_session_exercises- Critical when a
session_exercise_part.exercise_id(옛session_exercises, 이슈 #1215) has no matchingexercises.id.
- Critical when a
wodup_import_batches- Critical when a batch failed, has
result_error_count > 0, or is stuck in a non-terminal state longer thanp_stale_after. - Warning when a batch is currently open but not stale.
- Critical when a batch failed, has
stats_refresh_jobs- Critical when a dirty stats refresh job failed or is stale.
- Warning when a job is pending/processing but still fresh.
stats_staleness- Critical when completed session data is older than
p_stats_stale_afterand is missing materialized rollups/stats, or the materialized rows are older than the source rows.
- Critical when completed session data is older than
rpc_response_outliers- Critical when supplied frontend operation samples exceed
p_rpc_response_warning_bytes.
- Critical when supplied frontend operation samples exceed
edge_functions- Critical when a deployed function reports a different deployment version or cannot be reached.
- Warning when the browser did not supply a probe sample for an expected function.
schema_migrations- Critical when Supabase migration history is unavailable or an expected migration version is missing.
Edge Function Deployment Version
Each deployed function exposes:
GET /functions/v1/{function_name}x-lift-guild-function-namex-barbelic-deployment-version- JSON body with
function_nameanddeployment_version
The expected versions live in src/react/services/deploymentManifest.js. When a function is changed, bump the manifest version and redeploy every listed function. The deployment pipeline check keeps the manifest, supabase/config.toml, and function folders aligned.
Notes
This report deliberately does not expose raw Wodup payloads. Sample rows include IDs, dates, statuses, counts, and short operational fields only.