Skip to content

Add Confidence field and enrich deck descriptions with selection stats - #22

Merged
SKOHscripts merged 1 commit into
mainfrom
claude/anki-guid-puzzle-id-4pdvG
May 28, 2026
Merged

Add Confidence field and enrich deck descriptions with selection stats#22
SKOHscripts merged 1 commit into
mainfrom
claude/anki-guid-puzzle-id-4pdvG

Conversation

@SKOHscripts

Copy link
Copy Markdown
Owner

Summary

Two follow-up improvements on top of the sampling refactor:

1. New Confidence Anki field

  • The Bayesian quality score computed during selection (_quality, combining Popularity + NbPlays, confidence-weighted) is now written to each puzzle CSV as a Confidence column.
  • Added a Confidence field to the Anki note model (appended last to keep field order stable for existing collections).
  • Displayed on the card back as a ★ {score} pill so users can gauge how community-validated a puzzle is.

2. Richer deck descriptions

Each generated sub-deck description now mirrors the generation-time coverage report:

  • Summary line: puzzle count · ELO range/average · average popularity
  • Woodpecker mastery estimate: time for a first full pass at ~20 new puzzles/day (from the README), then accelerated repetition cycles — a motivational one-liner per deck
  • Coverage block: unique themes/motifs covered, distinct themes/motifs in tranche, motif coverage % (+ all-theme coverage %)
  • Full theme-frequency breakdown (every theme, sorted by frequency)

Example:

📊 1200 puzzles · Rating 800–999 (avg 900) · Popularity avg 92%

🔨 Woodpecker plan: at ~20 new puzzles/day, a first full pass takes about 60 days (~9 weeks). ...

📈 Coverage:
- Unique themes covered: 69 (motifs: 54)
- Distinct themes in tranche: 72 (motifs: 54)
- Motif coverage: 100.0%  (all-theme coverage: 95.8%)

🎯 14 themes by frequency:
  • endgame: 274 puzzles
  ...

Changes

  • lichess_optimized_puzzles_datasets.py: write Confidence column; _format_confidence helper.
  • build_apkg.py: new field + _row_to_note mapping + SAMPLE_CARDS; rewritten _build_description (now takes a stats dict) with _mastery_sentence and _coverage_lines helpers.
  • templates/back.html: confidence pill.
  • tests/build_apkg_test.py: updated to the new description format and stats param; added breakdown/mastery tests.
  • README.md: documents the field and the enriched descriptions.

Verification

  • pytest tests/ — 60 passed
  • pylint 10.00/10 (CI flags), mypy clean

Generated by Claude Code

…n stats

- Write the Bayesian quality score to CSV as a Confidence column and expose it
  as an Anki field, shown on the card back as a star pill.
- Rebuild deck descriptions to mirror the generation-time report: summary line,
  motif/theme coverage, full theme-frequency breakdown, and a Woodpecker-based
  mastery-time estimate (~20 new puzzles/day).
- Update tests and README accordingly.
@SKOHscripts
SKOHscripts marked this pull request as ready for review May 28, 2026 18:49
@SKOHscripts
SKOHscripts merged commit 5e0674a into main May 28, 2026
14 checks passed
@SKOHscripts
SKOHscripts deleted the claude/anki-guid-puzzle-id-4pdvG branch May 28, 2026 18:49
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.

2 participants