FsrsScheduler

service

Breakdex::ReviewEngine::FsrsScheduler

FSRS 2.0 spaced-repetition scheduling algorithm

The learning algorithm — models human forgetting curves with stability and difficulty parameters. Desired retention 0.85 (motor skills). State machine: New(0) → Learning(1) → Review(2) → Relearning(3). Ratings: again, hard, good, easy. Polymorphic: serves moves AND combos.

Relationships

Depends On 1

fsrs_library

Reads From 1

fsrs_cards_table

Writes To 2

fsrs_cards_tablereviews_table

Configured By 2

review_session_providerfiltered_review_moves_provider

Breaks If 3

fsrs_library_upgrade_changes_algorithmfsrs_cards_schema_changesentity_type_polymorphism_breaks

Data Access

\u2605 Owns 2

fsrs_cards_tablereviews_table

\u2190 Reads 1

fsrs_cards_table

\u2192 Writes 2

fsrs_cards_tablereviews_table

Answers

States

StateBehavior
no Due Cards
message: No moves due for review — check back later or add more moves
shows: empty_drill_screen

Invariants

desiredRetention is 0.85 — tuned for motor skills (slower decay than vocabulary)

Enforced by: fsrs_config_constant

Polymorphic: entityId + entityType serves both moves and combos

Enforced by: fsrs_cards_table_composite_pk

Failure Modes

  • Algorithm version mismatch corrupts scheduling — wrong due dates for all cards

Safe Change Notes

  • Internal algorithm parameters are encapsulated in fsrs_service.dart