Debug Routes
In Development (no auth required)
All debug routes are open with no authentication in non-production environments:
| Route | Method | Description |
|---|---|---|
/api/debug/presets?organization=<org> | GET | List all scoring presets for an org |
/api/debug/preset-by-id?presetId=<N> | GET | Inspect a single preset by ID |
/api/debug/computed-scores?organization=<org>&timePeriod=week | GET | Inspect raw computed score rows |
/api/debug/recompute?organization=<org>&reingest=1 | POST | DESTRUCTIVE — wipe everything and recompute from scratch |
In Production (gated)
The same routes are available in production only when both conditions are met:
ENABLE_DEBUG_ROUTES=trueis set in the environment- The request has a valid session
If ENABLE_DEBUG_ROUTES is not set, the debug routes return 404 in production regardless of session state.
Browser Cookie Debugging
Open DevTools → Application → Cookies → your domain.
| Cookie | Meaning |
|---|---|
gh_session | Present = authenticated. Absent or expired = not signed in. |
gh_auth_csrf | OAuth flow in progress. httpOnly, expires after 10 min. |
gh_auth_install_csrf | Install flow in progress. httpOnly, expires after 10 min. |
If gh_session is missing after a successful GitHub OAuth callback, the session was not written to the database. Check the database errors section in Common Issues.
Supabase SQL Debugging
Run these queries in the Supabase SQL Editor:
-- Check session records for a user
SELECT * FROM auth_sessions WHERE user_id = <id> LIMIT 10;
-- Check which installations are linked to a session
SELECT * FROM session_installations WHERE session_id = '<session-id>';
-- Check ingest history for an installation
SELECT * FROM ingest_log WHERE installation_id = <id>;
-- Count signals by type for an installation
SELECT COUNT(*), type FROM signals WHERE installation_id = <id> GROUP BY type;
-- Check partition health (default_partition_row_count > 0 is bad)
SELECT * FROM signals_partition_health;Log Prefixes
Console output uses consistent prefixes. Filter Vercel logs by these strings:
| Prefix | Source |
|---|---|
[leaderboard/score] | Score route handler |
[leaderboard/sync] | Sync route handler |
[recompute] | Recompute route handler |
[ingest] | Ingest phase inside the leaderboard pipeline |
[webhook] | GitHub webhook handler |
Known Stubs — Do Not Report as Bugs
These issues are known and intentional. Do not open bug reports for them:
| Symptom | Status |
|---|---|
useSyncStatusQuery returns 404 | Intentionally broken — calls /api/sync/status which does not exist. The correct endpoint is POST /api/[org]/leaderboard/sync. |
| Analytics dashboard shows all zeros and empty charts | Frontend hooks are intentionally stubbed (hardcoded values). Backend endpoints exist but hooks are not wired up. |
| Team management page shows “Coming Soon” | No backend implementation. useBulkTeamMembersMutation is a stub. |
| Role management page shows “Coming Soon” | No backend implementation. useBulkRoleMutation throws. |
useLeaderboardSyncMutation throws “Manual sync is disabled” | Intentional behavior. |
Last updated on