Repository navigation
8000 Evolve cardbrick-py into a CardBrick-style Spanish study appliance - #18
Merged
Merged
Conversation
Turn the proof-of-concept reviewer into a daily-use, child-safe study appliance while keeping the original prototype (main.py review) intact. New layers on top of the apkg -> SQLite -> py-fsrs -> pygame pipeline: - storage.py: versioned schema that migrates prototype DBs in place; adds suspended/buried card flags, an append-only review_log with before/after state snapshots, sessions, and child_profiles. - service.py: scheduler wrapper exposing get_due_cards / answer_card / undo_last_answer / bury_card / suspend_card with an injectable clock. Daily new/review caps are derived from the review log, so backlogs never flood the child and limits survive restarts; reviews queue before new cards; undo is an exact snapshot restore. - session.py: one-sitting runner with session card/time limits, intra-session learning-step requeue, and a concise summary (counts, pass rate, time, buried/suspended). - settings.py: JSON app settings with atomic writes. - app.py: controller-first state-machine UI (child start -> review -> summary; parent mode with .apkg import, category selection from Anki tags, daily limits, suspended-card recovery, 7-day progress, and study-direction toggle). Auto-play + replay audio with missing-audio fallback; SCALED logical 640x480 canvas; spec button roles (A=Good B=Again X=Easy Y=Hard, L=replay, R=bury, SELECT=menu, START=finish). - main.py: new default `study` command plus a `profile` command for CLI configuration; `review`, `import`, `decks` unchanged. - importer.py: per-card skip reasons and card timestamps. - tests/: 39 pytest cases covering daily limits (incl. backlog and midnight rollover with a fake clock), exact undo, bury/suspend, tag filtering, import, and crash/restart persistence. Crash recovery: every answer commits log + state together; dangling sessions are closed with aggregates on next boot. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X51wk4Xi1jmeu4Fddmsz3Y
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.
Turn the proof-of-concept reviewer into a daily-use, child-safe study
appliance while keeping the original prototype (main.py review) intact.
New layers on top of the apkg -> SQLite -> py-fsrs -> pygame pipeline:
adds suspended/buried card flags, an append-only review_log with
before/after state snapshots, sessions, and child_profiles.
undo_last_answer / bury_card / suspend_card with an injectable clock.
Daily new/review caps are derived from the review log, so backlogs
never flood the child and limits survive restarts; reviews queue
before new cards; undo is an exact snapshot restore.
intra-session learning-step requeue, and a concise summary
(counts, pass rate, time, buried/suspended).
summary; parent mode with .apkg import, category selection from Anki
tags, daily limits, suspended-card recovery, 7-day progress, and
study-direction toggle). Auto-play + replay audio with missing-audio
fallback; SCALED logical 640x480 canvas; spec button roles
(A=Good B=Again X=Easy Y=Hard, L=replay, R=bury, SELECT=menu,
START=finish).
studycommand plus aprofilecommand forCLI configuration;
review,import,decksunchanged.midnight rollover with a fake clock), exact undo, bury/suspend, tag
filtering, import, and crash/restart persistence.
Crash recovery: every answer commits log + state together; dangling
sessions are closed with aggregates on next boot.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01X51wk4Xi1jmeu4Fddmsz3Y