/** * @module logging/context * * Ambient fields stamped onto every log line. * * Tracing a bug means following ONE request through every subsystem it * touched. Without a correlation id you cannot: the gateway, the runner, the * tool layer and the proactive pipeline all log to the same file, interleaved * with concurrent runs, and nothing says which lines belong together. * * The run id already exists as AsyncLocalStorage in infra/koi-events, but the * logging layer must not import the run layer (that direction is a cycle, and * logging has to stay usable from anywhere). So the run layer PUSHES a * provider in, and logging pulls from it when it has one. */ type LogContextProvider = () => Record | undefined; /** Called once by the run layer at import; last registration wins. */ export declare function setLogContextProvider(next: LogContextProvider | null): void; /** * Fields for the current async context, or {} when there is none (a startup * line, a background timer). Never throws: a broken provider must not be able * to take logging down with it. */ export declare function getLogContext(): Record; export {};