Repository navigation
Browser entry and choice items with named misconceptions - #23
Merged
Merged
Conversation
src/browser.mjs exports practice, scheduling and diagnosis with no Node built-ins, so a static page can import them with no bundler. The session functions move from tutor.mjs into session.mjs, which tutor.mjs re-exports unchanged. A test walks the entry's import graph and fails on any node: or bare import, with controls that prove the walk can fail. src/tutor/choice.mjs adds learn-choice/1 items: one keyed answer, a named misconception per wrong choice. diagnoseChoice() tells a wrong attempt which misconception it matches and never returns the key; doctor checks this. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 3, 2026
Live explainers driven by the media engine, with Learn recall checks
HarperZ9/HarperZ9.github.io#315
Merged
Merged
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.
What this adds
@harperz9/learn/browser(src/browser.mjs): practice, mastery, spaced review (Leitner and FSRS), arithmetic diagnosis and choice diagnosis, with no Node built-ins. A static page imports it as an ES module with no bundler. Receipts, the session store, the CLI and the MCP server stay Node-only.learn-choice/1,src/tutor/choice.mjs,docs/CHOICE-ITEMS.md): one keyed answer, a named misconception per wrong choice.diagnoseChoice()returns the leaf and note for a wrong choice and never the keyed answer.publicItem()is what a page shows before the attempt.recordAttemptaccepts an optionalmisconceptionleaf, andmisconceptions()counts it.The session functions moved from
tutor.mjstosession.mjs(the ledger import pulled innode:crypto);tutor.mjsre-exports them, so existing imports are unchanged.Why
The portfolio site's explainers add recall checks after each step group. They need Learn's scheduling and a diagnosis that works for conceptual questions, running in the page with no network.
Checks
tests/learn-browser-entry.test.mjswalks the entry's import graph: only relative imports, noprocess,Bufferorrequire. Two controls show the walk fails on anode:cryptoimport and ontutor.mjsitself.tests/learn-choice.test.mjs: validation errors, the key never appearing in a wrong-choice diagnosis, no-attempt handling, and the count inmisconceptions().doctorgainstutor.choice_diagnosis_never_reveals_key.Limits
The diagnosis reports the misconception an item's author attached to a choice. It infers nothing and cannot check that the note is true. No version bump; the CHANGELOG entry is under Unreleased.
🤖 Generated with Claude Code