/** * post-build-smoke, proves a freshly compiled binary boots. * * Runs ` --version`, asserts the expected banner prefix, and rejects * output containing packaging-failure sentinels (e.g. `sqlite-vec`, * `$bunfs/root`) that mean a native addon or module failed to bundle. * * Also scans the artifact itself for top-level eager namespace-object reads * (`var X = exports_Y.Z;` at column 0 of the embedded bundle). Bun's bundler * emits module bodies in a nondeterministic order build-to-build; an eager * module-scope read off a lazy namespace object can therefore land before the * module that defines the binding, and the binary dies at load with a * ReferenceError, on SOME builds and not others. A binary that boots once is * safe forever (the order is baked at build time), but the pattern itself is a * per-build lottery, so its presence fails the smoke even when this particular * build happened to boot. */ import type { Exec, ExecResult, Logger } from './effects.js'; import type { SmokeConfig } from '../config.js'; /** * Scan bundler output (a plain bundle or the JS embedded in a compiled * binary) for top-level eager namespace reads. Returns one human-readable * description per offending read, capped at `limit`. Pure. */ export declare function scanArtifactForEagerNamespaceReads(artifactText: string, limit?: number): string[]; export interface SmokeResult { readonly ok: boolean; readonly detail: string; } /** Evaluate a captured `--version` run against the smoke policy. Pure. */ export declare function evaluateSmokeOutput(result: ExecResult, config: Pick): SmokeResult; export interface RunSmokeOptions { readonly binary: string; readonly config: SmokeConfig; readonly exec?: Exec; readonly logger?: Logger; /** Reads the artifact bytes for the eager-namespace-read scan. Injectable for tests. */ readonly readArtifact?: (path: string) => string; } /** Run the version smoke against a binary path. */ export declare function runPostBuildSmoke(options: RunSmokeOptions): SmokeResult; //# sourceMappingURL=post-build-smoke.d.ts.map