feat(learn): mascot, 25 sound effects, coins + shop, two leaderboards, sentence translation and tap-to-look-up #17
All Vouch review confidence checks passed
Residual risk 0.36 = Change Risk (0.48) × (1 − Review Confidence (0.26)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 547 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 48% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.377
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #17"
general
weight: 0.35
chatgpt-codex-connector[bot]
Reworks the Learn path around one idea: every answer should say something back.
What is in it
The path (
/learn) opens on an arena card — mascot, streak, total XP, coin balance and the daily-goal ring — with the shop, the board and the next lesson one press away.Bơ, the mascot — an original SVG creature with seven moods (idle, happy, sad, wow, think, wave, sleep). It hops on a right answer, droops on a wrong one, thinks while a question waits. One function maps a verdict to a mood and a line, so the lesson and the review describe a verdict the same way.
One sound per event — 25 synthesised WebAudio effects (
src/client/lib/sfx.ts), no audio files: tap, select, match, correct, combo, almost, wrong, heart lost, out of hearts, hint, reveal, coin, buy, boost, freeze, streak, daily goal, level up, lesson start, complete, perfect, fail, unlock, error, whoosh. A soundboard in the shop auditions them; muted before the first gesture, off under a mute switch, silent on a browser without WebAudio.Effects — confetti (28/60/120 pieces by occasion), floating XP / heart / coin numbers, combo badge, reaction flash, streak ring; all
aria-hidden, all switched off underprefers-reduced-motion.Coins, quests and a shop (
/learn/shop) — lessons, reviews, the first activity of a day and three daily quests pay coins; coins buy a hint (removes two wrong options / starts a typed answer), a heart refill, 30 minutes of double XP, or a streak freeze that carries a streak across exactly one missed day. Prices and caps are server-side (src/shared/shop.ts), purchases are conditional UPDATEs so racing calls cannot double-spend, and every movement is logged (learn_coin_log,learn_shop_orders). A coin chip in the shell keeps the wallet visible outside the shop.Two leaderboards (
/learn/leaderboard) — one endpoint, two scopes: XP on the path, submitted tests on the practice side; this week (Monday start, in the reader's own day) or all time; top 50 plus the reader's own rank even when it is outside the list. Practice is ranked on attempts with the best band beside it, never on band alone. Staff accounts never appear, and only display names are returned.Understanding the answer — after every question the footer shows the whole sentence (blank filled, model answer, or line of evidence) with the taught word underlined, a Vietnamese rendering of the sentence (cached per sentence in
learn_translations, so the provider is paid once platform-wide; with no provider configured the word's gloss is still shown and the copy says why), and the word's English + Vietnamese meanings.Tap a word to look it up — every word of a prompt, sentence, passage or model answer opens the dictionary in a bottom sheet (the same
DictionaryPanelthe exam uses, so a saved word lands in the notebook). Legendary lessons keep look-ups off; words aretabIndex={-1}so the tab order of a question stays sane.Data
Migration
0017_learn_shop_and_quests.sqladdslearn_profiles.coins/xp_boost_untiland the tableslearn_inventory,learn_shop_orders,learn_coin_log,learn_quest_rewards,learn_translations. The runtime schema is regenerated. Rate limits: 60 buys/h, 90 item uses/h, 240 translations/h, per user.Dev ergonomics
scripts/demo-accounts.mjsnow plays two lessons as the demo student on an untouched profile (75 coins, streak 1) so a fresh checkout has something in the shop; it is guarded by "profile has never earned XP", so re-running does not mint coins.Verification
npm run typecheckclean (worker, client, node) ·npm run lint0 errors ·npm test378 tests / 29 files ·npm run buildclean.npm run test:integration→ 85 checks passed, 0 failed.available: false, no error).Notes