Skip to content

feat: implement 10K review cap enforcement with session summaries#189

Open
djanderson26 wants to merge 3 commits into
mainfrom
feat/rework-reviews
Open

feat: implement 10K review cap enforcement with session summaries#189
djanderson26 wants to merge 3 commits into
mainfrom
feat/rework-reviews

Conversation

@djanderson26

Copy link
Copy Markdown
Collaborator

Implements review data rework (#133):

  • Add pruneOldReviews(userId) to ReviewRepository to enforce 10K per-user limit
  • Record ReviewSessionSummary on study session completion
  • Track card states during session for summary stats
  • Prune oldest reviews after each session to cap at 10K
  • Add comprehensive unit tests for pruning logic

Closes #133

- Add pruneOldReviews(userId) to ReviewRepository
- Deletes oldest reviews beyond 10K threshold per user
- Runs in database transaction for consistency
- Returns count of deleted rows
#133)

- Add card state tracking (_newCount, _learningCount, _reviewCount)
- Implement _finalizeSession() to create and persist ReviewSessionSummary
- Call pruneOldReviews() after each session to enforce 10K cap
- Trigger review pruning on both normal exit and early termination
- Schedule sync push after session finalization
- Test: no pruning under 10K reviews
- Test: correct capping at 10K threshold
- Test: oldest reviews deleted while newest kept
- Test: multi-user isolation
- Test: edge cases (empty userId, non-existent user)
@djanderson26 djanderson26 requested a review from Pairadux as a code owner April 17, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rework reviews: add review_session_summary table, cap reviews at 10K

1 participant