Problem
getLeaderboard passes its argument straight into LIMIT ? with no clamp: LIMIT -1 in SQLite means unlimited (full table dump), NaN misbehaves.
Where
lib/db.ts (getLeaderboard(limit), no validation).
Acceptance
Add a failing test first calling getLeaderboard(-1) and getLeaderboard(NaN), expecting a bounded default page. Then fix.
Problem
getLeaderboardpasses its argument straight intoLIMIT ?with no clamp:LIMIT -1in SQLite means unlimited (full table dump),NaNmisbehaves.Where
lib/db.ts(getLeaderboard(limit), no validation).Acceptance
Add a failing test first calling
getLeaderboard(-1)andgetLeaderboard(NaN), expecting a bounded default page. Then fix.