/** * Findings instrumentation hook (cognium-dev #145, re-scoped per * cognium-ai feedback). * * Opt-in, off by default. When enabled via `setFindingsInstrumentation(true)`, * the per-file analyzer emits one `[finding]` JSON line on stderr for every * `SastFinding` produced by the pipeline, plus one `[findings-summary]` line * per file with aggregate counts. The payload carries the fields required to * re-derive coalesce candidates after the fact (#143): * `rule_id`, `file`, `line`, `pass`, `category`, `severity`, `cwe`, * `sink_type`, `source_type`, `confidence`, `dedup_group_id`. * * Browser-safe: no Node-only APIs. `console.error` is universal and bypasses * the logger DI by design so the output stays grep-friendly regardless of * log level. * * Read-only contract: this module never mutates the findings array or any * other pipeline output. Disabling the flag fully no-ops the emission. */ import type { SastFinding, TaintSource, TaintSink } from '../types/index.js'; /** * Toggle the per-file findings instrumentation on or off. Off by default. * * The CLI wires this to the `CIRCLE_IR_INSTRUMENT_FINDINGS=1` environment * variable; library consumers can call it directly. */ export declare function setFindingsInstrumentation(enabled: boolean): void; /** * Current state of the instrumentation flag. Exposed for tests and for * consumers that want to gate their own diagnostics off the same switch. */ export declare function isFindingsInstrumentationEnabled(): boolean; /** * Emit one stderr line per `SastFinding` plus one summary line for the file. * Cheap no-op when the flag is off. * * Called by `analyze()` once per file, right after the pipeline has * accumulated all findings and right before the per-file result object is * assembled. See `src/analyzer.ts`. */ export declare function emitFindingsInstrumentation(filePath: string, findings: readonly SastFinding[], taint: { sources: readonly TaintSource[]; sinks: readonly TaintSink[]; }): void; //# sourceMappingURL=findings-instrumentation.d.ts.map