Skip to content

Conversation

ngc92
Copy link
Collaborator

@ngc92 ngc92 commented Jul 26, 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 4113cd1 to 0b32330 Compare July 26, 2025 19:52
@ngc92 ngc92 requested review from msaroufim and S1ro1 July 26, 2025 23:27
@ngc92 ngc92 force-pushed the ngc92/milestones branch 2 times, most recently from 8b867f0 to 31e5f90 Compare July 27, 2025 22:56
@ngc92 ngc92 force-pushed the ngc92/milestones branch from 2058747 to e1636b0 Compare July 30, 2025 17:34
Copy link

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

@ngc92 ngc92 closed this Aug 9, 2025
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