Add requirements specification v2.1 - production-ready version

This v2.1 represents comprehensive engineering improvements based on
three expert reviews and technical feasibility research (2026 latest tech stack).

Major improvements over v2.0:

**Data Consistency** ⭐
- wrong_count completely driven by attempts (no manual updates)
- Enforced rule: any "correct/wrong/unknown" action must create an attempt
- Provides rebuild_wrong_counts repair tool

**Offline Architecture Clarification** ⭐
- Online: PostgreSQL FTS + pg_jieba
- Offline: SQLite FTS5 + trigram tokenization
- Event Sourcing sync strategy (incremental action logs)
- Outbox queue + idempotency + conflict resolution

**FSRS Replaces SM-2** ⭐
- Using dart-fsrs v2.0.0 (official package)
- More scientific than SM-2 (adopted by Anki)
- Boundary conditions: ease_factor[1.3,2.8], max_interval=90 days
- Anti-gaming mechanisms (prevent same-day double attempts)

**Multi-question Segmentation Strategy** ⭐
- P0 (MVP): Manual box selection + intelligent hints (stable)
- P1 (Week 5-8): Auto-segmentation via PP-DocLayoutV3
- "Puzzle-style adjustment": drag boundaries with auto-snap
- Significantly reduces MVP risk (4-week delivery)

**Strict KPI Metrics** ⭐
- Cohort definition: Week 1 questions tracked to Week 4
- "Second review" definition: ≥24 hours interval, review_mode='daily_review'
- "Heavy wrong" definition: attempts wrong ≥3 on different dates
- All metrics aggregatable from attempts/review_sessions tables

**Latest Tech Stack (2026)** ⭐
- PP-OCRv5 (May 2025, +13% accuracy)
- PP-FormulaNet_plus-M (Chinese formula BLEU 89.76%)
- PP-DocLayoutV3 (Jan 2026, non-planar document support)
- PostgreSQL + pg_jieba (online FTS)
- SQLite FTS5 (offline FTS)
- FSRS via dart-fsrs v2.0.0
- pHash image fingerprinting + TF-IDF text similarity

**UX Optimizations** ⭐
- Anti-cheating: 3-second delay or key value input for "Got it" button
- Anti-frustration: Show hints/tips before full answer on "Don't know"
- Puzzle-style adjustment for manual question segmentation
- pHash first-pass deduplication (instant, OCR-error proof)

**Gamification Prep** ⭐
- Database schema reserves: points, current_streak, longest_streak
- badges and user_badges tables
- P2 implementation ready

**MVP Degradation Paths** ⭐
- Every P0 feature has minimum viable standard defined
- Clear fallback options if auto-features fail
- 4-week delivery risk significantly reduced

Addresses all critical feedback from:
- Expert Review 1 (S-grade): UX details, sync strategy, gamification
- Expert Review 2 (Tech feasibility): Data consistency, offline arch, MVP scope
- Expert Review 3 (Tech research): Latest 2026 tech stack

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
This commit is contained in:
2026-02-09 22:41:58 +08:00
co-authored by Claude Sonnet 4.5
parent 5198371250
commit 0a79d7de9a
File diff suppressed because it is too large Load Diff