/** * AffectedTests — which tests a change can actually break. * * The default move after an edit is `npm test`: the full suite, most of which cannot * possibly be affected by the three lines that changed. That costs minutes of wall time * and, worse for this project, dumps the whole run's output into the model's context. * * The import graph already knows the answer. A test can only be affected by a change if it * transitively imports the changed file, so walking reverse edges from the diff gives an * exact — not heuristic — over-approximation of the blast radius. * * Two honesty constraints shape this module: * * 1. It reports what it *cannot* see. Runtime-only coupling (dynamic `import()`, DI * containers, fixtures loaded by path, integration tests hitting a live service) is * invisible to a static import graph. A caller told "3 tests affected" without that * caveat may ship on a green subset that never exercised the break. * 2. It fails toward the full suite. No graph, no test files, an unrecognized runner — * every uncertain path recommends running everything rather than a confident subset. */ export declare function isTestFile(rel: string): boolean; export type TestRunner = "jest" | "vitest" | "unknown"; export interface AffectedTestsResult { /** Files the diff touched, as repo-relative paths. */ changed: string[]; /** Changed files that are themselves tests — always affected, no graph walk needed. */ directTests: string[]; /** Test files that transitively import at least one changed file. */ affected: string[]; /** Total test files in the repo, so the caller can see how much is being skipped. */ totalTests: number; runner: TestRunner; /** The command to run just the affected tests, or null when the full suite is the honest answer. */ command: string | null; /** Set when we are recommending the full suite anyway, with the reason why. */ fullSuiteReason: string | null; /** Changed files absent from the import graph — their blast radius is unknown. */ ungraphed: string[]; } /** * Files changed versus a base ref, from git. Includes the working tree (staged and * unstaged) because the whole point is to test edits that have not been committed yet. */ export declare function changedFilesFromGit(workspaceRoot: string, baseRef?: string): string[]; export interface AffectedTestsOptions { workspaceRoot: string; /** Explicit file list; when omitted the diff is read from git. */ files?: string[]; /** Base ref to diff against, in addition to the working tree. */ baseRef?: string; } export declare function findAffectedTests(options: AffectedTestsOptions): AffectedTestsResult; export declare function formatAffectedTests(result: AffectedTestsResult): string; //# sourceMappingURL=AffectedTests.d.ts.map