Skip to content

Add Daily Leaderboard to Competition#132

Open
Allan-Feng wants to merge 3 commits into
Open-Finance-Lab:mainfrom
Allan-Feng:feat/daily-leaderboard
Open

Add Daily Leaderboard to Competition#132
Allan-Feng wants to merge 3 commits into
Open-Finance-Lab:mainfrom
Allan-Feng:feat/daily-leaderboard

Conversation

@Allan-Feng

Copy link
Copy Markdown
Collaborator

Summary

  • Competition subtabs: Daily Leaderboard (first) · Competition Leaderboard · Participating Teams · About
  • Daily board reuses the existing leaderboard chart/table via GET /api/v1/leaderboard?period=daily over the last completed US weekday; caches under leaderboard-daily
  • Baselines auto-compute on load; LLM models refresh via dashboard/scripts/refresh_daily_leaderboard.py --models (nightly after market close)

Test plan

  • Competition → Daily Leaderboard shows same layout as Competition Leaderboard with Phase=Daily and a 1-day window
  • Competition Leaderboard still shows the Apr–May preseason window
  • GET /api/v1/leaderboard?period=daily returns period: daily and ranked entries
  • pytest dashboard/backend/tests/test_leaderboard_api.py -v passes
  • Optional: python dashboard/scripts/refresh_daily_leaderboard.py refreshes baselines

Made with Cursor

Reuse the same chart/table UI with ?period=daily over the last completed
weekday, cache under leaderboard-daily, and ship a nightly refresh script
for baselines (and optional LLM redeploys).

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

@Allan-Feng is attempting to deploy a commit to the allan-feng's projects Team on Vercel.

A member of the Team first needs to authorize it.

Allan-Feng and others added 2 commits July 16, 2026 00:20
…oad.

mean_variance (and similar) failures were never persisted, so each Daily
Leaderboard open treated the window as incomplete and pulled 30 symbols again.

Co-authored-by: Cursor <cursoragent@cursor.com>
A one-day window alone lacks bars for technicals; fetch the prior month for
features and clip decision steps to the daily contest window.

Co-authored-by: Cursor <cursoragent@cursor.com>
@FlyM1ss

FlyM1ss commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Reviewed (backend correctness, H6 integrity, route-contract freeze, frontend/XSS). Two things to fix before merge; everything else is clean.

Clean: H6 guard is intact (the daily path still hard-skips auto_compute:false LLM strategies — traced end-to-end, not just from the diff). No route added/changed, so the route-freeze golden sets are untouched. No XSS introduced (new render code uses textContent; backend/frontend field names match).

1. Blocker — 4 failing tests (test-only, verified fix)

test_service_move.py was never updated for the new ensure_leaderboard_runs signature. Every real caller is correct — only the test's stub is stale. Two edits:

# dashboard/backend/tests/domain/leaderboard/test_service_move.py:153
-        lambda force_refresh=False: {
+        lambda force_refresh=False, period="contest", config=None: {
# same file, ~line 195 — get_leaderboard() now returns 4 more keys
     assert set(result.keys()) == {
         "window", "updated_at", "total_entries", "leader", "entries", "display_capital",
+        "board_title", "period", "standings_label", "phase_label",
     }

Verified locally on 0af3190 merged with current main: 1041 passed, 6 skipped, 0 failed.

Note your branch predates #126/#133, so it needs a main update too — #133 (merged) fixes the 4 test_protocol_api.py failures you were also seeing.

2. Important — daily tab is the new default but boot CSS doesn't reveal it

The PR defaults the competition tab to daily (app.html:27, :47, plus the app.js defaults) and adds a daily arm to the subtab-highlight selectors — but the rule that actually reveals the panel still only matches leaderboard:

app.html:73  html[data-nav-boot][...][data-nav-competition-tab="leaderboard"] #leaderboardView { display: flex !important; }

So the default landing path is the one the anti-FOUC block no longer covers. Needs a ="daily" arm (or a shared selector).

Minors (your call)

  • js/leaderboard.js ~785: contest subtitle hardcodes 'Sep 1 – Oct 30, 2026' although window.label is in hand and is used correctly for the daily case.
  • js/leaderboard.js ~801: hiddenSeries = new Set() moved from first-load-only into loadLeaderboardData(), so it now resets on every call — curve selections are discarded when re-navigating to an already-active board.

Not flagged: daily_window_dates() using UTC. It diverges from ET for ~4h/night, but I simulated it — the UTC-picked day is always already closed, and ET-based logic would pick the staler day. Current behaviour is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants