import type { SourceFreeStructuralRelationship } from '@neurcode-ai/contracts'; import type { PythonImportResolution } from './python-import-resolver'; /** * Deterministic Python test-edge detection. * * A test edge connects a test file to the first-party application module it imports, derived * ONLY from deterministic_structural import edges. Test files are identified by deterministic * pytest/Django naming conventions — never by content. The result feeds an honest required-test * policy that may render a deterministic verdict ONLY when coverage is known (a deterministic * test edge exists) or absence is provable in a bounded scan (every test import resolves * deterministically or is clearly external). Otherwise it stays `not_evaluated`. */ export type RequiredTestTruth = 'deterministic' | 'not_evaluated'; export type RequiredTestVerdict = 'satisfied' | 'block' | 'not_evaluated'; export interface PythonTestEdgeResult { /** test file → app module edges, deterministic_structural only. */ testEdges: SourceFreeStructuralRelationship[]; testFiles: string[]; /** app module file → sorted list of test files that deterministically import it. */ coverageByModule: Record; /** * True when every import FROM a test file resolved deterministically or is clearly external. * Only then can the absence of a test edge be treated as proven (no hidden dynamic coverage). */ discoveryComplete: boolean; summary: { testFiles: number; testEdges: number; modulesCovered: number; nonDeterministicTestImports: number; }; } /** * Deterministic test-file classification by pytest/Django naming conventions: * - `test_*.py` / `*_test.py` (pytest default discovery) * - `tests.py` / `conftest.py` (Django app tests / pytest fixtures) * - any module inside a `tests/` or `test/` package directory */ export declare function isPythonTestFile(path: string): boolean; export declare function buildPythonTestEdges(input: { pythonFiles: string[]; importResolution: PythonImportResolution; }): PythonTestEdgeResult; /** * Honest required-test evaluation for a changed Python module. * * Renders a deterministic verdict ONLY when coverage is known or absence is provable: * - `satisfied` — a deterministic test edge imports the module (it is tested). * - `block` — discovery is complete AND no test edge exists (absence proven). Only a * bounded, fully-resolved scan can reach this state. * - `not_evaluated` — discovery is incomplete (a non-deterministic test import could hide * coverage), or the changed path is itself a test file. */ export declare function evaluatePythonRequiredTest(input: { changedModule: string; result: PythonTestEdgeResult; }): { verdict: RequiredTestVerdict; truth: RequiredTestTruth; reason: string; }; //# sourceMappingURL=python-test-edges.d.ts.map