halkyon/halkyon_learn_server/lib/src/review/review_log.spy.yaml
Tizian 「ティツィアーン」 baace1b6e9
feat(app): reviews know how a card was studied; progress can start afresh
Each review records its mode (ADR 0004, rule 3): front to back, back to
front with a schedule of its own, or crammed outside the schedule. A
card's schedule replays only the reviews of one mode. Resetting progress
appends a 'reset' entry per card, no migration (the column is text):
schedules replay what follows it, and the history stays for the streak
and the heatmap. Reviews are inserted in batches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-01 21:10:05 +02:00

32 lines
1.3 KiB
YAML

### One rating of a card, never changed once written: a card's schedule isn't
### stored but derived on each device by replaying its reviews in time order,
### so reviews from different devices never conflict (decided 2026-09-30).
### Synced; the review goes with its card.
class: ReviewLog
table: review_log
database: sync
fields:
### The card reviewed.
card: Card?, relation(onDelete=Cascade, deferred)
### How well it was recalled, FSRS's ratings: 1 again, 2 hard, 3 good,
### 4 easy.
rating: int
### When, in UTC.
reviewedAt: DateTime
### How long answering took, from showing the card to rating it, in
### milliseconds.
durationMs: int
### How the card was studied (ADR 0004): 'review' (front to back), 'reverse'
### (back to front, with a schedule of its own, as Anki's reverse cards have),
### or 'cram' (outside the schedule: counts for streaks and the activity
### heatmap, never moves a schedule). Reviews from before modes are 'review'.
### 'reset' is no rating but a fresh start: the card's schedules replay only
### what follows it, its rating means nothing.
mode: String, default='review'
indexes:
# Deleting a space finds its rows through this index (see studyset.spy.yaml).
review_log_space_idx:
fields: spaceId
# A card's reviews, in time order.
review_log_card_idx:
fields: cardId, reviewedAt