/** * PURE deterministic distillation of sprint outcomes into LessonEntry records. * * PURE — must not import from ../providers; no network, no Date.now(), no side effects, * no filesystem access. createdAt is stamped at PERSIST TIME by the CLI handler, not here. * lessonId is a sha256 content-hash of category+tags+sourceEntryRefs — never derived from time. * * IMPORTANT — this distills from the data shapes the REAL pipeline actually produces, NOT * an invented vocabulary. The four signals are: * (a) recurring failed-criterion categories — from eval results' criteriaResults[].result==="fail", * grouped by the criterion's verificationMethod (resolved from the owning contract). * (b) repeated failing eval strategies — from eval results' strategyResults[].result==="fail", * grouped by strategy name. * (c) sprints that needed rework — from contract.iterationHistory entries whose * result==="fail" (real shape: { iteration, evalId, result }), reinforced by history * entries with phase==="rework" && event==="evaluation-failed". * (d) fail→pass contrast — from contract.iterationHistory where at least one * result==="fail" is FOLLOWED (in iteration order) by a result==="pass", capturing the * sprint provenance and which iterations flipped. * * The eval-result inputs are read LENIENTLY (see DistillableEval) because the on-disk * .bober/eval-results/*.json files and the compiled EvalResultSchema use different shapes; * every field is optional and defensively narrowed. */ import type { HistoryEntry } from "../../state/history.js"; import type { SprintContract } from "../../contracts/sprint-contract.js"; import type { LessonEntry } from "../../state/memory.js"; /** * Lenient, structurally-typed view of an eval result for distillation. * * Unifies BOTH the on-disk .bober/eval-results/*.json shape * ({ overallResult, strategyResults, criteriaResults }) AND the compiled * EvalResultSchema shape ({ passed, criteriaResults }). Every field is optional; * distill never assumes a field is present. */ export interface DistillableEval { evalId?: string; contractId?: string; iteration?: number; /** on-disk variant: "pass" | "fail" */ overallResult?: string; /** compiled-schema variant */ passed?: boolean; criteriaResults?: Array<{ criterionId?: string; result?: string; verificationMethod?: string; }>; strategyResults?: Array<{ strategy?: string; result?: string; }>; } /** * Pure, side-effect-free distillation of sprint outcomes into LessonEntry records. * * Derives lessons from structured fields only (see file header for the three signals). * The returned array is sorted by lessonId for byte-identical output across calls. * The `createdAt` field is set to SENTINEL_CREATED_AT — the CLI handler MUST * replace it with the real wall-clock ISO string before persisting. */ export declare function distill(history: HistoryEntry[], contracts: SprintContract[], evalResults?: DistillableEval[]): LessonEntry[]; //# sourceMappingURL=distill.d.ts.map