/** * change: add-edit-loop-breakage-verdict * * Deterministic, watcher-produced edit verdicts. * * The watcher is the only writer. Readers never analyze: they validate the * artifact against the current analysis generation and the edited file's * content hash, then serve the already-derived findings. */ import type { CallEdge, FunctionNode, SerializedCallGraph } from '../analyzer/call-graph.js'; import type { GovernanceFinding } from './mcp-handlers/enforcement-policy.js'; import type { EdgeStore } from './edge-store.js'; export declare const EDIT_VERDICT_ARTIFACT = "edit-verdicts.json"; export declare const MAX_EDIT_VERDICT_BASIS_FILES = 2048; export declare const MAX_EDIT_VERDICT_BASIS_FILE_BYTES = 10000000; export declare const MAX_EDIT_VERDICT_BASIS_TOTAL_BYTES = 64000000; export interface EditVerdictBasis { file: string; contentHash: string; } export interface EditReachingTest { test: string; file: string; viaPath: string[]; basisFiles?: string[]; confidence: 'high' | 'medium' | 'low'; } export interface EditVerdictBoundary { staleFiles: string[]; reachingTestsBasis: 'incremental-graph' | 'last-full-analysis'; reachingTestsTruncated?: boolean; findingsTruncated?: boolean; staleFilesTruncated?: boolean; staleFileCount?: number; } export interface EditVerdictStoreBoundary { entriesEvicted: number; evictedFiles: string[]; bytesBounded?: true; } export interface EditVerdict { file: string; contentHash: string; findings: GovernanceFinding[]; reachingTests: EditReachingTest[]; languageScope: string[]; boundaries: EditVerdictBoundary; basis?: EditVerdictBasis[]; } export interface EditVerdictStore { version: 1; analysisGenerationId: string; entries: EditVerdict[]; boundaries?: EditVerdictStoreBoundary; } export type EditVerdictRead = { status: 'current'; entries: EditVerdict[]; storeBoundaries?: EditVerdictStoreBoundary; } | { status: 'missing' | 'stale' | 'invalid'; entries: []; reason: string; }; export interface EditCallSite { callerId: string; callerFile: string; calleeId: string; calleeName: string; line?: number; argCount?: number; argCountLowerBound?: true; confidence?: CallEdge['confidence']; kind?: CallEdge['kind']; } export interface ImportBreakageSite { importerFile: string; importedName: string; line?: number; } export interface GraphVerdictInput { file: string; contentHash: string; oldNodes: FunctionNode[]; newNodes: FunctionNode[]; oldIncoming: EditCallSite[]; postOutgoingByCaller: ReadonlyMap; postIncoming: EditCallSite[]; recomputedCallerFiles: ReadonlySet; staleFiles: readonly string[]; reachingTests: EditReachingTest[]; reachingTestsTruncated?: boolean; reachingTestsBasis?: EditVerdictBoundary['reachingTestsBasis']; importBreakages?: ImportBreakageSite[]; basis?: EditVerdictBasis[]; basisSnapshots?: ReadonlyMap; } export interface EditVerdictWriteOptions { previousGenerationId?: string; invalidatedFiles?: readonly string[]; evictedFiles?: readonly string[]; } export declare function writeEditVerdictStore(outputPath: string, analysisGenerationId: string, entries: EditVerdict[], options?: EditVerdictWriteOptions): Promise; /** Size-bounded, shape-validated artifact read. Never quarantines or mutates. */ export declare function readEditVerdictStore(outputPath: string): Promise; /** * Read only verdicts that belong to the current committed analysis generation * and still match their edited file's bytes. */ export declare function readCurrentEditVerdicts(rootPath: string, files?: readonly string[]): Promise; /** Pure, conservative verdict derivation over facts captured around one batch. */ export declare function deriveEditVerdict(input: GraphVerdictInput): EditVerdict; /** EdgeStore-backed form of select_tests' backward reachability. */ export declare function selectReachingTestsFromStore(store: EdgeStore, seedIds: readonly string[], maxDepth?: number): { tests: EditReachingTest[]; truncated: boolean; }; /** Reaching tests from the retained full-analysis graph, which includes test nodes. */ export declare function selectReachingTestsFromFullGraph(graph: Pick | undefined, seedIds: readonly string[], maxDepth?: number): { tests: EditReachingTest[]; truncated: boolean; }; export declare function mergeReachingTests(...groups: readonly EditReachingTest[][]): EditReachingTest[]; //# sourceMappingURL=edit-verdict.d.ts.map