Skip to content

Conversation

ngc92
Copy link
Collaborator

@ngc92 ngc92 commented Aug 9, 2025

This is a heavily modified/updated version of #291
It is rebased onto the libkernelbot changes, and uses a separate table to store milestone definitions as discussed.

The major design question that I'm not completely sure about is how to handle milestone runs.
In this version of the code, a milestone_id column is added to the runs table, and we set a constraint that enforces either submission or milestone id to be set. This is minimally invasive, but I wouldn't call it pretty. Contrary to what I first thought, though, it doesn't require any changes to existing queries. In order to match runs to leaderboards, we need to join on submission_id, so all milestone runs get filtered out automatically. A good sign for this approach?

Alternatives could be to distinguish at the submission level (as in @PaliC 's original code), or to have two completely separate tables (claude says there is a postgres-specific extension that allows table inheritance, but i'm not really sure of the implications of this).

At this point, the implementation is fully functional, but could use some interface tweaks/improvements:

  • API access; should be easy, the main functions are in backend
  • display milestones as part of the leaderboard (?)
  • automatic celebration message for beating a milestone the first time
  • update-problems needs to become milestone-aware (implemented, but not really tested yet)

@ngc92 ngc92 force-pushed the ngc92/milestones branch from 3d5a421 to cb0c224 Compare August 9, 2025 09:38
@ngc92 ngc92 force-pushed the ngc92/milestones branch from cb0c224 to f339298 Compare August 9, 2025 09:38
@msaroufim
Copy link
Member

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/libkernelbot
  db_types.py
  leaderboard_db.py 330-331
  task.py
  utils.py 153
Project Total  

This report was generated by python-coverage-comment-action

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