Skip to content

Function: mergeLessonOutcomePrecedence() ​

ts
function mergeLessonOutcomePrecedence(current, incoming): LessonOutcome;

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

Merges two 4-state LessonOutcome values using strict severity precedence (SPEC.md §3.4.3).

Enforces violated > gate_rejected_unrecovered > gate_rejected_recovered > clean_pass so each (stepExecId, lessonId) records at most one worst-case outcome.

Parameters ​

ParameterTypeDescription
currentLessonOutcome | undefinedPreviously recorded outcome for the lesson in the active step, if any.
incomingLessonOutcomeNewly observed outcome for the lesson.

Returns ​

LessonOutcome

Higher-severity outcome according to the 4-state precedence order.

Released under the MIT License.