Draft
Conversation
Automatically audit submissions for cheating using an LLM (gpt-4o-mini via OpenRouter). Runs as fire-and-forget after each submission completes. Admins can review flagged submissions via API.
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||
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.
Summary
OPENROUTER_API_KEYis unset, auditing is silently skipped (graceful degradation)Changes
src/migrations/20260301_01_audit-add-submission-audit.pyleaderboard.submission_audittablesrc/libkernelbot/audit.pysrc/libkernelbot/leaderboard_db.pysrc/libkernelbot/backend.pyasyncio.create_taskaftermark_submission_donesrc/kernelbot/api/main.pyGET /admin/auditsandPOST /admin/audits/{id}/reviewedpyproject.tomlopenaidependency (OpenAI SDK used as OpenRouter client)What this does NOT do
Test plan
yoyo apply src/migrations -d $DATABASE_URLuv run pytest tests/ -v(all 80 passing tests still pass)OPENROUTER_API_KEYset, submissions work normally with no errorsleaderboard.submission_audithas a rowcurl -H "Authorization: Bearer $ADMIN_TOKEN" localhost:8000/admin/auditscurl -X POST -H "Authorization: Bearer $ADMIN_TOKEN" localhost:8000/admin/audits/1/reviewed