feat: The Mastery Loop — self-graded understanding + library coverage (Pillar 3, Spec 1)#37
Merged
Merged
Conversation
learn → prove (self-graded flip-card check from the deep-dive's existing Feynman questions) → see it grow (library mastery coverage). Shared pure mastery.js model + IDB; zero new AI calls, no background.js changes. Research-backed by the "AI-Augmented Textbook"/Learn Your Way paper. Includes a rendered HTML version for review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First slice of Pillar 3 — the Knowledge Game. Adds a learn → prove → see it grow loop, research-backed by the "AI-Augmented Textbook"/Learn Your Way paper (embedded assessment), adapted to RepoLens's zero-backend, BYO-key model: self-graded, no new AI calls, fully local.
Built spec-first → plan → subagent-driven execution. Spec:
docs/superpowers/specs/2026-06-16-mastery-loop-design.md; plan:docs/superpowers/plans/2026-06-16-mastery-loop.md(both with rendered HTML).What's in it
mastery.js(new, pure, fully unit-tested) —deriveCheckResult,aggregateMastery, levels,UNDERSTOOD_THRESHOLD = 2/3(2-of-3 passes — the exact fraction, not a rounded 0.67).store.js+store/idb.js— a new local IDBmasterystore (DB v5→6, additive) with CRUD (getMastery/getAllMastery/setMastery), mirroring thedecisionsstore. Round-trip tested withfake-indexeddb.Reuse / invariants
background.js/ message-contract changes (grep-confirmed in the final review). Mastery is local IDB only; BYO-key untouched.mastery.jsis pure → all scoring/leveling/aggregation is unit-tested; persistence tested withfake-indexeddb; the store stays CRUD-only (no compute).Test plan
npx vitest run→ 875 passed (93 files; +9mastery.test.js, +3store-mastery.test.js, +1 library-filters case)npx eslint .→ 0 errorsnpm run check:html→ 24 files cleannode --checkon the 7 touched JS filesOne choice to confirm
The aggregate line's denominator (
Understood X of Y) is currently Y = repos you've checked (soX understood + N explored = Y), which is self-consistent and only appears once you've taken a check. If you'd prefer the coverage framing (Y = total library size, "12 of your 40 repos"), it's a one-line change — say the word.Out of scope (per spec → future Pillar 3 work)
AI-graded MCQ, spaced-repetition resurfacing, the corkboard knowledge-graph (Spec 2), and mastery in the backup envelope.