/** * The index-time centrality pass. * * Runs inside the indexer's atomic update, immediately after ref resolution * and module resolution have settled: `refs.to_id` is only final at that * point, and a rank computed from half-resolved refs would describe a graph * that never existed. * * Rank is a property of the whole graph, so this recomputes everything or * nothing. That is affordable on a full run and wasteful on a one-file * watcher run, which is what {@link shouldRefreshRanks} arbitrates. */ import type { IndexStore } from './writer.js'; /** * Build the `implicitlyVisible` predicate for one rank pass. * * Without it every same-package Go/Java/C# reference — code that needs no * import by the language's own rules — was scored as a contradicted * misresolution (weight 0.02), as was every call into a Go package other than * the one file the resolver picked to represent it. Centrality for those * languages was computed on a graph with its package-internal wiring erased. */ export declare function createImplicitVisibility(): (sourceFile: string, targetFile: string, imports: ReadonlySet | undefined) => boolean; /** * Data-version marker for the rank layer, in the same spirit as * `relation_graph_version`: bumping it forces every index to recompute ranks * once without a `SCHEMA_VERSION` bump (which would drop and rebuild the * entire database). Older processes sharing the DB cannot downgrade it. */ export declare const RANK_VERSION = "1"; export declare const RANK_VERSION_KEY = "rank_version"; /** * Above this many files in a targeted run, recompute. A watcher run that * touches one file barely moves any score, so leaving ranks one generation * stale is the cheaper trade; a bulk targeted run is effectively a full run * and should not be served stale ranks. */ export declare const RANK_REFRESH_FILE_THRESHOLD = 25; export interface RankPassResult { /** False when the pass decided the existing ranks were good enough. */ computed: boolean; symbols: number; files: number; durationMs: number; } export declare function shouldRefreshRanks(store: IndexStore, opts: { files?: readonly string[] | undefined; force?: boolean | undefined; }): boolean; /** * Recompute and persist both rank tables. Never throws: a failed rank pass * leaves the previous (or empty) ranks in place and must not take the index * run down with it — every consumer treats a missing rank as "unranked". */ export declare function runGraphRankPass(store: IndexStore, errors: string[]): RankPassResult; //# sourceMappingURL=graph-rank-pass.d.ts.map