import type { SourceFreeImportFact, SourceFreeStructuralRelationship } from '@neurcode-ai/contracts'; /** * Deterministic Python module-path import resolution. * * Given the set of repository-relative Python file paths and the raw import facts produced by * the AST worker (`fromFile`, dotted `target`, `importedNames`), this resolves each import to * the concrete first-party file(s) it depends on and assigns an honest truth tier: * * - `deterministic_structural` — the dotted module path resolves to exactly one repository * file (`pkg/mod.py` or `pkg/mod/__init__.py`) under a discovered source root. * - `bounded_inference` — ambiguous: the module path resolves under more than one * source root to different files, so the binding cannot be proven without runtime sys.path. * - `not_evaluated` — external/third-party/stdlib top-level, unresolved first-party * gaps, and dynamic forms (importlib / __import__). Never claimed as deterministic. * * The resolution is source-free: it consumes file PATHS and dotted module STRINGS only — never * file contents. It is pure and order-independent: the same file set + facts always produce the * same edges. */ export type PythonImportResolutionKind = 'resolved_repository' | 'external_package' | 'unresolved' | 'ambiguous' | 'dynamic'; export type ImportEdgeAuthorityClass = 'deterministic_structural' | 'bounded_inference' | 'not_evaluated'; export interface PythonImportResolutionSummary { total: number; resolvedRepository: number; externalPackage: number; unresolved: number; ambiguous: number; dynamic: number; deterministicStructural: number; boundedInference: number; notEvaluated: number; } export interface PythonImportResolution { /** Input import facts enriched with `resolvedFile`, `resolution`, `resolutionReason`. */ facts: SourceFreeImportFact[]; /** Concrete file→file import edges with authority class. One per resolved dependency. */ edges: SourceFreeStructuralRelationship[]; summary: PythonImportResolutionSummary; } export declare function importEdgeAuthorityClass(kind: PythonImportResolutionKind): ImportEdgeAuthorityClass; export declare function resolvePythonImports(input: { pythonFiles: string[]; imports: SourceFreeImportFact[]; }): PythonImportResolution; //# sourceMappingURL=python-import-resolver.d.ts.map