Commit Graph
5 Commits
Author SHA1 Message Date
adamfandClaude Opus 5.5 995b44a57a Add an Explain button that has Claude explain a problem
Test and publish the site / publish (push) Successful in 8m15s
Test and publish the site / test (push) Successful in 5m51s
When stuck, the admin can ask Claude for an intuitive explanation of a
problem. It is committed as explain.md and shown as folded sections, so
the reader opens only as much as they need: the key observation, hints
that get stronger, the approach, a walkthrough with an SVG diagram per
step, complexity, pitfalls and a pseudocode sketch.

- internal/claude: streamed call with a JSON-schema reply, high effort,
  the server-side refusal fallback, fixed error messages and logged
  token usage. CLAUDE_API_KEY and CLAUDE_MODEL (default claude-opus-5-5);
  without a key only this feature is off.
- internal/explain: the prompt, the schema, rendering to markdown, and
  a per-problem job tracker. The request starts a job and the page polls,
  since a call outlasts nginx's 120s timeout.
- internal/statement: fetches statements from LeetCode's GraphQL API and
  USACO's problem pages. Others (Codeforces is behind Cloudflare) are
  pasted.
- problem.md holds the statement, editable from the meta editor and
  shown only to the admin. Diagrams are sanitized with DOMPurify.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 20:38:15 +01:00
adamfandClaude Opus 5.5 3e2b52fdb2 Describe the CI host as stpvm, not the Pi
Test and publish the site / test (push) Successful in 1m29s
Test and publish the site / publish (push) Failing after 2s
The site and its runner moved from the arm64 Pi to stpvm (x86-64,
Docker 29), so the comments about the build host, its Docker version
and the image architecture were wrong.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 17:58:03 +01:00
adamfandClaude Opus 5.5 675410729e Link the site to the repo on Gitea
Test and publish the site / test (push) Successful in 39s
Test and publish the site / publish (push) Successful in 50s
A Source link in the header, and on the CLI page links to the script,
lib/cmd, usaco.zsh, the README, the template and debugging.h, plus the
clone URL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 23:45:50 +01:00
adamfandClaude Opus 5.5 cbf5cc32b7 Add a CLI guide page to the website
Test and publish the site / test (push) Successful in 32s
Test and publish the site / publish (push) Successful in 1m0s
/usaco/cli summarises the ./usaco commands, setup, a typical session and
interactive mode, linked from the header. It's a hand-written copy of the
README (the Docker build context is site/, so it can't import it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 23:27:39 +01:00
adamfandClaude Opus 5.5 6d956f1c76 Add the website: Go server + Vue SPA in site/, with CI
A standalone container for web_server, shaped like job-tracker: serves
/usaco/ with solved problems public and solving/skipped plus edits
(status, link, notes) for the site admin. Git is the only store: the
server clones adamf/usaco from Gitea, pulls on the push webhook, and
commits edits back. CI builds the image only when site/ changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 21:51:34 +01:00