All files / web/src/lib/curriculum/config readiness-thresholds.ts

100% Statements 46/46
100% Branches 0/0
100% Functions 0/0
100% Lines 46/46

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 472x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x  
/**
 * Readiness Thresholds Configuration
 *
 * Multi-dimensional readiness criteria for skill progression.
 * A skill is "solid" (ready to advance past) when ALL four dimensions are met:
 *
 * 1. Mastery: BKT P(known) + confidence
 * 2. Volume: Practice depth (problems + sessions)
 * 3. Speed: Automaticity / muscle memory
 * 4. Consistency: Reliable execution (accuracy + no-help streak)
 *
 * IMPORTANT: These values are designed to be adjustable via admin UI in the future.
 * All code should import from here rather than hardcoding values.
 */
 
export const READINESS_THRESHOLDS = {
  // --- Mastery dimension ---
  /** P(known) threshold for readiness (raised from BKT_THRESHOLDS.strong = 0.8) */
  pKnownThreshold: 0.85,
  /** Minimum confidence to trust BKT estimate for readiness (raised from 0.3) */
  confidenceThreshold: 0.5,
 
  // --- Volume dimension ---
  /** Minimum first-attempt problems with the skill */
  minOpportunities: 20,
  /** Minimum distinct sessions where skill appeared */
  minSessions: 3,
 
  // --- Speed dimension ---
  /** Maximum median seconds per term for automaticity */
  maxMedianSecondsPerTerm: 4.0,
  /** Number of recent problems to compute speed median from */
  speedWindowSize: 10,
 
  // --- Consistency dimension ---
  /** Last N problems must be help-free */
  noHelpInLastN: 5,
  /** Window size for recent accuracy computation */
  accuracyWindowSize: 15,
  /** Minimum accuracy in the recent window */
  minAccuracy: 0.85,
  /** Last N problems must all be correct */
  lastNAllCorrect: 5,
} as const
 
export type ReadinessThresholds = typeof READINESS_THRESHOLDS