Skip to content

Interface: LessonDistillationBuilder ​

Defined in: builders/lesson-distillation-builder.ts:10

Fluent configurator for contrastive lesson distillation ($d in .distillWith(model, $d => ...)).

Captures loop recovery triggers, beforeStop gate recovery thresholds, and distillation guidelines used when extracting empirical lessons from failure-to-pass trajectories.

Methods ​

build() ​

ts
build(): LessonDistillationConfig;

Defined in: builders/lesson-distillation-builder.ts:51

Compiles and returns the frozen LessonDistillationConfig.

Finalizes the distiller model, recovery triggers, and guidelines into a passive AST record.

Returns ​

LessonDistillationConfig

Deeply frozen distillation configuration.


guidelines() ​

ts
guidelines(source): LessonDistillationBuilder;

Defined in: builders/lesson-distillation-builder.ts:42

Binds distillation guidelines text or external SourceASTNode<string>.

Injected into the distiller model's prompt when extracting candidate lessons.

Parameters ​

ParameterTypeDescription
sourceMaybeSource<string>Inline guidelines string or source AST node.

Returns ​

LessonDistillationBuilder

New immutable distillation builder.


onGateRecovery() ​

ts
onGateRecovery(opts?): LessonDistillationBuilder;

Defined in: builders/lesson-distillation-builder.ts:31

Enables contrastive distillation on in-session beforeStop gate recoveries.

Triggers distillation when an agent fails at least minFailedChecks before subsequently passing beforeStop.

Parameters ​

ParameterTypeDescription
opts?{ minFailedChecks?: number; }Minimum failed check threshold options.
opts.minFailedChecks?number-

Returns ​

LessonDistillationBuilder

New immutable distillation builder.


onLoopRecovery() ​

ts
onLoopRecovery(enabled?): LessonDistillationBuilder;

Defined in: builders/lesson-distillation-builder.ts:20

Enables or disables contrastive distillation on outer P.loop recovery iterations.

Pairs the most recent rejected .act() trajectory with the subsequent accepted iteration trajectory.

Parameters ​

ParameterTypeDescription
enabled?booleanWhether outer loop recovery distillation is active.

Returns ​

LessonDistillationBuilder

New immutable distillation builder.

Released under the MIT License.