/** * @module koi/oo-harness/result-contract * * How a long job is allowed to END. * * The single largest difference NOOA measured against other harnesses was not * cleverness, it was termination: harnesses that stop the moment the model * answers without a tool call let it declare victory early, and on * Terminal-Bench 77% of one baseline's failed runs ended inside ten steps. A * typed return contract removes that failure mode — finishing is an ACTION * that has to validate, not a sentence the model happens to write. * * So an autonomous koi run ends one way: by submitting a result that carries * what it did, the evidence it is true, and how someone else can check. If it * cannot fill those in, it has not finished, and the harness says so and * keeps going. * * The rules are deliberately about EVIDENCE, not length: a verification step * that is a real command or a checkable observation, and a claim that does not * hedge ("should work", "probably") — hedging is the model telling you it did * not verify. */ export type TaskResult = { /** What the task turned out to be about, in one line. */ summary: string; /** What was actually changed or produced. Empty is allowed for read-only work. */ changes?: string[]; /** Why the result is believed true: what was observed, run, or read. */ evidence: string[]; /** How someone else checks it — a command, a URL, a file to open. */ verification: string; /** Anything deliberately not done, so it cannot be mistaken for done. */ notDone?: string[]; }; export type ContractOptions = { /** Read-only tasks legitimately change nothing. */ requireChanges?: boolean; minEvidence?: number; }; export type ContractOutcome = { ok: true; result: TaskResult; } | { ok: false; problems: string[]; message: string; }; /** * Validate a proposed ending. Failures come back as sentences addressed to * the model, because that string goes straight into its next turn. */ export declare function validateTaskResult(candidate: unknown, options?: ContractOptions): ContractOutcome; /** The human rendering of a validated result — what a person actually reads. */ export declare function renderTaskResult(result: TaskResult): string;