/** * ORACLE — the pluggable thing that runs an experiment and returns a result. * * The whole point of Melete: the brain does not care WHAT the oracle is. The same closed loop drives a * simulated objective, a wet-lab robot over HTTP, a factory process, a hyperparameter trainer, or an * expensive A/B test. An oracle is just `(experiment) => number | Promise` — the measured outcome * of one experiment. The brain proposes; the oracle measures; the brain learns. Swap the oracle, keep the * brain. */ import { type Experiment } from "./space.js"; export type Oracle = (e: Experiment) => number | Promise; /** In-process oracle from a pure objective function — used for simulation, benchmarking, and tests. */ export declare function simOracle(fn: (e: Experiment) => number): Oracle; /** * HTTP oracle — POSTs {experiment} to a lab/robot/service endpoint and reads {result} (or a number). * This is the slot a real self-driving lab plugs its robot into; the brain is unchanged. */ export declare function httpOracle(url: string, opts?: { resultKey?: string; headers?: Record; fetchImpl?: typeof fetch; }): Oracle; /** * ★ EVERYTHING IS f(x) — the universal adapter that expands the brain's universe far past "wet lab". * An oracle is just measured-outcome-of-an-experiment. `scoredOracle` turns ANY two-step process into one: * run(x) → produce an artifact (compile a program, render a design, synthesise a molecule, draft a * prompt, configure a process, ask a model to generate something) — may be async/expensive, * score(a)→ a single number measuring how good that artifact is (a benchmark, an assay, a metric, or * an LLM/judge grading a qualitative result). * So f(x) = score(run(x)). Suddenly the discovery brain optimises things no Bayesian-lab targets: prompts, * UI layouts, compiler flags, trading policies, material recipes, model hyperparameters — anything whose * output can be SCORED. The expensive black box stays opaque; the brain only needs the number. */ export declare function scoredOracle(run: (e: Experiment) => A | Promise, score: (a: A, e: Experiment) => number | Promise): Oracle; /** * CLI oracle — runs a shell command for each experiment and parses a number from its stdout. This is the * real-world adapter for CI / training / process tuning: optimise compiler flags by running the build + * parsing the benchmark, tune hyperparameters by running the trainer + parsing the metric, tune a process * script by running it + parsing the yield. `cmd(e)` builds the command for experiment e; `parse(stdout)` * extracts the metric (defaults to the last number printed). Provided as a factory so the heavy node: * child_process import is lazy (keeps the core dependency-free + browser-safe). */ export declare function cliOracle(cmd: (e: Experiment) => string, parse?: (stdout: string) => number, opts?: { cwd?: string; timeoutMs?: number; }): Oracle; /** Multi-objective → one number: a weighted sum of several oracles (e.g. maximise yield − cost − toxicity). */ export declare function compositeOracle(parts: ReadonlyArray<{ oracle: Oracle; weight: number; }>): Oracle; /** Wrap any oracle with a hard call budget + a counter (real experiments cost money — never overspend). */ export declare function meteredOracle(oracle: Oracle, maxCalls: number): Oracle & { calls: () => number; }; export declare function oracleGauntlet(): { score: 0 | 100; checks: Array<{ name: string; pass: boolean; }>; }; //# sourceMappingURL=oracle.d.ts.map