Skip to content

Dojo PuzzleBase - #2751

Open
hellokostya wants to merge 79 commits into
jackstenglein:mainfrom
hellokostya:feat/dojo-puzzlebase
Open

hellokostya wants to merge 79 commits into
jackstenglein:mainfrom
hellokostya:feat/dojo-puzzlebase

Conversation

@hellokostya

@hellokostya hellokostya commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds the Dojo PuzzleBase: a curated puzzle collection that approved Puzzle Contributors add to and tag, with a trainer and stats built on top.

For contributors and admins (/puzzles/base)

  • Browse, filter and export puzzles. Add them from a PGN or a Lichess study.
  • Edit a puzzle's rating, tags, position and solution. The pencil on a puzzle opens a board editor with the analysis board's tools (variations, symbols, evals, comments), and a right-click menu to mark a variation ALT, ALT2 or SKIP. Leaving with unapplied changes asks first.
  • Every puzzle is Tactics or Strategy, and Opening, Middlegame or Endgame, plus themes.
  • Review page to tag puzzles one at a time. Members can suggest tags, and contributor suggestions apply straight away.
  • Admins add, deny and remove contributors, and delete themes. Admin actions are logged.
  • Members can vote puzzles up or down. The dashboard lists the most popular.

Training

  • A trainer with a train screen (Tactics / Strategy, phase, theme, rating range) and a result card that shows your rating change, accuracy, speed, and how others near your rating did.
  • Every attempt is recorded. Ratings are Elo-style from accuracy and speed, first attempt only.
  • History page with sessions and stats, and a Puzzle Contributor chip on profiles.
  • Settings for board, pieces, coordinates and sounds.

Shared code

  • common/src/puzzlebase: schemas, PGN parsing, tags, scoring and export, used by backend and frontend.
  • backend/puzzlebaseService: new serverless service with two DynamoDB tables (<stage>-puzzlebase, <stage>-puzzlebase-runs, both Retain).
  • Small PgnBoard additions: largeBoard, extra slots (including a move-menu slot), and a compact option on ViewerSettings.

Rollout

  • Training is closed to regular members. Until PUZZLEBASE_TRAINING_OPEN=true is set at deploy time, train and attempt endpoints return 403 for everyone but contributors and admins.
  • For now the only way in is the Learn page card, shown to contributors and admins only. Applying to be a contributor comes later.
  • "Puzzle admin" currently means Dojo admin.

Testing

  • Unit tests pass in common, backend and frontend.
  • The e2e tests that fail in CI (Lichess game import, training plan sliders) are in code this PR does not touch.
  • Not yet deployed or run against real DynamoDB. Deploy to dev first. I added some missing IAM statements in serverless.yml, so check permissions on first deploy.

Not in this PR

  • UI strings are English only. Moving them to next-intl is a follow-up.
  • The initial 105 puzzles. They will be imported with Add puzzles.

🤖 Generated with Claude Code

hellokostya and others added 30 commits October 7, 2026 22:39
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… and stats

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tings

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ings

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…pular list

Members can vote on a puzzle after playing it, and change or take back
the vote. Popularity is computed as on Lichess, 100 x (up - down) /
(up + down). Totals live in their own item, updated in a transaction with
the member's vote, so editing a puzzle can never lose a vote. Puzzle
Contributors see the totals in the puzzle list and on the dashboard.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Three big buttons start the train screen, with tactics selected. The
focus menu moves above the rating slider and offers the phases of the
game and the themes of the chosen type. A training request can now ask
for several buckets at once, which a puzzle must all have.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…focus menu to Themes

Tactics is green with a bolt, Strategy yellowish with a brain, Mixed
orange with a shuffle icon. The focus menu is now Themes, and its first
option All Themes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…creen

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…trategy

The previous commit left CompareArrows unimported.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s for

A new endpoint gives the tag sets of the puzzles (counted together, and
nothing else about a puzzle), and the train screen leaves out the
phases and themes that would find nothing for the chosen type.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… centered titles

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…hoice

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ion length

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Tactics or strategy, and any of opening, middlegame and endgame, which
are all on to start with. The cards use the training plan's icons. A
training request can ask for puzzles of any of several types and phases,
and the Themes menu offers themes that puzzles of the chosen types and
phases have.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… phases

Tactics, Strategy or Mixed (both) pick the type; below a divider, any of
opening, middlegame and endgame can be on.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ox or headings

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…olving

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e board

On the solution page Stockfish and the notation come first, then the
result, the puzzle details and the tags. While solving, a straight
White/Black to play sticker sits just right of the board, halfway down,
through a new besideBoard slot on PgnBoard.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
hellokostya and others added 29 commits October 10, 2026 22:53
…use details text

The averages are of members rated within 200 points of the member
(totals kept per 50-point band of rating), shown in one compact strip
labelled Avg accuracy, Avg speed and Avg score, with no heading or time
caption. The solution page's details put the number and the short facts
on one line and give the game the whole next line.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… puzzle's rating

Replaces the streak and level tiles: every puzzle finished this session
gets a green tick if it was solved cleanly or a red cross if not, with
its rating under it, and the streak is the big number above.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A saved choice that is no longer offered plays the default.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Strike boxes beside the clock fill as puzzles are missed; the card shows
White/Black to move, the number correct, the puzzle's rating and the
streak, then a row of marks for every puzzle so far. Sounds and Settings
move to the foot of the card.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…G with a group icon and a rating-range tooltip

The left card has its settings gear, Accuracy and Mistakes tiles and Sounds
switch again; no strike boxes, no side-to-move title and no puzzle rating.
It keeps the correct count, the streak and the row of marks. The cohort
average is labelled Avg with a group icon, and hovering says which ratings
it is of, the member's rating plus and minus 200.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The number, the players and the result share a line, the place and year sit
under them, then rating and annotator. The tags follow with no extra line,
and the vote and Suggest tags button share a row, leaving the notation more
room.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…vote sits under Suggest tags

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ng band

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…le's accuracy

A move found on the second try now earns half, as in the puzzle's score,
instead of counting as a miss.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Bigger players and result, larger tags, more space between the groups, and
bigger Suggest tags and vote.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rating

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… more compact score block

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ion so far; wording

On the result card the correct count leaves the streak block (the flame and
marks stay) and appears as a Puzzles tile beside Accuracy and Mistakes. A
repeat says it does not affect the rating.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A repeat does not move the rating, but its result now carries the member's
rating, and the rating plate is shown with a note that it is not affected.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…, room above streak marks

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nges

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

1 participant