/** * Vacuity detection for `tool:` evidence (T12633). * * A tool that exits 0 after checking NOTHING is not evidence of anything, and * it is indistinguishable from a real pass by exit code alone. Measured in * this repository: the root `tsconfig.json` is references-only * (`"files": []` plus `references`), so the node default `npx tsc --noEmit` * type-checked zero files and exited 0 in 0.34s. Every `qaPassed` gate * recorded with `tool:typecheck` had been validated against a no-op. * * Two provable cases are detected, both for TypeScript's `tsc`: * * 1. STATIC — a command whose `tsc` steps include NO `-b`/`--build` step * and at least one of which targets a references-only config. TypeScript compiles no files for such a config * outside build mode; that is its documented semantics, not a guess. * Checked before the tool runs (and before any cache lookup), so a stale * cached pass for the vacuous command can never be served. * 2. PROBE — a direct `tsc` invocation (not through a package script, whose * body may `cd` elsewhere) that exited 0 is re-run with `--listFilesOnly`. * Zero files outside `node_modules` means nothing was checked. * * Anything this module cannot prove is reported as NOT vacuous. A false * "vacuous" would reject correct work, so every unknown fails open here and * the ordinary exit-code verdict stands. * * @task T12633 */ import type { ResolvedToolCommand } from './tool-resolver.js'; /** * Is this tsconfig references-only — a config TypeScript compiles ZERO files * for unless it is run in build mode (`tsc -b`)? * * True only when it is provable: a non-empty `references` array, an explicit * empty `files` array (or no `files` with an explicit empty `include`), and no * non-empty `include` inherited through `extends`. * * @param configPath - Absolute path to a tsconfig file. * @returns `true` only when the config provably selects no files. * * @task T12633 */ export declare function isReferencesOnlyTsconfig(configPath: string): boolean; /** * Statically prove that a resolved command's `tsc` step checks nothing. * * @param command - Resolved tool command. * @param executionRoot - Directory the command runs in. * @returns A reason string when provably vacuous, otherwise `null`. * * @task T12633 */ export declare function detectStaticVacuity(command: ResolvedToolCommand, executionRoot: string): string | null; /** * After a direct `tsc` run exited 0, count the project files it compiled. * * @param command - Resolved tool command. * @param executionRoot - Directory the command runs in. * @returns The count of compiled files outside `node_modules`, or `null` when * the command is not a direct non-build `tsc` invocation or the probe could * not run. * * @task T12633 */ export declare function probeTscFileCount(command: ResolvedToolCommand, executionRoot: string): number | null; /** * The fix hint attached to every `E_EVIDENCE_TOOL_VACUOUS` result. * * @task T12633 */ export declare const VACUOUS_TOOL_FIX: string; //# sourceMappingURL=tool-vacuity.d.ts.map