Skip to content

Function: shouldRetireLesson() ​

ts
function shouldRetireLesson(
   lesson, 
   retirement, 
   slidingWindow?
): boolean;

Defined in: runtime/lessons/lesson-scoring.ts:104

Evaluates the 3-way disjunction determining whether lesson must be retired (SPEC.md §3.4.3).

Retires when totalViolated >= v, or $(N_{\text{eff}} \ge m \land c_W / N_{\text{eff}} < \text{minRate})$, or $(|W| \ge m \land c_W / |W| < \text{minRate})$ where $N_{\text{eff}} = c_W + v_W + g_W^{\text{unrecovered}}$.

Parameters ​

ParameterTypeDefault valueDescription
lessonLessonRecordundefinedLesson record with updated outcome counters.
retirement| LessonRetirementConfig | undefinedundefinedOptional retirement thresholds from LessonsNode.
slidingWindow?numberDEFAULT_LESSON_SCORING_WEIGHTS.DEFAULT_SLIDING_WINDOW_SIZESliding window size $K$ (defaults to 20).

Returns ​

boolean

True when lesson satisfies any of the three retirement conditions.

Released under the MIT License.