Architecture
How a submission becomes Accepted.
- POST /actions/submitProof. The form posts
challengeIdandproofBodyonly. - Static filter. The server runs the forbidden-token regex on the comment-stripped proof body.
- Render & hash. The server emits
Submission_<id>.leanby interpolating the challenge fields and the proof body into a fixed template. Both the proof body and the full file are SHA-256-hashed and stored. - Push to GitHub. Octokit creates branch
submission/<id>offGITHUB_BASE_BRANCHand PUTs the file atJUDGE_REPO_PATH_PREFIX/<slug>/Submissions/Submission_<id>.lean. The commit SHA returned by GitHub is recorded. - GitHub Actions runs. The workflow at
.github/workflows/check-submission.ymlin the judge repo triggers on the path glob, runslake buildwith a pinnedlean-toolchain, and reports success/failure. - Status feedback. Either:
- Webhook. GitHub POSTs
workflow_runevents to/api/github/webhook; the server verifies the HMAC signature and updates the submission. - Polling. The admin can hit “Refresh GitHub status” to pull the latest workflow run via Octokit.
- Webhook. GitHub POSTs
- Seeds awarded. Only when the run on the recorded commit SHA has
conclusion=success, the submission moves toacceptedandawardForSubmission()writes one ledger entry and increments the balance in a single transaction. Idempotent.
Full diagram + sequence: docs/ARCHITECTURE.md.