refactor(web): remove Snowflake-backed public leaderboard endpoints - #5233
Merged
Conversation
The Snowflake connection these endpoints depend on is gone, so all three public leaderboard reports return 503/502 rather than data. Removes the endpoints and the support code that only existed for them: - api/public/leaderboard-model-usage - api/public/leaderboard-model-provider-usage - api/public/leaderboard-provider-race - lib/public-snowflake-report.ts (imported only by the three routes) - lib/public-inference-provider.ts (imported only by the model-provider route) - the three public-api:leaderboard-* keys in lib/redis-keys.ts lib/snowflake.ts stays, since routers/usage-analytics-router.ts is still a consumer. api/public/oss-sponsors is Postgres-backed and unaffected, as is the separate Snowflake client in services/kiloclaw-billing. Orphaned Redis entries expire on their own within the existing 1h TTL, so no cleanup is required.
RSO
enabled auto-merge (squash)
August 12, 2026 15:34
chrarnoldus
approved these changes
Aug 12, 2026
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryClean deletion-only removal of three dead Snowflake-backed public leaderboard endpoints and their sole-consumer support code; verified no dangling references remain to any deleted route, module, or Redis key. Verification performed
Files Reviewed (7 files)
Reviewed by kimi-k3 · Input: 94.7K · Output: 3.6K · Cached: 280.5K Review guidance: REVIEW.md from base branch |
This was referenced Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Deletes the three public leaderboard API endpoints that read from Snowflake, plus the support code that existed only to serve them.
The Snowflake connection these endpoints depend on is gone, so they currently return
503 Snowflake is not configured(or502on query failure) instead of data. They are dead weight and a source of Sentry noise.Removed
apps/web/src/app/api/public/leaderboard-model-usage/route.tsapps/web/src/app/api/public/leaderboard-model-provider-usage/route.tsapps/web/src/app/api/public/leaderboard-provider-race/route.ts+route.test.tsapps/web/src/lib/public-snowflake-report.tsapps/web/src/lib/public-inference-provider.tspublic-api:leaderboard-*keys inapps/web/src/lib/redis-keys.ts661 deletions, 0 insertions.
Deliberately kept
apps/web/src/lib/snowflake.tsand the 9SNOWFLAKE_*env vars —apps/web/src/routers/usage-analytics-router.tsis still a consumer, so this stays until that migration lands.api/public/oss-sponsors— Postgres-backed via@/lib/drizzle, unrelated.services/kiloclaw-billing/src/snowflake.ts— a separate, independent Snowflake client. Untouched.model-usagein the free/promoted-model-usage admin feature — unrelated naming collision.Notes
Access-Control-Allow-Origin: *, so the consumer was an external property; confirmed no longer in use.vercel.json(no cron warmed these keys — population was lazy-on-request),ENVIRONMENT.md, middleware, tRPC routers, mobile, or extension.Verification
scripts/typecheck-all.sh --changes-only→ clean (this always runstsgo --noEmit -p apps/web/tsconfig.json)pnpm lintinapps/web→ 0 warnings, 0 errors across 3582 filespnpm format:changed+git diff --check→ cleanjest src/lib/redis-keys.test.ts src/app/api/public/oss-sponsors/route.test.ts→ 10/10 passingFollow-ups (not in this PR)
/usageanalytics is fully off Snowflake (cf. feat(web): serve /usage analytics from Postgres replica #5223 / reverted in Revert "feat(web): serve /usage analytics from Postgres replica" #5228),lib/snowflake.tsand the 9SNOWFLAKE_*vars can be removed fromapps/webentirely — this PR reduces that file to a single consumer.SNOWFLAKE_*vars read byapps/web/src/lib/snowflake.tsare undocumented inENVIRONMENT.md(onlySNOWFLAKE_MAX_POLL_ATTEMPTSis listed, pointing at the billing service) and absent fromscripts/web-env.