/** * 📜 THE PROOF OF IMPROVEMENT (Dominance Certificate) — the signed artifact a business needs to JUSTIFY a * change: "switching from the current setting A to recipe B is a real gain of at least Δ, accounting for * measurement noise — and here is the offline-verifiable proof." * * It replicates the measurement of A and B, computes a one-sided 97.5% lower confidence bound on the gain * (μB − μA − z·√(seA²+seB²)), and only certifies an improvement when that bound clears zero. So the * certified Δ is a number you can stand behind: the TRUE gain is ≥ Δ with 97.5% confidence — not a noisy * single-shot "it looked better". The per-replicate measurements are recorded and the whole thing is * Ed25519-signed, so a reviewer re-derives Δ and the verdict offline. * * WORLD-FIRST + LLM-impossible: an LLM cannot run replicated physical/benchmark measurements, compute a * calibrated confidence bound, or sign a re-derivable certificate — it can only assert "B seems better". * (DIAKRISIS — MEASURED: when it certifies a gain Δ, the true gain ≥ Δ ≥97.5% of the time; and when A and B * are truly equal it falsely certifies ≤2.5% of the time. A calibrated decision, not a vibe.) */ import { type Experiment } from "./space.js"; import { type KeyObject } from "node:crypto"; export interface ImprovementCertificate { standard: "melete-improvement-certificate/v1"; verdict: "IMPROVEMENT" | "INCONCLUSIVE"; a: { experiment: Experiment; mean: number; n: number; }; b: { experiment: Experiment; mean: number; n: number; }; gainLowerBound: number; observedGain: number; confidence: number; paired: boolean; sequential?: { looks: number[]; alpha: number; stoppedAt: number; }; samplesA: number[]; samplesB: number[]; payloadHash: string; signature: string; publicKeyPem: string; algo: "ed25519+sha256"; } /** Certify (with proof) that B improves on A by at least Δ. Supply `oracle` for independent measurement, OR * `pairedOracle(i)` returning A and B measured under the SAME conditions (common random numbers) — the * shared noise cancels in the difference, so the same gain is certified from far fewer measurements. */ export declare function improvementCertificate(opts: { oracle?: (e: Experiment) => number; pairedOracle?: (i: number) => { a: number; b: number; }; a: Experiment; b: Experiment; replicates?: number; seed?: number; goal?: "maximize" | "minimize"; keys?: { publicKey: KeyObject; privateKey: KeyObject; }; }): ImprovementCertificate; /** SEQUENTIAL: measure in groups (looks) and STOP as soon as the gain is certified — far fewer measurements * on average. Bonferroni alpha-spending across the K looks keeps the overall false-certification ≤ alpha. */ export declare function sequentialImprovementCertificate(opts: { oracle?: (e: Experiment) => number; pairedOracle?: (i: number) => { a: number; b: number; }; a: Experiment; b: Experiment; looks?: number[]; alpha?: number; seed?: number; goal?: "maximize" | "minimize"; keys?: { publicKey: KeyObject; privateKey: KeyObject; }; }): ImprovementCertificate; /** Verify offline: recompute the gain bound + verdict from the recorded samples, then check the signature. */ export declare function verifyImprovementCertificate(c: ImprovementCertificate): { ok: boolean; reason: string; }; export declare function improvementGauntlet(): { score: 0 | 100; checks: Array<{ name: string; pass: boolean; detail: string; }>; }; //# sourceMappingURL=improvement.d.ts.map