Skip to content

FSRS: hybrid Unit-mode timing with Bespoke language policy - #3

Merged
Thunderkill016 merged 16 commits into
flashday-p0-finalizefrom
flashday-fsrs-hybrid
Sep 1, 2026
Merged

Thunderkill016 merged 16 commits into
flashday-p0-finalizefrom
flashday-fsrs-hybrid

Conversation

@Thunderkill016

Copy link
Copy Markdown
Owner

Mục tiêu

Tích hợp FSRS vào FlashDay theo ranh giới rõ ràng, không thay toàn bộ Bespoke.

Kiến trúc

  • FSRS v6 (ts-fsrs 5.4.2) sở hữu WHEN: due date, stability, difficulty, retrievability và next interval.
  • google/bespoke giữ WHAT/HOW/WHICH CARD: Unit, Listen/Speak/Read/Write, CardIndex, introduction preference, multi-unit card và card/context ranking.
  • FSRS state được lưu theo Unit × Mode (unitId::listen|speak|read|write), không theo sentence card.
  • Review event là lịch sử bền vững; fsrsProgress và bespokeProgress đều là cache có thể rebuild.

Implementation

  • thêm fsrs-scheduler.mjs dùng trực tiếp upstream ts-fsrs; không reimplement công thức FSRS
  • pin ts-fsrs chính xác ở 5.4.2 / FSRS v6
  • Again/Hard/Good map từ score 1/2/3; score 0 không được biến thành FSRS review; mapping 4 -> Easy đã chuẩn bị nhưng UI hiện chưa expose Easy
  • FSRS gate/rank các Unit × Mode đã đến hạn; Bespoke không còn được phép kéo một memory FSRS chưa đến hạn lên sớm
  • khi chưa có memory state, Bespoke vẫn ưu tiên chọn Unit/mode mới để giới thiệu
  • sau khi Unit/mode được chọn, Bespoke tiếp tục score các sentence card ứng viên
  • không tạo cross-skill evidence giả: review Write không tự update Listen/Speak/Read
  • multi-unit card update FSRS riêng cho từng Unit trong mode hiện tại
  • enable_fuzz:false để replay append-only review history cho due date deterministic
  • migration fallback: nếu snapshot cũ chưa có review-event history nhưng còn bespokeProgress.ratings, dùng chính rating history đó để seed FSRS thay vì reset toàn bộ trí nhớ
  • cloud merge làm vô hiệu cả hai scheduler cache khi có merged history để runtime rebuild lại
  • attribution/license đã cập nhật trong THIRD_PARTY_NOTICES.md

Verification

  • dedicated FSRS Unit-mode tests
  • dedicated Bespoke + FSRS boundary tests
  • existing Bespoke upstream-behavior tests vẫn giữ nguyên
  • full npm run verify (syntax + all regression tests + Vite production build) đang pass trên head branch

Rating UX hiện tại

UI FlashDay hiện chủ yếu là binary self-rating Again / Good thông qua Sai / Nhớ. Hybrid engine hỗ trợ Hard ở data contract và Easy mapping, nhưng PR này không giả vờ rằng UI đã có đủ 4 nút FSRS.

Base

PR này cố ý target flashday-p0-finalize vì P0 PR #2 vẫn chưa merge vào main. Sau khi P0 được merge, PR này có thể retarget sang main mà không kéo lẫn thay đổi correctness nền.

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flashday Ready Ready Preview Sep 1, 2026 6:24pm UTC

@Thunderkill016
Thunderkill016 merged commit 6004c3a into flashday-p0-finalize Sep 1, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 436b487e Deployed Sep 1, 2026 by vercel[bot]
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.

1 participant