- internal/jobs replaces explain.Jobs: one registry for every kind of
background job, with records in DATA_DIR/jobs. A job's draft is written
before its commit, so a failed commit can be saved again (POST
/jobs/<kind>/<key>/save) and a restart mid-commit resumes it, without
paying Claude twice.
- Graceful shutdown: SIGTERM stops new jobs and waits SHUTDOWN_GRACE for
running ones while still serving the pages that poll them.
- internal/usage records every Claude call's tokens and estimated cost in
DATA_DIR/usage.jsonl; CLAUDE_MONTHLY_BUDGET refuses new jobs (429) once a
month reaches it. The stats page shows the admin the spend.
- auth.SameOrigin refuses cross-origin writes to admin routes.
- The LeetCode importer runs the clone's script without the server's
secrets in its environment.
- A sync that leaves HEAD where it was skips the re-index.
- docs_test.go checks README's route table against the routes, and the CLI
page against the root README's commands.
- The repo is going private: Gitea links on the site are admin-only.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The problem list's admin row gains a link box beside "Today's LeetCode":
POST /leetcode/import takes {url} and does what `usaco new
<leetcode-link>` does, through the same lib/leetcode.py run and "Start
<slug>" commit as the daily question, then opens the solve page. A
problem already in the repo is only opened.
leetcode.Slug reads the link as slug_of in lib/leetcode.py does: full
links with /description/ and query strings, www., no scheme, or a bare
slug. Anything else is a 400.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A "Today's LeetCode" button on the problem list (admin only) does what
`usaco daily` does: it asks LeetCode for the daily question, runs the
clone's lib/leetcode.py to import it into solving/ (statement, starter,
driver.h and the examples as tests), commits it as "Start <slug>" and
opens its solve page. A daily question already in the repo is only
opened. The importer stays the CLI's one script rather than a Go copy
of its driver generator, so the site image now has python3.
Co-Authored-By: Claude Opus 5.5 <[email protected]>