/** * Coverage Gap Emitter — compiler self-awareness for KERN's IR. * * When the compiler encounters patterns it can't fully express (handler escapes, * non-standard attrs), it emits coverage gap signals. Evolve v3 collects these * to propose new IR nodes. */ import { type GapCategory } from './migrate-literals.js'; import type { IRNode } from './types.js'; export interface CoverageGap { file: string; line: number; nodeType: string; handlerLength: number; timestamp: string; /** * Actionable category for triage. Optional for backwards compatibility with * `.kern-gaps/*.json` written by older compilers; readers must default to * `detected` when the field is missing. */ category?: GapCategory; /** Name of the `kern migrate` migration that would rewrite this gap, if any. */ migration?: string; /** Type of the enclosing IR node (e.g. `const`, `fn`) — helps triage. */ parentType?: string; } /** * Walk the AST and collect coverage gaps — handler nodes signal IR limitations. * * Threads the parent node type so the classifier can tag migratable gaps * (e.g. `const` with a single-line literal body is rewritable via * `kern migrate literal-const`). */ export declare function collectCoverageGaps(root: IRNode, filePath: string): CoverageGap[]; /** * Write coverage gaps to the gap directory (accumulative). */ export declare function writeCoverageGaps(gaps: CoverageGap[], gapDir: string): void; /** * Read all accumulated coverage gaps from the gap directory. */ export declare function readCoverageGaps(gapDir: string): CoverageGap[];