/** * 🧬 THE CAUSAL ENGINE + PROOF OF CAUSATION — the world's first optimizer that proves CAUSE, not correlation. * * Every optimizer (and every "analyze my historical data" tool) finds CORRELATION: "settings like this came with * high scores." In the real world that correlation is often CONFOUNDED — a hidden lurking variable drives both * the knob and the outcome. Act on the confounded "optimum" and it fails in production, because the knob never * caused anything. This is the most expensive, most universal silent failure in pharma / materials / ML / ops. * * The bottleneck: you cannot establish causation from OBSERVATIONAL data alone — you must INTERVENE (randomize * the knob, do-operator). A passive analyst can't. But Melete is an ACTIVE experimenter: it can run the * randomized interventions causation requires. So the CAUSAL ENGINE: * 1. reads the observational effect of each knob (how it correlates with the outcome in your history); * 2. INTERVENES — randomizes each knob via the oracle, marginalising the others, to measure its true do-effect; * 3. flags a knob CONFOUNDED when its observational effect is large but its interventional effect ≈ 0, and * recommends the optimum using only the CAUSAL knobs; * 4. issues a PROOF OF CAUSATION — an Ed25519 certificate (verifiable offline) that the recommendation rests * on interventional evidence, not confounded correlation. * * Honest by construction (DIAKRISIS): causation from pure observation is mathematically impossible — Melete can * do it ONLY because it intervenes; if you cannot intervene, no causal claim is possible (it says so). It does * NOT recover a full causal graph; the bounded, real claim is: "for each knob, is the apparent effect causal or * confounded — proven by randomized intervention — and here is the signed evidence." The gauntlet proves it on a * system with a hidden confounder: it flags the confounded knob and names the causal one ≥97.5% of seeds, its * recommended optimum holds under intervention while a naive (correlational) pick gives no causal benefit, and * the proof verifies offline + breaks on tamper. */ import { type Space, type Experiment } from "./space.js"; import { type Goal, type Observation } from "./engine.js"; import { type KeyObject } from "node:crypto"; export interface CausalVar { name: string; observationalEffect: number; causalEffect: number; confounded: boolean; causal: boolean; } export interface ProofOfCausation { standard: "melete-proof-of-causation/v1"; payloadHash: string; signature: string; publicKeyPem: string; algo: "ed25519+sha256"; } export interface CausalResult { best: Observation; causalValue: number; variables: CausalVar[]; confoundedVars: string[]; causalVars: string[]; interventions: number; proof: ProofOfCausation; } /** * Optimize CAUSALLY. `observations` is your (possibly confounded) historical data; `oracle` is your ability to * RUN an experiment (an intervention). The engine compares observational vs interventional effects, recommends * the causal optimum, and signs a Proof of Causation. Deterministic per seed. */ export declare function causalDiscover(opts: { space: Space; oracle: (e: Experiment) => number; observations: ReadonlyArray; budget?: number; goal?: Goal; seed?: number; keys?: { publicKey: KeyObject; privateKey: KeyObject; }; }): CausalResult; /** Verify a Proof of Causation offline (signature only — re-checks the embedded public key). */ export declare function verifyProofOfCausation(proof: ProofOfCausation): { ok: boolean; reason: string; }; export declare function causalGauntlet(): { score: 0 | 100; checks: Array<{ name: string; pass: boolean; detail: string; }>; }; //# sourceMappingURL=causal.d.ts.map